diff --git a/README.md b/README.md index 3d4ac212..d29155de 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-beta.1") + implementation("com.chargebee:chargebee-java:4.0.0") } ``` @@ -56,7 +56,7 @@ dependencies { com.chargebee chargebee-java - 4.0.0-beta.2 + 4.0.0 ``` @@ -138,13 +138,13 @@ ChargebeeClient client = ChargebeeClient.builder() #### Create and list customers (sync) ```java -import com.chargebee.core.services.CustomerService; -import com.chargebee.core.models.customer.params.CustomerCreateParams; -import com.chargebee.core.models.customer.params.CustomerListParams; -import com.chargebee.core.responses.customer.CustomerCreateResponse; -import com.chargebee.core.responses.customer.CustomerListResponse; +import com.chargebee.v4.services.CustomerService; +import com.chargebee.v4.models.customer.params.CustomerCreateParams; +import com.chargebee.v4.models.customer.params.CustomerListParams; +import com.chargebee.v4.models.customer.responses.CustomerCreateResponse; +import com.chargebee.v4.models.customer.responses.CustomerListResponse; -CustomerService customers = client.customer(); +CustomerService customers = client.customers(); CustomerCreateResponse created = customers.create( CustomerCreateParams.builder() @@ -161,7 +161,7 @@ CustomerCreateResponse created = customers.create( .build() ) .build() -).get(); +); CustomerListResponse list = customers.list( CustomerListParams.builder() @@ -194,7 +194,7 @@ ChargebeeClient client = ChargebeeClient.builder() ```java import com.chargebee.v4.client.request.RequestOptions; -CustomerService scoped = customers.withOptions( +CustomerService scoped = client.customers().withOptions( RequestOptions.builder() .header("Idempotency-Key", "req-123") .maxNetworkRetries(2) @@ -215,6 +215,350 @@ future.thenAccept(resp -> { }); ``` +### Exception Handling + +The library provides a comprehensive exception hierarchy with **strongly-typed error enums** to handle different types of errors that may occur during API operations. + +#### Exception Hierarchy + +All Chargebee exceptions extend from `ChargebeeException`, which is an unchecked exception: + +``` +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.) +- **`ServerErrorException`**: HTTP 5xx server errors (internal server error, service unavailable, etc.) +- **`APIException`**: Base exception for Chargebee API errors - includes error type, API error code, and parameters +- **`InvalidRequestException`**: Invalid parameters, missing required fields, or validation errors (type: `invalid_request`) +- **`PaymentException`**: Payment failures such as card declined, insufficient funds, etc. (type: `payment`) +- **`OperationFailedException`**: Business logic violations or state conflicts (type: `operation_failed`) +- **`BatchAPIException`**: Errors specific to batch API operations +- **`UbbBatchIngestionInvalidRequestException`**: Errors specific to UBB batch ingestion operations + +#### Strongly-Typed Error Enums + +The v4 SDK provides strongly-typed enums for error handling, making it easier to write type-safe error handling code: + +##### ErrorType Enum +Represents the type of error returned by the API: +```java +import com.chargebee.v4.exceptions.ErrorType; + +// Available values: +ErrorType.INVALID_REQUEST // Validation and request errors +ErrorType.PAYMENT // Payment-related errors +ErrorType.OPERATION_FAILED // Business logic errors +ErrorType.UNTYPED // Untyped errors +ErrorType._UNKNOWN // Unknown/new error types (forward compatibility) +``` + +##### Per-HTTP-Status API Error Code Enums +Each HTTP status code has its own enum with specific error codes: + +| Enum | HTTP Status | Example Error Codes | +|------|-------------|---------------------| +| `BadRequestApiErrorCode` | 400 | `DUPLICATE_ENTRY`, `INVALID_REQUEST`, `PAYMENT_PROCESSING_FAILED`, `PARAM_WRONG_VALUE` | +| `UnauthorizedApiErrorCode` | 401 | `API_AUTHENTICATION_FAILED`, `BASIC_AUTHENTICATION_FAILED` | +| `ForbiddenApiErrorCode` | 403 | `REQUEST_BLOCKED`, `API_AUTHORIZATION_FAILED` | +| `NotFoundApiErrorCode` | 404 | `RESOURCE_NOT_FOUND`, `SITE_NOT_FOUND` | +| `ConflictApiErrorCode` | 409 | `INVALID_STATE_FOR_REQUEST` | +| `TooManyRequestsApiErrorCode` | 429 | `REQUEST_LIMIT_EXCEEDED`, `OPERATION_LIMIT_EXCEEDED` | +| `InternalServerErrorApiErrorCode` | 500 | `INTERNAL_ERROR`, `INTERNAL_TEMPORARY_ERROR` | +| `ServiceUnavailableApiErrorCode` | 503 | `SITE_NOT_READY`, `SITE_MIGRATING`, `SITE_UNDER_MAINTENANCE` | + +All enums include an `_UNKNOWN` value for forward compatibility when new error codes are added by the API. + +#### v4 SDK Exception Handling Examples + +##### Basic exception handling with enums +```java +import com.chargebee.v4.exceptions.*; +import com.chargebee.v4.exceptions.codes.ApiErrorCode; +import com.chargebee.v4.exceptions.codes.BadRequestApiErrorCode; +import com.chargebee.v4.services.CustomerService; +import com.chargebee.v4.models.customer.params.CustomerCreateParams; + +CustomerService customers = client.customers(); + +try { + CustomerCreateResponse created = customers.create( + CustomerCreateParams.builder() + .email("invalid-email") // Invalid email format + .build() + ); +} catch (InvalidRequestException e) { + // getApiErrorCode() returns a strongly-typed ApiErrorCode enum + ApiErrorCode errorCode = e.getApiErrorCode(); + + // Cast to specific enum based on HTTP status code + if (errorCode instanceof BadRequestApiErrorCode) { + BadRequestApiErrorCode code = (BadRequestApiErrorCode) errorCode; + if (code == BadRequestApiErrorCode.DUPLICATE_ENTRY) { + System.err.println("Resource already exists!"); + } else if (code == BadRequestApiErrorCode.PARAM_WRONG_VALUE) { + System.err.println("Invalid parameter: " + e.getParams()); + } + } +} catch (PaymentException e) { + ApiErrorCode errorCode = e.getApiErrorCode(); + + if (errorCode instanceof BadRequestApiErrorCode) { + BadRequestApiErrorCode code = (BadRequestApiErrorCode) errorCode; + if (code == BadRequestApiErrorCode.PAYMENT_PROCESSING_FAILED) { + System.err.println("Payment failed. Please try again."); + } else if (code == BadRequestApiErrorCode.PAYMENT_METHOD_NOT_PRESENT) { + System.err.println("No payment method on file."); + } + } +} catch (APIException e) { + // Handle other API errors + System.err.println("API error: " + e.getMessage()); + System.err.println("Error type: " + e.getErrorType()); +} catch (TransportException e) { + // Handle network/transport errors + System.err.println("Transport error: " + e.getMessage()); +} +``` + +##### Using switch with ErrorType enum +```java +try { + // API operation +} catch (APIException e) { + switch (e.getErrorType()) { + case INVALID_REQUEST: + System.err.println("Invalid request: " + e.getMessage()); + break; + case PAYMENT: + System.err.println("Payment error: " + e.getMessage()); + break; + case OPERATION_FAILED: + System.err.println("Operation failed: " + e.getMessage()); + break; + default: + System.err.println("Unknown error type: " + e.getType()); + } +} +``` + +##### Handling specific error codes +```java +import com.chargebee.v4.exceptions.*; +import com.chargebee.v4.exceptions.codes.ApiErrorCode; +import com.chargebee.v4.exceptions.codes.BadRequestApiErrorCode; + +try { + client.subscriptions().create(params); +} catch (APIException e) { + ApiErrorCode errorCode = e.getApiErrorCode(); + + // Check if it's a BadRequest error code + if (errorCode instanceof BadRequestApiErrorCode) { + BadRequestApiErrorCode code = (BadRequestApiErrorCode) errorCode; + switch (code) { + case DUPLICATE_ENTRY: + System.err.println("Resource already exists"); + break; + case RESOURCE_LIMIT_EXHAUSTED: + System.err.println("Limit reached, please upgrade your plan"); + break; + case PAYMENT_PROCESSING_FAILED: + System.err.println("Payment failed, please update payment method"); + break; + case _UNKNOWN: + // Unknown error code - use raw value for logging + System.err.println("Unknown error code: " + e.getApiErrorCodeRaw()); + break; + default: + System.err.println("Error: " + e.getMessage()); + } + } +} +``` + +##### Checking for unknown error types (forward compatibility) +```java +try { + // API operation +} catch (APIException e) { + ErrorType errorType = e.getErrorType(); + + if (!errorType.isKnown()) { + // New error type added by API that SDK doesn't know about yet + System.err.println("New error type encountered: " + e.getType()); + // Log for investigation, but handle gracefully + } + + ApiErrorCode errorCode = e.getApiErrorCode(); + if (errorCode != null && !errorCode.isKnown()) { + // New error code - handle gracefully using raw value + System.err.println("New error code: " + e.getApiErrorCodeRaw()); + } +} +``` + +##### Handling HTTP-level errors +```java +import com.chargebee.v4.exceptions.ClientErrorException; +import com.chargebee.v4.exceptions.ServerErrorException; +import com.chargebee.v4.exceptions.HttpException; + +try { + CustomerCreateResponse response = client.customers().create(params); +} catch (ClientErrorException e) { + // Handle 4xx client errors + if (e.isUnauthorized()) { + System.err.println("Authentication failed. Check your API key."); + } else if (e.isNotFound()) { + System.err.println("Resource not found."); + } else if (e.isTooManyRequests()) { + System.err.println("Rate limit exceeded. Retry after some time."); + } else { + System.err.println("Client error: " + e.getStatusCode()); + } +} catch (ServerErrorException e) { + // Handle 5xx server errors (often retryable) + if (e.isRetryable()) { + System.err.println("Server error. Consider retrying: " + e.getMessage()); + } +} catch (HttpException e) { + System.err.println("HTTP error: " + e.getStatusCode()); +} +catch (Exception e) { + throw new RuntimeException(e); +} +``` + +##### Error Response Attributes + +The `APIException` class provides typed access to all error response attributes: + +| Attribute | Method | Description | +|-----------|--------|-------------| +| `message` | `getMessage()` | Descriptive error information (for developer consumption, not for end users) | +| `type` | `getType()` / `getErrorType()` | Error type grouping: `payment`, `invalid_request`, `operation_failed` | +| `api_error_code` | `getApiErrorCode()` / `getApiErrorCodeRaw()` | Strongly-typed enum (`ApiErrorCode`) or raw string for error handling | +| `param` | `getParam()` / `getParams()` | Parameter name(s) if error is parameter-specific | +| `error_cause_id` | `getErrorCauseId()` | Chargebee-defined code for standardizing errors across gateways | + +##### Extracting detailed error information +```java +try { + // API operation +} catch (APIException e) { + // Get HTTP status code + int statusCode = e.getStatusCode(); + + // Get error type as enum (type-safe) + ErrorType errorType = e.getErrorType(); + + // Get error type as raw string + String type = e.getType(); + + // Get API error code as typed enum + ApiErrorCode apiErrorCode = e.getApiErrorCode(); + + // Get API error code as raw string (for logging) + String apiErrorCodeRaw = e.getApiErrorCodeRaw(); + + // Get error message (for developer consumption) + String message = e.getMessage(); + + // Get parameter name(s) that caused the error + String param = e.getParam(); // Single param (convenience) + List params = e.getParams(); // All params + + // Get error cause ID (for gateway error standardization) + String errorCauseId = e.getErrorCauseId(); + + // Get full JSON response for debugging + String jsonResponse = e.getJsonResponse(); + + // Get full HTTP response object + Response response = e.getResponse(); + + System.err.println("Error details: " + e.toString()); +} +``` + +##### Handling gateway errors with error_cause_id +```java +try { + // Payment operation +} catch (PaymentException e) { + // error_cause_id helps standardize errors across different payment gateways + String errorCauseId = e.getErrorCauseId(); + + if (errorCauseId != null) { + // Use error_cause_id for consistent handling across gateways + System.err.println("Gateway error cause: " + errorCauseId); + + } + + // Check the specific API error code using typed enum + ApiErrorCode errorCode = e.getApiErrorCode(); + if (errorCode instanceof BadRequestApiErrorCode) { + BadRequestApiErrorCode code = (BadRequestApiErrorCode) errorCode; + if (code == BadRequestApiErrorCode.PAYMENT_PROCESSING_FAILED) { + // Handle payment failure + } + } +} +``` + +##### Async exception handling +```java +import java.util.concurrent.CompletableFuture; + +CompletableFuture futureCustomer = customers.create(params); + +futureCustomer + .thenAccept(customer -> { + System.out.println("Customer created: " + customer.getCustomer().getId()); + }) + .exceptionally(throwable -> { + if (throwable.getCause() instanceof InvalidRequestException) { + InvalidRequestException e = (InvalidRequestException) throwable.getCause(); + ApiErrorCode errorCode = e.getApiErrorCode(); + + if (errorCode instanceof BadRequestApiErrorCode) { + BadRequestApiErrorCode code = (BadRequestApiErrorCode) errorCode; + if (code == BadRequestApiErrorCode.DUPLICATE_ENTRY) { + System.err.println("Customer already exists"); + } + } else { + System.err.println("Validation error: " + e.getMessage()); + } + } else if (throwable.getCause() instanceof APIException) { + APIException e = (APIException) throwable.getCause(); + System.err.println("API error: " + e.getApiErrorCodeRaw()); + } else { + System.err.println("Unexpected error: " + throwable.getMessage()); + } + return null; + }); +``` + ### v3 SDK Examples #### Create a subscription diff --git a/build.gradle.kts b/build.gradle.kts index 17a645f7..70f6085a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } group = "com.chargebee" -version = "4.0.0-beta.2" +version = "4.0.0" description = "Next-gen Java client library for ChargeBee API" // Project metadata diff --git a/dist/chargebee-java-4.0.0-beta.2-javadoc.jar b/dist/chargebee-java-4.0.0-beta.2-javadoc.jar deleted file mode 100644 index 47fa0c9a..00000000 Binary files a/dist/chargebee-java-4.0.0-beta.2-javadoc.jar and /dev/null differ diff --git a/dist/chargebee-java-4.0.0-beta.2-sources.jar b/dist/chargebee-java-4.0.0-beta.2-sources.jar deleted file mode 100644 index 13f24807..00000000 Binary files a/dist/chargebee-java-4.0.0-beta.2-sources.jar and /dev/null differ diff --git a/dist/chargebee-java-4.0.0-beta.2.jar b/dist/chargebee-java-4.0.0-beta.2.jar deleted file mode 100644 index acaac252..00000000 Binary files a/dist/chargebee-java-4.0.0-beta.2.jar and /dev/null differ diff --git a/dist/chargebee-java-4.0.0-javadoc.jar b/dist/chargebee-java-4.0.0-javadoc.jar new file mode 100644 index 00000000..590a3a0c Binary files /dev/null and b/dist/chargebee-java-4.0.0-javadoc.jar differ diff --git a/dist/chargebee-java-4.0.0-sources.jar b/dist/chargebee-java-4.0.0-sources.jar new file mode 100644 index 00000000..d1648189 Binary files /dev/null and b/dist/chargebee-java-4.0.0-sources.jar differ diff --git a/dist/chargebee-java-4.0.0.jar b/dist/chargebee-java-4.0.0.jar new file mode 100644 index 00000000..ee282e8b Binary files /dev/null and b/dist/chargebee-java-4.0.0.jar differ diff --git a/docs/MIGRATION_GUIDE.md b/docs/MIGRATION_GUIDE.md index 84ebe957..eb2d03d8 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-beta.1 + 4.0.0 ``` diff --git a/src/main/java/com/chargebee/v4/client/ChargebeeClient.java b/src/main/java/com/chargebee/v4/client/ChargebeeClient.java index c62bfd9f..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,11 @@ 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; +import com.chargebee.v4.exceptions.TransportException; import com.chargebee.v4.internal.RetryConfig; import com.chargebee.v4.transport.*; import com.chargebee.v4.transport.Transport; @@ -105,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() @@ -126,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()); } @@ -169,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") @@ -191,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") @@ -252,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); @@ -276,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/ClientMethods.java b/src/main/java/com/chargebee/v4/client/ClientMethods.java index ab475b0f..7a8ce455 100644 --- a/src/main/java/com/chargebee/v4/client/ClientMethods.java +++ b/src/main/java/com/chargebee/v4/client/ClientMethods.java @@ -1,166 +1,166 @@ package com.chargebee.v4.client; -import com.chargebee.v4.core.services.GiftService; +import com.chargebee.v4.services.GiftService; -import com.chargebee.v4.core.services.CsvTaxRuleService; +import com.chargebee.v4.services.CsvTaxRuleService; -import com.chargebee.v4.core.services.UsageService; +import com.chargebee.v4.services.UsageService; -import com.chargebee.v4.core.services.TimeMachineService; +import com.chargebee.v4.services.TimeMachineService; -import com.chargebee.v4.core.services.BusinessEntityService; +import com.chargebee.v4.services.BusinessEntityService; -import com.chargebee.v4.core.services.OfferEventService; +import com.chargebee.v4.services.OfferEventService; -import com.chargebee.v4.core.services.InAppSubscriptionService; +import com.chargebee.v4.services.InAppSubscriptionService; -import com.chargebee.v4.core.services.Pc2MigrationService; +import com.chargebee.v4.services.Pc2MigrationService; -import com.chargebee.v4.core.services.CreditNoteService; +import com.chargebee.v4.services.CreditNoteService; -import com.chargebee.v4.core.services.CouponSetService; +import com.chargebee.v4.services.CouponSetService; -import com.chargebee.v4.core.services.QuoteService; +import com.chargebee.v4.services.QuoteService; -import com.chargebee.v4.core.services.Pc2MigrationItemService; +import com.chargebee.v4.services.Pc2MigrationItemService; -import com.chargebee.v4.core.services.EstimateService; +import com.chargebee.v4.services.EstimateService; -import com.chargebee.v4.core.services.VariantService; +import com.chargebee.v4.services.VariantService; -import com.chargebee.v4.core.services.Pc2MigrationItemFamilyService; +import com.chargebee.v4.services.Pc2MigrationItemFamilyService; -import com.chargebee.v4.core.services.PaymentSourceService; +import com.chargebee.v4.services.PaymentSourceService; -import com.chargebee.v4.core.services.RecordedPurchaseService; +import com.chargebee.v4.services.RecordedPurchaseService; -import com.chargebee.v4.core.services.PlanService; +import com.chargebee.v4.services.PlanService; -import com.chargebee.v4.core.services.ExportService; +import com.chargebee.v4.services.ExportService; -import com.chargebee.v4.core.services.OrderService; +import com.chargebee.v4.services.OrderService; -import com.chargebee.v4.core.services.ItemService; +import com.chargebee.v4.services.ItemService; -import com.chargebee.v4.core.services.CustomerEntitlementService; +import com.chargebee.v4.services.CustomerEntitlementService; -import com.chargebee.v4.core.services.PersonalizedOfferService; +import com.chargebee.v4.services.PersonalizedOfferService; -import com.chargebee.v4.core.services.OmnichannelSubscriptionService; +import com.chargebee.v4.services.OmnichannelSubscriptionService; -import com.chargebee.v4.core.services.OmnichannelSubscriptionItemService; +import com.chargebee.v4.services.OmnichannelSubscriptionItemService; -import com.chargebee.v4.core.services.RampService; +import com.chargebee.v4.services.RampService; -import com.chargebee.v4.core.services.OmnichannelOneTimeOrderService; +import com.chargebee.v4.services.OmnichannelOneTimeOrderService; -import com.chargebee.v4.core.services.DifferentialPriceService; +import com.chargebee.v4.services.DifferentialPriceService; -import com.chargebee.v4.core.services.EntitlementService; +import com.chargebee.v4.services.EntitlementService; -import com.chargebee.v4.core.services.AdditionalBillingLogiqService; +import com.chargebee.v4.services.AdditionalBillingLogiqService; -import com.chargebee.v4.core.services.SubscriptionSettingService; +import com.chargebee.v4.services.SubscriptionSettingService; -import com.chargebee.v4.core.services.SiteMigrationDetailService; +import com.chargebee.v4.services.SiteMigrationDetailService; -import com.chargebee.v4.core.services.PaymentIntentService; +import com.chargebee.v4.services.PaymentIntentService; -import com.chargebee.v4.core.services.PaymentScheduleSchemeService; +import com.chargebee.v4.services.PaymentScheduleSchemeService; -import com.chargebee.v4.core.services.CardService; +import com.chargebee.v4.services.CardService; -import com.chargebee.v4.core.services.AttachedItemService; +import com.chargebee.v4.services.AttachedItemService; -import com.chargebee.v4.core.services.UsageEventService; +import com.chargebee.v4.services.UsageEventService; -import com.chargebee.v4.core.services.PriceVariantService; +import com.chargebee.v4.services.PriceVariantService; -import com.chargebee.v4.core.services.FullExportService; +import com.chargebee.v4.services.FullExportService; -import com.chargebee.v4.core.services.VirtualBankAccountService; +import com.chargebee.v4.services.VirtualBankAccountService; -import com.chargebee.v4.core.services.AddonService; +import com.chargebee.v4.services.AddonService; -import com.chargebee.v4.core.services.TpSiteUserService; +import com.chargebee.v4.services.TpSiteUserService; -import com.chargebee.v4.core.services.ConfigurationService; +import com.chargebee.v4.services.ConfigurationService; -import com.chargebee.v4.core.services.PricingPageSessionService; +import com.chargebee.v4.services.PricingPageSessionService; -import com.chargebee.v4.core.services.Pc2MigrationItemPriceService; +import com.chargebee.v4.services.Pc2MigrationItemPriceService; -import com.chargebee.v4.core.services.RuleService; +import com.chargebee.v4.services.RuleService; -import com.chargebee.v4.core.services.SubscriptionService; +import com.chargebee.v4.services.SubscriptionService; -import com.chargebee.v4.core.services.MediaService; +import com.chargebee.v4.services.MediaService; -import com.chargebee.v4.core.services.BusinessProfileService; +import com.chargebee.v4.services.BusinessProfileService; -import com.chargebee.v4.core.services.PromotionalCreditService; +import com.chargebee.v4.services.PromotionalCreditService; -import com.chargebee.v4.core.services.BrandConfigurationService; +import com.chargebee.v4.services.BrandConfigurationService; -import com.chargebee.v4.core.services.WebhookEndpointService; +import com.chargebee.v4.services.WebhookEndpointService; -import com.chargebee.v4.core.services.FeatureService; +import com.chargebee.v4.services.FeatureService; -import com.chargebee.v4.core.services.UnbilledChargesSettingService; +import com.chargebee.v4.services.UnbilledChargesSettingService; -import com.chargebee.v4.core.services.CurrencyService; +import com.chargebee.v4.services.CurrencyService; -import com.chargebee.v4.core.services.EventService; +import com.chargebee.v4.services.EventService; -import com.chargebee.v4.core.services.UsageFileService; +import com.chargebee.v4.services.UsageFileService; -import com.chargebee.v4.core.services.NonSubscriptionService; +import com.chargebee.v4.services.NonSubscriptionService; -import com.chargebee.v4.core.services.ResourceMigrationService; +import com.chargebee.v4.services.ResourceMigrationService; -import com.chargebee.v4.core.services.ProductService; +import com.chargebee.v4.services.ProductService; -import com.chargebee.v4.core.services.CouponCodeService; +import com.chargebee.v4.services.CouponCodeService; -import com.chargebee.v4.core.services.AddressService; +import com.chargebee.v4.services.AddressService; -import com.chargebee.v4.core.services.CouponService; +import com.chargebee.v4.services.CouponService; -import com.chargebee.v4.core.services.PortalSessionService; +import com.chargebee.v4.services.PortalSessionService; -import com.chargebee.v4.core.services.ItemPriceService; +import com.chargebee.v4.services.ItemPriceService; -import com.chargebee.v4.core.services.OfferFulfillmentService; +import com.chargebee.v4.services.OfferFulfillmentService; -import com.chargebee.v4.core.services.HostedPageService; +import com.chargebee.v4.services.HostedPageService; -import com.chargebee.v4.core.services.PurchaseService; +import com.chargebee.v4.services.PurchaseService; -import com.chargebee.v4.core.services.PaymentVoucherService; +import com.chargebee.v4.services.PaymentVoucherService; -import com.chargebee.v4.core.services.ItemFamilyService; +import com.chargebee.v4.services.ItemFamilyService; -import com.chargebee.v4.core.services.SubscriptionEntitlementService; +import com.chargebee.v4.services.SubscriptionEntitlementService; -import com.chargebee.v4.core.services.ThirdPartyEntityMappingService; +import com.chargebee.v4.services.ThirdPartyEntityMappingService; -import com.chargebee.v4.core.services.EntitlementOverrideService; +import com.chargebee.v4.services.EntitlementOverrideService; -import com.chargebee.v4.core.services.ThirdPartyConfigurationService; +import com.chargebee.v4.services.ThirdPartyConfigurationService; -import com.chargebee.v4.core.services.UnbilledChargeService; +import com.chargebee.v4.services.UnbilledChargeService; -import com.chargebee.v4.core.services.CommentService; +import com.chargebee.v4.services.CommentService; -import com.chargebee.v4.core.services.InvoiceService; +import com.chargebee.v4.services.InvoiceService; -import com.chargebee.v4.core.services.TransactionService; +import com.chargebee.v4.services.TransactionService; -import com.chargebee.v4.core.services.ThirdPartySyncDetailService; +import com.chargebee.v4.services.ThirdPartySyncDetailService; -import com.chargebee.v4.core.services.CustomerService; +import com.chargebee.v4.services.CustomerService; -import com.chargebee.v4.core.services.ItemEntitlementService; +import com.chargebee.v4.services.ItemEntitlementService; /** * Auto-generated interface defining all service access methods. ChargebeeClient implements this @@ -173,565 +173,565 @@ public interface ClientMethods { * * @return GiftService instance for fluent API access */ - GiftService gift(); + GiftService gifts(); /** * Access csv_tax_rule-related operations. * * @return CsvTaxRuleService instance for fluent API access */ - CsvTaxRuleService csvTaxRule(); + CsvTaxRuleService csvTaxRules(); /** * Access usage-related operations. * * @return UsageService instance for fluent API access */ - UsageService usage(); + UsageService usages(); /** * Access time_machine-related operations. * * @return TimeMachineService instance for fluent API access */ - TimeMachineService timeMachine(); + TimeMachineService timeMachines(); /** * Access business_entity-related operations. * * @return BusinessEntityService instance for fluent API access */ - BusinessEntityService businessEntity(); + BusinessEntityService businessEntities(); /** * Access offer_event-related operations. * * @return OfferEventService instance for fluent API access */ - OfferEventService offerEvent(); + OfferEventService offerEvents(); /** * Access in_app_subscription-related operations. * * @return InAppSubscriptionService instance for fluent API access */ - InAppSubscriptionService inAppSubscription(); + InAppSubscriptionService inAppSubscriptions(); /** * Access pc2_migration-related operations. * * @return Pc2MigrationService instance for fluent API access */ - Pc2MigrationService pc2Migration(); + Pc2MigrationService pc2Migrations(); /** * Access credit_note-related operations. * * @return CreditNoteService instance for fluent API access */ - CreditNoteService creditNote(); + CreditNoteService creditNotes(); /** * Access coupon_set-related operations. * * @return CouponSetService instance for fluent API access */ - CouponSetService couponSet(); + CouponSetService couponSets(); /** * Access quote-related operations. * * @return QuoteService instance for fluent API access */ - QuoteService quote(); + QuoteService quotes(); /** * Access pc2_migration_item-related operations. * * @return Pc2MigrationItemService instance for fluent API access */ - Pc2MigrationItemService pc2MigrationItem(); + Pc2MigrationItemService pc2MigrationItems(); /** * Access estimate-related operations. * * @return EstimateService instance for fluent API access */ - EstimateService estimate(); + EstimateService estimates(); /** * Access variant-related operations. * * @return VariantService instance for fluent API access */ - VariantService variant(); + VariantService variants(); /** * Access pc2_migration_item_family-related operations. * * @return Pc2MigrationItemFamilyService instance for fluent API access */ - Pc2MigrationItemFamilyService pc2MigrationItemFamily(); + Pc2MigrationItemFamilyService pc2MigrationItemFamilies(); /** * Access payment_source-related operations. * * @return PaymentSourceService instance for fluent API access */ - PaymentSourceService paymentSource(); + PaymentSourceService paymentSources(); /** * Access recorded_purchase-related operations. * * @return RecordedPurchaseService instance for fluent API access */ - RecordedPurchaseService recordedPurchase(); + RecordedPurchaseService recordedPurchases(); /** * Access plan-related operations. * * @return PlanService instance for fluent API access */ - PlanService plan(); + PlanService plans(); /** * Access export-related operations. * * @return ExportService instance for fluent API access */ - ExportService export(); + ExportService exports(); /** * Access order-related operations. * * @return OrderService instance for fluent API access */ - OrderService order(); + OrderService orders(); /** * Access item-related operations. * * @return ItemService instance for fluent API access */ - ItemService item(); + ItemService items(); /** * Access customer_entitlement-related operations. * * @return CustomerEntitlementService instance for fluent API access */ - CustomerEntitlementService customerEntitlement(); + CustomerEntitlementService customerEntitlements(); /** * Access personalized_offer-related operations. * * @return PersonalizedOfferService instance for fluent API access */ - PersonalizedOfferService personalizedOffer(); + PersonalizedOfferService personalizedOffers(); /** * Access omnichannel_subscription-related operations. * * @return OmnichannelSubscriptionService instance for fluent API access */ - OmnichannelSubscriptionService omnichannelSubscription(); + OmnichannelSubscriptionService omnichannelSubscriptions(); /** * Access omnichannel_subscription_item-related operations. * * @return OmnichannelSubscriptionItemService instance for fluent API access */ - OmnichannelSubscriptionItemService omnichannelSubscriptionItem(); + OmnichannelSubscriptionItemService omnichannelSubscriptionItems(); /** * Access ramp-related operations. * * @return RampService instance for fluent API access */ - RampService ramp(); + RampService ramps(); /** * Access omnichannel_one_time_order-related operations. * * @return OmnichannelOneTimeOrderService instance for fluent API access */ - OmnichannelOneTimeOrderService omnichannelOneTimeOrder(); + OmnichannelOneTimeOrderService omnichannelOneTimeOrders(); /** * Access differential_price-related operations. * * @return DifferentialPriceService instance for fluent API access */ - DifferentialPriceService differentialPrice(); + DifferentialPriceService differentialPrices(); /** * Access entitlement-related operations. * * @return EntitlementService instance for fluent API access */ - EntitlementService entitlement(); + EntitlementService entitlements(); /** * Access additional_billing_logiq-related operations. * * @return AdditionalBillingLogiqService instance for fluent API access */ - AdditionalBillingLogiqService additionalBillingLogiq(); + AdditionalBillingLogiqService additionalBillingLogiqs(); /** * Access subscription_setting-related operations. * * @return SubscriptionSettingService instance for fluent API access */ - SubscriptionSettingService subscriptionSetting(); + SubscriptionSettingService subscriptionSettings(); /** * Access site_migration_detail-related operations. * * @return SiteMigrationDetailService instance for fluent API access */ - SiteMigrationDetailService siteMigrationDetail(); + SiteMigrationDetailService siteMigrationDetails(); /** * Access payment_intent-related operations. * * @return PaymentIntentService instance for fluent API access */ - PaymentIntentService paymentIntent(); + PaymentIntentService paymentIntents(); /** * Access payment_schedule_scheme-related operations. * * @return PaymentScheduleSchemeService instance for fluent API access */ - PaymentScheduleSchemeService paymentScheduleScheme(); + PaymentScheduleSchemeService paymentScheduleSchemes(); /** * Access card-related operations. * * @return CardService instance for fluent API access */ - CardService card(); + CardService cards(); /** * Access attached_item-related operations. * * @return AttachedItemService instance for fluent API access */ - AttachedItemService attachedItem(); + AttachedItemService attachedItems(); /** * Access usage_event-related operations. * * @return UsageEventService instance for fluent API access */ - UsageEventService usageEvent(); + UsageEventService usageEvents(); /** * Access price_variant-related operations. * * @return PriceVariantService instance for fluent API access */ - PriceVariantService priceVariant(); + PriceVariantService priceVariants(); /** * Access full_export-related operations. * * @return FullExportService instance for fluent API access */ - FullExportService fullExport(); + FullExportService fullExports(); /** * Access virtual_bank_account-related operations. * * @return VirtualBankAccountService instance for fluent API access */ - VirtualBankAccountService virtualBankAccount(); + VirtualBankAccountService virtualBankAccounts(); /** * Access addon-related operations. * * @return AddonService instance for fluent API access */ - AddonService addon(); + AddonService addons(); /** * Access tp_site_user-related operations. * * @return TpSiteUserService instance for fluent API access */ - TpSiteUserService tpSiteUser(); + TpSiteUserService tpSiteUsers(); /** * Access configuration-related operations. * * @return ConfigurationService instance for fluent API access */ - ConfigurationService configuration(); + ConfigurationService configurations(); /** * Access pricing_page_session-related operations. * * @return PricingPageSessionService instance for fluent API access */ - PricingPageSessionService pricingPageSession(); + PricingPageSessionService pricingPageSessions(); /** * Access pc2_migration_item_price-related operations. * * @return Pc2MigrationItemPriceService instance for fluent API access */ - Pc2MigrationItemPriceService pc2MigrationItemPrice(); + Pc2MigrationItemPriceService pc2MigrationItemPrices(); /** * Access rule-related operations. * * @return RuleService instance for fluent API access */ - RuleService rule(); + RuleService rules(); /** * Access subscription-related operations. * * @return SubscriptionService instance for fluent API access */ - SubscriptionService subscription(); + SubscriptionService subscriptions(); /** * Access media-related operations. * * @return MediaService instance for fluent API access */ - MediaService media(); + MediaService medias(); /** * Access business_profile-related operations. * * @return BusinessProfileService instance for fluent API access */ - BusinessProfileService businessProfile(); + BusinessProfileService businessProfiles(); /** * Access promotional_credit-related operations. * * @return PromotionalCreditService instance for fluent API access */ - PromotionalCreditService promotionalCredit(); + PromotionalCreditService promotionalCredits(); /** * Access brand_configuration-related operations. * * @return BrandConfigurationService instance for fluent API access */ - BrandConfigurationService brandConfiguration(); + BrandConfigurationService brandConfigurations(); /** * Access webhook_endpoint-related operations. * * @return WebhookEndpointService instance for fluent API access */ - WebhookEndpointService webhookEndpoint(); + WebhookEndpointService webhookEndpoints(); /** * Access feature-related operations. * * @return FeatureService instance for fluent API access */ - FeatureService feature(); + FeatureService features(); /** * Access unbilled_charges_setting-related operations. * * @return UnbilledChargesSettingService instance for fluent API access */ - UnbilledChargesSettingService unbilledChargesSetting(); + UnbilledChargesSettingService unbilledChargesSettings(); /** * Access currency-related operations. * * @return CurrencyService instance for fluent API access */ - CurrencyService currency(); + CurrencyService currencies(); /** * Access event-related operations. * * @return EventService instance for fluent API access */ - EventService event(); + EventService events(); /** * Access usage_file-related operations. * * @return UsageFileService instance for fluent API access */ - UsageFileService usageFile(); + UsageFileService usageFiles(); /** * Access non_subscription-related operations. * * @return NonSubscriptionService instance for fluent API access */ - NonSubscriptionService nonSubscription(); + NonSubscriptionService nonSubscriptions(); /** * Access resource_migration-related operations. * * @return ResourceMigrationService instance for fluent API access */ - ResourceMigrationService resourceMigration(); + ResourceMigrationService resourceMigrations(); /** * Access product-related operations. * * @return ProductService instance for fluent API access */ - ProductService product(); + ProductService products(); /** * Access coupon_code-related operations. * * @return CouponCodeService instance for fluent API access */ - CouponCodeService couponCode(); + CouponCodeService couponCodes(); /** * Access address-related operations. * * @return AddressService instance for fluent API access */ - AddressService address(); + AddressService addresses(); /** * Access coupon-related operations. * * @return CouponService instance for fluent API access */ - CouponService coupon(); + CouponService coupons(); /** * Access portal_session-related operations. * * @return PortalSessionService instance for fluent API access */ - PortalSessionService portalSession(); + PortalSessionService portalSessions(); /** * Access item_price-related operations. * * @return ItemPriceService instance for fluent API access */ - ItemPriceService itemPrice(); + ItemPriceService itemPrices(); /** * Access offer_fulfillment-related operations. * * @return OfferFulfillmentService instance for fluent API access */ - OfferFulfillmentService offerFulfillment(); + OfferFulfillmentService offerFulfillments(); /** * Access hosted_page-related operations. * * @return HostedPageService instance for fluent API access */ - HostedPageService hostedPage(); + HostedPageService hostedPages(); /** * Access purchase-related operations. * * @return PurchaseService instance for fluent API access */ - PurchaseService purchase(); + PurchaseService purchases(); /** * Access payment_voucher-related operations. * * @return PaymentVoucherService instance for fluent API access */ - PaymentVoucherService paymentVoucher(); + PaymentVoucherService paymentVouchers(); /** * Access item_family-related operations. * * @return ItemFamilyService instance for fluent API access */ - ItemFamilyService itemFamily(); + ItemFamilyService itemFamilies(); /** * Access subscription_entitlement-related operations. * * @return SubscriptionEntitlementService instance for fluent API access */ - SubscriptionEntitlementService subscriptionEntitlement(); + SubscriptionEntitlementService subscriptionEntitlements(); /** * Access third_party_entity_mapping-related operations. * * @return ThirdPartyEntityMappingService instance for fluent API access */ - ThirdPartyEntityMappingService thirdPartyEntityMapping(); + ThirdPartyEntityMappingService thirdPartyEntityMappings(); /** * Access entitlement_override-related operations. * * @return EntitlementOverrideService instance for fluent API access */ - EntitlementOverrideService entitlementOverride(); + EntitlementOverrideService entitlementOverrides(); /** * Access third_party_configuration-related operations. * * @return ThirdPartyConfigurationService instance for fluent API access */ - ThirdPartyConfigurationService thirdPartyConfiguration(); + ThirdPartyConfigurationService thirdPartyConfigurations(); /** * Access unbilled_charge-related operations. * * @return UnbilledChargeService instance for fluent API access */ - UnbilledChargeService unbilledCharge(); + UnbilledChargeService unbilledCharges(); /** * Access comment-related operations. * * @return CommentService instance for fluent API access */ - CommentService comment(); + CommentService comments(); /** * Access invoice-related operations. * * @return InvoiceService instance for fluent API access */ - InvoiceService invoice(); + InvoiceService invoices(); /** * Access transaction-related operations. * * @return TransactionService instance for fluent API access */ - TransactionService transaction(); + TransactionService transactions(); /** * Access third_party_sync_detail-related operations. * * @return ThirdPartySyncDetailService instance for fluent API access */ - ThirdPartySyncDetailService thirdPartySyncDetail(); + ThirdPartySyncDetailService thirdPartySyncDetails(); /** * Access customer-related operations. * * @return CustomerService instance for fluent API access */ - CustomerService customer(); + CustomerService customers(); /** * Access item_entitlement-related operations. * * @return ItemEntitlementService instance for fluent API access */ - ItemEntitlementService itemEntitlement(); + ItemEntitlementService itemEntitlements(); } diff --git a/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java b/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java index a669c34e..5aed49b1 100644 --- a/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java +++ b/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java @@ -1,166 +1,166 @@ package com.chargebee.v4.client; -import com.chargebee.v4.core.services.GiftService; +import com.chargebee.v4.services.GiftService; -import com.chargebee.v4.core.services.CsvTaxRuleService; +import com.chargebee.v4.services.CsvTaxRuleService; -import com.chargebee.v4.core.services.UsageService; +import com.chargebee.v4.services.UsageService; -import com.chargebee.v4.core.services.TimeMachineService; +import com.chargebee.v4.services.TimeMachineService; -import com.chargebee.v4.core.services.BusinessEntityService; +import com.chargebee.v4.services.BusinessEntityService; -import com.chargebee.v4.core.services.OfferEventService; +import com.chargebee.v4.services.OfferEventService; -import com.chargebee.v4.core.services.InAppSubscriptionService; +import com.chargebee.v4.services.InAppSubscriptionService; -import com.chargebee.v4.core.services.Pc2MigrationService; +import com.chargebee.v4.services.Pc2MigrationService; -import com.chargebee.v4.core.services.CreditNoteService; +import com.chargebee.v4.services.CreditNoteService; -import com.chargebee.v4.core.services.CouponSetService; +import com.chargebee.v4.services.CouponSetService; -import com.chargebee.v4.core.services.QuoteService; +import com.chargebee.v4.services.QuoteService; -import com.chargebee.v4.core.services.Pc2MigrationItemService; +import com.chargebee.v4.services.Pc2MigrationItemService; -import com.chargebee.v4.core.services.EstimateService; +import com.chargebee.v4.services.EstimateService; -import com.chargebee.v4.core.services.VariantService; +import com.chargebee.v4.services.VariantService; -import com.chargebee.v4.core.services.Pc2MigrationItemFamilyService; +import com.chargebee.v4.services.Pc2MigrationItemFamilyService; -import com.chargebee.v4.core.services.PaymentSourceService; +import com.chargebee.v4.services.PaymentSourceService; -import com.chargebee.v4.core.services.RecordedPurchaseService; +import com.chargebee.v4.services.RecordedPurchaseService; -import com.chargebee.v4.core.services.PlanService; +import com.chargebee.v4.services.PlanService; -import com.chargebee.v4.core.services.ExportService; +import com.chargebee.v4.services.ExportService; -import com.chargebee.v4.core.services.OrderService; +import com.chargebee.v4.services.OrderService; -import com.chargebee.v4.core.services.ItemService; +import com.chargebee.v4.services.ItemService; -import com.chargebee.v4.core.services.CustomerEntitlementService; +import com.chargebee.v4.services.CustomerEntitlementService; -import com.chargebee.v4.core.services.PersonalizedOfferService; +import com.chargebee.v4.services.PersonalizedOfferService; -import com.chargebee.v4.core.services.OmnichannelSubscriptionService; +import com.chargebee.v4.services.OmnichannelSubscriptionService; -import com.chargebee.v4.core.services.OmnichannelSubscriptionItemService; +import com.chargebee.v4.services.OmnichannelSubscriptionItemService; -import com.chargebee.v4.core.services.RampService; +import com.chargebee.v4.services.RampService; -import com.chargebee.v4.core.services.OmnichannelOneTimeOrderService; +import com.chargebee.v4.services.OmnichannelOneTimeOrderService; -import com.chargebee.v4.core.services.DifferentialPriceService; +import com.chargebee.v4.services.DifferentialPriceService; -import com.chargebee.v4.core.services.EntitlementService; +import com.chargebee.v4.services.EntitlementService; -import com.chargebee.v4.core.services.AdditionalBillingLogiqService; +import com.chargebee.v4.services.AdditionalBillingLogiqService; -import com.chargebee.v4.core.services.SubscriptionSettingService; +import com.chargebee.v4.services.SubscriptionSettingService; -import com.chargebee.v4.core.services.SiteMigrationDetailService; +import com.chargebee.v4.services.SiteMigrationDetailService; -import com.chargebee.v4.core.services.PaymentIntentService; +import com.chargebee.v4.services.PaymentIntentService; -import com.chargebee.v4.core.services.PaymentScheduleSchemeService; +import com.chargebee.v4.services.PaymentScheduleSchemeService; -import com.chargebee.v4.core.services.CardService; +import com.chargebee.v4.services.CardService; -import com.chargebee.v4.core.services.AttachedItemService; +import com.chargebee.v4.services.AttachedItemService; -import com.chargebee.v4.core.services.UsageEventService; +import com.chargebee.v4.services.UsageEventService; -import com.chargebee.v4.core.services.PriceVariantService; +import com.chargebee.v4.services.PriceVariantService; -import com.chargebee.v4.core.services.FullExportService; +import com.chargebee.v4.services.FullExportService; -import com.chargebee.v4.core.services.VirtualBankAccountService; +import com.chargebee.v4.services.VirtualBankAccountService; -import com.chargebee.v4.core.services.AddonService; +import com.chargebee.v4.services.AddonService; -import com.chargebee.v4.core.services.TpSiteUserService; +import com.chargebee.v4.services.TpSiteUserService; -import com.chargebee.v4.core.services.ConfigurationService; +import com.chargebee.v4.services.ConfigurationService; -import com.chargebee.v4.core.services.PricingPageSessionService; +import com.chargebee.v4.services.PricingPageSessionService; -import com.chargebee.v4.core.services.Pc2MigrationItemPriceService; +import com.chargebee.v4.services.Pc2MigrationItemPriceService; -import com.chargebee.v4.core.services.RuleService; +import com.chargebee.v4.services.RuleService; -import com.chargebee.v4.core.services.SubscriptionService; +import com.chargebee.v4.services.SubscriptionService; -import com.chargebee.v4.core.services.MediaService; +import com.chargebee.v4.services.MediaService; -import com.chargebee.v4.core.services.BusinessProfileService; +import com.chargebee.v4.services.BusinessProfileService; -import com.chargebee.v4.core.services.PromotionalCreditService; +import com.chargebee.v4.services.PromotionalCreditService; -import com.chargebee.v4.core.services.BrandConfigurationService; +import com.chargebee.v4.services.BrandConfigurationService; -import com.chargebee.v4.core.services.WebhookEndpointService; +import com.chargebee.v4.services.WebhookEndpointService; -import com.chargebee.v4.core.services.FeatureService; +import com.chargebee.v4.services.FeatureService; -import com.chargebee.v4.core.services.UnbilledChargesSettingService; +import com.chargebee.v4.services.UnbilledChargesSettingService; -import com.chargebee.v4.core.services.CurrencyService; +import com.chargebee.v4.services.CurrencyService; -import com.chargebee.v4.core.services.EventService; +import com.chargebee.v4.services.EventService; -import com.chargebee.v4.core.services.UsageFileService; +import com.chargebee.v4.services.UsageFileService; -import com.chargebee.v4.core.services.NonSubscriptionService; +import com.chargebee.v4.services.NonSubscriptionService; -import com.chargebee.v4.core.services.ResourceMigrationService; +import com.chargebee.v4.services.ResourceMigrationService; -import com.chargebee.v4.core.services.ProductService; +import com.chargebee.v4.services.ProductService; -import com.chargebee.v4.core.services.CouponCodeService; +import com.chargebee.v4.services.CouponCodeService; -import com.chargebee.v4.core.services.AddressService; +import com.chargebee.v4.services.AddressService; -import com.chargebee.v4.core.services.CouponService; +import com.chargebee.v4.services.CouponService; -import com.chargebee.v4.core.services.PortalSessionService; +import com.chargebee.v4.services.PortalSessionService; -import com.chargebee.v4.core.services.ItemPriceService; +import com.chargebee.v4.services.ItemPriceService; -import com.chargebee.v4.core.services.OfferFulfillmentService; +import com.chargebee.v4.services.OfferFulfillmentService; -import com.chargebee.v4.core.services.HostedPageService; +import com.chargebee.v4.services.HostedPageService; -import com.chargebee.v4.core.services.PurchaseService; +import com.chargebee.v4.services.PurchaseService; -import com.chargebee.v4.core.services.PaymentVoucherService; +import com.chargebee.v4.services.PaymentVoucherService; -import com.chargebee.v4.core.services.ItemFamilyService; +import com.chargebee.v4.services.ItemFamilyService; -import com.chargebee.v4.core.services.SubscriptionEntitlementService; +import com.chargebee.v4.services.SubscriptionEntitlementService; -import com.chargebee.v4.core.services.ThirdPartyEntityMappingService; +import com.chargebee.v4.services.ThirdPartyEntityMappingService; -import com.chargebee.v4.core.services.EntitlementOverrideService; +import com.chargebee.v4.services.EntitlementOverrideService; -import com.chargebee.v4.core.services.ThirdPartyConfigurationService; +import com.chargebee.v4.services.ThirdPartyConfigurationService; -import com.chargebee.v4.core.services.UnbilledChargeService; +import com.chargebee.v4.services.UnbilledChargeService; -import com.chargebee.v4.core.services.CommentService; +import com.chargebee.v4.services.CommentService; -import com.chargebee.v4.core.services.InvoiceService; +import com.chargebee.v4.services.InvoiceService; -import com.chargebee.v4.core.services.TransactionService; +import com.chargebee.v4.services.TransactionService; -import com.chargebee.v4.core.services.ThirdPartySyncDetailService; +import com.chargebee.v4.services.ThirdPartySyncDetailService; -import com.chargebee.v4.core.services.CustomerService; +import com.chargebee.v4.services.CustomerService; -import com.chargebee.v4.core.services.ItemEntitlementService; +import com.chargebee.v4.services.ItemEntitlementService; /** * Auto-generated implementation of ClientMethods interface. This class provides the actual service @@ -171,407 +171,407 @@ abstract class ClientMethodsImpl implements ClientMethods { protected abstract ServiceRegistry getServiceRegistry(); @Override - public GiftService gift() { - return getServiceRegistry().gift(); + public GiftService gifts() { + return getServiceRegistry().gifts(); } @Override - public CsvTaxRuleService csvTaxRule() { - return getServiceRegistry().csvTaxRule(); + public CsvTaxRuleService csvTaxRules() { + return getServiceRegistry().csvTaxRules(); } @Override - public UsageService usage() { - return getServiceRegistry().usage(); + public UsageService usages() { + return getServiceRegistry().usages(); } @Override - public TimeMachineService timeMachine() { - return getServiceRegistry().timeMachine(); + public TimeMachineService timeMachines() { + return getServiceRegistry().timeMachines(); } @Override - public BusinessEntityService businessEntity() { - return getServiceRegistry().businessEntity(); + public BusinessEntityService businessEntities() { + return getServiceRegistry().businessEntities(); } @Override - public OfferEventService offerEvent() { - return getServiceRegistry().offerEvent(); + public OfferEventService offerEvents() { + return getServiceRegistry().offerEvents(); } @Override - public InAppSubscriptionService inAppSubscription() { - return getServiceRegistry().inAppSubscription(); + public InAppSubscriptionService inAppSubscriptions() { + return getServiceRegistry().inAppSubscriptions(); } @Override - public Pc2MigrationService pc2Migration() { - return getServiceRegistry().pc2Migration(); + public Pc2MigrationService pc2Migrations() { + return getServiceRegistry().pc2Migrations(); } @Override - public CreditNoteService creditNote() { - return getServiceRegistry().creditNote(); + public CreditNoteService creditNotes() { + return getServiceRegistry().creditNotes(); } @Override - public CouponSetService couponSet() { - return getServiceRegistry().couponSet(); + public CouponSetService couponSets() { + return getServiceRegistry().couponSets(); } @Override - public QuoteService quote() { - return getServiceRegistry().quote(); + public QuoteService quotes() { + return getServiceRegistry().quotes(); } @Override - public Pc2MigrationItemService pc2MigrationItem() { - return getServiceRegistry().pc2MigrationItem(); + public Pc2MigrationItemService pc2MigrationItems() { + return getServiceRegistry().pc2MigrationItems(); } @Override - public EstimateService estimate() { - return getServiceRegistry().estimate(); + public EstimateService estimates() { + return getServiceRegistry().estimates(); } @Override - public VariantService variant() { - return getServiceRegistry().variant(); + public VariantService variants() { + return getServiceRegistry().variants(); } @Override - public Pc2MigrationItemFamilyService pc2MigrationItemFamily() { - return getServiceRegistry().pc2MigrationItemFamily(); + public Pc2MigrationItemFamilyService pc2MigrationItemFamilies() { + return getServiceRegistry().pc2MigrationItemFamilies(); } @Override - public PaymentSourceService paymentSource() { - return getServiceRegistry().paymentSource(); + public PaymentSourceService paymentSources() { + return getServiceRegistry().paymentSources(); } @Override - public RecordedPurchaseService recordedPurchase() { - return getServiceRegistry().recordedPurchase(); + public RecordedPurchaseService recordedPurchases() { + return getServiceRegistry().recordedPurchases(); } @Override - public PlanService plan() { - return getServiceRegistry().plan(); + public PlanService plans() { + return getServiceRegistry().plans(); } @Override - public ExportService export() { - return getServiceRegistry().export(); + public ExportService exports() { + return getServiceRegistry().exports(); } @Override - public OrderService order() { - return getServiceRegistry().order(); + public OrderService orders() { + return getServiceRegistry().orders(); } @Override - public ItemService item() { - return getServiceRegistry().item(); + public ItemService items() { + return getServiceRegistry().items(); } @Override - public CustomerEntitlementService customerEntitlement() { - return getServiceRegistry().customerEntitlement(); + public CustomerEntitlementService customerEntitlements() { + return getServiceRegistry().customerEntitlements(); } @Override - public PersonalizedOfferService personalizedOffer() { - return getServiceRegistry().personalizedOffer(); + public PersonalizedOfferService personalizedOffers() { + return getServiceRegistry().personalizedOffers(); } @Override - public OmnichannelSubscriptionService omnichannelSubscription() { - return getServiceRegistry().omnichannelSubscription(); + public OmnichannelSubscriptionService omnichannelSubscriptions() { + return getServiceRegistry().omnichannelSubscriptions(); } @Override - public OmnichannelSubscriptionItemService omnichannelSubscriptionItem() { - return getServiceRegistry().omnichannelSubscriptionItem(); + public OmnichannelSubscriptionItemService omnichannelSubscriptionItems() { + return getServiceRegistry().omnichannelSubscriptionItems(); } @Override - public RampService ramp() { - return getServiceRegistry().ramp(); + public RampService ramps() { + return getServiceRegistry().ramps(); } @Override - public OmnichannelOneTimeOrderService omnichannelOneTimeOrder() { - return getServiceRegistry().omnichannelOneTimeOrder(); + public OmnichannelOneTimeOrderService omnichannelOneTimeOrders() { + return getServiceRegistry().omnichannelOneTimeOrders(); } @Override - public DifferentialPriceService differentialPrice() { - return getServiceRegistry().differentialPrice(); + public DifferentialPriceService differentialPrices() { + return getServiceRegistry().differentialPrices(); } @Override - public EntitlementService entitlement() { - return getServiceRegistry().entitlement(); + public EntitlementService entitlements() { + return getServiceRegistry().entitlements(); } @Override - public AdditionalBillingLogiqService additionalBillingLogiq() { - return getServiceRegistry().additionalBillingLogiq(); + public AdditionalBillingLogiqService additionalBillingLogiqs() { + return getServiceRegistry().additionalBillingLogiqs(); } @Override - public SubscriptionSettingService subscriptionSetting() { - return getServiceRegistry().subscriptionSetting(); + public SubscriptionSettingService subscriptionSettings() { + return getServiceRegistry().subscriptionSettings(); } @Override - public SiteMigrationDetailService siteMigrationDetail() { - return getServiceRegistry().siteMigrationDetail(); + public SiteMigrationDetailService siteMigrationDetails() { + return getServiceRegistry().siteMigrationDetails(); } @Override - public PaymentIntentService paymentIntent() { - return getServiceRegistry().paymentIntent(); + public PaymentIntentService paymentIntents() { + return getServiceRegistry().paymentIntents(); } @Override - public PaymentScheduleSchemeService paymentScheduleScheme() { - return getServiceRegistry().paymentScheduleScheme(); + public PaymentScheduleSchemeService paymentScheduleSchemes() { + return getServiceRegistry().paymentScheduleSchemes(); } @Override - public CardService card() { - return getServiceRegistry().card(); + public CardService cards() { + return getServiceRegistry().cards(); } @Override - public AttachedItemService attachedItem() { - return getServiceRegistry().attachedItem(); + public AttachedItemService attachedItems() { + return getServiceRegistry().attachedItems(); } @Override - public UsageEventService usageEvent() { - return getServiceRegistry().usageEvent(); + public UsageEventService usageEvents() { + return getServiceRegistry().usageEvents(); } @Override - public PriceVariantService priceVariant() { - return getServiceRegistry().priceVariant(); + public PriceVariantService priceVariants() { + return getServiceRegistry().priceVariants(); } @Override - public FullExportService fullExport() { - return getServiceRegistry().fullExport(); + public FullExportService fullExports() { + return getServiceRegistry().fullExports(); } @Override - public VirtualBankAccountService virtualBankAccount() { - return getServiceRegistry().virtualBankAccount(); + public VirtualBankAccountService virtualBankAccounts() { + return getServiceRegistry().virtualBankAccounts(); } @Override - public AddonService addon() { - return getServiceRegistry().addon(); + public AddonService addons() { + return getServiceRegistry().addons(); } @Override - public TpSiteUserService tpSiteUser() { - return getServiceRegistry().tpSiteUser(); + public TpSiteUserService tpSiteUsers() { + return getServiceRegistry().tpSiteUsers(); } @Override - public ConfigurationService configuration() { - return getServiceRegistry().configuration(); + public ConfigurationService configurations() { + return getServiceRegistry().configurations(); } @Override - public PricingPageSessionService pricingPageSession() { - return getServiceRegistry().pricingPageSession(); + public PricingPageSessionService pricingPageSessions() { + return getServiceRegistry().pricingPageSessions(); } @Override - public Pc2MigrationItemPriceService pc2MigrationItemPrice() { - return getServiceRegistry().pc2MigrationItemPrice(); + public Pc2MigrationItemPriceService pc2MigrationItemPrices() { + return getServiceRegistry().pc2MigrationItemPrices(); } @Override - public RuleService rule() { - return getServiceRegistry().rule(); + public RuleService rules() { + return getServiceRegistry().rules(); } @Override - public SubscriptionService subscription() { - return getServiceRegistry().subscription(); + public SubscriptionService subscriptions() { + return getServiceRegistry().subscriptions(); } @Override - public MediaService media() { - return getServiceRegistry().media(); + public MediaService medias() { + return getServiceRegistry().medias(); } @Override - public BusinessProfileService businessProfile() { - return getServiceRegistry().businessProfile(); + public BusinessProfileService businessProfiles() { + return getServiceRegistry().businessProfiles(); } @Override - public PromotionalCreditService promotionalCredit() { - return getServiceRegistry().promotionalCredit(); + public PromotionalCreditService promotionalCredits() { + return getServiceRegistry().promotionalCredits(); } @Override - public BrandConfigurationService brandConfiguration() { - return getServiceRegistry().brandConfiguration(); + public BrandConfigurationService brandConfigurations() { + return getServiceRegistry().brandConfigurations(); } @Override - public WebhookEndpointService webhookEndpoint() { - return getServiceRegistry().webhookEndpoint(); + public WebhookEndpointService webhookEndpoints() { + return getServiceRegistry().webhookEndpoints(); } @Override - public FeatureService feature() { - return getServiceRegistry().feature(); + public FeatureService features() { + return getServiceRegistry().features(); } @Override - public UnbilledChargesSettingService unbilledChargesSetting() { - return getServiceRegistry().unbilledChargesSetting(); + public UnbilledChargesSettingService unbilledChargesSettings() { + return getServiceRegistry().unbilledChargesSettings(); } @Override - public CurrencyService currency() { - return getServiceRegistry().currency(); + public CurrencyService currencies() { + return getServiceRegistry().currencies(); } @Override - public EventService event() { - return getServiceRegistry().event(); + public EventService events() { + return getServiceRegistry().events(); } @Override - public UsageFileService usageFile() { - return getServiceRegistry().usageFile(); + public UsageFileService usageFiles() { + return getServiceRegistry().usageFiles(); } @Override - public NonSubscriptionService nonSubscription() { - return getServiceRegistry().nonSubscription(); + public NonSubscriptionService nonSubscriptions() { + return getServiceRegistry().nonSubscriptions(); } @Override - public ResourceMigrationService resourceMigration() { - return getServiceRegistry().resourceMigration(); + public ResourceMigrationService resourceMigrations() { + return getServiceRegistry().resourceMigrations(); } @Override - public ProductService product() { - return getServiceRegistry().product(); + public ProductService products() { + return getServiceRegistry().products(); } @Override - public CouponCodeService couponCode() { - return getServiceRegistry().couponCode(); + public CouponCodeService couponCodes() { + return getServiceRegistry().couponCodes(); } @Override - public AddressService address() { - return getServiceRegistry().address(); + public AddressService addresses() { + return getServiceRegistry().addresses(); } @Override - public CouponService coupon() { - return getServiceRegistry().coupon(); + public CouponService coupons() { + return getServiceRegistry().coupons(); } @Override - public PortalSessionService portalSession() { - return getServiceRegistry().portalSession(); + public PortalSessionService portalSessions() { + return getServiceRegistry().portalSessions(); } @Override - public ItemPriceService itemPrice() { - return getServiceRegistry().itemPrice(); + public ItemPriceService itemPrices() { + return getServiceRegistry().itemPrices(); } @Override - public OfferFulfillmentService offerFulfillment() { - return getServiceRegistry().offerFulfillment(); + public OfferFulfillmentService offerFulfillments() { + return getServiceRegistry().offerFulfillments(); } @Override - public HostedPageService hostedPage() { - return getServiceRegistry().hostedPage(); + public HostedPageService hostedPages() { + return getServiceRegistry().hostedPages(); } @Override - public PurchaseService purchase() { - return getServiceRegistry().purchase(); + public PurchaseService purchases() { + return getServiceRegistry().purchases(); } @Override - public PaymentVoucherService paymentVoucher() { - return getServiceRegistry().paymentVoucher(); + public PaymentVoucherService paymentVouchers() { + return getServiceRegistry().paymentVouchers(); } @Override - public ItemFamilyService itemFamily() { - return getServiceRegistry().itemFamily(); + public ItemFamilyService itemFamilies() { + return getServiceRegistry().itemFamilies(); } @Override - public SubscriptionEntitlementService subscriptionEntitlement() { - return getServiceRegistry().subscriptionEntitlement(); + public SubscriptionEntitlementService subscriptionEntitlements() { + return getServiceRegistry().subscriptionEntitlements(); } @Override - public ThirdPartyEntityMappingService thirdPartyEntityMapping() { - return getServiceRegistry().thirdPartyEntityMapping(); + public ThirdPartyEntityMappingService thirdPartyEntityMappings() { + return getServiceRegistry().thirdPartyEntityMappings(); } @Override - public EntitlementOverrideService entitlementOverride() { - return getServiceRegistry().entitlementOverride(); + public EntitlementOverrideService entitlementOverrides() { + return getServiceRegistry().entitlementOverrides(); } @Override - public ThirdPartyConfigurationService thirdPartyConfiguration() { - return getServiceRegistry().thirdPartyConfiguration(); + public ThirdPartyConfigurationService thirdPartyConfigurations() { + return getServiceRegistry().thirdPartyConfigurations(); } @Override - public UnbilledChargeService unbilledCharge() { - return getServiceRegistry().unbilledCharge(); + public UnbilledChargeService unbilledCharges() { + return getServiceRegistry().unbilledCharges(); } @Override - public CommentService comment() { - return getServiceRegistry().comment(); + public CommentService comments() { + return getServiceRegistry().comments(); } @Override - public InvoiceService invoice() { - return getServiceRegistry().invoice(); + public InvoiceService invoices() { + return getServiceRegistry().invoices(); } @Override - public TransactionService transaction() { - return getServiceRegistry().transaction(); + public TransactionService transactions() { + return getServiceRegistry().transactions(); } @Override - public ThirdPartySyncDetailService thirdPartySyncDetail() { - return getServiceRegistry().thirdPartySyncDetail(); + public ThirdPartySyncDetailService thirdPartySyncDetails() { + return getServiceRegistry().thirdPartySyncDetails(); } @Override - public CustomerService customer() { - return getServiceRegistry().customer(); + public CustomerService customers() { + return getServiceRegistry().customers(); } @Override - public ItemEntitlementService itemEntitlement() { - return getServiceRegistry().itemEntitlement(); + public ItemEntitlementService itemEntitlements() { + return getServiceRegistry().itemEntitlements(); } } diff --git a/src/main/java/com/chargebee/v4/client/ServiceRegistry.java b/src/main/java/com/chargebee/v4/client/ServiceRegistry.java index 28d1978d..7938b35d 100644 --- a/src/main/java/com/chargebee/v4/client/ServiceRegistry.java +++ b/src/main/java/com/chargebee/v4/client/ServiceRegistry.java @@ -1,166 +1,166 @@ package com.chargebee.v4.client; -import com.chargebee.v4.core.services.GiftService; +import com.chargebee.v4.services.GiftService; -import com.chargebee.v4.core.services.CsvTaxRuleService; +import com.chargebee.v4.services.CsvTaxRuleService; -import com.chargebee.v4.core.services.UsageService; +import com.chargebee.v4.services.UsageService; -import com.chargebee.v4.core.services.TimeMachineService; +import com.chargebee.v4.services.TimeMachineService; -import com.chargebee.v4.core.services.BusinessEntityService; +import com.chargebee.v4.services.BusinessEntityService; -import com.chargebee.v4.core.services.OfferEventService; +import com.chargebee.v4.services.OfferEventService; -import com.chargebee.v4.core.services.InAppSubscriptionService; +import com.chargebee.v4.services.InAppSubscriptionService; -import com.chargebee.v4.core.services.Pc2MigrationService; +import com.chargebee.v4.services.Pc2MigrationService; -import com.chargebee.v4.core.services.CreditNoteService; +import com.chargebee.v4.services.CreditNoteService; -import com.chargebee.v4.core.services.CouponSetService; +import com.chargebee.v4.services.CouponSetService; -import com.chargebee.v4.core.services.QuoteService; +import com.chargebee.v4.services.QuoteService; -import com.chargebee.v4.core.services.Pc2MigrationItemService; +import com.chargebee.v4.services.Pc2MigrationItemService; -import com.chargebee.v4.core.services.EstimateService; +import com.chargebee.v4.services.EstimateService; -import com.chargebee.v4.core.services.VariantService; +import com.chargebee.v4.services.VariantService; -import com.chargebee.v4.core.services.Pc2MigrationItemFamilyService; +import com.chargebee.v4.services.Pc2MigrationItemFamilyService; -import com.chargebee.v4.core.services.PaymentSourceService; +import com.chargebee.v4.services.PaymentSourceService; -import com.chargebee.v4.core.services.RecordedPurchaseService; +import com.chargebee.v4.services.RecordedPurchaseService; -import com.chargebee.v4.core.services.PlanService; +import com.chargebee.v4.services.PlanService; -import com.chargebee.v4.core.services.ExportService; +import com.chargebee.v4.services.ExportService; -import com.chargebee.v4.core.services.OrderService; +import com.chargebee.v4.services.OrderService; -import com.chargebee.v4.core.services.ItemService; +import com.chargebee.v4.services.ItemService; -import com.chargebee.v4.core.services.CustomerEntitlementService; +import com.chargebee.v4.services.CustomerEntitlementService; -import com.chargebee.v4.core.services.PersonalizedOfferService; +import com.chargebee.v4.services.PersonalizedOfferService; -import com.chargebee.v4.core.services.OmnichannelSubscriptionService; +import com.chargebee.v4.services.OmnichannelSubscriptionService; -import com.chargebee.v4.core.services.OmnichannelSubscriptionItemService; +import com.chargebee.v4.services.OmnichannelSubscriptionItemService; -import com.chargebee.v4.core.services.RampService; +import com.chargebee.v4.services.RampService; -import com.chargebee.v4.core.services.OmnichannelOneTimeOrderService; +import com.chargebee.v4.services.OmnichannelOneTimeOrderService; -import com.chargebee.v4.core.services.DifferentialPriceService; +import com.chargebee.v4.services.DifferentialPriceService; -import com.chargebee.v4.core.services.EntitlementService; +import com.chargebee.v4.services.EntitlementService; -import com.chargebee.v4.core.services.AdditionalBillingLogiqService; +import com.chargebee.v4.services.AdditionalBillingLogiqService; -import com.chargebee.v4.core.services.SubscriptionSettingService; +import com.chargebee.v4.services.SubscriptionSettingService; -import com.chargebee.v4.core.services.SiteMigrationDetailService; +import com.chargebee.v4.services.SiteMigrationDetailService; -import com.chargebee.v4.core.services.PaymentIntentService; +import com.chargebee.v4.services.PaymentIntentService; -import com.chargebee.v4.core.services.PaymentScheduleSchemeService; +import com.chargebee.v4.services.PaymentScheduleSchemeService; -import com.chargebee.v4.core.services.CardService; +import com.chargebee.v4.services.CardService; -import com.chargebee.v4.core.services.AttachedItemService; +import com.chargebee.v4.services.AttachedItemService; -import com.chargebee.v4.core.services.UsageEventService; +import com.chargebee.v4.services.UsageEventService; -import com.chargebee.v4.core.services.PriceVariantService; +import com.chargebee.v4.services.PriceVariantService; -import com.chargebee.v4.core.services.FullExportService; +import com.chargebee.v4.services.FullExportService; -import com.chargebee.v4.core.services.VirtualBankAccountService; +import com.chargebee.v4.services.VirtualBankAccountService; -import com.chargebee.v4.core.services.AddonService; +import com.chargebee.v4.services.AddonService; -import com.chargebee.v4.core.services.TpSiteUserService; +import com.chargebee.v4.services.TpSiteUserService; -import com.chargebee.v4.core.services.ConfigurationService; +import com.chargebee.v4.services.ConfigurationService; -import com.chargebee.v4.core.services.PricingPageSessionService; +import com.chargebee.v4.services.PricingPageSessionService; -import com.chargebee.v4.core.services.Pc2MigrationItemPriceService; +import com.chargebee.v4.services.Pc2MigrationItemPriceService; -import com.chargebee.v4.core.services.RuleService; +import com.chargebee.v4.services.RuleService; -import com.chargebee.v4.core.services.SubscriptionService; +import com.chargebee.v4.services.SubscriptionService; -import com.chargebee.v4.core.services.MediaService; +import com.chargebee.v4.services.MediaService; -import com.chargebee.v4.core.services.BusinessProfileService; +import com.chargebee.v4.services.BusinessProfileService; -import com.chargebee.v4.core.services.PromotionalCreditService; +import com.chargebee.v4.services.PromotionalCreditService; -import com.chargebee.v4.core.services.BrandConfigurationService; +import com.chargebee.v4.services.BrandConfigurationService; -import com.chargebee.v4.core.services.WebhookEndpointService; +import com.chargebee.v4.services.WebhookEndpointService; -import com.chargebee.v4.core.services.FeatureService; +import com.chargebee.v4.services.FeatureService; -import com.chargebee.v4.core.services.UnbilledChargesSettingService; +import com.chargebee.v4.services.UnbilledChargesSettingService; -import com.chargebee.v4.core.services.CurrencyService; +import com.chargebee.v4.services.CurrencyService; -import com.chargebee.v4.core.services.EventService; +import com.chargebee.v4.services.EventService; -import com.chargebee.v4.core.services.UsageFileService; +import com.chargebee.v4.services.UsageFileService; -import com.chargebee.v4.core.services.NonSubscriptionService; +import com.chargebee.v4.services.NonSubscriptionService; -import com.chargebee.v4.core.services.ResourceMigrationService; +import com.chargebee.v4.services.ResourceMigrationService; -import com.chargebee.v4.core.services.ProductService; +import com.chargebee.v4.services.ProductService; -import com.chargebee.v4.core.services.CouponCodeService; +import com.chargebee.v4.services.CouponCodeService; -import com.chargebee.v4.core.services.AddressService; +import com.chargebee.v4.services.AddressService; -import com.chargebee.v4.core.services.CouponService; +import com.chargebee.v4.services.CouponService; -import com.chargebee.v4.core.services.PortalSessionService; +import com.chargebee.v4.services.PortalSessionService; -import com.chargebee.v4.core.services.ItemPriceService; +import com.chargebee.v4.services.ItemPriceService; -import com.chargebee.v4.core.services.OfferFulfillmentService; +import com.chargebee.v4.services.OfferFulfillmentService; -import com.chargebee.v4.core.services.HostedPageService; +import com.chargebee.v4.services.HostedPageService; -import com.chargebee.v4.core.services.PurchaseService; +import com.chargebee.v4.services.PurchaseService; -import com.chargebee.v4.core.services.PaymentVoucherService; +import com.chargebee.v4.services.PaymentVoucherService; -import com.chargebee.v4.core.services.ItemFamilyService; +import com.chargebee.v4.services.ItemFamilyService; -import com.chargebee.v4.core.services.SubscriptionEntitlementService; +import com.chargebee.v4.services.SubscriptionEntitlementService; -import com.chargebee.v4.core.services.ThirdPartyEntityMappingService; +import com.chargebee.v4.services.ThirdPartyEntityMappingService; -import com.chargebee.v4.core.services.EntitlementOverrideService; +import com.chargebee.v4.services.EntitlementOverrideService; -import com.chargebee.v4.core.services.ThirdPartyConfigurationService; +import com.chargebee.v4.services.ThirdPartyConfigurationService; -import com.chargebee.v4.core.services.UnbilledChargeService; +import com.chargebee.v4.services.UnbilledChargeService; -import com.chargebee.v4.core.services.CommentService; +import com.chargebee.v4.services.CommentService; -import com.chargebee.v4.core.services.InvoiceService; +import com.chargebee.v4.services.InvoiceService; -import com.chargebee.v4.core.services.TransactionService; +import com.chargebee.v4.services.TransactionService; -import com.chargebee.v4.core.services.ThirdPartySyncDetailService; +import com.chargebee.v4.services.ThirdPartySyncDetailService; -import com.chargebee.v4.core.services.CustomerService; +import com.chargebee.v4.services.CustomerService; -import com.chargebee.v4.core.services.ItemEntitlementService; +import com.chargebee.v4.services.ItemEntitlementService; /** * Auto-generated service registry for lazy initialization of all Chargebee services. This class @@ -339,7 +339,7 @@ final class ServiceRegistry { * Get or create the GiftService instance. Thread-safe lazy initialization using double-checked * locking. */ - GiftService gift() { + GiftService gifts() { if (giftService == null) { synchronized (this) { if (giftService == null) { @@ -354,7 +354,7 @@ GiftService gift() { * Get or create the CsvTaxRuleService instance. Thread-safe lazy initialization using * double-checked locking. */ - CsvTaxRuleService csvTaxRule() { + CsvTaxRuleService csvTaxRules() { if (csvTaxRuleService == null) { synchronized (this) { if (csvTaxRuleService == null) { @@ -369,7 +369,7 @@ CsvTaxRuleService csvTaxRule() { * Get or create the UsageService instance. Thread-safe lazy initialization using double-checked * locking. */ - UsageService usage() { + UsageService usages() { if (usageService == null) { synchronized (this) { if (usageService == null) { @@ -384,7 +384,7 @@ UsageService usage() { * Get or create the TimeMachineService instance. Thread-safe lazy initialization using * double-checked locking. */ - TimeMachineService timeMachine() { + TimeMachineService timeMachines() { if (timeMachineService == null) { synchronized (this) { if (timeMachineService == null) { @@ -399,7 +399,7 @@ TimeMachineService timeMachine() { * Get or create the BusinessEntityService instance. Thread-safe lazy initialization using * double-checked locking. */ - BusinessEntityService businessEntity() { + BusinessEntityService businessEntities() { if (businessEntityService == null) { synchronized (this) { if (businessEntityService == null) { @@ -414,7 +414,7 @@ BusinessEntityService businessEntity() { * Get or create the OfferEventService instance. Thread-safe lazy initialization using * double-checked locking. */ - OfferEventService offerEvent() { + OfferEventService offerEvents() { if (offerEventService == null) { synchronized (this) { if (offerEventService == null) { @@ -429,7 +429,7 @@ OfferEventService offerEvent() { * Get or create the InAppSubscriptionService instance. Thread-safe lazy initialization using * double-checked locking. */ - InAppSubscriptionService inAppSubscription() { + InAppSubscriptionService inAppSubscriptions() { if (inAppSubscriptionService == null) { synchronized (this) { if (inAppSubscriptionService == null) { @@ -444,7 +444,7 @@ InAppSubscriptionService inAppSubscription() { * Get or create the Pc2MigrationService instance. Thread-safe lazy initialization using * double-checked locking. */ - Pc2MigrationService pc2Migration() { + Pc2MigrationService pc2Migrations() { if (pc2MigrationService == null) { synchronized (this) { if (pc2MigrationService == null) { @@ -459,7 +459,7 @@ Pc2MigrationService pc2Migration() { * Get or create the CreditNoteService instance. Thread-safe lazy initialization using * double-checked locking. */ - CreditNoteService creditNote() { + CreditNoteService creditNotes() { if (creditNoteService == null) { synchronized (this) { if (creditNoteService == null) { @@ -474,7 +474,7 @@ CreditNoteService creditNote() { * Get or create the CouponSetService instance. Thread-safe lazy initialization using * double-checked locking. */ - CouponSetService couponSet() { + CouponSetService couponSets() { if (couponSetService == null) { synchronized (this) { if (couponSetService == null) { @@ -489,7 +489,7 @@ CouponSetService couponSet() { * Get or create the QuoteService instance. Thread-safe lazy initialization using double-checked * locking. */ - QuoteService quote() { + QuoteService quotes() { if (quoteService == null) { synchronized (this) { if (quoteService == null) { @@ -504,7 +504,7 @@ QuoteService quote() { * Get or create the Pc2MigrationItemService instance. Thread-safe lazy initialization using * double-checked locking. */ - Pc2MigrationItemService pc2MigrationItem() { + Pc2MigrationItemService pc2MigrationItems() { if (pc2MigrationItemService == null) { synchronized (this) { if (pc2MigrationItemService == null) { @@ -519,7 +519,7 @@ Pc2MigrationItemService pc2MigrationItem() { * Get or create the EstimateService instance. Thread-safe lazy initialization using * double-checked locking. */ - EstimateService estimate() { + EstimateService estimates() { if (estimateService == null) { synchronized (this) { if (estimateService == null) { @@ -534,7 +534,7 @@ EstimateService estimate() { * Get or create the VariantService instance. Thread-safe lazy initialization using double-checked * locking. */ - VariantService variant() { + VariantService variants() { if (variantService == null) { synchronized (this) { if (variantService == null) { @@ -549,7 +549,7 @@ VariantService variant() { * Get or create the Pc2MigrationItemFamilyService instance. Thread-safe lazy initialization using * double-checked locking. */ - Pc2MigrationItemFamilyService pc2MigrationItemFamily() { + Pc2MigrationItemFamilyService pc2MigrationItemFamilies() { if (pc2MigrationItemFamilyService == null) { synchronized (this) { if (pc2MigrationItemFamilyService == null) { @@ -564,7 +564,7 @@ Pc2MigrationItemFamilyService pc2MigrationItemFamily() { * Get or create the PaymentSourceService instance. Thread-safe lazy initialization using * double-checked locking. */ - PaymentSourceService paymentSource() { + PaymentSourceService paymentSources() { if (paymentSourceService == null) { synchronized (this) { if (paymentSourceService == null) { @@ -579,7 +579,7 @@ PaymentSourceService paymentSource() { * Get or create the RecordedPurchaseService instance. Thread-safe lazy initialization using * double-checked locking. */ - RecordedPurchaseService recordedPurchase() { + RecordedPurchaseService recordedPurchases() { if (recordedPurchaseService == null) { synchronized (this) { if (recordedPurchaseService == null) { @@ -594,7 +594,7 @@ RecordedPurchaseService recordedPurchase() { * Get or create the PlanService instance. Thread-safe lazy initialization using double-checked * locking. */ - PlanService plan() { + PlanService plans() { if (planService == null) { synchronized (this) { if (planService == null) { @@ -609,7 +609,7 @@ PlanService plan() { * Get or create the ExportService instance. Thread-safe lazy initialization using double-checked * locking. */ - ExportService export() { + ExportService exports() { if (exportService == null) { synchronized (this) { if (exportService == null) { @@ -624,7 +624,7 @@ ExportService export() { * Get or create the OrderService instance. Thread-safe lazy initialization using double-checked * locking. */ - OrderService order() { + OrderService orders() { if (orderService == null) { synchronized (this) { if (orderService == null) { @@ -639,7 +639,7 @@ OrderService order() { * Get or create the ItemService instance. Thread-safe lazy initialization using double-checked * locking. */ - ItemService item() { + ItemService items() { if (itemService == null) { synchronized (this) { if (itemService == null) { @@ -654,7 +654,7 @@ ItemService item() { * Get or create the CustomerEntitlementService instance. Thread-safe lazy initialization using * double-checked locking. */ - CustomerEntitlementService customerEntitlement() { + CustomerEntitlementService customerEntitlements() { if (customerEntitlementService == null) { synchronized (this) { if (customerEntitlementService == null) { @@ -669,7 +669,7 @@ CustomerEntitlementService customerEntitlement() { * Get or create the PersonalizedOfferService instance. Thread-safe lazy initialization using * double-checked locking. */ - PersonalizedOfferService personalizedOffer() { + PersonalizedOfferService personalizedOffers() { if (personalizedOfferService == null) { synchronized (this) { if (personalizedOfferService == null) { @@ -684,7 +684,7 @@ PersonalizedOfferService personalizedOffer() { * Get or create the OmnichannelSubscriptionService instance. Thread-safe lazy initialization * using double-checked locking. */ - OmnichannelSubscriptionService omnichannelSubscription() { + OmnichannelSubscriptionService omnichannelSubscriptions() { if (omnichannelSubscriptionService == null) { synchronized (this) { if (omnichannelSubscriptionService == null) { @@ -699,7 +699,7 @@ OmnichannelSubscriptionService omnichannelSubscription() { * Get or create the OmnichannelSubscriptionItemService instance. Thread-safe lazy initialization * using double-checked locking. */ - OmnichannelSubscriptionItemService omnichannelSubscriptionItem() { + OmnichannelSubscriptionItemService omnichannelSubscriptionItems() { if (omnichannelSubscriptionItemService == null) { synchronized (this) { if (omnichannelSubscriptionItemService == null) { @@ -714,7 +714,7 @@ OmnichannelSubscriptionItemService omnichannelSubscriptionItem() { * Get or create the RampService instance. Thread-safe lazy initialization using double-checked * locking. */ - RampService ramp() { + RampService ramps() { if (rampService == null) { synchronized (this) { if (rampService == null) { @@ -729,7 +729,7 @@ RampService ramp() { * Get or create the OmnichannelOneTimeOrderService instance. Thread-safe lazy initialization * using double-checked locking. */ - OmnichannelOneTimeOrderService omnichannelOneTimeOrder() { + OmnichannelOneTimeOrderService omnichannelOneTimeOrders() { if (omnichannelOneTimeOrderService == null) { synchronized (this) { if (omnichannelOneTimeOrderService == null) { @@ -744,7 +744,7 @@ OmnichannelOneTimeOrderService omnichannelOneTimeOrder() { * Get or create the DifferentialPriceService instance. Thread-safe lazy initialization using * double-checked locking. */ - DifferentialPriceService differentialPrice() { + DifferentialPriceService differentialPrices() { if (differentialPriceService == null) { synchronized (this) { if (differentialPriceService == null) { @@ -759,7 +759,7 @@ DifferentialPriceService differentialPrice() { * Get or create the EntitlementService instance. Thread-safe lazy initialization using * double-checked locking. */ - EntitlementService entitlement() { + EntitlementService entitlements() { if (entitlementService == null) { synchronized (this) { if (entitlementService == null) { @@ -774,7 +774,7 @@ EntitlementService entitlement() { * Get or create the AdditionalBillingLogiqService instance. Thread-safe lazy initialization using * double-checked locking. */ - AdditionalBillingLogiqService additionalBillingLogiq() { + AdditionalBillingLogiqService additionalBillingLogiqs() { if (additionalBillingLogiqService == null) { synchronized (this) { if (additionalBillingLogiqService == null) { @@ -789,7 +789,7 @@ AdditionalBillingLogiqService additionalBillingLogiq() { * Get or create the SubscriptionSettingService instance. Thread-safe lazy initialization using * double-checked locking. */ - SubscriptionSettingService subscriptionSetting() { + SubscriptionSettingService subscriptionSettings() { if (subscriptionSettingService == null) { synchronized (this) { if (subscriptionSettingService == null) { @@ -804,7 +804,7 @@ SubscriptionSettingService subscriptionSetting() { * Get or create the SiteMigrationDetailService instance. Thread-safe lazy initialization using * double-checked locking. */ - SiteMigrationDetailService siteMigrationDetail() { + SiteMigrationDetailService siteMigrationDetails() { if (siteMigrationDetailService == null) { synchronized (this) { if (siteMigrationDetailService == null) { @@ -819,7 +819,7 @@ SiteMigrationDetailService siteMigrationDetail() { * Get or create the PaymentIntentService instance. Thread-safe lazy initialization using * double-checked locking. */ - PaymentIntentService paymentIntent() { + PaymentIntentService paymentIntents() { if (paymentIntentService == null) { synchronized (this) { if (paymentIntentService == null) { @@ -834,7 +834,7 @@ PaymentIntentService paymentIntent() { * Get or create the PaymentScheduleSchemeService instance. Thread-safe lazy initialization using * double-checked locking. */ - PaymentScheduleSchemeService paymentScheduleScheme() { + PaymentScheduleSchemeService paymentScheduleSchemes() { if (paymentScheduleSchemeService == null) { synchronized (this) { if (paymentScheduleSchemeService == null) { @@ -849,7 +849,7 @@ PaymentScheduleSchemeService paymentScheduleScheme() { * Get or create the CardService instance. Thread-safe lazy initialization using double-checked * locking. */ - CardService card() { + CardService cards() { if (cardService == null) { synchronized (this) { if (cardService == null) { @@ -864,7 +864,7 @@ CardService card() { * Get or create the AttachedItemService instance. Thread-safe lazy initialization using * double-checked locking. */ - AttachedItemService attachedItem() { + AttachedItemService attachedItems() { if (attachedItemService == null) { synchronized (this) { if (attachedItemService == null) { @@ -879,7 +879,7 @@ AttachedItemService attachedItem() { * Get or create the UsageEventService instance. Thread-safe lazy initialization using * double-checked locking. */ - UsageEventService usageEvent() { + UsageEventService usageEvents() { if (usageEventService == null) { synchronized (this) { if (usageEventService == null) { @@ -894,7 +894,7 @@ UsageEventService usageEvent() { * Get or create the PriceVariantService instance. Thread-safe lazy initialization using * double-checked locking. */ - PriceVariantService priceVariant() { + PriceVariantService priceVariants() { if (priceVariantService == null) { synchronized (this) { if (priceVariantService == null) { @@ -909,7 +909,7 @@ PriceVariantService priceVariant() { * Get or create the FullExportService instance. Thread-safe lazy initialization using * double-checked locking. */ - FullExportService fullExport() { + FullExportService fullExports() { if (fullExportService == null) { synchronized (this) { if (fullExportService == null) { @@ -924,7 +924,7 @@ FullExportService fullExport() { * Get or create the VirtualBankAccountService instance. Thread-safe lazy initialization using * double-checked locking. */ - VirtualBankAccountService virtualBankAccount() { + VirtualBankAccountService virtualBankAccounts() { if (virtualBankAccountService == null) { synchronized (this) { if (virtualBankAccountService == null) { @@ -939,7 +939,7 @@ VirtualBankAccountService virtualBankAccount() { * Get or create the AddonService instance. Thread-safe lazy initialization using double-checked * locking. */ - AddonService addon() { + AddonService addons() { if (addonService == null) { synchronized (this) { if (addonService == null) { @@ -954,7 +954,7 @@ AddonService addon() { * Get or create the TpSiteUserService instance. Thread-safe lazy initialization using * double-checked locking. */ - TpSiteUserService tpSiteUser() { + TpSiteUserService tpSiteUsers() { if (tpSiteUserService == null) { synchronized (this) { if (tpSiteUserService == null) { @@ -969,7 +969,7 @@ TpSiteUserService tpSiteUser() { * Get or create the ConfigurationService instance. Thread-safe lazy initialization using * double-checked locking. */ - ConfigurationService configuration() { + ConfigurationService configurations() { if (configurationService == null) { synchronized (this) { if (configurationService == null) { @@ -984,7 +984,7 @@ ConfigurationService configuration() { * Get or create the PricingPageSessionService instance. Thread-safe lazy initialization using * double-checked locking. */ - PricingPageSessionService pricingPageSession() { + PricingPageSessionService pricingPageSessions() { if (pricingPageSessionService == null) { synchronized (this) { if (pricingPageSessionService == null) { @@ -999,7 +999,7 @@ PricingPageSessionService pricingPageSession() { * Get or create the Pc2MigrationItemPriceService instance. Thread-safe lazy initialization using * double-checked locking. */ - Pc2MigrationItemPriceService pc2MigrationItemPrice() { + Pc2MigrationItemPriceService pc2MigrationItemPrices() { if (pc2MigrationItemPriceService == null) { synchronized (this) { if (pc2MigrationItemPriceService == null) { @@ -1014,7 +1014,7 @@ Pc2MigrationItemPriceService pc2MigrationItemPrice() { * Get or create the RuleService instance. Thread-safe lazy initialization using double-checked * locking. */ - RuleService rule() { + RuleService rules() { if (ruleService == null) { synchronized (this) { if (ruleService == null) { @@ -1029,7 +1029,7 @@ RuleService rule() { * Get or create the SubscriptionService instance. Thread-safe lazy initialization using * double-checked locking. */ - SubscriptionService subscription() { + SubscriptionService subscriptions() { if (subscriptionService == null) { synchronized (this) { if (subscriptionService == null) { @@ -1044,7 +1044,7 @@ SubscriptionService subscription() { * Get or create the MediaService instance. Thread-safe lazy initialization using double-checked * locking. */ - MediaService media() { + MediaService medias() { if (mediaService == null) { synchronized (this) { if (mediaService == null) { @@ -1059,7 +1059,7 @@ MediaService media() { * Get or create the BusinessProfileService instance. Thread-safe lazy initialization using * double-checked locking. */ - BusinessProfileService businessProfile() { + BusinessProfileService businessProfiles() { if (businessProfileService == null) { synchronized (this) { if (businessProfileService == null) { @@ -1074,7 +1074,7 @@ BusinessProfileService businessProfile() { * Get or create the PromotionalCreditService instance. Thread-safe lazy initialization using * double-checked locking. */ - PromotionalCreditService promotionalCredit() { + PromotionalCreditService promotionalCredits() { if (promotionalCreditService == null) { synchronized (this) { if (promotionalCreditService == null) { @@ -1089,7 +1089,7 @@ PromotionalCreditService promotionalCredit() { * Get or create the BrandConfigurationService instance. Thread-safe lazy initialization using * double-checked locking. */ - BrandConfigurationService brandConfiguration() { + BrandConfigurationService brandConfigurations() { if (brandConfigurationService == null) { synchronized (this) { if (brandConfigurationService == null) { @@ -1104,7 +1104,7 @@ BrandConfigurationService brandConfiguration() { * Get or create the WebhookEndpointService instance. Thread-safe lazy initialization using * double-checked locking. */ - WebhookEndpointService webhookEndpoint() { + WebhookEndpointService webhookEndpoints() { if (webhookEndpointService == null) { synchronized (this) { if (webhookEndpointService == null) { @@ -1119,7 +1119,7 @@ WebhookEndpointService webhookEndpoint() { * Get or create the FeatureService instance. Thread-safe lazy initialization using double-checked * locking. */ - FeatureService feature() { + FeatureService features() { if (featureService == null) { synchronized (this) { if (featureService == null) { @@ -1134,7 +1134,7 @@ FeatureService feature() { * Get or create the UnbilledChargesSettingService instance. Thread-safe lazy initialization using * double-checked locking. */ - UnbilledChargesSettingService unbilledChargesSetting() { + UnbilledChargesSettingService unbilledChargesSettings() { if (unbilledChargesSettingService == null) { synchronized (this) { if (unbilledChargesSettingService == null) { @@ -1149,7 +1149,7 @@ UnbilledChargesSettingService unbilledChargesSetting() { * Get or create the CurrencyService instance. Thread-safe lazy initialization using * double-checked locking. */ - CurrencyService currency() { + CurrencyService currencies() { if (currencyService == null) { synchronized (this) { if (currencyService == null) { @@ -1164,7 +1164,7 @@ CurrencyService currency() { * Get or create the EventService instance. Thread-safe lazy initialization using double-checked * locking. */ - EventService event() { + EventService events() { if (eventService == null) { synchronized (this) { if (eventService == null) { @@ -1179,7 +1179,7 @@ EventService event() { * Get or create the UsageFileService instance. Thread-safe lazy initialization using * double-checked locking. */ - UsageFileService usageFile() { + UsageFileService usageFiles() { if (usageFileService == null) { synchronized (this) { if (usageFileService == null) { @@ -1194,7 +1194,7 @@ UsageFileService usageFile() { * Get or create the NonSubscriptionService instance. Thread-safe lazy initialization using * double-checked locking. */ - NonSubscriptionService nonSubscription() { + NonSubscriptionService nonSubscriptions() { if (nonSubscriptionService == null) { synchronized (this) { if (nonSubscriptionService == null) { @@ -1209,7 +1209,7 @@ NonSubscriptionService nonSubscription() { * Get or create the ResourceMigrationService instance. Thread-safe lazy initialization using * double-checked locking. */ - ResourceMigrationService resourceMigration() { + ResourceMigrationService resourceMigrations() { if (resourceMigrationService == null) { synchronized (this) { if (resourceMigrationService == null) { @@ -1224,7 +1224,7 @@ ResourceMigrationService resourceMigration() { * Get or create the ProductService instance. Thread-safe lazy initialization using double-checked * locking. */ - ProductService product() { + ProductService products() { if (productService == null) { synchronized (this) { if (productService == null) { @@ -1239,7 +1239,7 @@ ProductService product() { * Get or create the CouponCodeService instance. Thread-safe lazy initialization using * double-checked locking. */ - CouponCodeService couponCode() { + CouponCodeService couponCodes() { if (couponCodeService == null) { synchronized (this) { if (couponCodeService == null) { @@ -1254,7 +1254,7 @@ CouponCodeService couponCode() { * Get or create the AddressService instance. Thread-safe lazy initialization using double-checked * locking. */ - AddressService address() { + AddressService addresses() { if (addressService == null) { synchronized (this) { if (addressService == null) { @@ -1269,7 +1269,7 @@ AddressService address() { * Get or create the CouponService instance. Thread-safe lazy initialization using double-checked * locking. */ - CouponService coupon() { + CouponService coupons() { if (couponService == null) { synchronized (this) { if (couponService == null) { @@ -1284,7 +1284,7 @@ CouponService coupon() { * Get or create the PortalSessionService instance. Thread-safe lazy initialization using * double-checked locking. */ - PortalSessionService portalSession() { + PortalSessionService portalSessions() { if (portalSessionService == null) { synchronized (this) { if (portalSessionService == null) { @@ -1299,7 +1299,7 @@ PortalSessionService portalSession() { * Get or create the ItemPriceService instance. Thread-safe lazy initialization using * double-checked locking. */ - ItemPriceService itemPrice() { + ItemPriceService itemPrices() { if (itemPriceService == null) { synchronized (this) { if (itemPriceService == null) { @@ -1314,7 +1314,7 @@ ItemPriceService itemPrice() { * Get or create the OfferFulfillmentService instance. Thread-safe lazy initialization using * double-checked locking. */ - OfferFulfillmentService offerFulfillment() { + OfferFulfillmentService offerFulfillments() { if (offerFulfillmentService == null) { synchronized (this) { if (offerFulfillmentService == null) { @@ -1329,7 +1329,7 @@ OfferFulfillmentService offerFulfillment() { * Get or create the HostedPageService instance. Thread-safe lazy initialization using * double-checked locking. */ - HostedPageService hostedPage() { + HostedPageService hostedPages() { if (hostedPageService == null) { synchronized (this) { if (hostedPageService == null) { @@ -1344,7 +1344,7 @@ HostedPageService hostedPage() { * Get or create the PurchaseService instance. Thread-safe lazy initialization using * double-checked locking. */ - PurchaseService purchase() { + PurchaseService purchases() { if (purchaseService == null) { synchronized (this) { if (purchaseService == null) { @@ -1359,7 +1359,7 @@ PurchaseService purchase() { * Get or create the PaymentVoucherService instance. Thread-safe lazy initialization using * double-checked locking. */ - PaymentVoucherService paymentVoucher() { + PaymentVoucherService paymentVouchers() { if (paymentVoucherService == null) { synchronized (this) { if (paymentVoucherService == null) { @@ -1374,7 +1374,7 @@ PaymentVoucherService paymentVoucher() { * Get or create the ItemFamilyService instance. Thread-safe lazy initialization using * double-checked locking. */ - ItemFamilyService itemFamily() { + ItemFamilyService itemFamilies() { if (itemFamilyService == null) { synchronized (this) { if (itemFamilyService == null) { @@ -1389,7 +1389,7 @@ ItemFamilyService itemFamily() { * Get or create the SubscriptionEntitlementService instance. Thread-safe lazy initialization * using double-checked locking. */ - SubscriptionEntitlementService subscriptionEntitlement() { + SubscriptionEntitlementService subscriptionEntitlements() { if (subscriptionEntitlementService == null) { synchronized (this) { if (subscriptionEntitlementService == null) { @@ -1404,7 +1404,7 @@ SubscriptionEntitlementService subscriptionEntitlement() { * Get or create the ThirdPartyEntityMappingService instance. Thread-safe lazy initialization * using double-checked locking. */ - ThirdPartyEntityMappingService thirdPartyEntityMapping() { + ThirdPartyEntityMappingService thirdPartyEntityMappings() { if (thirdPartyEntityMappingService == null) { synchronized (this) { if (thirdPartyEntityMappingService == null) { @@ -1419,7 +1419,7 @@ ThirdPartyEntityMappingService thirdPartyEntityMapping() { * Get or create the EntitlementOverrideService instance. Thread-safe lazy initialization using * double-checked locking. */ - EntitlementOverrideService entitlementOverride() { + EntitlementOverrideService entitlementOverrides() { if (entitlementOverrideService == null) { synchronized (this) { if (entitlementOverrideService == null) { @@ -1434,7 +1434,7 @@ EntitlementOverrideService entitlementOverride() { * Get or create the ThirdPartyConfigurationService instance. Thread-safe lazy initialization * using double-checked locking. */ - ThirdPartyConfigurationService thirdPartyConfiguration() { + ThirdPartyConfigurationService thirdPartyConfigurations() { if (thirdPartyConfigurationService == null) { synchronized (this) { if (thirdPartyConfigurationService == null) { @@ -1449,7 +1449,7 @@ ThirdPartyConfigurationService thirdPartyConfiguration() { * Get or create the UnbilledChargeService instance. Thread-safe lazy initialization using * double-checked locking. */ - UnbilledChargeService unbilledCharge() { + UnbilledChargeService unbilledCharges() { if (unbilledChargeService == null) { synchronized (this) { if (unbilledChargeService == null) { @@ -1464,7 +1464,7 @@ UnbilledChargeService unbilledCharge() { * Get or create the CommentService instance. Thread-safe lazy initialization using double-checked * locking. */ - CommentService comment() { + CommentService comments() { if (commentService == null) { synchronized (this) { if (commentService == null) { @@ -1479,7 +1479,7 @@ CommentService comment() { * Get or create the InvoiceService instance. Thread-safe lazy initialization using double-checked * locking. */ - InvoiceService invoice() { + InvoiceService invoices() { if (invoiceService == null) { synchronized (this) { if (invoiceService == null) { @@ -1494,7 +1494,7 @@ InvoiceService invoice() { * Get or create the TransactionService instance. Thread-safe lazy initialization using * double-checked locking. */ - TransactionService transaction() { + TransactionService transactions() { if (transactionService == null) { synchronized (this) { if (transactionService == null) { @@ -1509,7 +1509,7 @@ TransactionService transaction() { * Get or create the ThirdPartySyncDetailService instance. Thread-safe lazy initialization using * double-checked locking. */ - ThirdPartySyncDetailService thirdPartySyncDetail() { + ThirdPartySyncDetailService thirdPartySyncDetails() { if (thirdPartySyncDetailService == null) { synchronized (this) { if (thirdPartySyncDetailService == null) { @@ -1524,7 +1524,7 @@ ThirdPartySyncDetailService thirdPartySyncDetail() { * Get or create the CustomerService instance. Thread-safe lazy initialization using * double-checked locking. */ - CustomerService customer() { + CustomerService customers() { if (customerService == null) { synchronized (this) { if (customerService == null) { @@ -1539,7 +1539,7 @@ CustomerService customer() { * Get or create the ItemEntitlementService instance. Thread-safe lazy initialization using * double-checked locking. */ - ItemEntitlementService itemEntitlement() { + ItemEntitlementService itemEntitlements() { if (itemEntitlementService == null) { synchronized (this) { if (itemEntitlementService == null) { 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/core/http/ChargebeeApiResponse.java b/src/main/java/com/chargebee/v4/core/http/ChargebeeApiResponse.java deleted file mode 100644 index 4ae5fd96..00000000 --- a/src/main/java/com/chargebee/v4/core/http/ChargebeeApiResponse.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.chargebee.core.http; - -import com.chargebee.v4.transport.Response; - -/** - * Wrapper for HTTP responses that provides access to both raw response data - * and parsed objects. - */ -public final class ChargebeeApiResponse { - private final Response rawResponse; - private final T parsedObject; - - public ChargebeeApiResponse(Response rawResponse, T parsedObject) { - this.rawResponse = rawResponse; - this.parsedObject = parsedObject; - } - - /** - * Get the HTTP status code. - */ - public int statusCode() { - return rawResponse.getStatusCode(); - } - - /** - * Get the response headers. - */ - public Headers headers() { - return new Headers(rawResponse.getHeaders()); - } - - /** - * Get the raw response body as string. - */ - public String rawBody() { - return rawResponse.getBodyAsString(); - } - - /** - * Get the raw response body as bytes. - */ - public byte[] rawBodyBytes() { - return rawResponse.getBody(); - } - - /** - * Get the parsed object. - */ - public T parse() { - return parsedObject; - } - - /** - * Check if the response was successful (2xx status code). - */ - public boolean isSuccessful() { - return rawResponse.isSuccessful(); - } - - /** - * Get the underlying raw Response object. - */ - public Response getRawResponse() { - return rawResponse; - } - - @Override - public String toString() { - return "ChargebeeApiResponse{" + - "statusCode=" + statusCode() + - ", headers=" + headers().names().size() + " headers" + - ", parsedObject=" + parsedObject + - '}'; - } -} \ No newline at end of file diff --git a/src/main/java/com/chargebee/v4/core/http/Headers.java b/src/main/java/com/chargebee/v4/core/http/Headers.java deleted file mode 100644 index dcff02ab..00000000 --- a/src/main/java/com/chargebee/v4/core/http/Headers.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.chargebee.core.http; - -import java.util.*; - -/** - * Immutable wrapper for HTTP response headers. - */ -public final class Headers { - private final Map> headers; - - public Headers(Map> headers) { - this.headers = Collections.unmodifiableMap(new HashMap<>(headers)); - } - - /** - * Get header value by name (case-insensitive). - */ - public String get(String name) { - List values = getAll(name); - return values != null && !values.isEmpty() ? values.get(0) : null; - } - - /** - * Get all header values by name (case-insensitive). - */ - public List getAll(String name) { - for (Map.Entry> entry : headers.entrySet()) { - if (name.equalsIgnoreCase(entry.getKey())) { - return entry.getValue(); - } - } - return null; - } - - /** - * Check if header exists (case-insensitive). - */ - public boolean contains(String name) { - return getAll(name) != null; - } - - /** - * Get all header names. - */ - public Set names() { - return headers.keySet(); - } - - /** - * Get the raw headers map. - */ - public Map> toMap() { - return headers; - } - - @Override - public String toString() { - return "Headers{" + headers + "}"; - } -} \ No newline at end of file diff --git a/src/main/java/com/chargebee/v4/core/models/addon/params/AddonCopyParams.java b/src/main/java/com/chargebee/v4/core/models/addon/params/AddonCopyParams.java deleted file mode 100644 index 132f5912..00000000 --- a/src/main/java/com/chargebee/v4/core/models/addon/params/AddonCopyParams.java +++ /dev/null @@ -1,71 +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.core.models.addon.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class AddonCopyParams { - - private final Map formData; - - private AddonCopyParams(AddonCopyBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonCopyParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonCopyBuilder builder() { - return new AddonCopyBuilder(); - } - - public static final class AddonCopyBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonCopyBuilder() {} - - public AddonCopyBuilder fromSite(String value) { - - formData.put("from_site", value); - - return this; - } - - public AddonCopyBuilder idAtFromSite(String value) { - - formData.put("id_at_from_site", value); - - return this; - } - - public AddonCopyBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonCopyBuilder forSiteMerging(Boolean value) { - - formData.put("for_site_merging", value); - - return this; - } - - public AddonCopyParams build() { - return new AddonCopyParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/addon/params/AddonCreateParams.java b/src/main/java/com/chargebee/v4/core/models/addon/params/AddonCreateParams.java deleted file mode 100644 index 12d85443..00000000 --- a/src/main/java/com/chargebee/v4/core/models/addon/params/AddonCreateParams.java +++ /dev/null @@ -1,758 +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.core.models.addon.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; - -public final class AddonCreateParams { - - private final Map formData; - - private AddonCreateParams(AddonCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonCreateBuilder builder() { - return new AddonCreateBuilder(); - } - - public static final class AddonCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonCreateBuilder() {} - - public AddonCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonCreateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public AddonCreateBuilder invoiceName(String value) { - - formData.put("invoice_name", value); - - return this; - } - - public AddonCreateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public AddonCreateBuilder chargeType(ChargeType value) { - - formData.put("charge_type", value); - - return this; - } - - public AddonCreateBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public AddonCreateBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public AddonCreateBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public AddonCreateBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public AddonCreateBuilder pricingModel(PricingModel value) { - - formData.put("pricing_model", value); - - return this; - } - - @Deprecated - public AddonCreateBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public AddonCreateBuilder unit(String value) { - - formData.put("unit", value); - - return this; - } - - public AddonCreateBuilder enabledInPortal(Boolean value) { - - formData.put("enabled_in_portal", value); - - return this; - } - - public AddonCreateBuilder taxable(Boolean value) { - - formData.put("taxable", value); - - return this; - } - - public AddonCreateBuilder taxProfileId(String value) { - - formData.put("tax_profile_id", value); - - return this; - } - - public AddonCreateBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public AddonCreateBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public AddonCreateBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public AddonCreateBuilder taxCode(String value) { - - formData.put("tax_code", value); - - return this; - } - - public AddonCreateBuilder hsnCode(String value) { - - formData.put("hsn_code", value); - - return this; - } - - public AddonCreateBuilder taxjarProductCode(String value) { - - formData.put("taxjar_product_code", value); - - return this; - } - - public AddonCreateBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public AddonCreateBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public AddonCreateBuilder sku(String value) { - - formData.put("sku", value); - - return this; - } - - public AddonCreateBuilder accountingCode(String value) { - - formData.put("accounting_code", value); - - return this; - } - - public AddonCreateBuilder accountingCategory1(String value) { - - formData.put("accounting_category1", value); - - return this; - } - - public AddonCreateBuilder accountingCategory2(String value) { - - formData.put("accounting_category2", value); - - return this; - } - - public AddonCreateBuilder accountingCategory3(String value) { - - formData.put("accounting_category3", value); - - return this; - } - - public AddonCreateBuilder accountingCategory4(String value) { - - formData.put("accounting_category4", value); - - return this; - } - - public AddonCreateBuilder isShippable(Boolean value) { - - formData.put("is_shippable", value); - - return this; - } - - public AddonCreateBuilder shippingFrequencyPeriod(Integer value) { - - formData.put("shipping_frequency_period", value); - - return this; - } - - public AddonCreateBuilder shippingFrequencyPeriodUnit(ShippingFrequencyPeriodUnit value) { - - formData.put("shipping_frequency_period_unit", value); - - return this; - } - - public AddonCreateBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public AddonCreateBuilder showDescriptionInInvoices(Boolean value) { - - formData.put("show_description_in_invoices", value); - - return this; - } - - public AddonCreateBuilder showDescriptionInQuotes(Boolean value) { - - formData.put("show_description_in_quotes", value); - - return this; - } - - public AddonCreateBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public AddonCreateBuilder prorationType(ProrationType value) { - - formData.put("proration_type", value); - - return this; - } - - public AddonCreateBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public AddonCreateBuilder tiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public AddonCreateBuilder taxProvidersFields(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 AddonCreateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 AddonCreateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public AddonCreateParams build() { - return new AddonCreateParams(this); - } - } - - public enum ChargeType { - RECURRING("recurring"), - - NON_RECURRING("non_recurring"), - - /** An enum member indicating that ChargeType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeType enumValue : ChargeType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - NOT_APPLICABLE("not_applicable"), - - /** 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 enum PricingModel { - FLAT_FEE("flat_fee"), - - PER_UNIT("per_unit"), - - TIERED("tiered"), - - VOLUME("volume"), - - STAIRSTEP("stairstep"), - - /** An enum member indicating that PricingModel was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingModel(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingModel fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingModel enumValue : PricingModel.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Type { - ON_OFF("on_off"), - - QUANTITY("quantity"), - - TIERED("tiered"), - - VOLUME("volume"), - - STAIRSTEP("stairstep"), - - /** 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 AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ShippingFrequencyPeriodUnit { - YEAR("year"), - - MONTH("month"), - - WEEK("week"), - - DAY("day"), - - /** - * An enum member indicating that ShippingFrequencyPeriodUnit was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - ShippingFrequencyPeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ShippingFrequencyPeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (ShippingFrequencyPeriodUnit enumValue : ShippingFrequencyPeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ProrationType { - SITE_DEFAULT("site_default"), - - PARTIAL_TERM("partial_term"), - - FULL_TERM("full_term"), - - /** An enum member indicating that ProrationType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ProrationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ProrationType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ProrationType enumValue : ProrationType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Status { - ACTIVE("active"), - - ARCHIVED("archived"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class TiersParams { - - private final Map formData; - - private TiersParams(TiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TiersBuilder builder() { - return new TiersBuilder(); - } - - public static final class TiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TiersBuilder() {} - - public TiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public TiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public TiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public TiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public TiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public TiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public TiersParams build() { - return new TiersParams(this); - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/addon/params/AddonDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/addon/params/AddonDeleteParams.java deleted file mode 100644 index bc21a23a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/addon/params/AddonDeleteParams.java +++ /dev/null @@ -1,43 +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.core.models.addon.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class AddonDeleteParams { - - private final Map formData; - - private AddonDeleteParams(AddonDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private AddonDeleteBuilder() {} - - public AddonDeleteParams build() { - return new AddonDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/addon/params/AddonUnarchiveParams.java b/src/main/java/com/chargebee/v4/core/models/addon/params/AddonUnarchiveParams.java deleted file mode 100644 index 2856ca45..00000000 --- a/src/main/java/com/chargebee/v4/core/models/addon/params/AddonUnarchiveParams.java +++ /dev/null @@ -1,43 +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.core.models.addon.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class AddonUnarchiveParams { - - private final Map formData; - - private AddonUnarchiveParams(AddonUnarchiveBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private AddonUnarchiveBuilder() {} - - public AddonUnarchiveParams build() { - return new AddonUnarchiveParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/addon/params/AddonUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/addon/params/AddonUpdateParams.java deleted file mode 100644 index 357c1117..00000000 --- a/src/main/java/com/chargebee/v4/core/models/addon/params/AddonUpdateParams.java +++ /dev/null @@ -1,716 +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.core.models.addon.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; - -public final class AddonUpdateParams { - - private final Map formData; - - private AddonUpdateParams(AddonUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonUpdateBuilder builder() { - return new AddonUpdateBuilder(); - } - - public static final class AddonUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonUpdateBuilder() {} - - public AddonUpdateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public AddonUpdateBuilder invoiceName(String value) { - - formData.put("invoice_name", value); - - return this; - } - - public AddonUpdateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public AddonUpdateBuilder chargeType(ChargeType value) { - - formData.put("charge_type", value); - - return this; - } - - public AddonUpdateBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public AddonUpdateBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public AddonUpdateBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public AddonUpdateBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public AddonUpdateBuilder pricingModel(PricingModel value) { - - formData.put("pricing_model", value); - - return this; - } - - @Deprecated - public AddonUpdateBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public AddonUpdateBuilder unit(String value) { - - formData.put("unit", value); - - return this; - } - - public AddonUpdateBuilder enabledInPortal(Boolean value) { - - formData.put("enabled_in_portal", value); - - return this; - } - - public AddonUpdateBuilder taxable(Boolean value) { - - formData.put("taxable", value); - - return this; - } - - public AddonUpdateBuilder taxProfileId(String value) { - - formData.put("tax_profile_id", value); - - return this; - } - - public AddonUpdateBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public AddonUpdateBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public AddonUpdateBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public AddonUpdateBuilder taxCode(String value) { - - formData.put("tax_code", value); - - return this; - } - - public AddonUpdateBuilder hsnCode(String value) { - - formData.put("hsn_code", value); - - return this; - } - - public AddonUpdateBuilder taxjarProductCode(String value) { - - formData.put("taxjar_product_code", value); - - return this; - } - - public AddonUpdateBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public AddonUpdateBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public AddonUpdateBuilder sku(String value) { - - formData.put("sku", value); - - return this; - } - - public AddonUpdateBuilder accountingCode(String value) { - - formData.put("accounting_code", value); - - return this; - } - - public AddonUpdateBuilder accountingCategory1(String value) { - - formData.put("accounting_category1", value); - - return this; - } - - public AddonUpdateBuilder accountingCategory2(String value) { - - formData.put("accounting_category2", value); - - return this; - } - - public AddonUpdateBuilder accountingCategory3(String value) { - - formData.put("accounting_category3", value); - - return this; - } - - public AddonUpdateBuilder accountingCategory4(String value) { - - formData.put("accounting_category4", value); - - return this; - } - - public AddonUpdateBuilder isShippable(Boolean value) { - - formData.put("is_shippable", value); - - return this; - } - - public AddonUpdateBuilder shippingFrequencyPeriod(Integer value) { - - formData.put("shipping_frequency_period", value); - - return this; - } - - public AddonUpdateBuilder shippingFrequencyPeriodUnit(ShippingFrequencyPeriodUnit value) { - - formData.put("shipping_frequency_period_unit", value); - - return this; - } - - public AddonUpdateBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public AddonUpdateBuilder showDescriptionInInvoices(Boolean value) { - - formData.put("show_description_in_invoices", value); - - return this; - } - - public AddonUpdateBuilder showDescriptionInQuotes(Boolean value) { - - formData.put("show_description_in_quotes", value); - - return this; - } - - public AddonUpdateBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public AddonUpdateBuilder prorationType(ProrationType value) { - - formData.put("proration_type", value); - - return this; - } - - public AddonUpdateBuilder tiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public AddonUpdateBuilder taxProvidersFields(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 AddonUpdateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 AddonUpdateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public AddonUpdateParams build() { - return new AddonUpdateParams(this); - } - } - - public enum ChargeType { - RECURRING("recurring"), - - NON_RECURRING("non_recurring"), - - /** An enum member indicating that ChargeType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeType enumValue : ChargeType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - NOT_APPLICABLE("not_applicable"), - - /** 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 enum PricingModel { - FLAT_FEE("flat_fee"), - - PER_UNIT("per_unit"), - - TIERED("tiered"), - - VOLUME("volume"), - - STAIRSTEP("stairstep"), - - /** An enum member indicating that PricingModel was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingModel(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingModel fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingModel enumValue : PricingModel.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Type { - ON_OFF("on_off"), - - QUANTITY("quantity"), - - TIERED("tiered"), - - VOLUME("volume"), - - STAIRSTEP("stairstep"), - - /** 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 AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ShippingFrequencyPeriodUnit { - YEAR("year"), - - MONTH("month"), - - WEEK("week"), - - DAY("day"), - - /** - * An enum member indicating that ShippingFrequencyPeriodUnit was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - ShippingFrequencyPeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ShippingFrequencyPeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (ShippingFrequencyPeriodUnit enumValue : ShippingFrequencyPeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ProrationType { - SITE_DEFAULT("site_default"), - - PARTIAL_TERM("partial_term"), - - FULL_TERM("full_term"), - - /** An enum member indicating that ProrationType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ProrationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ProrationType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ProrationType enumValue : ProrationType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class TiersParams { - - private final Map formData; - - private TiersParams(TiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TiersBuilder builder() { - return new TiersBuilder(); - } - - public static final class TiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TiersBuilder() {} - - public TiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public TiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public TiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public TiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public TiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public TiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public TiersParams build() { - return new TiersParams(this); - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/address/params/AddressUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/address/params/AddressUpdateParams.java deleted file mode 100644 index 61205877..00000000 --- a/src/main/java/com/chargebee/v4/core/models/address/params/AddressUpdateParams.java +++ /dev/null @@ -1,187 +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.core.models.address.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class AddressUpdateParams { - - private final Map formData; - - private AddressUpdateParams(AddressUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private AddressUpdateBuilder() {} - - public AddressUpdateBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public AddressUpdateBuilder label(String value) { - - formData.put("label", value); - - return this; - } - - public AddressUpdateBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public AddressUpdateBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public AddressUpdateBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public AddressUpdateBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public AddressUpdateBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public AddressUpdateBuilder addr(String value) { - - formData.put("addr", value); - - return this; - } - - public AddressUpdateBuilder extendedAddr(String value) { - - formData.put("extended_addr", value); - - return this; - } - - public AddressUpdateBuilder extendedAddr2(String value) { - - formData.put("extended_addr2", value); - - return this; - } - - public AddressUpdateBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public AddressUpdateBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public AddressUpdateBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public AddressUpdateBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public AddressUpdateBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public AddressUpdateBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", 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/core/models/attachedItem/params/AttachedItemCreateParams.java b/src/main/java/com/chargebee/v4/core/models/attachedItem/params/AttachedItemCreateParams.java deleted file mode 100644 index 455a28e7..00000000 --- a/src/main/java/com/chargebee/v4/core/models/attachedItem/params/AttachedItemCreateParams.java +++ /dev/null @@ -1,165 +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.core.models.attachedItem.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class AttachedItemCreateParams { - - private final Map formData; - - private AttachedItemCreateParams(AttachedItemCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private AttachedItemCreateBuilder() {} - - public AttachedItemCreateBuilder itemId(String value) { - - formData.put("item_id", value); - - return this; - } - - public AttachedItemCreateBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public AttachedItemCreateBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AttachedItemCreateBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AttachedItemCreateBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AttachedItemCreateBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public AttachedItemCreateBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public AttachedItemCreateBuilder businessEntityId(String value) { - - formData.put("business_entity_id", 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/core/models/attachedItem/params/AttachedItemDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/attachedItem/params/AttachedItemDeleteParams.java deleted file mode 100644 index 04e6ac35..00000000 --- a/src/main/java/com/chargebee/v4/core/models/attachedItem/params/AttachedItemDeleteParams.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.core.models.attachedItem.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class AttachedItemDeleteParams { - - private final Map formData; - - private AttachedItemDeleteParams(AttachedItemDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private AttachedItemDeleteBuilder() {} - - public AttachedItemDeleteBuilder parentItemId(String value) { - - formData.put("parent_item_id", value); - - return this; - } - - public AttachedItemDeleteParams build() { - return new AttachedItemDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/attachedItem/params/AttachedItemUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/attachedItem/params/AttachedItemUpdateParams.java deleted file mode 100644 index 3e947a5c..00000000 --- a/src/main/java/com/chargebee/v4/core/models/attachedItem/params/AttachedItemUpdateParams.java +++ /dev/null @@ -1,158 +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.core.models.attachedItem.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class AttachedItemUpdateParams { - - private final Map formData; - - private AttachedItemUpdateParams(AttachedItemUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AttachedItemUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AttachedItemUpdateBuilder builder() { - return new AttachedItemUpdateBuilder(); - } - - public static final class AttachedItemUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AttachedItemUpdateBuilder() {} - - public AttachedItemUpdateBuilder parentItemId(String value) { - - formData.put("parent_item_id", value); - - return this; - } - - public AttachedItemUpdateBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public AttachedItemUpdateBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AttachedItemUpdateBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AttachedItemUpdateBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AttachedItemUpdateBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public AttachedItemUpdateBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public AttachedItemUpdateParams build() { - return new AttachedItemUpdateParams(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/core/models/businessEntity/params/BusinessEntityCreateTransfersParams.java b/src/main/java/com/chargebee/v4/core/models/businessEntity/params/BusinessEntityCreateTransfersParams.java deleted file mode 100644 index b6a707bc..00000000 --- a/src/main/java/com/chargebee/v4/core/models/businessEntity/params/BusinessEntityCreateTransfersParams.java +++ /dev/null @@ -1,81 +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.core.models.businessEntity.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class BusinessEntityCreateTransfersParams { - - private final Map formData; - - private BusinessEntityCreateTransfersParams(BusinessEntityCreateTransfersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private BusinessEntityCreateTransfersBuilder() {} - - public BusinessEntityCreateTransfersBuilder activeResourceIds(List value) { - - formData.put("active_resource_ids", value); - - return this; - } - - public BusinessEntityCreateTransfersBuilder destinationBusinessEntityIds(List value) { - - formData.put("destination_business_entity_ids", value); - - return this; - } - - @Deprecated - public BusinessEntityCreateTransfersBuilder sourceBusinessEntityIds(List value) { - - formData.put("source_business_entity_ids", value); - - return this; - } - - @Deprecated - public BusinessEntityCreateTransfersBuilder resourceTypes(List value) { - - formData.put("resource_types", value); - - return this; - } - - public BusinessEntityCreateTransfersBuilder reasonCodes(List value) { - - formData.put("reason_codes", value); - - return this; - } - - public BusinessEntityCreateTransfersParams build() { - return new BusinessEntityCreateTransfersParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/businessEntityChange/BusinessEntityChange.java b/src/main/java/com/chargebee/v4/core/models/businessEntityChange/BusinessEntityChange.java deleted file mode 100644 index 1bd107eb..00000000 --- a/src/main/java/com/chargebee/v4/core/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.core.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/core/models/card/params/CardCopyCardForCustomerParams.java b/src/main/java/com/chargebee/v4/core/models/card/params/CardCopyCardForCustomerParams.java deleted file mode 100644 index ea47d8a8..00000000 --- a/src/main/java/com/chargebee/v4/core/models/card/params/CardCopyCardForCustomerParams.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.core.models.card.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CardCopyCardForCustomerParams { - - private final Map formData; - - private CardCopyCardForCustomerParams(CardCopyCardForCustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardCopyCardForCustomerParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardCopyCardForCustomerBuilder builder() { - return new CardCopyCardForCustomerBuilder(); - } - - public static final class CardCopyCardForCustomerBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardCopyCardForCustomerBuilder() {} - - public CardCopyCardForCustomerBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public CardCopyCardForCustomerParams build() { - return new CardCopyCardForCustomerParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/card/params/CardDeleteCardForCustomerParams.java b/src/main/java/com/chargebee/v4/core/models/card/params/CardDeleteCardForCustomerParams.java deleted file mode 100644 index c62879f8..00000000 --- a/src/main/java/com/chargebee/v4/core/models/card/params/CardDeleteCardForCustomerParams.java +++ /dev/null @@ -1,43 +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.core.models.card.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CardDeleteCardForCustomerParams { - - private final Map formData; - - private CardDeleteCardForCustomerParams(CardDeleteCardForCustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardDeleteCardForCustomerParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardDeleteCardForCustomerBuilder builder() { - return new CardDeleteCardForCustomerBuilder(); - } - - public static final class CardDeleteCardForCustomerBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardDeleteCardForCustomerBuilder() {} - - public CardDeleteCardForCustomerParams build() { - return new CardDeleteCardForCustomerParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/card/params/CardUpdateCardForCustomerParams.java b/src/main/java/com/chargebee/v4/core/models/card/params/CardUpdateCardForCustomerParams.java deleted file mode 100644 index 434df683..00000000 --- a/src/main/java/com/chargebee/v4/core/models/card/params/CardUpdateCardForCustomerParams.java +++ /dev/null @@ -1,383 +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.core.models.card.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CardUpdateCardForCustomerParams { - - private final Map formData; - - private CardUpdateCardForCustomerParams(CardUpdateCardForCustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardUpdateCardForCustomerParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardUpdateCardForCustomerBuilder builder() { - return new CardUpdateCardForCustomerBuilder(); - } - - public static final class CardUpdateCardForCustomerBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardUpdateCardForCustomerBuilder() {} - - @Deprecated - public CardUpdateCardForCustomerBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder number(String value) { - - formData.put("number", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder expiryMonth(Integer value) { - - formData.put("expiry_month", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder expiryYear(Integer value) { - - formData.put("expiry_year", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder cvv(String value) { - - formData.put("cvv", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder preferredScheme(PreferredScheme value) { - - formData.put("preferred_scheme", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder billingAddr1(String value) { - - formData.put("billing_addr1", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder billingAddr2(String value) { - - formData.put("billing_addr2", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder billingCity(String value) { - - formData.put("billing_city", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder billingStateCode(String value) { - - formData.put("billing_state_code", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder billingState(String value) { - - formData.put("billing_state", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder billingZip(String value) { - - formData.put("billing_zip", value); - - return this; - } - - public CardUpdateCardForCustomerBuilder billingCountry(String value) { - - formData.put("billing_country", value); - - return this; - } - - @Deprecated - public CardUpdateCardForCustomerBuilder ipAddress(String value) { - - formData.put("ip_address", value); - - return this; - } - - @Deprecated - public CardUpdateCardForCustomerBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CardUpdateCardForCustomerParams build() { - return new CardUpdateCardForCustomerParams(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"), - - /** 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 Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - @Deprecated - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/comment/params/CommentCreateParams.java b/src/main/java/com/chargebee/v4/core/models/comment/params/CommentCreateParams.java deleted file mode 100644 index ebddd9d2..00000000 --- a/src/main/java/com/chargebee/v4/core/models/comment/params/CommentCreateParams.java +++ /dev/null @@ -1,125 +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.core.models.comment.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CommentCreateParams { - - private final Map formData; - - private CommentCreateParams(CommentCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CommentCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CommentCreateBuilder builder() { - return new CommentCreateBuilder(); - } - - public static final class CommentCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CommentCreateBuilder() {} - - public CommentCreateBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public CommentCreateBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public CommentCreateBuilder notes(String value) { - - formData.put("notes", value); - - return this; - } - - public CommentCreateBuilder addedBy(String value) { - - formData.put("added_by", value); - - return this; - } - - public CommentCreateParams build() { - return new CommentCreateParams(this); - } - } - - public enum EntityType { - CUSTOMER("customer"), - - SUBSCRIPTION("subscription"), - - INVOICE("invoice"), - - QUOTE("quote"), - - CREDIT_NOTE("credit_note"), - - TRANSACTION("transaction"), - - PLAN("plan"), - - ADDON("addon"), - - COUPON("coupon"), - - ORDER("order"), - - BUSINESS_ENTITY("business_entity"), - - ITEM_FAMILY("item_family"), - - ITEM("item"), - - ITEM_PRICE("item_price"), - - PRICE_VARIANT("price_variant"), - - /** 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; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/comment/params/CommentDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/comment/params/CommentDeleteParams.java deleted file mode 100644 index b27269df..00000000 --- a/src/main/java/com/chargebee/v4/core/models/comment/params/CommentDeleteParams.java +++ /dev/null @@ -1,43 +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.core.models.comment.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CommentDeleteParams { - - private final Map formData; - - private CommentDeleteParams(CommentDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CommentDeleteBuilder() {} - - public CommentDeleteParams build() { - return new CommentDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponCopyParams.java b/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponCopyParams.java deleted file mode 100644 index 095c48f7..00000000 --- a/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponCopyParams.java +++ /dev/null @@ -1,71 +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.core.models.coupon.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CouponCopyParams { - - private final Map formData; - - private CouponCopyParams(CouponCopyBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponCopyParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponCopyBuilder builder() { - return new CouponCopyBuilder(); - } - - public static final class CouponCopyBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponCopyBuilder() {} - - public CouponCopyBuilder fromSite(String value) { - - formData.put("from_site", value); - - return this; - } - - public CouponCopyBuilder idAtFromSite(String value) { - - formData.put("id_at_from_site", value); - - return this; - } - - public CouponCopyBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CouponCopyBuilder forSiteMerging(Boolean value) { - - formData.put("for_site_merging", value); - - return this; - } - - public CouponCopyParams build() { - return new CouponCopyParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponCreateForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponCreateForItemsParams.java deleted file mode 100644 index 4976e4f7..00000000 --- a/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponCreateForItemsParams.java +++ /dev/null @@ -1,733 +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.core.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 CouponCreateForItemsParams { - - private final Map formData; - - private CouponCreateForItemsParams(CouponCreateForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponCreateForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponCreateForItemsBuilder builder() { - return new CouponCreateForItemsBuilder(); - } - - public static final class CouponCreateForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponCreateForItemsBuilder() {} - - public CouponCreateForItemsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CouponCreateForItemsBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public CouponCreateForItemsBuilder invoiceName(String value) { - - formData.put("invoice_name", value); - - return this; - } - - public CouponCreateForItemsBuilder discountType(DiscountType value) { - - formData.put("discount_type", value); - - return this; - } - - public CouponCreateForItemsBuilder discountAmount(Long value) { - - formData.put("discount_amount", value); - - return this; - } - - public CouponCreateForItemsBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public CouponCreateForItemsBuilder discountPercentage(Number value) { - - formData.put("discount_percentage", value); - - return this; - } - - public CouponCreateForItemsBuilder discountQuantity(Integer value) { - - formData.put("discount_quantity", value); - - return this; - } - - public CouponCreateForItemsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public CouponCreateForItemsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public CouponCreateForItemsBuilder durationMonth(Integer value) { - - formData.put("duration_month", value); - - return this; - } - - public CouponCreateForItemsBuilder validFrom(Timestamp value) { - - formData.put("valid_from", value); - - return this; - } - - public CouponCreateForItemsBuilder validTill(Timestamp value) { - - formData.put("valid_till", value); - - return this; - } - - public CouponCreateForItemsBuilder maxRedemptions(Integer value) { - - formData.put("max_redemptions", value); - - return this; - } - - public CouponCreateForItemsBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public CouponCreateForItemsBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public CouponCreateForItemsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public CouponCreateForItemsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public CouponCreateForItemsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public CouponCreateForItemsBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public CouponCreateForItemsBuilder itemConstraints(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemConstraintsParams item = value.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()); - } - } - } - } - return this; - } - - public CouponCreateForItemsBuilder itemConstraintCriteria( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemConstraintCriteriaParams item = value.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()); - } - } - } - } - return this; - } - - public CouponCreateForItemsBuilder couponConstraints(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponConstraintsParams item = value.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()); - } - } - } - } - 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 CouponCreateForItemsBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 CouponCreateForItemsBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public CouponCreateForItemsParams build() { - return new CouponCreateForItemsParams(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 enum Status { - ACTIVE("active"), - - ARCHIVED("archived"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class ItemConstraintsParams { - - private final Map formData; - - private ItemConstraintsParams(ItemConstraintsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private ItemConstraintsBuilder() {} - - public ItemConstraintsBuilder constraint(Constraint value) { - - formData.put("constraint", value); - - return this; - } - - public ItemConstraintsBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public ItemConstraintsBuilder itemPriceIds(List value) { - - formData.put("item_price_ids", JsonUtil.toJson(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 Map formData; - - private ItemConstraintCriteriaParams(ItemConstraintCriteriaBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private ItemConstraintCriteriaBuilder() {} - - public ItemConstraintCriteriaBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public ItemConstraintCriteriaBuilder itemFamilyIds(List value) { - - formData.put("item_family_ids", JsonUtil.toJson(value)); - - return this; - } - - public ItemConstraintCriteriaBuilder currencies(List value) { - - formData.put("currencies", JsonUtil.toJson(value)); - - return this; - } - - public ItemConstraintCriteriaBuilder itemPricePeriods(List value) { - - formData.put("item_price_periods", JsonUtil.toJson(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 Map formData; - - private CouponConstraintsParams(CouponConstraintsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CouponConstraintsBuilder() {} - - public CouponConstraintsBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public CouponConstraintsBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public CouponConstraintsBuilder value(String value) { - - formData.put("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/core/models/coupon/params/CouponCreateParams.java b/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponCreateParams.java deleted file mode 100644 index fe21b648..00000000 --- a/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponCreateParams.java +++ /dev/null @@ -1,419 +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.core.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 CouponCreateParams { - - private final Map formData; - - private CouponCreateParams(CouponCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponCreateBuilder builder() { - return new CouponCreateBuilder(); - } - - public static final class CouponCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponCreateBuilder() {} - - public CouponCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CouponCreateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public CouponCreateBuilder invoiceName(String value) { - - formData.put("invoice_name", value); - - return this; - } - - public CouponCreateBuilder discountType(DiscountType value) { - - formData.put("discount_type", value); - - return this; - } - - public CouponCreateBuilder discountAmount(Long value) { - - formData.put("discount_amount", value); - - return this; - } - - public CouponCreateBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public CouponCreateBuilder discountPercentage(Number value) { - - formData.put("discount_percentage", value); - - return this; - } - - public CouponCreateBuilder discountQuantity(Integer value) { - - formData.put("discount_quantity", value); - - return this; - } - - public CouponCreateBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public CouponCreateBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public CouponCreateBuilder durationMonth(Integer value) { - - formData.put("duration_month", value); - - return this; - } - - public CouponCreateBuilder validTill(Timestamp value) { - - formData.put("valid_till", value); - - return this; - } - - public CouponCreateBuilder maxRedemptions(Integer value) { - - formData.put("max_redemptions", value); - - return this; - } - - public CouponCreateBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public CouponCreateBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public CouponCreateBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public CouponCreateBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public CouponCreateBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public CouponCreateBuilder planConstraint(PlanConstraint value) { - - formData.put("plan_constraint", value); - - return this; - } - - public CouponCreateBuilder addonConstraint(AddonConstraint value) { - - formData.put("addon_constraint", value); - - return this; - } - - public CouponCreateBuilder planIds(List value) { - - formData.put("plan_ids", value); - - return this; - } - - public CouponCreateBuilder addonIds(List value) { - - formData.put("addon_ids", value); - - return this; - } - - public CouponCreateBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public CouponCreateParams build() { - return new CouponCreateParams(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 enum PlanConstraint { - NONE("none"), - - ALL("all"), - - SPECIFIC("specific"), - - /** An enum member indicating that PlanConstraint was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PlanConstraint(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PlanConstraint fromString(String value) { - if (value == null) return _UNKNOWN; - for (PlanConstraint enumValue : PlanConstraint.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AddonConstraint { - NONE("none"), - - ALL("all"), - - SPECIFIC("specific"), - - /** An enum member indicating that AddonConstraint was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AddonConstraint(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AddonConstraint fromString(String value) { - if (value == null) return _UNKNOWN; - for (AddonConstraint enumValue : AddonConstraint.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Status { - ACTIVE("active"), - - ARCHIVED("archived"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponDeleteParams.java deleted file mode 100644 index 5434b6a8..00000000 --- a/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponDeleteParams.java +++ /dev/null @@ -1,43 +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.core.models.coupon.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CouponDeleteParams { - - private final Map formData; - - private CouponDeleteParams(CouponDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CouponDeleteBuilder() {} - - public CouponDeleteParams build() { - return new CouponDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponUpdateForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponUpdateForItemsParams.java deleted file mode 100644 index c0a5a550..00000000 --- a/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponUpdateForItemsParams.java +++ /dev/null @@ -1,691 +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.core.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 Map formData; - - private CouponUpdateForItemsParams(CouponUpdateForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CouponUpdateForItemsBuilder() {} - - public CouponUpdateForItemsBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public CouponUpdateForItemsBuilder invoiceName(String value) { - - formData.put("invoice_name", value); - - return this; - } - - public CouponUpdateForItemsBuilder discountType(DiscountType value) { - - formData.put("discount_type", value); - - return this; - } - - public CouponUpdateForItemsBuilder discountAmount(Long value) { - - formData.put("discount_amount", value); - - return this; - } - - public CouponUpdateForItemsBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public CouponUpdateForItemsBuilder discountPercentage(Number value) { - - formData.put("discount_percentage", value); - - return this; - } - - public CouponUpdateForItemsBuilder discountQuantity(Integer value) { - - formData.put("discount_quantity", value); - - return this; - } - - public CouponUpdateForItemsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public CouponUpdateForItemsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public CouponUpdateForItemsBuilder durationMonth(Integer value) { - - formData.put("duration_month", value); - - return this; - } - - public CouponUpdateForItemsBuilder validFrom(Timestamp value) { - - formData.put("valid_from", value); - - return this; - } - - public CouponUpdateForItemsBuilder validTill(Timestamp value) { - - formData.put("valid_till", value); - - return this; - } - - public CouponUpdateForItemsBuilder maxRedemptions(Integer value) { - - formData.put("max_redemptions", value); - - return this; - } - - public CouponUpdateForItemsBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public CouponUpdateForItemsBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public CouponUpdateForItemsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public CouponUpdateForItemsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public CouponUpdateForItemsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public CouponUpdateForItemsBuilder itemConstraints(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemConstraintsParams item = value.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()); - } - } - } - } - return this; - } - - public CouponUpdateForItemsBuilder itemConstraintCriteria( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemConstraintCriteriaParams item = value.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()); - } - } - } - } - return this; - } - - public CouponUpdateForItemsBuilder couponConstraints(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponConstraintsParams item = value.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()); - } - } - } - } - 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, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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()); - } - formData.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 Map formData; - - private ItemConstraintsParams(ItemConstraintsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private ItemConstraintsBuilder() {} - - public ItemConstraintsBuilder constraint(Constraint value) { - - formData.put("constraint", value); - - return this; - } - - public ItemConstraintsBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public ItemConstraintsBuilder itemPriceIds(List value) { - - formData.put("item_price_ids", JsonUtil.toJson(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 Map formData; - - private ItemConstraintCriteriaParams(ItemConstraintCriteriaBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private ItemConstraintCriteriaBuilder() {} - - public ItemConstraintCriteriaBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public ItemConstraintCriteriaBuilder itemFamilyIds(List value) { - - formData.put("item_family_ids", JsonUtil.toJson(value)); - - return this; - } - - public ItemConstraintCriteriaBuilder currencies(List value) { - - formData.put("currencies", JsonUtil.toJson(value)); - - return this; - } - - public ItemConstraintCriteriaBuilder itemPricePeriods(List value) { - - formData.put("item_price_periods", JsonUtil.toJson(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 Map formData; - - private CouponConstraintsParams(CouponConstraintsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CouponConstraintsBuilder() {} - - public CouponConstraintsBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public CouponConstraintsBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public CouponConstraintsBuilder value(String value) { - - formData.put("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/core/models/coupon/params/CouponUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponUpdateParams.java deleted file mode 100644 index 3874f98b..00000000 --- a/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponUpdateParams.java +++ /dev/null @@ -1,377 +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.core.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 CouponUpdateParams { - - private final Map formData; - - private CouponUpdateParams(CouponUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponUpdateBuilder builder() { - return new CouponUpdateBuilder(); - } - - public static final class CouponUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponUpdateBuilder() {} - - public CouponUpdateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public CouponUpdateBuilder invoiceName(String value) { - - formData.put("invoice_name", value); - - return this; - } - - public CouponUpdateBuilder discountType(DiscountType value) { - - formData.put("discount_type", value); - - return this; - } - - public CouponUpdateBuilder discountAmount(Long value) { - - formData.put("discount_amount", value); - - return this; - } - - public CouponUpdateBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public CouponUpdateBuilder discountPercentage(Number value) { - - formData.put("discount_percentage", value); - - return this; - } - - public CouponUpdateBuilder discountQuantity(Integer value) { - - formData.put("discount_quantity", value); - - return this; - } - - public CouponUpdateBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public CouponUpdateBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public CouponUpdateBuilder durationMonth(Integer value) { - - formData.put("duration_month", value); - - return this; - } - - public CouponUpdateBuilder validTill(Timestamp value) { - - formData.put("valid_till", value); - - return this; - } - - public CouponUpdateBuilder maxRedemptions(Integer value) { - - formData.put("max_redemptions", value); - - return this; - } - - public CouponUpdateBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public CouponUpdateBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public CouponUpdateBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public CouponUpdateBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public CouponUpdateBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public CouponUpdateBuilder planConstraint(PlanConstraint value) { - - formData.put("plan_constraint", value); - - return this; - } - - public CouponUpdateBuilder addonConstraint(AddonConstraint value) { - - formData.put("addon_constraint", value); - - return this; - } - - public CouponUpdateBuilder planIds(List value) { - - formData.put("plan_ids", value); - - return this; - } - - public CouponUpdateBuilder addonIds(List value) { - - formData.put("addon_ids", value); - - return this; - } - - public CouponUpdateParams build() { - return new CouponUpdateParams(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 enum PlanConstraint { - NONE("none"), - - ALL("all"), - - SPECIFIC("specific"), - - /** An enum member indicating that PlanConstraint was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PlanConstraint(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PlanConstraint fromString(String value) { - if (value == null) return _UNKNOWN; - for (PlanConstraint enumValue : PlanConstraint.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AddonConstraint { - NONE("none"), - - ALL("all"), - - SPECIFIC("specific"), - - /** An enum member indicating that AddonConstraint was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AddonConstraint(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AddonConstraint fromString(String value) { - if (value == null) return _UNKNOWN; - for (AddonConstraint enumValue : AddonConstraint.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/couponCode/params/CouponCodeCreateParams.java b/src/main/java/com/chargebee/v4/core/models/couponCode/params/CouponCodeCreateParams.java deleted file mode 100644 index f82c52cd..00000000 --- a/src/main/java/com/chargebee/v4/core/models/couponCode/params/CouponCodeCreateParams.java +++ /dev/null @@ -1,64 +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.core.models.couponCode.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CouponCodeCreateParams { - - private final Map formData; - - private CouponCodeCreateParams(CouponCodeCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponCodeCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponCodeCreateBuilder builder() { - return new CouponCodeCreateBuilder(); - } - - public static final class CouponCodeCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponCodeCreateBuilder() {} - - public CouponCodeCreateBuilder couponId(String value) { - - formData.put("coupon_id", value); - - return this; - } - - public CouponCodeCreateBuilder couponSetName(String value) { - - formData.put("coupon_set_name", value); - - return this; - } - - public CouponCodeCreateBuilder code(String value) { - - formData.put("code", value); - - return this; - } - - public CouponCodeCreateParams build() { - return new CouponCodeCreateParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetCreateParams.java b/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetCreateParams.java deleted file mode 100644 index 3f9300e5..00000000 --- a/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetCreateParams.java +++ /dev/null @@ -1,72 +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.core.models.couponSet.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; - -public final class CouponSetCreateParams { - - private final Map formData; - - private CouponSetCreateParams(CouponSetCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponSetCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponSetCreateBuilder builder() { - return new CouponSetCreateBuilder(); - } - - public static final class CouponSetCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponSetCreateBuilder() {} - - public CouponSetCreateBuilder couponId(String value) { - - formData.put("coupon_id", value); - - return this; - } - - public CouponSetCreateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public CouponSetCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CouponSetCreateBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public CouponSetCreateParams build() { - return new CouponSetCreateParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetUpdateParams.java deleted file mode 100644 index ec821a82..00000000 --- a/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetUpdateParams.java +++ /dev/null @@ -1,58 +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.core.models.couponSet.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; - -public final class CouponSetUpdateParams { - - private final Map formData; - - private CouponSetUpdateParams(CouponSetUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponSetUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponSetUpdateBuilder builder() { - return new CouponSetUpdateBuilder(); - } - - public static final class CouponSetUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponSetUpdateBuilder() {} - - public CouponSetUpdateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public CouponSetUpdateBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public CouponSetUpdateParams build() { - return new CouponSetUpdateParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteCreateParams.java b/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteCreateParams.java deleted file mode 100644 index e8f16d55..00000000 --- a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteCreateParams.java +++ /dev/null @@ -1,376 +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.core.models.creditNote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class CreditNoteCreateParams { - - private final Map formData; - - private CreditNoteCreateParams(CreditNoteCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditNoteCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNoteCreateBuilder builder() { - return new CreditNoteCreateBuilder(); - } - - public static final class CreditNoteCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditNoteCreateBuilder() {} - - public CreditNoteCreateBuilder referenceInvoiceId(String value) { - - formData.put("reference_invoice_id", value); - - return this; - } - - public CreditNoteCreateBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public CreditNoteCreateBuilder total(Long value) { - - formData.put("total", value); - - return this; - } - - public CreditNoteCreateBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public CreditNoteCreateBuilder reasonCode(ReasonCode value) { - - formData.put("reason_code", value); - - return this; - } - - public CreditNoteCreateBuilder createReasonCode(String value) { - - formData.put("create_reason_code", value); - - return this; - } - - public CreditNoteCreateBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public CreditNoteCreateBuilder customerNotes(String value) { - - formData.put("customer_notes", value); - - return this; - } - - public CreditNoteCreateBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public CreditNoteCreateBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public CreditNoteCreateBuilder lineItems(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - LineItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "line_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 CreditNoteCreateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 CreditNoteCreateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public CreditNoteCreateParams build() { - return new CreditNoteCreateParams(this); - } - } - - public enum Type { - ADJUSTMENT("adjustment"), - - REFUNDABLE("refundable"), - - STORE("store"), - - /** 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 ReasonCode { - PRODUCT_UNSATISFACTORY("product_unsatisfactory"), - - SERVICE_UNSATISFACTORY("service_unsatisfactory"), - - ORDER_CHANGE("order_change"), - - ORDER_CANCELLATION("order_cancellation"), - - WAIVER("waiver"), - - OTHER("other"), - - /** An enum member indicating that ReasonCode was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ReasonCode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ReasonCode fromString(String value) { - if (value == null) return _UNKNOWN; - for (ReasonCode enumValue : ReasonCode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class LineItemsParams { - - private final Map formData; - - private LineItemsParams(LineItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for LineItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static LineItemsBuilder builder() { - return new LineItemsBuilder(); - } - - public static final class LineItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private LineItemsBuilder() {} - - public LineItemsBuilder referenceLineItemId(String value) { - - formData.put("reference_line_item_id", value); - - return this; - } - - public LineItemsBuilder unitAmount(Long value) { - - formData.put("unit_amount", value); - - return this; - } - - public LineItemsBuilder unitAmountInDecimal(String value) { - - formData.put("unit_amount_in_decimal", value); - - return this; - } - - public LineItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public LineItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public LineItemsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public LineItemsBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public LineItemsBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public LineItemsBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public LineItemsBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public LineItemsBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public LineItemsParams build() { - return new LineItemsParams(this); - } - } - - public enum EntityType { - ADHOC("adhoc"), - - PLAN_ITEM_PRICE("plan_item_price"), - - ADDON_ITEM_PRICE("addon_item_price"), - - CHARGE_ITEM_PRICE("charge_item_price"), - - PLAN("plan"), - - ADDON("addon"), - - /** 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteCreditNotesForCustomerParams.java b/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteCreditNotesForCustomerParams.java deleted file mode 100644 index 7bb78e7a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteCreditNotesForCustomerParams.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.core.models.creditNote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CreditNoteCreditNotesForCustomerParams { - - private final Map queryParams; - - private CreditNoteCreditNotesForCustomerParams(CreditNoteCreditNotesForCustomerBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public CreditNoteCreditNotesForCustomerBuilder toBuilder() { - CreditNoteCreditNotesForCustomerBuilder builder = new CreditNoteCreditNotesForCustomerBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for CreditNoteCreditNotesForCustomerParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNoteCreditNotesForCustomerBuilder builder() { - return new CreditNoteCreditNotesForCustomerBuilder(); - } - - public static final class CreditNoteCreditNotesForCustomerBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private CreditNoteCreditNotesForCustomerBuilder() {} - - public CreditNoteCreditNotesForCustomerBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public CreditNoteCreditNotesForCustomerBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public CreditNoteCreditNotesForCustomerParams build() { - return new CreditNoteCreditNotesForCustomerParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteDeleteParams.java deleted file mode 100644 index 165c0b06..00000000 --- a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteDeleteParams.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.core.models.creditNote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CreditNoteDeleteParams { - - private final Map formData; - - private CreditNoteDeleteParams(CreditNoteDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditNoteDeleteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNoteDeleteBuilder builder() { - return new CreditNoteDeleteBuilder(); - } - - public static final class CreditNoteDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditNoteDeleteBuilder() {} - - public CreditNoteDeleteBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public CreditNoteDeleteParams build() { - return new CreditNoteDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteImportCreditNoteParams.java b/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteImportCreditNoteParams.java deleted file mode 100644 index 6d7b613c..00000000 --- a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteImportCreditNoteParams.java +++ /dev/null @@ -1,1143 +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.core.models.creditNote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class CreditNoteImportCreditNoteParams { - - private final Map formData; - - private CreditNoteImportCreditNoteParams(CreditNoteImportCreditNoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditNoteImportCreditNoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNoteImportCreditNoteBuilder builder() { - return new CreditNoteImportCreditNoteBuilder(); - } - - public static final class CreditNoteImportCreditNoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditNoteImportCreditNoteBuilder() {} - - public CreditNoteImportCreditNoteBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder referenceInvoiceId(String value) { - - formData.put("reference_invoice_id", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder createReasonCode(String value) { - - formData.put("create_reason_code", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder total(Long value) { - - formData.put("total", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder refundedAt(Timestamp value) { - - formData.put("refunded_at", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder voidedAt(Timestamp value) { - - formData.put("voided_at", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder subTotal(Long value) { - - formData.put("sub_total", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder roundOffAmount(Long value) { - - formData.put("round_off_amount", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder fractionalCorrection(Long value) { - - formData.put("fractional_correction", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CreditNoteImportCreditNoteBuilder lineItems(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - LineItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "line_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public CreditNoteImportCreditNoteBuilder lineItemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - LineItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "line_item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public CreditNoteImportCreditNoteBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public CreditNoteImportCreditNoteBuilder taxes(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "taxes[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public CreditNoteImportCreditNoteBuilder allocations(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AllocationsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "allocations[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public CreditNoteImportCreditNoteBuilder linkedRefunds(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - LinkedRefundsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "linked_refunds[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 CreditNoteImportCreditNoteBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 CreditNoteImportCreditNoteBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public CreditNoteImportCreditNoteParams build() { - return new CreditNoteImportCreditNoteParams(this); - } - } - - public enum Type { - ADJUSTMENT("adjustment"), - - REFUNDABLE("refundable"), - - STORE("store"), - - /** 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 Status { - ADJUSTED("adjusted"), - - REFUNDED("refunded"), - - REFUND_DUE("refund_due"), - - VOIDED("voided"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class LineItemsParams { - - private final Map formData; - - private LineItemsParams(LineItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for LineItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static LineItemsBuilder builder() { - return new LineItemsBuilder(); - } - - public static final class LineItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private LineItemsBuilder() {} - - public LineItemsBuilder referenceLineItemId(String value) { - - formData.put("reference_line_item_id", value); - - return this; - } - - public LineItemsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public LineItemsBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public LineItemsBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public LineItemsBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public LineItemsBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public LineItemsBuilder unitAmount(Long value) { - - formData.put("unit_amount", value); - - return this; - } - - public LineItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public LineItemsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public LineItemsBuilder unitAmountInDecimal(String value) { - - formData.put("unit_amount_in_decimal", value); - - return this; - } - - public LineItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public LineItemsBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public LineItemsBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public LineItemsBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public LineItemsBuilder itemLevelDiscount1EntityId(String value) { - - formData.put("item_level_discount1_entity_id", value); - - return this; - } - - public LineItemsBuilder itemLevelDiscount1Amount(Long value) { - - formData.put("item_level_discount1_amount", value); - - return this; - } - - public LineItemsBuilder itemLevelDiscount2EntityId(String value) { - - formData.put("item_level_discount2_entity_id", value); - - return this; - } - - public LineItemsBuilder itemLevelDiscount2Amount(Long value) { - - formData.put("item_level_discount2_amount", value); - - return this; - } - - public LineItemsBuilder tax1Name(String value) { - - formData.put("tax1_name", value); - - return this; - } - - public LineItemsBuilder tax1Amount(Long value) { - - formData.put("tax1_amount", value); - - return this; - } - - public LineItemsBuilder tax2Name(String value) { - - formData.put("tax2_name", value); - - return this; - } - - public LineItemsBuilder tax2Amount(Long value) { - - formData.put("tax2_amount", value); - - return this; - } - - public LineItemsBuilder tax3Name(String value) { - - formData.put("tax3_name", value); - - return this; - } - - public LineItemsBuilder tax3Amount(Long value) { - - formData.put("tax3_amount", value); - - return this; - } - - public LineItemsBuilder tax4Name(String value) { - - formData.put("tax4_name", value); - - return this; - } - - public LineItemsBuilder tax4Amount(Long value) { - - formData.put("tax4_amount", value); - - return this; - } - - public LineItemsBuilder tax5Name(String value) { - - formData.put("tax5_name", value); - - return this; - } - - public LineItemsBuilder tax5Amount(Long value) { - - formData.put("tax5_amount", value); - - return this; - } - - public LineItemsBuilder tax6Name(String value) { - - formData.put("tax6_name", value); - - return this; - } - - public LineItemsBuilder tax6Amount(Long value) { - - formData.put("tax6_amount", value); - - return this; - } - - public LineItemsBuilder tax7Name(String value) { - - formData.put("tax7_name", value); - - return this; - } - - public LineItemsBuilder tax7Amount(Long value) { - - formData.put("tax7_amount", value); - - return this; - } - - public LineItemsBuilder tax8Name(String value) { - - formData.put("tax8_name", value); - - return this; - } - - public LineItemsBuilder tax8Amount(Long value) { - - formData.put("tax8_amount", value); - - return this; - } - - public LineItemsBuilder tax9Name(String value) { - - formData.put("tax9_name", value); - - return this; - } - - public LineItemsBuilder tax9Amount(Long value) { - - formData.put("tax9_amount", value); - - return this; - } - - public LineItemsBuilder tax10Name(String value) { - - formData.put("tax10_name", value); - - return this; - } - - public LineItemsBuilder tax10Amount(Long value) { - - formData.put("tax10_amount", value); - - return this; - } - - public LineItemsParams build() { - return new LineItemsParams(this); - } - } - - public enum EntityType { - ADHOC("adhoc"), - - PLAN_ITEM_PRICE("plan_item_price"), - - ADDON_ITEM_PRICE("addon_item_price"), - - CHARGE_ITEM_PRICE("charge_item_price"), - - PLAN_SETUP("plan_setup"), - - PLAN("plan"), - - ADDON("addon"), - - /** 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 static final class LineItemTiersParams { - - private final Map formData; - - private LineItemTiersParams(LineItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for LineItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static LineItemTiersBuilder builder() { - return new LineItemTiersBuilder(); - } - - public static final class LineItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private LineItemTiersBuilder() {} - - public LineItemTiersBuilder lineItemId(String value) { - - formData.put("line_item_id", value); - - return this; - } - - public LineItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public LineItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public LineItemTiersBuilder quantityUsed(Integer value) { - - formData.put("quantity_used", value); - - return this; - } - - public LineItemTiersBuilder unitAmount(Long value) { - - formData.put("unit_amount", value); - - return this; - } - - public LineItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public LineItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public LineItemTiersBuilder quantityUsedInDecimal(String value) { - - formData.put("quantity_used_in_decimal", value); - - return this; - } - - public LineItemTiersBuilder unitAmountInDecimal(String value) { - - formData.put("unit_amount_in_decimal", value); - - return this; - } - - public LineItemTiersParams build() { - return new LineItemTiersParams(this); - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public DiscountsBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public DiscountsBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum EntityType { - ITEM_LEVEL_COUPON("item_level_coupon"), - - DOCUMENT_LEVEL_COUPON("document_level_coupon"), - - PROMOTIONAL_CREDITS("promotional_credits"), - - ITEM_LEVEL_DISCOUNT("item_level_discount"), - - DOCUMENT_LEVEL_DISCOUNT("document_level_discount"), - - /** 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 static final class TaxesParams { - - private final Map formData; - - private TaxesParams(TaxesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxesBuilder builder() { - return new TaxesBuilder(); - } - - public static final class TaxesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxesBuilder() {} - - public TaxesBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public TaxesBuilder rate(Number value) { - - formData.put("rate", value); - - return this; - } - - public TaxesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public TaxesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public TaxesBuilder jurisType(JurisType value) { - - formData.put("juris_type", value); - - return this; - } - - public TaxesBuilder jurisName(String value) { - - formData.put("juris_name", value); - - return this; - } - - public TaxesBuilder jurisCode(String value) { - - formData.put("juris_code", value); - - return this; - } - - public TaxesParams build() { - return new TaxesParams(this); - } - } - - public enum JurisType { - COUNTRY("country"), - - FEDERAL("federal"), - - STATE("state"), - - COUNTY("county"), - - CITY("city"), - - SPECIAL("special"), - - UNINCORPORATED("unincorporated"), - - OTHER("other"), - - /** An enum member indicating that JurisType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - JurisType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static JurisType fromString(String value) { - if (value == null) return _UNKNOWN; - for (JurisType enumValue : JurisType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AllocationsParams { - - private final Map formData; - - private AllocationsParams(AllocationsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AllocationsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AllocationsBuilder builder() { - return new AllocationsBuilder(); - } - - public static final class AllocationsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AllocationsBuilder() {} - - public AllocationsBuilder invoiceId(String value) { - - formData.put("invoice_id", value); - - return this; - } - - public AllocationsBuilder allocatedAmount(Long value) { - - formData.put("allocated_amount", value); - - return this; - } - - public AllocationsBuilder allocatedAt(Timestamp value) { - - formData.put("allocated_at", value); - - return this; - } - - public AllocationsParams build() { - return new AllocationsParams(this); - } - } - } - - public static final class LinkedRefundsParams { - - private final Map formData; - - private LinkedRefundsParams(LinkedRefundsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for LinkedRefundsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static LinkedRefundsBuilder builder() { - return new LinkedRefundsBuilder(); - } - - public static final class LinkedRefundsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private LinkedRefundsBuilder() {} - - public LinkedRefundsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public LinkedRefundsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public LinkedRefundsBuilder paymentMethod(PaymentMethod value) { - - formData.put("payment_method", value); - - return this; - } - - public LinkedRefundsBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public LinkedRefundsBuilder referenceNumber(String value) { - - formData.put("reference_number", value); - - return this; - } - - public LinkedRefundsParams build() { - return new LinkedRefundsParams(this); - } - } - - public enum PaymentMethod { - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - OTHER("other"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - CUSTOM("custom"), - - /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethod enumValue : PaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteRecordRefundParams.java b/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteRecordRefundParams.java deleted file mode 100644 index de14d34b..00000000 --- a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteRecordRefundParams.java +++ /dev/null @@ -1,181 +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.core.models.creditNote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class CreditNoteRecordRefundParams { - - private final Map formData; - - private CreditNoteRecordRefundParams(CreditNoteRecordRefundBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditNoteRecordRefundParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNoteRecordRefundBuilder builder() { - return new CreditNoteRecordRefundBuilder(); - } - - public static final class CreditNoteRecordRefundBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditNoteRecordRefundBuilder() {} - - public CreditNoteRecordRefundBuilder refundReasonCode(String value) { - - formData.put("refund_reason_code", value); - - return this; - } - - public CreditNoteRecordRefundBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public CreditNoteRecordRefundBuilder transaction(TransactionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "transaction[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteRecordRefundParams build() { - return new CreditNoteRecordRefundParams(this); - } - } - - public static final class TransactionParams { - - private final Map formData; - - private TransactionParams(TransactionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionBuilder builder() { - return new TransactionBuilder(); - } - - public static final class TransactionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionBuilder() {} - - public TransactionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public TransactionBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public TransactionBuilder paymentMethod(PaymentMethod value) { - - formData.put("payment_method", value); - - return this; - } - - public TransactionBuilder referenceNumber(String value) { - - formData.put("reference_number", value); - - return this; - } - - public TransactionBuilder customPaymentMethodId(String value) { - - formData.put("custom_payment_method_id", value); - - return this; - } - - public TransactionBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public TransactionParams build() { - return new TransactionParams(this); - } - } - - public enum PaymentMethod { - CASH("cash"), - - CHECK("check"), - - CHARGEBACK("chargeback"), - - BANK_TRANSFER("bank_transfer"), - - OTHER("other"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - CUSTOM("custom"), - - /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethod enumValue : PaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteRefundParams.java b/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteRefundParams.java deleted file mode 100644 index ca1725bf..00000000 --- a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteRefundParams.java +++ /dev/null @@ -1,64 +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.core.models.creditNote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CreditNoteRefundParams { - - private final Map formData; - - private CreditNoteRefundParams(CreditNoteRefundBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditNoteRefundParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNoteRefundBuilder builder() { - return new CreditNoteRefundBuilder(); - } - - public static final class CreditNoteRefundBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditNoteRefundBuilder() {} - - public CreditNoteRefundBuilder refundAmount(Long value) { - - formData.put("refund_amount", value); - - return this; - } - - public CreditNoteRefundBuilder customerNotes(String value) { - - formData.put("customer_notes", value); - - return this; - } - - public CreditNoteRefundBuilder refundReasonCode(String value) { - - formData.put("refund_reason_code", value); - - return this; - } - - public CreditNoteRefundParams build() { - return new CreditNoteRefundParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteRemoveTaxWithheldRefundParams.java b/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteRemoveTaxWithheldRefundParams.java deleted file mode 100644 index c0df981a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteRemoveTaxWithheldRefundParams.java +++ /dev/null @@ -1,92 +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.core.models.creditNote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CreditNoteRemoveTaxWithheldRefundParams { - - private final Map formData; - - private CreditNoteRemoveTaxWithheldRefundParams( - CreditNoteRemoveTaxWithheldRefundBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditNoteRemoveTaxWithheldRefundParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNoteRemoveTaxWithheldRefundBuilder builder() { - return new CreditNoteRemoveTaxWithheldRefundBuilder(); - } - - public static final class CreditNoteRemoveTaxWithheldRefundBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditNoteRemoveTaxWithheldRefundBuilder() {} - - public CreditNoteRemoveTaxWithheldRefundBuilder taxWithheld(TaxWithheldParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "tax_withheld[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteRemoveTaxWithheldRefundParams build() { - return new CreditNoteRemoveTaxWithheldRefundParams(this); - } - } - - public static final class TaxWithheldParams { - - private final Map formData; - - private TaxWithheldParams(TaxWithheldBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxWithheldParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxWithheldBuilder builder() { - return new TaxWithheldBuilder(); - } - - public static final class TaxWithheldBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxWithheldBuilder() {} - - public TaxWithheldBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public TaxWithheldParams build() { - return new TaxWithheldParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteVoidCreditNoteParams.java b/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteVoidCreditNoteParams.java deleted file mode 100644 index 94fd8a31..00000000 --- a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteVoidCreditNoteParams.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.core.models.creditNote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CreditNoteVoidCreditNoteParams { - - private final Map formData; - - private CreditNoteVoidCreditNoteParams(CreditNoteVoidCreditNoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditNoteVoidCreditNoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNoteVoidCreditNoteBuilder builder() { - return new CreditNoteVoidCreditNoteBuilder(); - } - - public static final class CreditNoteVoidCreditNoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditNoteVoidCreditNoteBuilder() {} - - public CreditNoteVoidCreditNoteBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public CreditNoteVoidCreditNoteParams build() { - return new CreditNoteVoidCreditNoteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/csvTaxRule/params/CsvTaxRuleCreateParams.java b/src/main/java/com/chargebee/v4/core/models/csvTaxRule/params/CsvTaxRuleCreateParams.java deleted file mode 100644 index a7bce50b..00000000 --- a/src/main/java/com/chargebee/v4/core/models/csvTaxRule/params/CsvTaxRuleCreateParams.java +++ /dev/null @@ -1,451 +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.core.models.csvTaxRule.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class CsvTaxRuleCreateParams { - - private final Map formData; - - private CsvTaxRuleCreateParams(CsvTaxRuleCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CsvTaxRuleCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CsvTaxRuleCreateBuilder builder() { - return new CsvTaxRuleCreateBuilder(); - } - - public static final class CsvTaxRuleCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CsvTaxRuleCreateBuilder() {} - - public CsvTaxRuleCreateBuilder taxProfileName(String value) { - - formData.put("tax_profile_name", value); - - return this; - } - - public CsvTaxRuleCreateBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public CsvTaxRuleCreateBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public CsvTaxRuleCreateBuilder zipCode(String value) { - - formData.put("zip_code", value); - - return this; - } - - public CsvTaxRuleCreateBuilder zipCodeStart(Integer value) { - - formData.put("zip_code_start", value); - - return this; - } - - public CsvTaxRuleCreateBuilder zipCodeEnd(Integer value) { - - formData.put("zip_code_end", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax1Name(String value) { - - formData.put("tax1_name", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax1Rate(Number value) { - - formData.put("tax1_rate", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax1JurisType(Tax1JurisType value) { - - formData.put("tax1_juris_type", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax1JurisName(String value) { - - formData.put("tax1_juris_name", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax1JurisCode(String value) { - - formData.put("tax1_juris_code", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax2Name(String value) { - - formData.put("tax2_name", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax2Rate(Number value) { - - formData.put("tax2_rate", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax2JurisType(Tax2JurisType value) { - - formData.put("tax2_juris_type", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax2JurisName(String value) { - - formData.put("tax2_juris_name", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax2JurisCode(String value) { - - formData.put("tax2_juris_code", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax3Name(String value) { - - formData.put("tax3_name", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax3Rate(Number value) { - - formData.put("tax3_rate", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax3JurisType(Tax3JurisType value) { - - formData.put("tax3_juris_type", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax3JurisName(String value) { - - formData.put("tax3_juris_name", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax3JurisCode(String value) { - - formData.put("tax3_juris_code", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax4Name(String value) { - - formData.put("tax4_name", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax4Rate(Number value) { - - formData.put("tax4_rate", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax4JurisType(Tax4JurisType value) { - - formData.put("tax4_juris_type", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax4JurisName(String value) { - - formData.put("tax4_juris_name", value); - - return this; - } - - public CsvTaxRuleCreateBuilder tax4JurisCode(String value) { - - formData.put("tax4_juris_code", value); - - return this; - } - - public CsvTaxRuleCreateBuilder serviceType(ServiceType value) { - - formData.put("service_type", value); - - return this; - } - - public CsvTaxRuleCreateBuilder timeZone(String value) { - - formData.put("time_zone", value); - - return this; - } - - public CsvTaxRuleCreateBuilder validFrom(Timestamp value) { - - formData.put("valid_from", value); - - return this; - } - - public CsvTaxRuleCreateBuilder validTill(Timestamp value) { - - formData.put("valid_till", value); - - return this; - } - - public CsvTaxRuleCreateBuilder overwrite(Boolean value) { - - formData.put("overwrite", value); - - return this; - } - - public CsvTaxRuleCreateParams build() { - return new CsvTaxRuleCreateParams(this); - } - } - - public enum Tax1JurisType { - COUNTRY("country"), - - FEDERAL("federal"), - - STATE("state"), - - COUNTY("county"), - - CITY("city"), - - SPECIAL("special"), - - UNINCORPORATED("unincorporated"), - - OTHER("other"), - - /** An enum member indicating that Tax1JurisType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Tax1JurisType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Tax1JurisType fromString(String value) { - if (value == null) return _UNKNOWN; - for (Tax1JurisType enumValue : Tax1JurisType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Tax2JurisType { - COUNTRY("country"), - - FEDERAL("federal"), - - STATE("state"), - - COUNTY("county"), - - CITY("city"), - - SPECIAL("special"), - - UNINCORPORATED("unincorporated"), - - OTHER("other"), - - /** An enum member indicating that Tax2JurisType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Tax2JurisType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Tax2JurisType fromString(String value) { - if (value == null) return _UNKNOWN; - for (Tax2JurisType enumValue : Tax2JurisType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Tax3JurisType { - COUNTRY("country"), - - FEDERAL("federal"), - - STATE("state"), - - COUNTY("county"), - - CITY("city"), - - SPECIAL("special"), - - UNINCORPORATED("unincorporated"), - - OTHER("other"), - - /** An enum member indicating that Tax3JurisType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Tax3JurisType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Tax3JurisType fromString(String value) { - if (value == null) return _UNKNOWN; - for (Tax3JurisType enumValue : Tax3JurisType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Tax4JurisType { - COUNTRY("country"), - - FEDERAL("federal"), - - STATE("state"), - - COUNTY("county"), - - CITY("city"), - - SPECIAL("special"), - - UNINCORPORATED("unincorporated"), - - OTHER("other"), - - /** An enum member indicating that Tax4JurisType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Tax4JurisType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Tax4JurisType fromString(String value) { - if (value == null) return _UNKNOWN; - for (Tax4JurisType enumValue : Tax4JurisType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ServiceType { - DIGITAL("digital"), - - OTHER("other"), - - NOT_APPLICABLE("not_applicable"), - - /** An enum member indicating that ServiceType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ServiceType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ServiceType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ServiceType enumValue : ServiceType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyAddScheduleParams.java b/src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyAddScheduleParams.java deleted file mode 100644 index 44e9d325..00000000 --- a/src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyAddScheduleParams.java +++ /dev/null @@ -1,58 +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.core.models.currency.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class CurrencyAddScheduleParams { - - private final Map formData; - - private CurrencyAddScheduleParams(CurrencyAddScheduleBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CurrencyAddScheduleParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CurrencyAddScheduleBuilder builder() { - return new CurrencyAddScheduleBuilder(); - } - - public static final class CurrencyAddScheduleBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CurrencyAddScheduleBuilder() {} - - public CurrencyAddScheduleBuilder manualExchangeRate(String value) { - - formData.put("manual_exchange_rate", value); - - return this; - } - - public CurrencyAddScheduleBuilder scheduleAt(Timestamp value) { - - formData.put("schedule_at", value); - - return this; - } - - public CurrencyAddScheduleParams build() { - return new CurrencyAddScheduleParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyCreateParams.java b/src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyCreateParams.java deleted file mode 100644 index 4257f141..00000000 --- a/src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyCreateParams.java +++ /dev/null @@ -1,92 +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.core.models.currency.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CurrencyCreateParams { - - private final Map formData; - - private CurrencyCreateParams(CurrencyCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CurrencyCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CurrencyCreateBuilder builder() { - return new CurrencyCreateBuilder(); - } - - public static final class CurrencyCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CurrencyCreateBuilder() {} - - public CurrencyCreateBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public CurrencyCreateBuilder forexType(ForexType value) { - - formData.put("forex_type", value); - - return this; - } - - public CurrencyCreateBuilder manualExchangeRate(String value) { - - formData.put("manual_exchange_rate", value); - - return this; - } - - public CurrencyCreateParams build() { - return new CurrencyCreateParams(this); - } - } - - public enum ForexType { - MANUAL("manual"), - - AUTO("auto"), - - /** An enum member indicating that ForexType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ForexType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ForexType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ForexType enumValue : ForexType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyUpdateParams.java deleted file mode 100644 index 498a313e..00000000 --- a/src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyUpdateParams.java +++ /dev/null @@ -1,85 +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.core.models.currency.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CurrencyUpdateParams { - - private final Map formData; - - private CurrencyUpdateParams(CurrencyUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CurrencyUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CurrencyUpdateBuilder builder() { - return new CurrencyUpdateBuilder(); - } - - public static final class CurrencyUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CurrencyUpdateBuilder() {} - - public CurrencyUpdateBuilder forexType(ForexType value) { - - formData.put("forex_type", value); - - return this; - } - - public CurrencyUpdateBuilder manualExchangeRate(String value) { - - formData.put("manual_exchange_rate", value); - - return this; - } - - public CurrencyUpdateParams build() { - return new CurrencyUpdateParams(this); - } - } - - public enum ForexType { - MANUAL("manual"), - - AUTO("auto"), - - /** An enum member indicating that ForexType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ForexType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ForexType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ForexType enumValue : ForexType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerAddContactParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerAddContactParams.java deleted file mode 100644 index a03d5d5f..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerAddContactParams.java +++ /dev/null @@ -1,147 +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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CustomerAddContactParams { - - private final Map formData; - - private CustomerAddContactParams(CustomerAddContactBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerAddContactParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerAddContactBuilder builder() { - return new CustomerAddContactBuilder(); - } - - public static final class CustomerAddContactBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerAddContactBuilder() {} - - public CustomerAddContactBuilder contact(ContactParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contact[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerAddContactParams build() { - return new CustomerAddContactParams(this); - } - } - - public static final class ContactParams { - - private final Map formData; - - private ContactParams(ContactBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContactParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContactBuilder builder() { - return new ContactBuilder(); - } - - public static final class ContactBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContactBuilder() {} - - public ContactBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ContactBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ContactBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ContactBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ContactBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ContactBuilder label(String value) { - - formData.put("label", value); - - return this; - } - - public ContactBuilder enabled(Boolean value) { - - formData.put("enabled", value); - - return this; - } - - public ContactBuilder sendBillingEmail(Boolean value) { - - formData.put("send_billing_email", value); - - return this; - } - - public ContactBuilder sendAccountEmail(Boolean value) { - - formData.put("send_account_email", value); - - return this; - } - - public ContactParams build() { - return new ContactParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerAddPromotionalCreditsParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerAddPromotionalCreditsParams.java deleted file mode 100644 index c6df73f3..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerAddPromotionalCreditsParams.java +++ /dev/null @@ -1,108 +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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CustomerAddPromotionalCreditsParams { - - private final Map formData; - - private CustomerAddPromotionalCreditsParams(CustomerAddPromotionalCreditsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerAddPromotionalCreditsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerAddPromotionalCreditsBuilder builder() { - return new CustomerAddPromotionalCreditsBuilder(); - } - - public static final class CustomerAddPromotionalCreditsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerAddPromotionalCreditsBuilder() {} - - public CustomerAddPromotionalCreditsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public CustomerAddPromotionalCreditsBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public CustomerAddPromotionalCreditsBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public CustomerAddPromotionalCreditsBuilder creditType(CreditType value) { - - formData.put("credit_type", value); - - return this; - } - - public CustomerAddPromotionalCreditsBuilder reference(String value) { - - formData.put("reference", value); - - return this; - } - - public CustomerAddPromotionalCreditsParams build() { - return new CustomerAddPromotionalCreditsParams(this); - } - } - - public enum CreditType { - LOYALTY_CREDITS("loyalty_credits"), - - REFERRAL_REWARDS("referral_rewards"), - - GENERAL("general"), - - /** An enum member indicating that CreditType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CreditType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CreditType fromString(String value) { - if (value == null) return _UNKNOWN; - for (CreditType enumValue : CreditType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerAssignPaymentRoleParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerAssignPaymentRoleParams.java deleted file mode 100644 index 5e68995f..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerAssignPaymentRoleParams.java +++ /dev/null @@ -1,87 +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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CustomerAssignPaymentRoleParams { - - private final Map formData; - - private CustomerAssignPaymentRoleParams(CustomerAssignPaymentRoleBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerAssignPaymentRoleParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerAssignPaymentRoleBuilder builder() { - return new CustomerAssignPaymentRoleBuilder(); - } - - public static final class CustomerAssignPaymentRoleBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerAssignPaymentRoleBuilder() {} - - public CustomerAssignPaymentRoleBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public CustomerAssignPaymentRoleBuilder role(Role value) { - - formData.put("role", value); - - return this; - } - - public CustomerAssignPaymentRoleParams build() { - return new CustomerAssignPaymentRoleParams(this); - } - } - - public enum Role { - PRIMARY("primary"), - - BACKUP("backup"), - - NONE("none"), - - /** An enum member indicating that Role was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Role(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Role fromString(String value) { - if (value == null) return _UNKNOWN; - for (Role enumValue : Role.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerChangeBillingDateParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerChangeBillingDateParams.java deleted file mode 100644 index 44bbc07c..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerChangeBillingDateParams.java +++ /dev/null @@ -1,174 +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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CustomerChangeBillingDateParams { - - private final Map formData; - - private CustomerChangeBillingDateParams(CustomerChangeBillingDateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerChangeBillingDateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerChangeBillingDateBuilder builder() { - return new CustomerChangeBillingDateBuilder(); - } - - public static final class CustomerChangeBillingDateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerChangeBillingDateBuilder() {} - - public CustomerChangeBillingDateBuilder billingDate(Integer value) { - - formData.put("billing_date", value); - - return this; - } - - public CustomerChangeBillingDateBuilder billingMonth(Integer value) { - - formData.put("billing_month", value); - - return this; - } - - public CustomerChangeBillingDateBuilder billingDateMode(BillingDateMode value) { - - formData.put("billing_date_mode", value); - - return this; - } - - public CustomerChangeBillingDateBuilder billingDayOfWeek(BillingDayOfWeek value) { - - formData.put("billing_day_of_week", value); - - return this; - } - - public CustomerChangeBillingDateBuilder billingDayOfWeekMode(BillingDayOfWeekMode value) { - - formData.put("billing_day_of_week_mode", value); - - return this; - } - - public CustomerChangeBillingDateParams build() { - return new CustomerChangeBillingDateParams(this); - } - } - - public enum BillingDateMode { - USING_DEFAULTS("using_defaults"), - - MANUALLY_SET("manually_set"), - - /** An enum member indicating that BillingDateMode was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - BillingDateMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingDateMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingDateMode enumValue : BillingDateMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum BillingDayOfWeek { - SUNDAY("sunday"), - - MONDAY("monday"), - - TUESDAY("tuesday"), - - WEDNESDAY("wednesday"), - - THURSDAY("thursday"), - - FRIDAY("friday"), - - SATURDAY("saturday"), - - /** An enum member indicating that BillingDayOfWeek was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - BillingDayOfWeek(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingDayOfWeek fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingDayOfWeek enumValue : BillingDayOfWeek.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum BillingDayOfWeekMode { - USING_DEFAULTS("using_defaults"), - - MANUALLY_SET("manually_set"), - - /** - * An enum member indicating that BillingDayOfWeekMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingDayOfWeekMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingDayOfWeekMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingDayOfWeekMode enumValue : BillingDayOfWeekMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerCollectPaymentParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerCollectPaymentParams.java deleted file mode 100644 index d32348ea..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerCollectPaymentParams.java +++ /dev/null @@ -1,667 +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.core.models.customer.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; - -public final class CustomerCollectPaymentParams { - - private final Map formData; - - private CustomerCollectPaymentParams(CustomerCollectPaymentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerCollectPaymentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerCollectPaymentBuilder builder() { - return new CustomerCollectPaymentBuilder(); - } - - public static final class CustomerCollectPaymentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerCollectPaymentBuilder() {} - - public CustomerCollectPaymentBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public CustomerCollectPaymentBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public CustomerCollectPaymentBuilder tokenId(String value) { - - formData.put("token_id", value); - - return this; - } - - public CustomerCollectPaymentBuilder replacePrimaryPaymentSource(Boolean value) { - - formData.put("replace_primary_payment_source", value); - - return this; - } - - public CustomerCollectPaymentBuilder retainPaymentSource(Boolean value) { - - formData.put("retain_payment_source", value); - - return this; - } - - public CustomerCollectPaymentBuilder paymentInitiator(PaymentInitiator value) { - - formData.put("payment_initiator", value); - - return this; - } - - public CustomerCollectPaymentBuilder paymentMethod(PaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerCollectPaymentBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerCollectPaymentBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerCollectPaymentBuilder invoiceAllocations(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - InvoiceAllocationsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "invoice_allocations[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public CustomerCollectPaymentParams build() { - return new CustomerCollectPaymentParams(this); - } - } - - public enum PaymentInitiator { - CUSTOMER("customer"), - - MERCHANT("merchant"), - - /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentInitiator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentInitiator fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentInitiator enumValue : PaymentInitiator.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class PaymentMethodParams { - - private final Map formData; - - private PaymentMethodParams(PaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentMethodBuilder builder() { - return new PaymentMethodBuilder(); - } - - public static final class PaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentMethodBuilder() {} - - public PaymentMethodBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public PaymentMethodBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentMethodBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public PaymentMethodBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public PaymentMethodBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentMethodParams build() { - return new PaymentMethodParams(this); - } - } - - public enum Type { - CARD("card"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - AMAZON_PAYMENTS("amazon_payments"), - - DIRECT_DEBIT("direct_debit"), - - GENERIC("generic"), - - ALIPAY("alipay"), - - UNIONPAY("unionpay"), - - APPLE_PAY("apple_pay"), - - WECHAT_PAY("wechat_pay"), - - IDEAL("ideal"), - - GOOGLE_PAY("google_pay"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GIROPAY("giropay"), - - DOTPAY("dotpay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - VENMO("venmo"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** 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 static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public CardBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CardBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CardBuilder number(String value) { - - formData.put("number", value); - - return this; - } - - public CardBuilder expiryMonth(Integer value) { - - formData.put("expiry_month", value); - - return this; - } - - public CardBuilder expiryYear(Integer value) { - - formData.put("expiry_year", value); - - return this; - } - - public CardBuilder cvv(String value) { - - formData.put("cvv", value); - - return this; - } - - public CardBuilder preferredScheme(PreferredScheme value) { - - formData.put("preferred_scheme", value); - - return this; - } - - public CardBuilder billingAddr1(String value) { - - formData.put("billing_addr1", value); - - return this; - } - - public CardBuilder billingAddr2(String value) { - - formData.put("billing_addr2", value); - - return this; - } - - public CardBuilder billingCity(String value) { - - formData.put("billing_city", value); - - return this; - } - - public CardBuilder billingStateCode(String value) { - - formData.put("billing_state_code", value); - - return this; - } - - public CardBuilder billingState(String value) { - - formData.put("billing_state", value); - - return this; - } - - public CardBuilder billingZip(String value) { - - formData.put("billing_zip", value); - - return this; - } - - public CardBuilder billingCountry(String value) { - - formData.put("billing_country", value); - - return this; - } - - public CardBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public CardParams build() { - return new CardParams(this); - } - } - - 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 PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class InvoiceAllocationsParams { - - private final Map formData; - - private InvoiceAllocationsParams(InvoiceAllocationsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceAllocationsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceAllocationsBuilder builder() { - return new InvoiceAllocationsBuilder(); - } - - public static final class InvoiceAllocationsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceAllocationsBuilder() {} - - public InvoiceAllocationsBuilder invoiceId(String value) { - - formData.put("invoice_id", value); - - return this; - } - - public InvoiceAllocationsBuilder allocationAmount(Long value) { - - formData.put("allocation_amount", value); - - return this; - } - - public InvoiceAllocationsParams build() { - return new InvoiceAllocationsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerContactsForCustomerParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerContactsForCustomerParams.java deleted file mode 100644 index 7d27d2d3..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerContactsForCustomerParams.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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CustomerContactsForCustomerParams { - - private final Map queryParams; - - private CustomerContactsForCustomerParams(CustomerContactsForCustomerBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public CustomerContactsForCustomerBuilder toBuilder() { - CustomerContactsForCustomerBuilder builder = new CustomerContactsForCustomerBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for CustomerContactsForCustomerParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerContactsForCustomerBuilder builder() { - return new CustomerContactsForCustomerBuilder(); - } - - public static final class CustomerContactsForCustomerBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private CustomerContactsForCustomerBuilder() {} - - public CustomerContactsForCustomerBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public CustomerContactsForCustomerBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public CustomerContactsForCustomerParams build() { - return new CustomerContactsForCustomerParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerCreateParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerCreateParams.java deleted file mode 100644 index 481b3ab4..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerCreateParams.java +++ /dev/null @@ -1,1944 +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.core.models.customer.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; - -public final class CustomerCreateParams { - - private final Map formData; - - private CustomerCreateParams(CustomerCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerCreateBuilder builder() { - return new CustomerCreateBuilder(); - } - - public static final class CustomerCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerCreateBuilder() {} - - public CustomerCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerCreateBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CustomerCreateBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CustomerCreateBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public CustomerCreateBuilder preferredCurrencyCode(String value) { - - formData.put("preferred_currency_code", value); - - return this; - } - - public CustomerCreateBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public CustomerCreateBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public CustomerCreateBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public CustomerCreateBuilder netTermDays(Integer value) { - - formData.put("net_term_days", value); - - return this; - } - - public CustomerCreateBuilder allowDirectDebit(Boolean value) { - - formData.put("allow_direct_debit", value); - - return this; - } - - public CustomerCreateBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerCreateBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerCreateBuilder entityIdentifierScheme(String value) { - - formData.put("entity_identifier_scheme", value); - - return this; - } - - public CustomerCreateBuilder entityIdentifierStandard(String value) { - - formData.put("entity_identifier_standard", value); - - return this; - } - - public CustomerCreateBuilder registeredForGst(Boolean value) { - - formData.put("registered_for_gst", value); - - return this; - } - - public CustomerCreateBuilder isEinvoiceEnabled(Boolean value) { - - formData.put("is_einvoice_enabled", value); - - return this; - } - - public CustomerCreateBuilder einvoicingMethod(EinvoicingMethod value) { - - formData.put("einvoicing_method", value); - - return this; - } - - public CustomerCreateBuilder taxability(Taxability value) { - - formData.put("taxability", value); - - return this; - } - - public CustomerCreateBuilder exemptionDetails(List value) { - - formData.put("exemption_details", JsonUtil.toJson(value)); - - return this; - } - - public CustomerCreateBuilder customerType(CustomerType value) { - - formData.put("customer_type", value); - - return this; - } - - public CustomerCreateBuilder clientProfileId(String value) { - - formData.put("client_profile_id", value); - - return this; - } - - public CustomerCreateBuilder taxjarExemptionCategory(TaxjarExemptionCategory value) { - - formData.put("taxjar_exemption_category", value); - - return this; - } - - public CustomerCreateBuilder businessCustomerWithoutVatNumber(Boolean value) { - - formData.put("business_customer_without_vat_number", value); - - return this; - } - - public CustomerCreateBuilder locale(String value) { - - formData.put("locale", value); - - return this; - } - - public CustomerCreateBuilder entityCode(EntityCode value) { - - formData.put("entity_code", value); - - return this; - } - - public CustomerCreateBuilder exemptNumber(String value) { - - formData.put("exempt_number", value); - - return this; - } - - public CustomerCreateBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public CustomerCreateBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public CustomerCreateBuilder autoCloseInvoices(Boolean value) { - - formData.put("auto_close_invoices", value); - - return this; - } - - public CustomerCreateBuilder consolidatedInvoicing(Boolean value) { - - formData.put("consolidated_invoicing", value); - - return this; - } - - public CustomerCreateBuilder tokenId(String value) { - - formData.put("token_id", value); - - return this; - } - - public CustomerCreateBuilder businessEntityId(String value) { - - formData.put("business_entity_id", value); - - return this; - } - - @Deprecated - public CustomerCreateBuilder createdFromIp(String value) { - - formData.put("created_from_ip", value); - - return this; - } - - public CustomerCreateBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public CustomerCreateBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerCreateBuilder bankAccount(BankAccountParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "bank_account[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerCreateBuilder paymentMethod(PaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerCreateBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerCreateBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerCreateBuilder entityIdentifiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EntityIdentifiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "entity_identifiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public CustomerCreateBuilder taxProvidersFields(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 CustomerCreateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 CustomerCreateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public CustomerCreateParams build() { - return new CustomerCreateParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EinvoicingMethod { - AUTOMATIC("automatic"), - - MANUAL("manual"), - - SITE_DEFAULT("site_default"), - - /** An enum member indicating that EinvoicingMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EinvoicingMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EinvoicingMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (EinvoicingMethod enumValue : EinvoicingMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Taxability { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Taxability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Taxability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Taxability fromString(String value) { - if (value == null) return _UNKNOWN; - for (Taxability enumValue : Taxability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum CustomerType { - RESIDENTIAL("residential"), - - BUSINESS("business"), - - SENIOR_CITIZEN("senior_citizen"), - - INDUSTRIAL("industrial"), - - /** An enum member indicating that CustomerType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CustomerType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CustomerType fromString(String value) { - if (value == null) return _UNKNOWN; - for (CustomerType enumValue : CustomerType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TaxjarExemptionCategory { - WHOLESALE("wholesale"), - - GOVERNMENT("government"), - - OTHER("other"), - - /** - * An enum member indicating that TaxjarExemptionCategory was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - TaxjarExemptionCategory(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TaxjarExemptionCategory fromString(String value) { - if (value == null) return _UNKNOWN; - for (TaxjarExemptionCategory enumValue : TaxjarExemptionCategory.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EntityCode { - A("a"), - - B("b"), - - C("c"), - - D("d"), - - E("e"), - - F("f"), - - G("g"), - - H("h"), - - I("i"), - - J("j"), - - K("k"), - - L("l"), - - M("m"), - - N("n"), - - P("p"), - - Q("q"), - - R("r"), - - MED_1("med1"), - - MED_2("med2"), - - /** An enum member indicating that EntityCode was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EntityCode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EntityCode fromString(String value) { - if (value == null) return _UNKNOWN; - for (EntityCode enumValue : EntityCode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - @Deprecated - public CardBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public CardBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CardBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CardBuilder number(String value) { - - formData.put("number", value); - - return this; - } - - public CardBuilder expiryMonth(Integer value) { - - formData.put("expiry_month", value); - - return this; - } - - public CardBuilder expiryYear(Integer value) { - - formData.put("expiry_year", value); - - return this; - } - - public CardBuilder cvv(String value) { - - formData.put("cvv", value); - - return this; - } - - public CardBuilder preferredScheme(PreferredScheme value) { - - formData.put("preferred_scheme", value); - - return this; - } - - public CardBuilder billingAddr1(String value) { - - formData.put("billing_addr1", value); - - return this; - } - - public CardBuilder billingAddr2(String value) { - - formData.put("billing_addr2", value); - - return this; - } - - public CardBuilder billingCity(String value) { - - formData.put("billing_city", value); - - return this; - } - - public CardBuilder billingStateCode(String value) { - - formData.put("billing_state_code", value); - - return this; - } - - public CardBuilder billingState(String value) { - - formData.put("billing_state", value); - - return this; - } - - public CardBuilder billingZip(String value) { - - formData.put("billing_zip", value); - - return this; - } - - public CardBuilder billingCountry(String value) { - - formData.put("billing_country", value); - - return this; - } - - @Deprecated - public CardBuilder ipAddress(String value) { - - formData.put("ip_address", value); - - return this; - } - - public CardBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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 BankAccountParams { - - private final Map formData; - - private BankAccountParams(BankAccountBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BankAccountParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BankAccountBuilder builder() { - return new BankAccountBuilder(); - } - - public static final class BankAccountBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BankAccountBuilder() {} - - public BankAccountBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public BankAccountBuilder iban(String value) { - - formData.put("iban", value); - - return this; - } - - public BankAccountBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BankAccountBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BankAccountBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BankAccountBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BankAccountBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BankAccountBuilder bankName(String value) { - - formData.put("bank_name", value); - - return this; - } - - public BankAccountBuilder accountNumber(String value) { - - formData.put("account_number", value); - - return this; - } - - public BankAccountBuilder routingNumber(String value) { - - formData.put("routing_number", value); - - return this; - } - - public BankAccountBuilder bankCode(String value) { - - formData.put("bank_code", value); - - return this; - } - - public BankAccountBuilder accountType(AccountType value) { - - formData.put("account_type", value); - - return this; - } - - public BankAccountBuilder accountHolderType(AccountHolderType value) { - - formData.put("account_holder_type", value); - - return this; - } - - public BankAccountBuilder echeckType(EcheckType value) { - - formData.put("echeck_type", value); - - return this; - } - - public BankAccountBuilder issuingCountry(String value) { - - formData.put("issuing_country", value); - - return this; - } - - public BankAccountBuilder swedishIdentityNumber(String value) { - - formData.put("swedish_identity_number", value); - - return this; - } - - public BankAccountBuilder billingAddress(java.util.Map value) { - - formData.put("billing_address", JsonUtil.toJson(value)); - - return this; - } - - public BankAccountParams build() { - return new BankAccountParams(this); - } - } - - public enum AccountType { - CHECKING("checking"), - - SAVINGS("savings"), - - BUSINESS_CHECKING("business_checking"), - - CURRENT("current"), - - /** An enum member indicating that AccountType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AccountType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AccountType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AccountType enumValue : AccountType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AccountHolderType { - INDIVIDUAL("individual"), - - COMPANY("company"), - - /** - * An enum member indicating that AccountHolderType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - AccountHolderType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AccountHolderType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AccountHolderType enumValue : AccountHolderType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EcheckType { - WEB("web"), - - PPD("ppd"), - - CCD("ccd"), - - /** An enum member indicating that EcheckType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EcheckType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EcheckType fromString(String value) { - if (value == null) return _UNKNOWN; - for (EcheckType enumValue : EcheckType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PaymentMethodParams { - - private final Map formData; - - private PaymentMethodParams(PaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentMethodBuilder builder() { - return new PaymentMethodBuilder(); - } - - public static final class PaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentMethodBuilder() {} - - public PaymentMethodBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - @Deprecated - public PaymentMethodBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public PaymentMethodBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentMethodBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public PaymentMethodBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public PaymentMethodBuilder issuingCountry(String value) { - - formData.put("issuing_country", value); - - return this; - } - - public PaymentMethodBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentMethodParams build() { - return new PaymentMethodParams(this); - } - } - - public enum Type { - CARD("card"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - AMAZON_PAYMENTS("amazon_payments"), - - DIRECT_DEBIT("direct_debit"), - - GENERIC("generic"), - - ALIPAY("alipay"), - - UNIONPAY("unionpay"), - - APPLE_PAY("apple_pay"), - - WECHAT_PAY("wechat_pay"), - - IDEAL("ideal"), - - GOOGLE_PAY("google_pay"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GIROPAY("giropay"), - - DOTPAY("dotpay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - VENMO("venmo"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** 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 Gateway { - 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"), - - GOCARDLESS("gocardless"), - - 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"), - - /** 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 static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class EntityIdentifiersParams { - - private final Map formData; - - private EntityIdentifiersParams(EntityIdentifiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EntityIdentifiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EntityIdentifiersBuilder builder() { - return new EntityIdentifiersBuilder(); - } - - public static final class EntityIdentifiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EntityIdentifiersBuilder() {} - - public EntityIdentifiersBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EntityIdentifiersBuilder scheme(String value) { - - formData.put("scheme", value); - - return this; - } - - public EntityIdentifiersBuilder value(String value) { - - formData.put("value", value); - - return this; - } - - public EntityIdentifiersBuilder standard(String value) { - - formData.put("standard", value); - - return this; - } - - public EntityIdentifiersParams build() { - return new EntityIdentifiersParams(this); - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerDeductPromotionalCreditsParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerDeductPromotionalCreditsParams.java deleted file mode 100644 index 055623d7..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerDeductPromotionalCreditsParams.java +++ /dev/null @@ -1,108 +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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CustomerDeductPromotionalCreditsParams { - - private final Map formData; - - private CustomerDeductPromotionalCreditsParams(CustomerDeductPromotionalCreditsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerDeductPromotionalCreditsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerDeductPromotionalCreditsBuilder builder() { - return new CustomerDeductPromotionalCreditsBuilder(); - } - - public static final class CustomerDeductPromotionalCreditsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerDeductPromotionalCreditsBuilder() {} - - public CustomerDeductPromotionalCreditsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public CustomerDeductPromotionalCreditsBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public CustomerDeductPromotionalCreditsBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public CustomerDeductPromotionalCreditsBuilder creditType(CreditType value) { - - formData.put("credit_type", value); - - return this; - } - - public CustomerDeductPromotionalCreditsBuilder reference(String value) { - - formData.put("reference", value); - - return this; - } - - public CustomerDeductPromotionalCreditsParams build() { - return new CustomerDeductPromotionalCreditsParams(this); - } - } - - public enum CreditType { - LOYALTY_CREDITS("loyalty_credits"), - - REFERRAL_REWARDS("referral_rewards"), - - GENERAL("general"), - - /** An enum member indicating that CreditType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CreditType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CreditType fromString(String value) { - if (value == null) return _UNKNOWN; - for (CreditType enumValue : CreditType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerDeleteContactParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerDeleteContactParams.java deleted file mode 100644 index 868d0298..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerDeleteContactParams.java +++ /dev/null @@ -1,91 +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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CustomerDeleteContactParams { - - private final Map formData; - - private CustomerDeleteContactParams(CustomerDeleteContactBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerDeleteContactParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerDeleteContactBuilder builder() { - return new CustomerDeleteContactBuilder(); - } - - public static final class CustomerDeleteContactBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerDeleteContactBuilder() {} - - public CustomerDeleteContactBuilder contact(ContactParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contact[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerDeleteContactParams build() { - return new CustomerDeleteContactParams(this); - } - } - - public static final class ContactParams { - - private final Map formData; - - private ContactParams(ContactBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContactParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContactBuilder builder() { - return new ContactBuilder(); - } - - public static final class ContactBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContactBuilder() {} - - public ContactBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ContactParams build() { - return new ContactParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerDeleteParams.java deleted file mode 100644 index 3b0ee1d2..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerDeleteParams.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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CustomerDeleteParams { - - private final Map formData; - - private CustomerDeleteParams(CustomerDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerDeleteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerDeleteBuilder builder() { - return new CustomerDeleteBuilder(); - } - - public static final class CustomerDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerDeleteBuilder() {} - - public CustomerDeleteBuilder deletePaymentMethod(Boolean value) { - - formData.put("delete_payment_method", value); - - return this; - } - - public CustomerDeleteParams build() { - return new CustomerDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerMergeParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerMergeParams.java deleted file mode 100644 index 1dabd1f7..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerMergeParams.java +++ /dev/null @@ -1,57 +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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CustomerMergeParams { - - private final Map formData; - - private CustomerMergeParams(CustomerMergeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerMergeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerMergeBuilder builder() { - return new CustomerMergeBuilder(); - } - - public static final class CustomerMergeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerMergeBuilder() {} - - public CustomerMergeBuilder fromCustomerId(String value) { - - formData.put("from_customer_id", value); - - return this; - } - - public CustomerMergeBuilder toCustomerId(String value) { - - formData.put("to_customer_id", value); - - return this; - } - - public CustomerMergeParams build() { - return new CustomerMergeParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerMoveParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerMoveParams.java deleted file mode 100644 index 1861cd33..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerMoveParams.java +++ /dev/null @@ -1,57 +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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CustomerMoveParams { - - private final Map formData; - - private CustomerMoveParams(CustomerMoveBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerMoveParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerMoveBuilder builder() { - return new CustomerMoveBuilder(); - } - - public static final class CustomerMoveBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerMoveBuilder() {} - - public CustomerMoveBuilder idAtFromSite(String value) { - - formData.put("id_at_from_site", value); - - return this; - } - - public CustomerMoveBuilder fromSite(String value) { - - formData.put("from_site", value); - - return this; - } - - public CustomerMoveParams build() { - return new CustomerMoveParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerRecordExcessPaymentParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerRecordExcessPaymentParams.java deleted file mode 100644 index eedf4ff4..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerRecordExcessPaymentParams.java +++ /dev/null @@ -1,179 +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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class CustomerRecordExcessPaymentParams { - - private final Map formData; - - private CustomerRecordExcessPaymentParams(CustomerRecordExcessPaymentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerRecordExcessPaymentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerRecordExcessPaymentBuilder builder() { - return new CustomerRecordExcessPaymentBuilder(); - } - - public static final class CustomerRecordExcessPaymentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerRecordExcessPaymentBuilder() {} - - public CustomerRecordExcessPaymentBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public CustomerRecordExcessPaymentBuilder transaction(TransactionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "transaction[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerRecordExcessPaymentParams build() { - return new CustomerRecordExcessPaymentParams(this); - } - } - - public static final class TransactionParams { - - private final Map formData; - - private TransactionParams(TransactionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionBuilder builder() { - return new TransactionBuilder(); - } - - public static final class TransactionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionBuilder() {} - - public TransactionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public TransactionBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public TransactionBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public TransactionBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public TransactionBuilder paymentMethod(PaymentMethod value) { - - formData.put("payment_method", value); - - return this; - } - - public TransactionBuilder referenceNumber(String value) { - - formData.put("reference_number", value); - - return this; - } - - public TransactionBuilder customPaymentMethodId(String value) { - - formData.put("custom_payment_method_id", value); - - return this; - } - - public TransactionParams build() { - return new TransactionParams(this); - } - } - - public enum PaymentMethod { - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - OTHER("other"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - CUSTOM("custom"), - - /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethod enumValue : PaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerRelationshipsParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerRelationshipsParams.java deleted file mode 100644 index 505a3def..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerRelationshipsParams.java +++ /dev/null @@ -1,355 +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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CustomerRelationshipsParams { - - private final Map formData; - - private CustomerRelationshipsParams(CustomerRelationshipsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerRelationshipsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerRelationshipsBuilder builder() { - return new CustomerRelationshipsBuilder(); - } - - public static final class CustomerRelationshipsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerRelationshipsBuilder() {} - - public CustomerRelationshipsBuilder parentId(String value) { - - formData.put("parent_id", value); - - return this; - } - - public CustomerRelationshipsBuilder paymentOwnerId(String value) { - - formData.put("payment_owner_id", value); - - return this; - } - - public CustomerRelationshipsBuilder invoiceOwnerId(String value) { - - formData.put("invoice_owner_id", value); - - return this; - } - - public CustomerRelationshipsBuilder useDefaultHierarchySettings(Boolean value) { - - formData.put("use_default_hierarchy_settings", value); - - return this; - } - - public CustomerRelationshipsBuilder parentAccountAccess(ParentAccountAccessParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "parent_account_access[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerRelationshipsBuilder childAccountAccess(ChildAccountAccessParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "child_account_access[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerRelationshipsParams build() { - return new CustomerRelationshipsParams(this); - } - } - - public static final class ParentAccountAccessParams { - - private final Map formData; - - private ParentAccountAccessParams(ParentAccountAccessBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ParentAccountAccessParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ParentAccountAccessBuilder builder() { - return new ParentAccountAccessBuilder(); - } - - public static final class ParentAccountAccessBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ParentAccountAccessBuilder() {} - - public ParentAccountAccessBuilder portalEditChildSubscriptions( - PortalEditChildSubscriptions value) { - - formData.put("portal_edit_child_subscriptions", value); - - return this; - } - - public ParentAccountAccessBuilder portalDownloadChildInvoices( - PortalDownloadChildInvoices value) { - - formData.put("portal_download_child_invoices", value); - - return this; - } - - public ParentAccountAccessBuilder sendSubscriptionEmails(Boolean value) { - - formData.put("send_subscription_emails", value); - - return this; - } - - public ParentAccountAccessBuilder sendPaymentEmails(Boolean value) { - - formData.put("send_payment_emails", value); - - return this; - } - - public ParentAccountAccessBuilder sendInvoiceEmails(Boolean value) { - - formData.put("send_invoice_emails", value); - - return this; - } - - public ParentAccountAccessParams build() { - return new ParentAccountAccessParams(this); - } - } - - public enum PortalEditChildSubscriptions { - YES("yes"), - - VIEW_ONLY("view_only"), - - NO("no"), - - /** - * An enum member indicating that PortalEditChildSubscriptions was instantiated with an - * unknown value. - */ - _UNKNOWN(null); - private final String value; - - PortalEditChildSubscriptions(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PortalEditChildSubscriptions fromString(String value) { - if (value == null) return _UNKNOWN; - for (PortalEditChildSubscriptions enumValue : PortalEditChildSubscriptions.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PortalDownloadChildInvoices { - YES("yes"), - - VIEW_ONLY("view_only"), - - NO("no"), - - /** - * An enum member indicating that PortalDownloadChildInvoices was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - PortalDownloadChildInvoices(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PortalDownloadChildInvoices fromString(String value) { - if (value == null) return _UNKNOWN; - for (PortalDownloadChildInvoices enumValue : PortalDownloadChildInvoices.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ChildAccountAccessParams { - - private final Map formData; - - private ChildAccountAccessParams(ChildAccountAccessBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChildAccountAccessParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChildAccountAccessBuilder builder() { - return new ChildAccountAccessBuilder(); - } - - public static final class ChildAccountAccessBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChildAccountAccessBuilder() {} - - public ChildAccountAccessBuilder portalEditSubscriptions(PortalEditSubscriptions value) { - - formData.put("portal_edit_subscriptions", value); - - return this; - } - - public ChildAccountAccessBuilder portalDownloadInvoices(PortalDownloadInvoices value) { - - formData.put("portal_download_invoices", value); - - return this; - } - - public ChildAccountAccessBuilder sendSubscriptionEmails(Boolean value) { - - formData.put("send_subscription_emails", value); - - return this; - } - - public ChildAccountAccessBuilder sendPaymentEmails(Boolean value) { - - formData.put("send_payment_emails", value); - - return this; - } - - public ChildAccountAccessBuilder sendInvoiceEmails(Boolean value) { - - formData.put("send_invoice_emails", value); - - return this; - } - - public ChildAccountAccessParams build() { - return new ChildAccountAccessParams(this); - } - } - - public enum PortalEditSubscriptions { - YES("yes"), - - VIEW_ONLY("view_only"), - - /** - * An enum member indicating that PortalEditSubscriptions was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - PortalEditSubscriptions(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PortalEditSubscriptions fromString(String value) { - if (value == null) return _UNKNOWN; - for (PortalEditSubscriptions enumValue : PortalEditSubscriptions.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PortalDownloadInvoices { - YES("yes"), - - VIEW_ONLY("view_only"), - - NO("no"), - - /** - * An enum member indicating that PortalDownloadInvoices was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - PortalDownloadInvoices(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PortalDownloadInvoices fromString(String value) { - if (value == null) return _UNKNOWN; - for (PortalDownloadInvoices enumValue : PortalDownloadInvoices.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerSetPromotionalCreditsParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerSetPromotionalCreditsParams.java deleted file mode 100644 index b777f7c5..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerSetPromotionalCreditsParams.java +++ /dev/null @@ -1,108 +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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CustomerSetPromotionalCreditsParams { - - private final Map formData; - - private CustomerSetPromotionalCreditsParams(CustomerSetPromotionalCreditsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerSetPromotionalCreditsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerSetPromotionalCreditsBuilder builder() { - return new CustomerSetPromotionalCreditsBuilder(); - } - - public static final class CustomerSetPromotionalCreditsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerSetPromotionalCreditsBuilder() {} - - public CustomerSetPromotionalCreditsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public CustomerSetPromotionalCreditsBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public CustomerSetPromotionalCreditsBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public CustomerSetPromotionalCreditsBuilder creditType(CreditType value) { - - formData.put("credit_type", value); - - return this; - } - - public CustomerSetPromotionalCreditsBuilder reference(String value) { - - formData.put("reference", value); - - return this; - } - - public CustomerSetPromotionalCreditsParams build() { - return new CustomerSetPromotionalCreditsParams(this); - } - } - - public enum CreditType { - LOYALTY_CREDITS("loyalty_credits"), - - REFERRAL_REWARDS("referral_rewards"), - - GENERAL("general"), - - /** An enum member indicating that CreditType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CreditType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CreditType fromString(String value) { - if (value == null) return _UNKNOWN; - for (CreditType enumValue : CreditType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerUpdateBillingInfoParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerUpdateBillingInfoParams.java deleted file mode 100644 index bfe880af..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerUpdateBillingInfoParams.java +++ /dev/null @@ -1,480 +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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class CustomerUpdateBillingInfoParams { - - private final Map formData; - - private CustomerUpdateBillingInfoParams(CustomerUpdateBillingInfoBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerUpdateBillingInfoParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerUpdateBillingInfoBuilder builder() { - return new CustomerUpdateBillingInfoBuilder(); - } - - public static final class CustomerUpdateBillingInfoBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerUpdateBillingInfoBuilder() {} - - public CustomerUpdateBillingInfoBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerUpdateBillingInfoBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerUpdateBillingInfoBuilder entityIdentifierScheme(String value) { - - formData.put("entity_identifier_scheme", value); - - return this; - } - - public CustomerUpdateBillingInfoBuilder entityIdentifierStandard(String value) { - - formData.put("entity_identifier_standard", value); - - return this; - } - - public CustomerUpdateBillingInfoBuilder registeredForGst(Boolean value) { - - formData.put("registered_for_gst", value); - - return this; - } - - public CustomerUpdateBillingInfoBuilder businessCustomerWithoutVatNumber(Boolean value) { - - formData.put("business_customer_without_vat_number", value); - - return this; - } - - public CustomerUpdateBillingInfoBuilder isEinvoiceEnabled(Boolean value) { - - formData.put("is_einvoice_enabled", value); - - return this; - } - - public CustomerUpdateBillingInfoBuilder einvoicingMethod(EinvoicingMethod value) { - - formData.put("einvoicing_method", value); - - return this; - } - - public CustomerUpdateBillingInfoBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerUpdateBillingInfoBuilder entityIdentifiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EntityIdentifiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "entity_identifiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public CustomerUpdateBillingInfoBuilder taxProvidersFields( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public CustomerUpdateBillingInfoParams build() { - return new CustomerUpdateBillingInfoParams(this); - } - } - - public enum EinvoicingMethod { - AUTOMATIC("automatic"), - - MANUAL("manual"), - - SITE_DEFAULT("site_default"), - - /** An enum member indicating that EinvoicingMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EinvoicingMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EinvoicingMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (EinvoicingMethod enumValue : EinvoicingMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class EntityIdentifiersParams { - - private final Map formData; - - private EntityIdentifiersParams(EntityIdentifiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EntityIdentifiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EntityIdentifiersBuilder builder() { - return new EntityIdentifiersBuilder(); - } - - public static final class EntityIdentifiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EntityIdentifiersBuilder() {} - - public EntityIdentifiersBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EntityIdentifiersBuilder scheme(String value) { - - formData.put("scheme", value); - - return this; - } - - public EntityIdentifiersBuilder value(String value) { - - formData.put("value", value); - - return this; - } - - public EntityIdentifiersBuilder operation(Operation value) { - - formData.put("operation", value); - - return this; - } - - public EntityIdentifiersBuilder standard(String value) { - - formData.put("standard", value); - - return this; - } - - public EntityIdentifiersParams build() { - return new EntityIdentifiersParams(this); - } - } - - public enum Operation { - CREATE("create"), - - UPDATE("update"), - - DELETE("delete"), - - /** An enum member indicating that Operation was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Operation(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Operation fromString(String value) { - if (value == null) return _UNKNOWN; - for (Operation enumValue : Operation.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerUpdateContactParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerUpdateContactParams.java deleted file mode 100644 index 0288f0e3..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerUpdateContactParams.java +++ /dev/null @@ -1,147 +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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CustomerUpdateContactParams { - - private final Map formData; - - private CustomerUpdateContactParams(CustomerUpdateContactBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerUpdateContactParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerUpdateContactBuilder builder() { - return new CustomerUpdateContactBuilder(); - } - - public static final class CustomerUpdateContactBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerUpdateContactBuilder() {} - - public CustomerUpdateContactBuilder contact(ContactParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contact[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerUpdateContactParams build() { - return new CustomerUpdateContactParams(this); - } - } - - public static final class ContactParams { - - private final Map formData; - - private ContactParams(ContactBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContactParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContactBuilder builder() { - return new ContactBuilder(); - } - - public static final class ContactBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContactBuilder() {} - - public ContactBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ContactBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ContactBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ContactBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ContactBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ContactBuilder label(String value) { - - formData.put("label", value); - - return this; - } - - public ContactBuilder enabled(Boolean value) { - - formData.put("enabled", value); - - return this; - } - - public ContactBuilder sendBillingEmail(Boolean value) { - - formData.put("send_billing_email", value); - - return this; - } - - public ContactBuilder sendAccountEmail(Boolean value) { - - formData.put("send_account_email", value); - - return this; - } - - public ContactParams build() { - return new ContactParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerUpdateHierarchySettingsParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerUpdateHierarchySettingsParams.java deleted file mode 100644 index e369491a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerUpdateHierarchySettingsParams.java +++ /dev/null @@ -1,336 +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.core.models.customer.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class CustomerUpdateHierarchySettingsParams { - - private final Map formData; - - private CustomerUpdateHierarchySettingsParams(CustomerUpdateHierarchySettingsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerUpdateHierarchySettingsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerUpdateHierarchySettingsBuilder builder() { - return new CustomerUpdateHierarchySettingsBuilder(); - } - - public static final class CustomerUpdateHierarchySettingsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerUpdateHierarchySettingsBuilder() {} - - public CustomerUpdateHierarchySettingsBuilder useDefaultHierarchySettings(Boolean value) { - - formData.put("use_default_hierarchy_settings", value); - - return this; - } - - public CustomerUpdateHierarchySettingsBuilder parentAccountAccess( - ParentAccountAccessParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "parent_account_access[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerUpdateHierarchySettingsBuilder childAccountAccess( - ChildAccountAccessParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "child_account_access[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerUpdateHierarchySettingsParams build() { - return new CustomerUpdateHierarchySettingsParams(this); - } - } - - public static final class ParentAccountAccessParams { - - private final Map formData; - - private ParentAccountAccessParams(ParentAccountAccessBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ParentAccountAccessParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ParentAccountAccessBuilder builder() { - return new ParentAccountAccessBuilder(); - } - - public static final class ParentAccountAccessBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ParentAccountAccessBuilder() {} - - public ParentAccountAccessBuilder portalEditChildSubscriptions( - PortalEditChildSubscriptions value) { - - formData.put("portal_edit_child_subscriptions", value); - - return this; - } - - public ParentAccountAccessBuilder portalDownloadChildInvoices( - PortalDownloadChildInvoices value) { - - formData.put("portal_download_child_invoices", value); - - return this; - } - - public ParentAccountAccessBuilder sendSubscriptionEmails(Boolean value) { - - formData.put("send_subscription_emails", value); - - return this; - } - - public ParentAccountAccessBuilder sendPaymentEmails(Boolean value) { - - formData.put("send_payment_emails", value); - - return this; - } - - public ParentAccountAccessBuilder sendInvoiceEmails(Boolean value) { - - formData.put("send_invoice_emails", value); - - return this; - } - - public ParentAccountAccessParams build() { - return new ParentAccountAccessParams(this); - } - } - - public enum PortalEditChildSubscriptions { - YES("yes"), - - VIEW_ONLY("view_only"), - - NO("no"), - - /** - * An enum member indicating that PortalEditChildSubscriptions was instantiated with an - * unknown value. - */ - _UNKNOWN(null); - private final String value; - - PortalEditChildSubscriptions(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PortalEditChildSubscriptions fromString(String value) { - if (value == null) return _UNKNOWN; - for (PortalEditChildSubscriptions enumValue : PortalEditChildSubscriptions.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PortalDownloadChildInvoices { - YES("yes"), - - VIEW_ONLY("view_only"), - - NO("no"), - - /** - * An enum member indicating that PortalDownloadChildInvoices was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - PortalDownloadChildInvoices(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PortalDownloadChildInvoices fromString(String value) { - if (value == null) return _UNKNOWN; - for (PortalDownloadChildInvoices enumValue : PortalDownloadChildInvoices.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ChildAccountAccessParams { - - private final Map formData; - - private ChildAccountAccessParams(ChildAccountAccessBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChildAccountAccessParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChildAccountAccessBuilder builder() { - return new ChildAccountAccessBuilder(); - } - - public static final class ChildAccountAccessBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChildAccountAccessBuilder() {} - - public ChildAccountAccessBuilder portalEditSubscriptions(PortalEditSubscriptions value) { - - formData.put("portal_edit_subscriptions", value); - - return this; - } - - public ChildAccountAccessBuilder portalDownloadInvoices(PortalDownloadInvoices value) { - - formData.put("portal_download_invoices", value); - - return this; - } - - public ChildAccountAccessBuilder sendSubscriptionEmails(Boolean value) { - - formData.put("send_subscription_emails", value); - - return this; - } - - public ChildAccountAccessBuilder sendPaymentEmails(Boolean value) { - - formData.put("send_payment_emails", value); - - return this; - } - - public ChildAccountAccessBuilder sendInvoiceEmails(Boolean value) { - - formData.put("send_invoice_emails", value); - - return this; - } - - public ChildAccountAccessParams build() { - return new ChildAccountAccessParams(this); - } - } - - public enum PortalEditSubscriptions { - YES("yes"), - - VIEW_ONLY("view_only"), - - /** - * An enum member indicating that PortalEditSubscriptions was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - PortalEditSubscriptions(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PortalEditSubscriptions fromString(String value) { - if (value == null) return _UNKNOWN; - for (PortalEditSubscriptions enumValue : PortalEditSubscriptions.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PortalDownloadInvoices { - YES("yes"), - - VIEW_ONLY("view_only"), - - NO("no"), - - /** - * An enum member indicating that PortalDownloadInvoices was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - PortalDownloadInvoices(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PortalDownloadInvoices fromString(String value) { - if (value == null) return _UNKNOWN; - for (PortalDownloadInvoices enumValue : PortalDownloadInvoices.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerUpdateParams.java deleted file mode 100644 index f1c40b60..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerUpdateParams.java +++ /dev/null @@ -1,572 +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.core.models.customer.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; - -public final class CustomerUpdateParams { - - private final Map formData; - - private CustomerUpdateParams(CustomerUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerUpdateBuilder builder() { - return new CustomerUpdateBuilder(); - } - - public static final class CustomerUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerUpdateBuilder() {} - - public CustomerUpdateBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CustomerUpdateBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CustomerUpdateBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public CustomerUpdateBuilder preferredCurrencyCode(String value) { - - formData.put("preferred_currency_code", value); - - return this; - } - - public CustomerUpdateBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public CustomerUpdateBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public CustomerUpdateBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public CustomerUpdateBuilder allowDirectDebit(Boolean value) { - - formData.put("allow_direct_debit", value); - - return this; - } - - public CustomerUpdateBuilder netTermDays(Integer value) { - - formData.put("net_term_days", value); - - return this; - } - - public CustomerUpdateBuilder taxability(Taxability value) { - - formData.put("taxability", value); - - return this; - } - - public CustomerUpdateBuilder exemptionDetails(List value) { - - formData.put("exemption_details", JsonUtil.toJson(value)); - - return this; - } - - public CustomerUpdateBuilder customerType(CustomerType value) { - - formData.put("customer_type", value); - - return this; - } - - public CustomerUpdateBuilder clientProfileId(String value) { - - formData.put("client_profile_id", value); - - return this; - } - - public CustomerUpdateBuilder taxjarExemptionCategory(TaxjarExemptionCategory value) { - - formData.put("taxjar_exemption_category", value); - - return this; - } - - public CustomerUpdateBuilder locale(String value) { - - formData.put("locale", value); - - return this; - } - - public CustomerUpdateBuilder entityCode(EntityCode value) { - - formData.put("entity_code", value); - - return this; - } - - public CustomerUpdateBuilder exemptNumber(String value) { - - formData.put("exempt_number", value); - - return this; - } - - public CustomerUpdateBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public CustomerUpdateBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public CustomerUpdateBuilder autoCloseInvoices(Boolean value) { - - formData.put("auto_close_invoices", value); - - return this; - } - - public CustomerUpdateBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public CustomerUpdateBuilder fraudFlag(FraudFlag value) { - - formData.put("fraud_flag", value); - - return this; - } - - public CustomerUpdateBuilder consolidatedInvoicing(Boolean value) { - - formData.put("consolidated_invoicing", value); - - return this; - } - - public CustomerUpdateBuilder taxProvidersFields(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 CustomerUpdateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 CustomerUpdateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public CustomerUpdateParams build() { - return new CustomerUpdateParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Taxability { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Taxability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Taxability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Taxability fromString(String value) { - if (value == null) return _UNKNOWN; - for (Taxability enumValue : Taxability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum CustomerType { - RESIDENTIAL("residential"), - - BUSINESS("business"), - - SENIOR_CITIZEN("senior_citizen"), - - INDUSTRIAL("industrial"), - - /** An enum member indicating that CustomerType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CustomerType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CustomerType fromString(String value) { - if (value == null) return _UNKNOWN; - for (CustomerType enumValue : CustomerType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TaxjarExemptionCategory { - WHOLESALE("wholesale"), - - GOVERNMENT("government"), - - OTHER("other"), - - /** - * An enum member indicating that TaxjarExemptionCategory was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - TaxjarExemptionCategory(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TaxjarExemptionCategory fromString(String value) { - if (value == null) return _UNKNOWN; - for (TaxjarExemptionCategory enumValue : TaxjarExemptionCategory.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EntityCode { - A("a"), - - B("b"), - - C("c"), - - D("d"), - - E("e"), - - F("f"), - - G("g"), - - H("h"), - - I("i"), - - J("j"), - - K("k"), - - L("l"), - - M("m"), - - N("n"), - - P("p"), - - Q("q"), - - R("r"), - - MED_1("med1"), - - MED_2("med2"), - - /** An enum member indicating that EntityCode was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EntityCode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EntityCode fromString(String value) { - if (value == null) return _UNKNOWN; - for (EntityCode enumValue : EntityCode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum FraudFlag { - SAFE("safe"), - - FRAUDULENT("fraudulent"), - - /** An enum member indicating that FraudFlag was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - FraudFlag(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static FraudFlag fromString(String value) { - if (value == null) return _UNKNOWN; - for (FraudFlag enumValue : FraudFlag.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerUpdatePaymentMethodParams.java b/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerUpdatePaymentMethodParams.java deleted file mode 100644 index 80ecdc86..00000000 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerUpdatePaymentMethodParams.java +++ /dev/null @@ -1,339 +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.core.models.customer.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; - -public final class CustomerUpdatePaymentMethodParams { - - private final Map formData; - - private CustomerUpdatePaymentMethodParams(CustomerUpdatePaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerUpdatePaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerUpdatePaymentMethodBuilder builder() { - return new CustomerUpdatePaymentMethodBuilder(); - } - - public static final class CustomerUpdatePaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerUpdatePaymentMethodBuilder() {} - - public CustomerUpdatePaymentMethodBuilder paymentMethod(PaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerUpdatePaymentMethodParams build() { - return new CustomerUpdatePaymentMethodParams(this); - } - } - - public static final class PaymentMethodParams { - - private final Map formData; - - private PaymentMethodParams(PaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentMethodBuilder builder() { - return new PaymentMethodBuilder(); - } - - public static final class PaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentMethodBuilder() {} - - public PaymentMethodBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - @Deprecated - public PaymentMethodBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public PaymentMethodBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentMethodBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public PaymentMethodBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public PaymentMethodBuilder issuingCountry(String value) { - - formData.put("issuing_country", value); - - return this; - } - - public PaymentMethodBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentMethodParams build() { - return new PaymentMethodParams(this); - } - } - - public enum Type { - CARD("card"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - AMAZON_PAYMENTS("amazon_payments"), - - DIRECT_DEBIT("direct_debit"), - - GENERIC("generic"), - - ALIPAY("alipay"), - - UNIONPAY("unionpay"), - - WECHAT_PAY("wechat_pay"), - - IDEAL("ideal"), - - GOOGLE_PAY("google_pay"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GIROPAY("giropay"), - - DOTPAY("dotpay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - VENMO("venmo"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** 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 Gateway { - 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"), - - GOCARDLESS("gocardless"), - - 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"), - - /** 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/differentialPrice/params/DifferentialPriceCreateParams.java b/src/main/java/com/chargebee/v4/core/models/differentialPrice/params/DifferentialPriceCreateParams.java deleted file mode 100644 index a08c17b9..00000000 --- a/src/main/java/com/chargebee/v4/core/models/differentialPrice/params/DifferentialPriceCreateParams.java +++ /dev/null @@ -1,297 +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.core.models.differentialPrice.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; - -public final class DifferentialPriceCreateParams { - - private final Map formData; - - private DifferentialPriceCreateParams(DifferentialPriceCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DifferentialPriceCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DifferentialPriceCreateBuilder builder() { - return new DifferentialPriceCreateBuilder(); - } - - public static final class DifferentialPriceCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DifferentialPriceCreateBuilder() {} - - public DifferentialPriceCreateBuilder parentItemId(String value) { - - formData.put("parent_item_id", value); - - return this; - } - - public DifferentialPriceCreateBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public DifferentialPriceCreateBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public DifferentialPriceCreateBuilder businessEntityId(String value) { - - formData.put("business_entity_id", value); - - return this; - } - - public DifferentialPriceCreateBuilder parentPeriods(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ParentPeriodsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "parent_periods[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public DifferentialPriceCreateBuilder tiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public DifferentialPriceCreateParams build() { - return new DifferentialPriceCreateParams(this); - } - } - - public static final class ParentPeriodsParams { - - private final Map formData; - - private ParentPeriodsParams(ParentPeriodsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ParentPeriodsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ParentPeriodsBuilder builder() { - return new ParentPeriodsBuilder(); - } - - public static final class ParentPeriodsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ParentPeriodsBuilder() {} - - public ParentPeriodsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public ParentPeriodsBuilder period(List value) { - - formData.put("period", JsonUtil.toJson(value)); - - return this; - } - - public ParentPeriodsParams build() { - return new ParentPeriodsParams(this); - } - } - - 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 TiersParams { - - private final Map formData; - - private TiersParams(TiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TiersBuilder builder() { - return new TiersBuilder(); - } - - public static final class TiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TiersBuilder() {} - - public TiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public TiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public TiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public TiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public TiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public TiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public TiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public TiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public TiersParams build() { - return new TiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/differentialPrice/params/DifferentialPriceDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/differentialPrice/params/DifferentialPriceDeleteParams.java deleted file mode 100644 index 73798c3b..00000000 --- a/src/main/java/com/chargebee/v4/core/models/differentialPrice/params/DifferentialPriceDeleteParams.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.core.models.differentialPrice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class DifferentialPriceDeleteParams { - - private final Map formData; - - private DifferentialPriceDeleteParams(DifferentialPriceDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DifferentialPriceDeleteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DifferentialPriceDeleteBuilder builder() { - return new DifferentialPriceDeleteBuilder(); - } - - public static final class DifferentialPriceDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DifferentialPriceDeleteBuilder() {} - - public DifferentialPriceDeleteBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DifferentialPriceDeleteParams build() { - return new DifferentialPriceDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/differentialPrice/params/DifferentialPriceUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/differentialPrice/params/DifferentialPriceUpdateParams.java deleted file mode 100644 index bccb3cab..00000000 --- a/src/main/java/com/chargebee/v4/core/models/differentialPrice/params/DifferentialPriceUpdateParams.java +++ /dev/null @@ -1,290 +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.core.models.differentialPrice.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; - -public final class DifferentialPriceUpdateParams { - - private final Map formData; - - private DifferentialPriceUpdateParams(DifferentialPriceUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DifferentialPriceUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DifferentialPriceUpdateBuilder builder() { - return new DifferentialPriceUpdateBuilder(); - } - - public static final class DifferentialPriceUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DifferentialPriceUpdateBuilder() {} - - public DifferentialPriceUpdateBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DifferentialPriceUpdateBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public DifferentialPriceUpdateBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public DifferentialPriceUpdateBuilder parentPeriods(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ParentPeriodsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "parent_periods[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public DifferentialPriceUpdateBuilder tiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public DifferentialPriceUpdateParams build() { - return new DifferentialPriceUpdateParams(this); - } - } - - public static final class ParentPeriodsParams { - - private final Map formData; - - private ParentPeriodsParams(ParentPeriodsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ParentPeriodsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ParentPeriodsBuilder builder() { - return new ParentPeriodsBuilder(); - } - - public static final class ParentPeriodsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ParentPeriodsBuilder() {} - - public ParentPeriodsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public ParentPeriodsBuilder period(List value) { - - formData.put("period", JsonUtil.toJson(value)); - - return this; - } - - public ParentPeriodsParams build() { - return new ParentPeriodsParams(this); - } - } - - 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 TiersParams { - - private final Map formData; - - private TiersParams(TiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TiersBuilder builder() { - return new TiersBuilder(); - } - - public static final class TiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TiersBuilder() {} - - public TiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public TiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public TiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public TiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public TiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public TiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public TiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public TiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public TiersParams build() { - return new TiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/entitlement/params/EntitlementCreateParams.java b/src/main/java/com/chargebee/v4/core/models/entitlement/params/EntitlementCreateParams.java deleted file mode 100644 index cbc1479b..00000000 --- a/src/main/java/com/chargebee/v4/core/models/entitlement/params/EntitlementCreateParams.java +++ /dev/null @@ -1,201 +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.core.models.entitlement.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class EntitlementCreateParams { - - private final Map formData; - - private EntitlementCreateParams(EntitlementCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EntitlementCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EntitlementCreateBuilder builder() { - return new EntitlementCreateBuilder(); - } - - public static final class EntitlementCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EntitlementCreateBuilder() {} - - public EntitlementCreateBuilder action(Action value) { - - formData.put("action", value); - - return this; - } - - public EntitlementCreateBuilder changeReason(String value) { - - formData.put("change_reason", value); - - return this; - } - - public EntitlementCreateBuilder entitlements(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EntitlementsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "entitlements[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EntitlementCreateParams build() { - return new EntitlementCreateParams(this); - } - } - - public enum Action { - UPSERT("upsert"), - - REMOVE("remove"), - - /** An enum member indicating that Action was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Action(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Action fromString(String value) { - if (value == null) return _UNKNOWN; - for (Action enumValue : Action.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class EntitlementsParams { - - private final Map formData; - - private EntitlementsParams(EntitlementsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EntitlementsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EntitlementsBuilder builder() { - return new EntitlementsBuilder(); - } - - public static final class EntitlementsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EntitlementsBuilder() {} - - public EntitlementsBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public EntitlementsBuilder featureId(String value) { - - formData.put("feature_id", value); - - return this; - } - - public EntitlementsBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public EntitlementsBuilder value(String value) { - - formData.put("value", value); - - return this; - } - - public EntitlementsBuilder applyGrandfathering(Boolean value) { - - formData.put("apply_grandfathering", value); - - return this; - } - - public EntitlementsParams build() { - return new EntitlementsParams(this); - } - } - - public enum EntityType { - PLAN("plan"), - - ADDON("addon"), - - CHARGE("charge"), - - PLAN_PRICE("plan_price"), - - ADDON_PRICE("addon_price"), - - /** 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/entitlementOverride/params/EntitlementOverrideAddEntitlementOverrideForSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/entitlementOverride/params/EntitlementOverrideAddEntitlementOverrideForSubscriptionParams.java deleted file mode 100644 index 0546601d..00000000 --- a/src/main/java/com/chargebee/v4/core/models/entitlementOverride/params/EntitlementOverrideAddEntitlementOverrideForSubscriptionParams.java +++ /dev/null @@ -1,156 +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.core.models.entitlementOverride.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class EntitlementOverrideAddEntitlementOverrideForSubscriptionParams { - - private final Map formData; - - private EntitlementOverrideAddEntitlementOverrideForSubscriptionParams( - EntitlementOverrideAddEntitlementOverrideForSubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EntitlementOverrideAddEntitlementOverrideForSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EntitlementOverrideAddEntitlementOverrideForSubscriptionBuilder builder() { - return new EntitlementOverrideAddEntitlementOverrideForSubscriptionBuilder(); - } - - public static final class EntitlementOverrideAddEntitlementOverrideForSubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EntitlementOverrideAddEntitlementOverrideForSubscriptionBuilder() {} - - public EntitlementOverrideAddEntitlementOverrideForSubscriptionBuilder action(Action value) { - - formData.put("action", value); - - return this; - } - - public EntitlementOverrideAddEntitlementOverrideForSubscriptionBuilder entitlementOverrides( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EntitlementOverridesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "entitlement_overrides[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EntitlementOverrideAddEntitlementOverrideForSubscriptionParams build() { - return new EntitlementOverrideAddEntitlementOverrideForSubscriptionParams(this); - } - } - - public enum Action { - UPSERT("upsert"), - - REMOVE("remove"), - - /** An enum member indicating that Action was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Action(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Action fromString(String value) { - if (value == null) return _UNKNOWN; - for (Action enumValue : Action.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class EntitlementOverridesParams { - - private final Map formData; - - private EntitlementOverridesParams(EntitlementOverridesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EntitlementOverridesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EntitlementOverridesBuilder builder() { - return new EntitlementOverridesBuilder(); - } - - public static final class EntitlementOverridesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EntitlementOverridesBuilder() {} - - public EntitlementOverridesBuilder featureId(String value) { - - formData.put("feature_id", value); - - return this; - } - - public EntitlementOverridesBuilder value(String value) { - - formData.put("value", value); - - return this; - } - - public EntitlementOverridesBuilder expiresAt(Timestamp value) { - - formData.put("expires_at", value); - - return this; - } - - public EntitlementOverridesBuilder effectiveFrom(Timestamp value) { - - formData.put("effective_from", value); - - return this; - } - - public EntitlementOverridesParams build() { - return new EntitlementOverridesParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/entitlementOverride/params/EntitlementOverrideListEntitlementOverrideForSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/entitlementOverride/params/EntitlementOverrideListEntitlementOverrideForSubscriptionParams.java deleted file mode 100644 index 91a3037a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/entitlementOverride/params/EntitlementOverrideListEntitlementOverrideForSubscriptionParams.java +++ /dev/null @@ -1,82 +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.core.models.entitlementOverride.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class EntitlementOverrideListEntitlementOverrideForSubscriptionParams { - - private final Map queryParams; - - private EntitlementOverrideListEntitlementOverrideForSubscriptionParams( - EntitlementOverrideListEntitlementOverrideForSubscriptionBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public EntitlementOverrideListEntitlementOverrideForSubscriptionBuilder toBuilder() { - EntitlementOverrideListEntitlementOverrideForSubscriptionBuilder builder = - new EntitlementOverrideListEntitlementOverrideForSubscriptionBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for EntitlementOverrideListEntitlementOverrideForSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EntitlementOverrideListEntitlementOverrideForSubscriptionBuilder builder() { - return new EntitlementOverrideListEntitlementOverrideForSubscriptionBuilder(); - } - - public static final class EntitlementOverrideListEntitlementOverrideForSubscriptionBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private EntitlementOverrideListEntitlementOverrideForSubscriptionBuilder() {} - - public EntitlementOverrideListEntitlementOverrideForSubscriptionBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public EntitlementOverrideListEntitlementOverrideForSubscriptionBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - @Deprecated - public EntitlementOverrideListEntitlementOverrideForSubscriptionBuilder embed(String value) { - queryParams.put("embed", value); - return this; - } - - @Deprecated - public EntitlementOverrideListEntitlementOverrideForSubscriptionBuilder includeDrafts( - Boolean value) { - queryParams.put("include_drafts", value); - return this; - } - - @Deprecated - public EntitlementOverrideListEntitlementOverrideForSubscriptionBuilder - includeScheduledOverrides(Boolean value) { - queryParams.put("include_scheduled_overrides", value); - return this; - } - - public EntitlementOverrideListEntitlementOverrideForSubscriptionParams build() { - return new EntitlementOverrideListEntitlementOverrideForSubscriptionParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateAdvanceInvoiceEstimateParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateAdvanceInvoiceEstimateParams.java deleted file mode 100644 index 98e4f331..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateAdvanceInvoiceEstimateParams.java +++ /dev/null @@ -1,257 +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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class EstimateAdvanceInvoiceEstimateParams { - - private final Map formData; - - private EstimateAdvanceInvoiceEstimateParams(EstimateAdvanceInvoiceEstimateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimateAdvanceInvoiceEstimateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateAdvanceInvoiceEstimateBuilder builder() { - return new EstimateAdvanceInvoiceEstimateBuilder(); - } - - public static final class EstimateAdvanceInvoiceEstimateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimateAdvanceInvoiceEstimateBuilder() {} - - public EstimateAdvanceInvoiceEstimateBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public EstimateAdvanceInvoiceEstimateBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public EstimateAdvanceInvoiceEstimateBuilder scheduleType(ScheduleType value) { - - formData.put("schedule_type", value); - - return this; - } - - public EstimateAdvanceInvoiceEstimateBuilder fixedIntervalSchedule( - FixedIntervalScheduleParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "fixed_interval_schedule[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateAdvanceInvoiceEstimateBuilder specificDatesSchedule( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SpecificDatesScheduleParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "specific_dates_schedule[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateAdvanceInvoiceEstimateParams build() { - return new EstimateAdvanceInvoiceEstimateParams(this); - } - } - - public enum ScheduleType { - IMMEDIATE("immediate"), - - SPECIFIC_DATES("specific_dates"), - - FIXED_INTERVALS("fixed_intervals"), - - /** An enum member indicating that ScheduleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ScheduleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ScheduleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ScheduleType enumValue : ScheduleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class FixedIntervalScheduleParams { - - private final Map formData; - - private FixedIntervalScheduleParams(FixedIntervalScheduleBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for FixedIntervalScheduleParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static FixedIntervalScheduleBuilder builder() { - return new FixedIntervalScheduleBuilder(); - } - - public static final class FixedIntervalScheduleBuilder { - private final Map formData = new LinkedHashMap<>(); - - private FixedIntervalScheduleBuilder() {} - - public FixedIntervalScheduleBuilder numberOfOccurrences(Integer value) { - - formData.put("number_of_occurrences", value); - - return this; - } - - public FixedIntervalScheduleBuilder daysBeforeRenewal(Integer value) { - - formData.put("days_before_renewal", value); - - return this; - } - - public FixedIntervalScheduleBuilder endScheduleOn(EndScheduleOn value) { - - formData.put("end_schedule_on", value); - - return this; - } - - public FixedIntervalScheduleBuilder endDate(Timestamp value) { - - formData.put("end_date", value); - - return this; - } - - public FixedIntervalScheduleParams build() { - return new FixedIntervalScheduleParams(this); - } - } - - public enum EndScheduleOn { - AFTER_NUMBER_OF_INTERVALS("after_number_of_intervals"), - - SPECIFIC_DATE("specific_date"), - - SUBSCRIPTION_END("subscription_end"), - - /** An enum member indicating that EndScheduleOn was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EndScheduleOn(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EndScheduleOn fromString(String value) { - if (value == null) return _UNKNOWN; - for (EndScheduleOn enumValue : EndScheduleOn.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class SpecificDatesScheduleParams { - - private final Map formData; - - private SpecificDatesScheduleParams(SpecificDatesScheduleBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SpecificDatesScheduleParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SpecificDatesScheduleBuilder builder() { - return new SpecificDatesScheduleBuilder(); - } - - public static final class SpecificDatesScheduleBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SpecificDatesScheduleBuilder() {} - - public SpecificDatesScheduleBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public SpecificDatesScheduleBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public SpecificDatesScheduleParams build() { - return new SpecificDatesScheduleParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCancelSubscriptionForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCancelSubscriptionForItemsParams.java deleted file mode 100644 index 00567bdd..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCancelSubscriptionForItemsParams.java +++ /dev/null @@ -1,405 +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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class EstimateCancelSubscriptionForItemsParams { - - private final Map formData; - - private EstimateCancelSubscriptionForItemsParams( - EstimateCancelSubscriptionForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimateCancelSubscriptionForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateCancelSubscriptionForItemsBuilder builder() { - return new EstimateCancelSubscriptionForItemsBuilder(); - } - - public static final class EstimateCancelSubscriptionForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimateCancelSubscriptionForItemsBuilder() {} - - public EstimateCancelSubscriptionForItemsBuilder cancelOption(CancelOption value) { - - formData.put("cancel_option", value); - - return this; - } - - public EstimateCancelSubscriptionForItemsBuilder endOfTerm(Boolean value) { - - formData.put("end_of_term", value); - - return this; - } - - public EstimateCancelSubscriptionForItemsBuilder cancelAt(Timestamp value) { - - formData.put("cancel_at", value); - - return this; - } - - public EstimateCancelSubscriptionForItemsBuilder creditOptionForCurrentTermCharges( - CreditOptionForCurrentTermCharges value) { - - formData.put("credit_option_for_current_term_charges", value); - - return this; - } - - public EstimateCancelSubscriptionForItemsBuilder unbilledChargesOption( - UnbilledChargesOption value) { - - formData.put("unbilled_charges_option", value); - - return this; - } - - public EstimateCancelSubscriptionForItemsBuilder accountReceivablesHandling( - AccountReceivablesHandling value) { - - formData.put("account_receivables_handling", value); - - return this; - } - - public EstimateCancelSubscriptionForItemsBuilder refundableCreditsHandling( - RefundableCreditsHandling value) { - - formData.put("refundable_credits_handling", value); - - return this; - } - - public EstimateCancelSubscriptionForItemsBuilder contractTermCancelOption( - ContractTermCancelOption value) { - - formData.put("contract_term_cancel_option", value); - - return this; - } - - public EstimateCancelSubscriptionForItemsBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public EstimateCancelSubscriptionForItemsBuilder cancelReasonCode(String value) { - - formData.put("cancel_reason_code", value); - - return this; - } - - public EstimateCancelSubscriptionForItemsBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCancelSubscriptionForItemsParams build() { - return new EstimateCancelSubscriptionForItemsParams(this); - } - } - - public enum CancelOption { - IMMEDIATELY("immediately"), - - END_OF_TERM("end_of_term"), - - SPECIFIC_DATE("specific_date"), - - END_OF_BILLING_TERM("end_of_billing_term"), - - /** An enum member indicating that CancelOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CancelOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CancelOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (CancelOption enumValue : CancelOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum CreditOptionForCurrentTermCharges { - NONE("none"), - - PRORATE("prorate"), - - FULL("full"), - - /** - * An enum member indicating that CreditOptionForCurrentTermCharges was instantiated with an - * unknown value. - */ - _UNKNOWN(null); - private final String value; - - CreditOptionForCurrentTermCharges(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CreditOptionForCurrentTermCharges fromString(String value) { - if (value == null) return _UNKNOWN; - for (CreditOptionForCurrentTermCharges enumValue : - CreditOptionForCurrentTermCharges.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum UnbilledChargesOption { - INVOICE("invoice"), - - DELETE("delete"), - - /** - * An enum member indicating that UnbilledChargesOption was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - UnbilledChargesOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static UnbilledChargesOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (UnbilledChargesOption enumValue : UnbilledChargesOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AccountReceivablesHandling { - NO_ACTION("no_action"), - - SCHEDULE_PAYMENT_COLLECTION("schedule_payment_collection"), - - WRITE_OFF("write_off"), - - /** - * An enum member indicating that AccountReceivablesHandling was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - AccountReceivablesHandling(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AccountReceivablesHandling fromString(String value) { - if (value == null) return _UNKNOWN; - for (AccountReceivablesHandling enumValue : AccountReceivablesHandling.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum RefundableCreditsHandling { - NO_ACTION("no_action"), - - SCHEDULE_REFUND("schedule_refund"), - - /** - * An enum member indicating that RefundableCreditsHandling was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - RefundableCreditsHandling(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static RefundableCreditsHandling fromString(String value) { - if (value == null) return _UNKNOWN; - for (RefundableCreditsHandling enumValue : RefundableCreditsHandling.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ContractTermCancelOption { - TERMINATE_IMMEDIATELY("terminate_immediately"), - - END_OF_CONTRACT_TERM("end_of_contract_term"), - - SPECIFIC_DATE("specific_date"), - - END_OF_SUBSCRIPTION_BILLING_TERM("end_of_subscription_billing_term"), - - /** - * An enum member indicating that ContractTermCancelOption was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - ContractTermCancelOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ContractTermCancelOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ContractTermCancelOption enumValue : ContractTermCancelOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public SubscriptionItemsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCancelSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCancelSubscriptionParams.java deleted file mode 100644 index 40347a07..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCancelSubscriptionParams.java +++ /dev/null @@ -1,388 +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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class EstimateCancelSubscriptionParams { - - private final Map formData; - - private EstimateCancelSubscriptionParams(EstimateCancelSubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimateCancelSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateCancelSubscriptionBuilder builder() { - return new EstimateCancelSubscriptionBuilder(); - } - - public static final class EstimateCancelSubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimateCancelSubscriptionBuilder() {} - - public EstimateCancelSubscriptionBuilder cancelOption(CancelOption value) { - - formData.put("cancel_option", value); - - return this; - } - - public EstimateCancelSubscriptionBuilder endOfTerm(Boolean value) { - - formData.put("end_of_term", value); - - return this; - } - - public EstimateCancelSubscriptionBuilder cancelAt(Timestamp value) { - - formData.put("cancel_at", value); - - return this; - } - - public EstimateCancelSubscriptionBuilder creditOptionForCurrentTermCharges( - CreditOptionForCurrentTermCharges value) { - - formData.put("credit_option_for_current_term_charges", value); - - return this; - } - - public EstimateCancelSubscriptionBuilder unbilledChargesOption(UnbilledChargesOption value) { - - formData.put("unbilled_charges_option", value); - - return this; - } - - public EstimateCancelSubscriptionBuilder accountReceivablesHandling( - AccountReceivablesHandling value) { - - formData.put("account_receivables_handling", value); - - return this; - } - - public EstimateCancelSubscriptionBuilder refundableCreditsHandling( - RefundableCreditsHandling value) { - - formData.put("refundable_credits_handling", value); - - return this; - } - - public EstimateCancelSubscriptionBuilder contractTermCancelOption( - ContractTermCancelOption value) { - - formData.put("contract_term_cancel_option", value); - - return this; - } - - public EstimateCancelSubscriptionBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public EstimateCancelSubscriptionBuilder cancelReasonCode(String value) { - - formData.put("cancel_reason_code", value); - - return this; - } - - public EstimateCancelSubscriptionBuilder eventBasedAddons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCancelSubscriptionParams build() { - return new EstimateCancelSubscriptionParams(this); - } - } - - public enum CancelOption { - IMMEDIATELY("immediately"), - - END_OF_TERM("end_of_term"), - - SPECIFIC_DATE("specific_date"), - - END_OF_BILLING_TERM("end_of_billing_term"), - - /** An enum member indicating that CancelOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CancelOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CancelOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (CancelOption enumValue : CancelOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum CreditOptionForCurrentTermCharges { - NONE("none"), - - PRORATE("prorate"), - - FULL("full"), - - /** - * An enum member indicating that CreditOptionForCurrentTermCharges was instantiated with an - * unknown value. - */ - _UNKNOWN(null); - private final String value; - - CreditOptionForCurrentTermCharges(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CreditOptionForCurrentTermCharges fromString(String value) { - if (value == null) return _UNKNOWN; - for (CreditOptionForCurrentTermCharges enumValue : - CreditOptionForCurrentTermCharges.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum UnbilledChargesOption { - INVOICE("invoice"), - - DELETE("delete"), - - /** - * An enum member indicating that UnbilledChargesOption was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - UnbilledChargesOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static UnbilledChargesOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (UnbilledChargesOption enumValue : UnbilledChargesOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AccountReceivablesHandling { - NO_ACTION("no_action"), - - SCHEDULE_PAYMENT_COLLECTION("schedule_payment_collection"), - - WRITE_OFF("write_off"), - - /** - * An enum member indicating that AccountReceivablesHandling was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - AccountReceivablesHandling(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AccountReceivablesHandling fromString(String value) { - if (value == null) return _UNKNOWN; - for (AccountReceivablesHandling enumValue : AccountReceivablesHandling.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum RefundableCreditsHandling { - NO_ACTION("no_action"), - - SCHEDULE_REFUND("schedule_refund"), - - /** - * An enum member indicating that RefundableCreditsHandling was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - RefundableCreditsHandling(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static RefundableCreditsHandling fromString(String value) { - if (value == null) return _UNKNOWN; - for (RefundableCreditsHandling enumValue : RefundableCreditsHandling.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ContractTermCancelOption { - TERMINATE_IMMEDIATELY("terminate_immediately"), - - END_OF_CONTRACT_TERM("end_of_contract_term"), - - SPECIFIC_DATE("specific_date"), - - END_OF_SUBSCRIPTION_BILLING_TERM("end_of_subscription_billing_term"), - - /** - * An enum member indicating that ContractTermCancelOption was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - ContractTermCancelOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ContractTermCancelOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ContractTermCancelOption enumValue : ContractTermCancelOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { - - formData.put("service_period_in_days", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateChangeTermEndParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateChangeTermEndParams.java deleted file mode 100644 index b7822a61..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateChangeTermEndParams.java +++ /dev/null @@ -1,65 +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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class EstimateChangeTermEndParams { - - private final Map formData; - - private EstimateChangeTermEndParams(EstimateChangeTermEndBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimateChangeTermEndParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateChangeTermEndBuilder builder() { - return new EstimateChangeTermEndBuilder(); - } - - public static final class EstimateChangeTermEndBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimateChangeTermEndBuilder() {} - - public EstimateChangeTermEndBuilder termEndsAt(Timestamp value) { - - formData.put("term_ends_at", value); - - return this; - } - - public EstimateChangeTermEndBuilder prorate(Boolean value) { - - formData.put("prorate", value); - - return this; - } - - public EstimateChangeTermEndBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public EstimateChangeTermEndParams build() { - return new EstimateChangeTermEndParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateInvoiceForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateInvoiceForItemsParams.java deleted file mode 100644 index 0c022407..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateInvoiceForItemsParams.java +++ /dev/null @@ -1,1175 +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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class EstimateCreateInvoiceForItemsParams { - - private final Map formData; - - private EstimateCreateInvoiceForItemsParams(EstimateCreateInvoiceForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimateCreateInvoiceForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateCreateInvoiceForItemsBuilder builder() { - return new EstimateCreateInvoiceForItemsBuilder(); - } - - public static final class EstimateCreateInvoiceForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimateCreateInvoiceForItemsBuilder() {} - - public EstimateCreateInvoiceForItemsBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public EstimateCreateInvoiceForItemsBuilder invoiceNote(String value) { - - formData.put("invoice_note", value); - - return this; - } - - public EstimateCreateInvoiceForItemsBuilder removeGeneralNote(Boolean value) { - - formData.put("remove_general_note", value); - - return this; - } - - @Deprecated - public EstimateCreateInvoiceForItemsBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public EstimateCreateInvoiceForItemsBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public EstimateCreateInvoiceForItemsBuilder authorizationTransactionId(String value) { - - formData.put("authorization_transaction_id", value); - - return this; - } - - public EstimateCreateInvoiceForItemsBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public EstimateCreateInvoiceForItemsBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public EstimateCreateInvoiceForItemsBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public EstimateCreateInvoiceForItemsBuilder invoice(InvoiceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "invoice[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateInvoiceForItemsBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateInvoiceForItemsBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateInvoiceForItemsBuilder itemPrices(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemPricesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_prices[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateInvoiceForItemsBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateInvoiceForItemsBuilder charges(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ChargesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateInvoiceForItemsBuilder notesToRemove(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - NotesToRemoveParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "notes_to_remove[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateInvoiceForItemsBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateInvoiceForItemsBuilder taxProvidersFields( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateInvoiceForItemsParams build() { - return new EstimateCreateInvoiceForItemsParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class InvoiceParams { - - private final Map formData; - - private InvoiceParams(InvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceBuilder builder() { - return new InvoiceBuilder(); - } - - public static final class InvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceBuilder() {} - - public InvoiceBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public InvoiceBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public InvoiceBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public InvoiceParams build() { - return new InvoiceParams(this); - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ItemPricesParams { - - private final Map formData; - - private ItemPricesParams(ItemPricesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemPricesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPricesBuilder builder() { - return new ItemPricesBuilder(); - } - - public static final class ItemPricesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemPricesBuilder() {} - - public ItemPricesBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemPricesBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public ItemPricesBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public ItemPricesBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public ItemPricesBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public ItemPricesBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public ItemPricesBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public ItemPricesParams build() { - return new ItemPricesParams(this); - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ChargesParams { - - private final Map formData; - - private ChargesParams(ChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargesBuilder builder() { - return new ChargesBuilder(); - } - - public static final class ChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargesBuilder() {} - - public ChargesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public ChargesBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public ChargesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ChargesBuilder taxable(Boolean value) { - - formData.put("taxable", value); - - return this; - } - - public ChargesBuilder taxProfileId(String value) { - - formData.put("tax_profile_id", value); - - return this; - } - - public ChargesBuilder avalaraTaxCode(String value) { - - formData.put("avalara_tax_code", value); - - return this; - } - - public ChargesBuilder hsnCode(String value) { - - formData.put("hsn_code", value); - - return this; - } - - public ChargesBuilder taxjarProductCode(String value) { - - formData.put("taxjar_product_code", value); - - return this; - } - - public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public ChargesBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public ChargesBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public ChargesBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public ChargesBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public ChargesParams build() { - return new ChargesParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class NotesToRemoveParams { - - private final Map formData; - - private NotesToRemoveParams(NotesToRemoveBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NotesToRemoveParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NotesToRemoveBuilder builder() { - return new NotesToRemoveBuilder(); - } - - public static final class NotesToRemoveBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NotesToRemoveBuilder() {} - - public NotesToRemoveBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public NotesToRemoveBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public NotesToRemoveParams build() { - return new NotesToRemoveParams(this); - } - } - - public enum EntityType { - CUSTOMER("customer"), - - SUBSCRIPTION("subscription"), - - COUPON("coupon"), - - PLAN_ITEM_PRICE("plan_item_price"), - - ADDON_ITEM_PRICE("addon_item_price"), - - CHARGE_ITEM_PRICE("charge_item_price"), - - /** 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 static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateInvoiceParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateInvoiceParams.java deleted file mode 100644 index 9f72a2be..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateInvoiceParams.java +++ /dev/null @@ -1,795 +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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class EstimateCreateInvoiceParams { - - private final Map formData; - - private EstimateCreateInvoiceParams(EstimateCreateInvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimateCreateInvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateCreateInvoiceBuilder builder() { - return new EstimateCreateInvoiceBuilder(); - } - - public static final class EstimateCreateInvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimateCreateInvoiceBuilder() {} - - public EstimateCreateInvoiceBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public EstimateCreateInvoiceBuilder invoiceNote(String value) { - - formData.put("invoice_note", value); - - return this; - } - - public EstimateCreateInvoiceBuilder removeGeneralNote(Boolean value) { - - formData.put("remove_general_note", value); - - return this; - } - - @Deprecated - public EstimateCreateInvoiceBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public EstimateCreateInvoiceBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public EstimateCreateInvoiceBuilder authorizationTransactionId(String value) { - - formData.put("authorization_transaction_id", value); - - return this; - } - - public EstimateCreateInvoiceBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public EstimateCreateInvoiceBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public EstimateCreateInvoiceBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public EstimateCreateInvoiceBuilder invoice(InvoiceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "invoice[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateInvoiceBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateInvoiceBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateInvoiceBuilder charges(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ChargesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateInvoiceBuilder notesToRemove(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - NotesToRemoveParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "notes_to_remove[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateInvoiceBuilder taxProvidersFields(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateInvoiceParams build() { - return new EstimateCreateInvoiceParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class InvoiceParams { - - private final Map formData; - - private InvoiceParams(InvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceBuilder builder() { - return new InvoiceBuilder(); - } - - public static final class InvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceBuilder() {} - - public InvoiceBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public InvoiceBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public InvoiceBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public InvoiceParams build() { - return new InvoiceParams(this); - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public AddonsBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class ChargesParams { - - private final Map formData; - - private ChargesParams(ChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargesBuilder builder() { - return new ChargesBuilder(); - } - - public static final class ChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargesBuilder() {} - - public ChargesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public ChargesBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public ChargesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ChargesBuilder taxable(Boolean value) { - - formData.put("taxable", value); - - return this; - } - - public ChargesBuilder taxProfileId(String value) { - - formData.put("tax_profile_id", value); - - return this; - } - - public ChargesBuilder avalaraTaxCode(String value) { - - formData.put("avalara_tax_code", value); - - return this; - } - - public ChargesBuilder hsnCode(String value) { - - formData.put("hsn_code", value); - - return this; - } - - public ChargesBuilder taxjarProductCode(String value) { - - formData.put("taxjar_product_code", value); - - return this; - } - - public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public ChargesBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public ChargesBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public ChargesBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public ChargesBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public ChargesParams build() { - return new ChargesParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class NotesToRemoveParams { - - private final Map formData; - - private NotesToRemoveParams(NotesToRemoveBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NotesToRemoveParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NotesToRemoveBuilder builder() { - return new NotesToRemoveBuilder(); - } - - public static final class NotesToRemoveBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NotesToRemoveBuilder() {} - - public NotesToRemoveBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public NotesToRemoveBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public NotesToRemoveParams build() { - return new NotesToRemoveParams(this); - } - } - - public enum EntityType { - PLAN("plan"), - - ADDON("addon"), - - CUSTOMER("customer"), - - SUBSCRIPTION("subscription"), - - COUPON("coupon"), - - /** 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 static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateSubForCustomerEstimateParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateSubForCustomerEstimateParams.java deleted file mode 100644 index 7c799271..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateSubForCustomerEstimateParams.java +++ /dev/null @@ -1,901 +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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.sql.Timestamp; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class EstimateCreateSubForCustomerEstimateParams { - - private final Map queryParams; - - private EstimateCreateSubForCustomerEstimateParams( - EstimateCreateSubForCustomerEstimateBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public EstimateCreateSubForCustomerEstimateBuilder toBuilder() { - EstimateCreateSubForCustomerEstimateBuilder builder = - new EstimateCreateSubForCustomerEstimateBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for EstimateCreateSubForCustomerEstimateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateCreateSubForCustomerEstimateBuilder builder() { - return new EstimateCreateSubForCustomerEstimateBuilder(); - } - - public static final class EstimateCreateSubForCustomerEstimateBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private EstimateCreateSubForCustomerEstimateBuilder() {} - - public EstimateCreateSubForCustomerEstimateBuilder useExistingBalances(Boolean value) { - queryParams.put("use_existing_balances", value); - return this; - } - - public EstimateCreateSubForCustomerEstimateBuilder invoiceImmediately(Boolean value) { - queryParams.put("invoice_immediately", value); - return this; - } - - public EstimateCreateSubForCustomerEstimateBuilder billingCycles(Integer value) { - queryParams.put("billing_cycles", value); - return this; - } - - public EstimateCreateSubForCustomerEstimateBuilder mandatoryAddonsToRemove(List value) { - queryParams.put("mandatory_addons_to_remove", value); - return this; - } - - public EstimateCreateSubForCustomerEstimateBuilder termsToCharge(Integer value) { - queryParams.put("terms_to_charge", value); - return this; - } - - public EstimateCreateSubForCustomerEstimateBuilder billingAlignmentMode( - BillingAlignmentMode value) { - queryParams.put("billing_alignment_mode", value); - return this; - } - - public EstimateCreateSubForCustomerEstimateBuilder invoiceDate(Timestamp value) { - queryParams.put("invoice_date", value); - return this; - } - - public EstimateCreateSubForCustomerEstimateBuilder couponIds(List value) { - queryParams.put("coupon_ids", value); - return this; - } - - public EstimateCreateSubForCustomerEstimateBuilder subscription(SubscriptionParams value) { - queryParams.put("subscription", value); - return this; - } - - public EstimateCreateSubForCustomerEstimateBuilder shippingAddress( - ShippingAddressParams value) { - queryParams.put("shipping_address", value); - return this; - } - - public EstimateCreateSubForCustomerEstimateBuilder contractTerm(ContractTermParams value) { - queryParams.put("contract_term", value); - return this; - } - - public EstimateCreateSubForCustomerEstimateBuilder addons(AddonsParams value) { - queryParams.put("addons", value); - return this; - } - - public EstimateCreateSubForCustomerEstimateBuilder eventBasedAddons( - EventBasedAddonsParams value) { - queryParams.put("event_based_addons", value); - return this; - } - - public EstimateCreateSubForCustomerEstimateParams build() { - return new EstimateCreateSubForCustomerEstimateParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum SubscriptionOfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that SubscriptionOfflinePaymentMethod was instantiated with an - * unknown value. - */ - _UNKNOWN(null); - private final String value; - - SubscriptionOfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static SubscriptionOfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (SubscriptionOfflinePaymentMethod enumValue : SubscriptionOfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum SubscriptionFreePeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** - * An enum member indicating that SubscriptionFreePeriodUnit was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - SubscriptionFreePeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static SubscriptionFreePeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (SubscriptionFreePeriodUnit enumValue : SubscriptionFreePeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum SubscriptionTrialEndAction { - SITE_DEFAULT("site_default"), - - PLAN_DEFAULT("plan_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** - * An enum member indicating that SubscriptionTrialEndAction was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - SubscriptionTrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static SubscriptionTrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (SubscriptionTrialEndAction enumValue : SubscriptionTrialEndAction.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ShippingAddressValidationStatus { - NOT_VALIDATED("not_validated"), - - VALID("valid"), - - PARTIALLY_VALID("partially_valid"), - - INVALID("invalid"), - - /** - * An enum member indicating that ShippingAddressValidationStatus was instantiated with an - * unknown value. - */ - _UNKNOWN(null); - private final String value; - - ShippingAddressValidationStatus(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ShippingAddressValidationStatus fromString(String value) { - if (value == null) return _UNKNOWN; - for (ShippingAddressValidationStatus enumValue : ShippingAddressValidationStatus.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ContractTermActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** - * An enum member indicating that ContractTermActionAtTermEnd was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - ContractTermActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ContractTermActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ContractTermActionAtTermEnd enumValue : ContractTermActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map queryParams; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public SubscriptionBuilder toBuilder() { - SubscriptionBuilder builder = new SubscriptionBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - queryParams.put("id", value); - return this; - } - - public SubscriptionBuilder planId(String value) { - queryParams.put("plan_id", value); - return this; - } - - public SubscriptionBuilder planQuantity(Integer value) { - queryParams.put("plan_quantity", value); - return this; - } - - public SubscriptionBuilder planQuantityInDecimal(String value) { - queryParams.put("plan_quantity_in_decimal", value); - return this; - } - - public SubscriptionBuilder planUnitPrice(Long value) { - queryParams.put("plan_unit_price", value); - return this; - } - - public SubscriptionBuilder planUnitPriceInDecimal(String value) { - queryParams.put("plan_unit_price_in_decimal", value); - return this; - } - - public SubscriptionBuilder setupFee(Long value) { - queryParams.put("setup_fee", value); - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - queryParams.put("trial_end", value); - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - queryParams.put("start_date", value); - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - queryParams.put("offline_payment_method", value); - return this; - } - - public SubscriptionBuilder freePeriod(Integer value) { - queryParams.put("free_period", value); - return this; - } - - public SubscriptionBuilder freePeriodUnit(FreePeriodUnit value) { - queryParams.put("free_period_unit", value); - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - queryParams.put("contract_term_billing_cycle_on_renewal", value); - return this; - } - - public SubscriptionBuilder trialEndAction(TrialEndAction value) { - queryParams.put("trial_end_action", value); - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum FreePeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - FreePeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static FreePeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TrialEndAction { - SITE_DEFAULT("site_default"), - - PLAN_DEFAULT("plan_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialEndAction enumValue : TrialEndAction.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ShippingAddressParams { - - private final Map queryParams; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public ShippingAddressBuilder toBuilder() { - ShippingAddressBuilder builder = new ShippingAddressBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder line1(String value) { - queryParams.put("line1", value); - return this; - } - - public ShippingAddressBuilder line2(String value) { - queryParams.put("line2", value); - return this; - } - - public ShippingAddressBuilder line3(String value) { - queryParams.put("line3", value); - return this; - } - - public ShippingAddressBuilder city(String value) { - queryParams.put("city", value); - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - queryParams.put("state_code", value); - return this; - } - - public ShippingAddressBuilder zip(String value) { - queryParams.put("zip", value); - return this; - } - - public ShippingAddressBuilder country(String value) { - queryParams.put("country", value); - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - queryParams.put("validation_status", value); - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class ContractTermParams { - - private final Map queryParams; - - private ContractTermParams(ContractTermBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public ContractTermBuilder toBuilder() { - ContractTermBuilder builder = new ContractTermBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - queryParams.put("action_at_term_end", value); - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - queryParams.put("cancellation_cutoff_period", value); - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AddonsParams { - - private final Map queryParams; - - private AddonsParams(AddonsBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public AddonsBuilder toBuilder() { - AddonsBuilder builder = new AddonsBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(List value) { - queryParams.put("id", value); - return this; - } - - public AddonsBuilder quantity(List value) { - queryParams.put("quantity", value); - return this; - } - - public AddonsBuilder quantityInDecimal(List value) { - queryParams.put("quantity_in_decimal", value); - return this; - } - - public AddonsBuilder unitPrice(List value) { - queryParams.put("unit_price", value); - return this; - } - - public AddonsBuilder unitPriceInDecimal(List value) { - queryParams.put("unit_price_in_decimal", value); - return this; - } - - public AddonsBuilder billingCycles(List value) { - queryParams.put("billing_cycles", value); - return this; - } - - public AddonsBuilder trialEnd(List value) { - queryParams.put("trial_end", value); - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map queryParams; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public EventBasedAddonsBuilder toBuilder() { - EventBasedAddonsBuilder builder = new EventBasedAddonsBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(List value) { - queryParams.put("id", value); - return this; - } - - public EventBasedAddonsBuilder quantity(List value) { - queryParams.put("quantity", value); - return this; - } - - public EventBasedAddonsBuilder unitPrice(List value) { - queryParams.put("unit_price", value); - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(List value) { - queryParams.put("quantity_in_decimal", value); - return this; - } - - public EventBasedAddonsBuilder unitPriceInDecimal(List value) { - queryParams.put("unit_price_in_decimal", value); - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(List value) { - queryParams.put("service_period_in_days", value); - return this; - } - - public EventBasedAddonsBuilder onEvent(List value) { - queryParams.put("on_event", value); - return this; - } - - public EventBasedAddonsBuilder chargeOnce(List value) { - queryParams.put("charge_once", value); - return this; - } - - public EventBasedAddonsBuilder chargeOn(List value) { - queryParams.put("charge_on", value); - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateSubItemEstimateParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateSubItemEstimateParams.java deleted file mode 100644 index a918dd3e..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateSubItemEstimateParams.java +++ /dev/null @@ -1,1560 +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.core.models.estimate.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 EstimateCreateSubItemEstimateParams { - - private final Map formData; - - private EstimateCreateSubItemEstimateParams(EstimateCreateSubItemEstimateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimateCreateSubItemEstimateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateCreateSubItemEstimateBuilder builder() { - return new EstimateCreateSubItemEstimateBuilder(); - } - - public static final class EstimateCreateSubItemEstimateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimateCreateSubItemEstimateBuilder() {} - - public EstimateCreateSubItemEstimateBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public EstimateCreateSubItemEstimateBuilder mandatoryItemsToRemove(List value) { - - formData.put("mandatory_items_to_remove", value); - - return this; - } - - public EstimateCreateSubItemEstimateBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public EstimateCreateSubItemEstimateBuilder billingAlignmentMode(BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public EstimateCreateSubItemEstimateBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public EstimateCreateSubItemEstimateBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public EstimateCreateSubItemEstimateBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public EstimateCreateSubItemEstimateBuilder clientProfileId(String value) { - - formData.put("client_profile_id", value); - - return this; - } - - public EstimateCreateSubItemEstimateBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateSubItemEstimateBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateSubItemEstimateBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateSubItemEstimateBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateSubItemEstimateBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateSubItemEstimateBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateSubItemEstimateBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateSubItemEstimateBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateSubItemEstimateBuilder taxProvidersFields( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateSubItemEstimateParams build() { - return new EstimateCreateSubItemEstimateParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder freePeriod(Integer value) { - - formData.put("free_period", value); - - return this; - } - - public SubscriptionBuilder freePeriodUnit(FreePeriodUnit value) { - - formData.put("free_period_unit", value); - - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionBuilder trialEndAction(TrialEndAction value) { - - formData.put("trial_end_action", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum FreePeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - FreePeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static FreePeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TrialEndAction { - SITE_DEFAULT("site_default"), - - PLAN_DEFAULT("plan_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialEndAction enumValue : TrialEndAction.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder registeredForGst(Boolean value) { - - formData.put("registered_for_gst", value); - - return this; - } - - public CustomerBuilder taxability(Taxability value) { - - formData.put("taxability", value); - - return this; - } - - public CustomerBuilder entityCode(EntityCode value) { - - formData.put("entity_code", value); - - return this; - } - - public CustomerBuilder exemptNumber(String value) { - - formData.put("exempt_number", value); - - return this; - } - - public CustomerBuilder exemptionDetails(List value) { - - formData.put("exemption_details", JsonUtil.toJson(value)); - - return this; - } - - public CustomerBuilder customerType(CustomerType value) { - - formData.put("customer_type", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - - public enum Taxability { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Taxability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Taxability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Taxability fromString(String value) { - if (value == null) return _UNKNOWN; - for (Taxability enumValue : Taxability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EntityCode { - A("a"), - - B("b"), - - C("c"), - - D("d"), - - E("e"), - - F("f"), - - G("g"), - - H("h"), - - I("i"), - - J("j"), - - K("k"), - - L("l"), - - M("m"), - - N("n"), - - P("p"), - - Q("q"), - - R("r"), - - MED_1("med1"), - - MED_2("med2"), - - /** An enum member indicating that EntityCode was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EntityCode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EntityCode fromString(String value) { - if (value == null) return _UNKNOWN; - for (EntityCode enumValue : EntityCode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum CustomerType { - RESIDENTIAL("residential"), - - BUSINESS("business"), - - SENIOR_CITIZEN("senior_citizen"), - - INDUSTRIAL("industrial"), - - /** An enum member indicating that CustomerType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CustomerType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CustomerType fromString(String value) { - if (value == null) return _UNKNOWN; - for (CustomerType enumValue : CustomerType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - @Deprecated - public ContractTermBuilder contractStart(Timestamp value) { - - formData.put("contract_start", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public SubscriptionItemsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionItemsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionItemsBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public SubscriptionItemsBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { - - formData.put("charge_on_option", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - - 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"), - - /** 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; - } - } - - 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 enum ChargeOnOption { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOnOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOnOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOnOption enumValue : ChargeOnOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateSubItemForCustomerEstimateParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateSubItemForCustomerEstimateParams.java deleted file mode 100644 index 6a0839f5..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateSubItemForCustomerEstimateParams.java +++ /dev/null @@ -1,1325 +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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class EstimateCreateSubItemForCustomerEstimateParams { - - private final Map formData; - - private EstimateCreateSubItemForCustomerEstimateParams( - EstimateCreateSubItemForCustomerEstimateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimateCreateSubItemForCustomerEstimateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateCreateSubItemForCustomerEstimateBuilder builder() { - return new EstimateCreateSubItemForCustomerEstimateBuilder(); - } - - public static final class EstimateCreateSubItemForCustomerEstimateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimateCreateSubItemForCustomerEstimateBuilder() {} - - public EstimateCreateSubItemForCustomerEstimateBuilder useExistingBalances(Boolean value) { - - formData.put("use_existing_balances", value); - - return this; - } - - public EstimateCreateSubItemForCustomerEstimateBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public EstimateCreateSubItemForCustomerEstimateBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public EstimateCreateSubItemForCustomerEstimateBuilder mandatoryItemsToRemove( - List value) { - - formData.put("mandatory_items_to_remove", value); - - return this; - } - - public EstimateCreateSubItemForCustomerEstimateBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public EstimateCreateSubItemForCustomerEstimateBuilder billingAlignmentMode( - BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public EstimateCreateSubItemForCustomerEstimateBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public EstimateCreateSubItemForCustomerEstimateBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public EstimateCreateSubItemForCustomerEstimateBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateSubItemForCustomerEstimateBuilder shippingAddress( - ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateSubItemForCustomerEstimateBuilder billingAddress( - BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateSubItemForCustomerEstimateBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateSubItemForCustomerEstimateBuilder billingOverride( - BillingOverrideParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_override[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateSubItemForCustomerEstimateBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateSubItemForCustomerEstimateBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateSubItemForCustomerEstimateBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateSubItemForCustomerEstimateParams build() { - return new EstimateCreateSubItemForCustomerEstimateParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder freePeriod(Integer value) { - - formData.put("free_period", value); - - return this; - } - - public SubscriptionBuilder freePeriodUnit(FreePeriodUnit value) { - - formData.put("free_period_unit", value); - - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionBuilder trialEndAction(TrialEndAction value) { - - formData.put("trial_end_action", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum FreePeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - FreePeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static FreePeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TrialEndAction { - SITE_DEFAULT("site_default"), - - PLAN_DEFAULT("plan_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialEndAction enumValue : TrialEndAction.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - @Deprecated - public ContractTermBuilder contractStart(Timestamp value) { - - formData.put("contract_start", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingOverrideParams { - - private final Map formData; - - private BillingOverrideParams(BillingOverrideBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingOverrideParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingOverrideBuilder builder() { - return new BillingOverrideBuilder(); - } - - public static final class BillingOverrideBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingOverrideBuilder() {} - - public BillingOverrideBuilder maxExcessPaymentUsage(Long value) { - - formData.put("max_excess_payment_usage", value); - - return this; - } - - public BillingOverrideBuilder maxRefundableCreditsUsage(Long value) { - - formData.put("max_refundable_credits_usage", value); - - return this; - } - - public BillingOverrideParams build() { - return new BillingOverrideParams(this); - } - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public SubscriptionItemsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionItemsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionItemsBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public SubscriptionItemsBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { - - formData.put("charge_on_option", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - - 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"), - - /** 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; - } - } - - 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 enum ChargeOnOption { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOnOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOnOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOnOption enumValue : ChargeOnOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateSubscriptionParams.java deleted file mode 100644 index 47323a45..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateCreateSubscriptionParams.java +++ /dev/null @@ -1,1291 +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.core.models.estimate.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 EstimateCreateSubscriptionParams { - - private final Map formData; - - private EstimateCreateSubscriptionParams(EstimateCreateSubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimateCreateSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateCreateSubscriptionBuilder builder() { - return new EstimateCreateSubscriptionBuilder(); - } - - public static final class EstimateCreateSubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimateCreateSubscriptionBuilder() {} - - public EstimateCreateSubscriptionBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public EstimateCreateSubscriptionBuilder mandatoryAddonsToRemove(List value) { - - formData.put("mandatory_addons_to_remove", value); - - return this; - } - - public EstimateCreateSubscriptionBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public EstimateCreateSubscriptionBuilder billingAlignmentMode(BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public EstimateCreateSubscriptionBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public EstimateCreateSubscriptionBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public EstimateCreateSubscriptionBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public EstimateCreateSubscriptionBuilder clientProfileId(String value) { - - formData.put("client_profile_id", value); - - return this; - } - - public EstimateCreateSubscriptionBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateSubscriptionBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateSubscriptionBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateSubscriptionBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateSubscriptionBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateCreateSubscriptionBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateSubscriptionBuilder eventBasedAddons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateSubscriptionBuilder taxProvidersFields( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateCreateSubscriptionParams build() { - return new EstimateCreateSubscriptionParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - public SubscriptionBuilder planUnitPrice(Long value) { - - formData.put("plan_unit_price", value); - - return this; - } - - public SubscriptionBuilder planUnitPriceInDecimal(String value) { - - formData.put("plan_unit_price_in_decimal", value); - - return this; - } - - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder freePeriod(Integer value) { - - formData.put("free_period", value); - - return this; - } - - public SubscriptionBuilder freePeriodUnit(FreePeriodUnit value) { - - formData.put("free_period_unit", value); - - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionBuilder trialEndAction(TrialEndAction value) { - - formData.put("trial_end_action", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum FreePeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - FreePeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static FreePeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TrialEndAction { - SITE_DEFAULT("site_default"), - - PLAN_DEFAULT("plan_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialEndAction enumValue : TrialEndAction.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder registeredForGst(Boolean value) { - - formData.put("registered_for_gst", value); - - return this; - } - - public CustomerBuilder taxability(Taxability value) { - - formData.put("taxability", value); - - return this; - } - - public CustomerBuilder entityCode(EntityCode value) { - - formData.put("entity_code", value); - - return this; - } - - public CustomerBuilder exemptNumber(String value) { - - formData.put("exempt_number", value); - - return this; - } - - public CustomerBuilder exemptionDetails(List value) { - - formData.put("exemption_details", JsonUtil.toJson(value)); - - return this; - } - - public CustomerBuilder customerType(CustomerType value) { - - formData.put("customer_type", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - - public enum Taxability { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Taxability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Taxability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Taxability fromString(String value) { - if (value == null) return _UNKNOWN; - for (Taxability enumValue : Taxability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EntityCode { - A("a"), - - B("b"), - - C("c"), - - D("d"), - - E("e"), - - F("f"), - - G("g"), - - H("h"), - - I("i"), - - J("j"), - - K("k"), - - L("l"), - - M("m"), - - N("n"), - - P("p"), - - Q("q"), - - R("r"), - - MED_1("med1"), - - MED_2("med2"), - - /** An enum member indicating that EntityCode was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EntityCode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EntityCode fromString(String value) { - if (value == null) return _UNKNOWN; - for (EntityCode enumValue : EntityCode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum CustomerType { - RESIDENTIAL("residential"), - - BUSINESS("business"), - - SENIOR_CITIZEN("senior_citizen"), - - INDUSTRIAL("industrial"), - - /** An enum member indicating that CustomerType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CustomerType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CustomerType fromString(String value) { - if (value == null) return _UNKNOWN; - for (CustomerType enumValue : CustomerType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AddonsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { - - formData.put("service_period_in_days", value); - - return this; - } - - public EventBasedAddonsBuilder onEvent(OnEvent value) { - - formData.put("on_event", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOn(ChargeOn value) { - - formData.put("charge_on", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - - public enum OnEvent { - SUBSCRIPTION_CREATION("subscription_creation"), - - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** An enum member indicating that OnEvent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OnEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OnEvent fromString(String value) { - if (value == null) return _UNKNOWN; - for (OnEvent enumValue : OnEvent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChargeOn { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOn(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOn fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOn enumValue : ChargeOn.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateGiftSubscriptionForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateGiftSubscriptionForItemsParams.java deleted file mode 100644 index a70a1f59..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateGiftSubscriptionForItemsParams.java +++ /dev/null @@ -1,658 +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.core.models.estimate.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 EstimateGiftSubscriptionForItemsParams { - - private final Map formData; - - private EstimateGiftSubscriptionForItemsParams(EstimateGiftSubscriptionForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimateGiftSubscriptionForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateGiftSubscriptionForItemsBuilder builder() { - return new EstimateGiftSubscriptionForItemsBuilder(); - } - - public static final class EstimateGiftSubscriptionForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimateGiftSubscriptionForItemsBuilder() {} - - public EstimateGiftSubscriptionForItemsBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public EstimateGiftSubscriptionForItemsBuilder gift(GiftParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "gift[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateGiftSubscriptionForItemsBuilder gifter(GifterParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "gifter[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateGiftSubscriptionForItemsBuilder giftReceiver(GiftReceiverParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "gift_receiver[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateGiftSubscriptionForItemsBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateGiftSubscriptionForItemsBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateGiftSubscriptionForItemsBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateGiftSubscriptionForItemsParams build() { - return new EstimateGiftSubscriptionForItemsParams(this); - } - } - - public static final class GiftParams { - - private final Map formData; - - private GiftParams(GiftBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GiftParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GiftBuilder builder() { - return new GiftBuilder(); - } - - public static final class GiftBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GiftBuilder() {} - - public GiftBuilder scheduledAt(Timestamp value) { - - formData.put("scheduled_at", value); - - return this; - } - - public GiftBuilder autoClaim(Boolean value) { - - formData.put("auto_claim", value); - - return this; - } - - public GiftBuilder noExpiry(Boolean value) { - - formData.put("no_expiry", value); - - return this; - } - - public GiftBuilder claimExpiryDate(Timestamp value) { - - formData.put("claim_expiry_date", value); - - return this; - } - - public GiftParams build() { - return new GiftParams(this); - } - } - } - - public static final class GifterParams { - - private final Map formData; - - private GifterParams(GifterBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GifterParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GifterBuilder builder() { - return new GifterBuilder(); - } - - public static final class GifterBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GifterBuilder() {} - - public GifterBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public GifterBuilder signature(String value) { - - formData.put("signature", value); - - return this; - } - - public GifterBuilder note(String value) { - - formData.put("note", value); - - return this; - } - - public GifterBuilder paymentSrcId(String value) { - - formData.put("payment_src_id", value); - - return this; - } - - public GifterParams build() { - return new GifterParams(this); - } - } - } - - public static final class GiftReceiverParams { - - private final Map formData; - - private GiftReceiverParams(GiftReceiverBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GiftReceiverParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GiftReceiverBuilder builder() { - return new GiftReceiverBuilder(); - } - - public static final class GiftReceiverBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GiftReceiverBuilder() {} - - public GiftReceiverBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public GiftReceiverBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public GiftReceiverBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public GiftReceiverBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public GiftReceiverParams build() { - return new GiftReceiverParams(this); - } - } - } - - public static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateGiftSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateGiftSubscriptionParams.java deleted file mode 100644 index 71c74b53..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateGiftSubscriptionParams.java +++ /dev/null @@ -1,719 +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.core.models.estimate.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 EstimateGiftSubscriptionParams { - - private final Map formData; - - private EstimateGiftSubscriptionParams(EstimateGiftSubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimateGiftSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateGiftSubscriptionBuilder builder() { - return new EstimateGiftSubscriptionBuilder(); - } - - public static final class EstimateGiftSubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimateGiftSubscriptionBuilder() {} - - public EstimateGiftSubscriptionBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public EstimateGiftSubscriptionBuilder gift(GiftParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "gift[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateGiftSubscriptionBuilder gifter(GifterParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "gifter[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateGiftSubscriptionBuilder giftReceiver(GiftReceiverParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "gift_receiver[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateGiftSubscriptionBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateGiftSubscriptionBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateGiftSubscriptionBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateGiftSubscriptionBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateGiftSubscriptionParams build() { - return new EstimateGiftSubscriptionParams(this); - } - } - - public static final class GiftParams { - - private final Map formData; - - private GiftParams(GiftBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GiftParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GiftBuilder builder() { - return new GiftBuilder(); - } - - public static final class GiftBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GiftBuilder() {} - - public GiftBuilder scheduledAt(Timestamp value) { - - formData.put("scheduled_at", value); - - return this; - } - - public GiftBuilder autoClaim(Boolean value) { - - formData.put("auto_claim", value); - - return this; - } - - public GiftBuilder noExpiry(Boolean value) { - - formData.put("no_expiry", value); - - return this; - } - - public GiftBuilder claimExpiryDate(Timestamp value) { - - formData.put("claim_expiry_date", value); - - return this; - } - - public GiftParams build() { - return new GiftParams(this); - } - } - } - - public static final class GifterParams { - - private final Map formData; - - private GifterParams(GifterBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GifterParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GifterBuilder builder() { - return new GifterBuilder(); - } - - public static final class GifterBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GifterBuilder() {} - - public GifterBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public GifterBuilder signature(String value) { - - formData.put("signature", value); - - return this; - } - - public GifterBuilder note(String value) { - - formData.put("note", value); - - return this; - } - - public GifterBuilder paymentSrcId(String value) { - - formData.put("payment_src_id", value); - - return this; - } - - public GifterParams build() { - return new GifterParams(this); - } - } - } - - public static final class GiftReceiverParams { - - private final Map formData; - - private GiftReceiverParams(GiftReceiverBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GiftReceiverParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GiftReceiverBuilder builder() { - return new GiftReceiverBuilder(); - } - - public static final class GiftReceiverBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GiftReceiverBuilder() {} - - public GiftReceiverBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public GiftReceiverBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public GiftReceiverBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public GiftReceiverBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public GiftReceiverParams build() { - return new GiftReceiverParams(this); - } - } - } - - public static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimatePauseSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimatePauseSubscriptionParams.java deleted file mode 100644 index 5bcef4b9..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimatePauseSubscriptionParams.java +++ /dev/null @@ -1,183 +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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class EstimatePauseSubscriptionParams { - - private final Map formData; - - private EstimatePauseSubscriptionParams(EstimatePauseSubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimatePauseSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimatePauseSubscriptionBuilder builder() { - return new EstimatePauseSubscriptionBuilder(); - } - - public static final class EstimatePauseSubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimatePauseSubscriptionBuilder() {} - - public EstimatePauseSubscriptionBuilder pauseOption(PauseOption value) { - - formData.put("pause_option", value); - - return this; - } - - public EstimatePauseSubscriptionBuilder unbilledChargesHandling(UnbilledChargesHandling value) { - - formData.put("unbilled_charges_handling", value); - - return this; - } - - public EstimatePauseSubscriptionBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimatePauseSubscriptionParams build() { - return new EstimatePauseSubscriptionParams(this); - } - } - - public enum PauseOption { - IMMEDIATELY("immediately"), - - END_OF_TERM("end_of_term"), - - SPECIFIC_DATE("specific_date"), - - BILLING_CYCLES("billing_cycles"), - - /** An enum member indicating that PauseOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PauseOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PauseOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (PauseOption enumValue : PauseOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum UnbilledChargesHandling { - NO_ACTION("no_action"), - - INVOICE("invoice"), - - /** - * An enum member indicating that UnbilledChargesHandling was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - UnbilledChargesHandling(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static UnbilledChargesHandling fromString(String value) { - if (value == null) return _UNKNOWN; - for (UnbilledChargesHandling enumValue : UnbilledChargesHandling.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder pauseDate(Timestamp value) { - - formData.put("pause_date", value); - - return this; - } - - public SubscriptionBuilder resumeDate(Timestamp value) { - - formData.put("resume_date", value); - - return this; - } - - public SubscriptionBuilder skipBillingCycles(Integer value) { - - formData.put("skip_billing_cycles", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimatePaymentSchedulesParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimatePaymentSchedulesParams.java deleted file mode 100644 index d3e3333e..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimatePaymentSchedulesParams.java +++ /dev/null @@ -1,72 +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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class EstimatePaymentSchedulesParams { - - private final Map formData; - - private EstimatePaymentSchedulesParams(EstimatePaymentSchedulesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimatePaymentSchedulesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimatePaymentSchedulesBuilder builder() { - return new EstimatePaymentSchedulesBuilder(); - } - - public static final class EstimatePaymentSchedulesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimatePaymentSchedulesBuilder() {} - - public EstimatePaymentSchedulesBuilder schemeId(String value) { - - formData.put("scheme_id", value); - - return this; - } - - public EstimatePaymentSchedulesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public EstimatePaymentSchedulesBuilder invoiceId(String value) { - - formData.put("invoice_id", value); - - return this; - } - - public EstimatePaymentSchedulesBuilder paymentScheduleStartDate(Timestamp value) { - - formData.put("payment_schedule_start_date", value); - - return this; - } - - public EstimatePaymentSchedulesParams build() { - return new EstimatePaymentSchedulesParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateRegenerateInvoiceEstimateParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateRegenerateInvoiceEstimateParams.java deleted file mode 100644 index 6ac5a4c6..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateRegenerateInvoiceEstimateParams.java +++ /dev/null @@ -1,73 +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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class EstimateRegenerateInvoiceEstimateParams { - - private final Map formData; - - private EstimateRegenerateInvoiceEstimateParams( - EstimateRegenerateInvoiceEstimateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimateRegenerateInvoiceEstimateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateRegenerateInvoiceEstimateBuilder builder() { - return new EstimateRegenerateInvoiceEstimateBuilder(); - } - - public static final class EstimateRegenerateInvoiceEstimateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimateRegenerateInvoiceEstimateBuilder() {} - - public EstimateRegenerateInvoiceEstimateBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public EstimateRegenerateInvoiceEstimateBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public EstimateRegenerateInvoiceEstimateBuilder prorate(Boolean value) { - - formData.put("prorate", value); - - return this; - } - - public EstimateRegenerateInvoiceEstimateBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public EstimateRegenerateInvoiceEstimateParams build() { - return new EstimateRegenerateInvoiceEstimateParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateRenewalEstimateParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateRenewalEstimateParams.java deleted file mode 100644 index d86f79cc..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateRenewalEstimateParams.java +++ /dev/null @@ -1,70 +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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class EstimateRenewalEstimateParams { - - private final Map queryParams; - - private EstimateRenewalEstimateParams(EstimateRenewalEstimateBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public EstimateRenewalEstimateBuilder toBuilder() { - EstimateRenewalEstimateBuilder builder = new EstimateRenewalEstimateBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for EstimateRenewalEstimateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateRenewalEstimateBuilder builder() { - return new EstimateRenewalEstimateBuilder(); - } - - public static final class EstimateRenewalEstimateBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private EstimateRenewalEstimateBuilder() {} - - public EstimateRenewalEstimateBuilder includeDelayedCharges(Boolean value) { - queryParams.put("include_delayed_charges", value); - return this; - } - - public EstimateRenewalEstimateBuilder useExistingBalances(Boolean value) { - queryParams.put("use_existing_balances", value); - return this; - } - - public EstimateRenewalEstimateBuilder ignoreScheduledCancellation(Boolean value) { - queryParams.put("ignore_scheduled_cancellation", value); - return this; - } - - public EstimateRenewalEstimateBuilder ignoreScheduledChanges(Boolean value) { - queryParams.put("ignore_scheduled_changes", value); - return this; - } - - public EstimateRenewalEstimateParams build() { - return new EstimateRenewalEstimateParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateResumeSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateResumeSubscriptionParams.java deleted file mode 100644 index 78632f5b..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateResumeSubscriptionParams.java +++ /dev/null @@ -1,162 +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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class EstimateResumeSubscriptionParams { - - private final Map formData; - - private EstimateResumeSubscriptionParams(EstimateResumeSubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimateResumeSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateResumeSubscriptionBuilder builder() { - return new EstimateResumeSubscriptionBuilder(); - } - - public static final class EstimateResumeSubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimateResumeSubscriptionBuilder() {} - - public EstimateResumeSubscriptionBuilder resumeOption(ResumeOption value) { - - formData.put("resume_option", value); - - return this; - } - - public EstimateResumeSubscriptionBuilder chargesHandling(ChargesHandling value) { - - formData.put("charges_handling", value); - - return this; - } - - public EstimateResumeSubscriptionBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateResumeSubscriptionParams build() { - return new EstimateResumeSubscriptionParams(this); - } - } - - public enum ResumeOption { - IMMEDIATELY("immediately"), - - SPECIFIC_DATE("specific_date"), - - /** An enum member indicating that ResumeOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ResumeOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ResumeOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ResumeOption enumValue : ResumeOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChargesHandling { - INVOICE_IMMEDIATELY("invoice_immediately"), - - ADD_TO_UNBILLED_CHARGES("add_to_unbilled_charges"), - - /** An enum member indicating that ChargesHandling was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargesHandling(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargesHandling fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargesHandling enumValue : ChargesHandling.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder resumeDate(Timestamp value) { - - formData.put("resume_date", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateUpcomingInvoicesEstimateParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateUpcomingInvoicesEstimateParams.java deleted file mode 100644 index 492f6056..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateUpcomingInvoicesEstimateParams.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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class EstimateUpcomingInvoicesEstimateParams { - - private final Map queryParams; - - private EstimateUpcomingInvoicesEstimateParams(EstimateUpcomingInvoicesEstimateBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public EstimateUpcomingInvoicesEstimateBuilder toBuilder() { - EstimateUpcomingInvoicesEstimateBuilder builder = new EstimateUpcomingInvoicesEstimateBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for EstimateUpcomingInvoicesEstimateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateUpcomingInvoicesEstimateBuilder builder() { - return new EstimateUpcomingInvoicesEstimateBuilder(); - } - - public static final class EstimateUpcomingInvoicesEstimateBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private EstimateUpcomingInvoicesEstimateBuilder() {} - - public EstimateUpcomingInvoicesEstimateParams build() { - return new EstimateUpcomingInvoicesEstimateParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateUpdateSubscriptionForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateUpdateSubscriptionForItemsParams.java deleted file mode 100644 index 7263af81..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateUpdateSubscriptionForItemsParams.java +++ /dev/null @@ -1,1548 +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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class EstimateUpdateSubscriptionForItemsParams { - - private final Map formData; - - private EstimateUpdateSubscriptionForItemsParams( - EstimateUpdateSubscriptionForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimateUpdateSubscriptionForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateUpdateSubscriptionForItemsBuilder builder() { - return new EstimateUpdateSubscriptionForItemsBuilder(); - } - - public static final class EstimateUpdateSubscriptionForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimateUpdateSubscriptionForItemsBuilder() {} - - public EstimateUpdateSubscriptionForItemsBuilder changesScheduledAt(Timestamp value) { - - formData.put("changes_scheduled_at", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder changeOption(ChangeOption value) { - - formData.put("change_option", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder mandatoryItemsToRemove(List value) { - - formData.put("mandatory_items_to_remove", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder replaceItemsList(Boolean value) { - - formData.put("replace_items_list", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder reactivateFrom(Timestamp value) { - - formData.put("reactivate_from", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder billingAlignmentMode( - BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder replaceCouponList(Boolean value) { - - formData.put("replace_coupon_list", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder prorate(Boolean value) { - - formData.put("prorate", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder endOfTerm(Boolean value) { - - formData.put("end_of_term", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder forceTermReset(Boolean value) { - - formData.put("force_term_reset", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder reactivate(Boolean value) { - - formData.put("reactivate", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder includeDelayedCharges(Boolean value) { - - formData.put("include_delayed_charges", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder useExistingBalances(Boolean value) { - - formData.put("use_existing_balances", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder invoiceUsages(Boolean value) { - - formData.put("invoice_usages", value); - - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder billingOverride(BillingOverrideParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_override[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateUpdateSubscriptionForItemsBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateUpdateSubscriptionForItemsParams build() { - return new EstimateUpdateSubscriptionForItemsParams(this); - } - } - - public enum ChangeOption { - IMMEDIATELY("immediately"), - - END_OF_TERM("end_of_term"), - - SPECIFIC_DATE("specific_date"), - - /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChangeOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChangeOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChangeOption enumValue : ChangeOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder freePeriod(Integer value) { - - formData.put("free_period", value); - - return this; - } - - public SubscriptionBuilder freePeriodUnit(FreePeriodUnit value) { - - formData.put("free_period_unit", value); - - return this; - } - - public SubscriptionBuilder trialEndAction(TrialEndAction value) { - - formData.put("trial_end_action", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum FreePeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - FreePeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static FreePeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TrialEndAction { - SITE_DEFAULT("site_default"), - - PLAN_DEFAULT("plan_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialEndAction enumValue : TrialEndAction.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder registeredForGst(Boolean value) { - - formData.put("registered_for_gst", value); - - return this; - } - - @Deprecated - public CustomerBuilder taxability(Taxability value) { - - formData.put("taxability", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - - public enum Taxability { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Taxability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Taxability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Taxability fromString(String value) { - if (value == null) return _UNKNOWN; - for (Taxability enumValue : Taxability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingOverrideParams { - - private final Map formData; - - private BillingOverrideParams(BillingOverrideBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingOverrideParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingOverrideBuilder builder() { - return new BillingOverrideBuilder(); - } - - public static final class BillingOverrideBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingOverrideBuilder() {} - - public BillingOverrideBuilder maxExcessPaymentUsage(Long value) { - - formData.put("max_excess_payment_usage", value); - - return this; - } - - public BillingOverrideBuilder maxRefundableCreditsUsage(Long value) { - - formData.put("max_refundable_credits_usage", value); - - return this; - } - - public BillingOverrideParams build() { - return new BillingOverrideParams(this); - } - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public SubscriptionItemsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionItemsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionItemsBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { - - formData.put("charge_on_option", value); - - return this; - } - - public SubscriptionItemsBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public SubscriptionItemsBuilder prorationType(ProrationType value) { - - formData.put("proration_type", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - - 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"), - - /** 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; - } - } - - public enum ChargeOnOption { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOnOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOnOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOnOption enumValue : ChargeOnOption.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 enum ProrationType { - FULL_TERM("full_term"), - - PARTIAL_TERM("partial_term"), - - NONE("none"), - - /** An enum member indicating that ProrationType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ProrationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ProrationType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ProrationType enumValue : ProrationType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder operationType(OperationType value) { - - formData.put("operation_type", value); - - return this; - } - - public DiscountsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 enum OperationType { - ADD("add"), - - REMOVE("remove"), - - /** An enum member indicating that OperationType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OperationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OperationType fromString(String value) { - if (value == null) return _UNKNOWN; - for (OperationType enumValue : OperationType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateUpdateSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateUpdateSubscriptionParams.java deleted file mode 100644 index 5c1794e6..00000000 --- a/src/main/java/com/chargebee/v4/core/models/estimate/params/EstimateUpdateSubscriptionParams.java +++ /dev/null @@ -1,1181 +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.core.models.estimate.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class EstimateUpdateSubscriptionParams { - - private final Map formData; - - private EstimateUpdateSubscriptionParams(EstimateUpdateSubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EstimateUpdateSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EstimateUpdateSubscriptionBuilder builder() { - return new EstimateUpdateSubscriptionBuilder(); - } - - public static final class EstimateUpdateSubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EstimateUpdateSubscriptionBuilder() {} - - public EstimateUpdateSubscriptionBuilder changesScheduledAt(Timestamp value) { - - formData.put("changes_scheduled_at", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder changeOption(ChangeOption value) { - - formData.put("change_option", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder replaceAddonList(Boolean value) { - - formData.put("replace_addon_list", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder mandatoryAddonsToRemove(List value) { - - formData.put("mandatory_addons_to_remove", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder reactivateFrom(Timestamp value) { - - formData.put("reactivate_from", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder billingAlignmentMode(BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder replaceCouponList(Boolean value) { - - formData.put("replace_coupon_list", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder prorate(Boolean value) { - - formData.put("prorate", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder endOfTerm(Boolean value) { - - formData.put("end_of_term", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder forceTermReset(Boolean value) { - - formData.put("force_term_reset", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder reactivate(Boolean value) { - - formData.put("reactivate", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder includeDelayedCharges(Boolean value) { - - formData.put("include_delayed_charges", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder useExistingBalances(Boolean value) { - - formData.put("use_existing_balances", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public EstimateUpdateSubscriptionBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateUpdateSubscriptionBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateUpdateSubscriptionBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateUpdateSubscriptionBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public EstimateUpdateSubscriptionBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateUpdateSubscriptionBuilder eventBasedAddons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public EstimateUpdateSubscriptionParams build() { - return new EstimateUpdateSubscriptionParams(this); - } - } - - public enum ChangeOption { - IMMEDIATELY("immediately"), - - END_OF_TERM("end_of_term"), - - SPECIFIC_DATE("specific_date"), - - /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChangeOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChangeOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChangeOption enumValue : ChangeOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionBuilder planUnitPrice(Long value) { - - formData.put("plan_unit_price", value); - - return this; - } - - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - public SubscriptionBuilder planUnitPriceInDecimal(String value) { - - formData.put("plan_unit_price_in_decimal", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder freePeriod(Integer value) { - - formData.put("free_period", value); - - return this; - } - - public SubscriptionBuilder freePeriodUnit(FreePeriodUnit value) { - - formData.put("free_period_unit", value); - - return this; - } - - public SubscriptionBuilder trialEndAction(TrialEndAction value) { - - formData.put("trial_end_action", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum FreePeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - FreePeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static FreePeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TrialEndAction { - SITE_DEFAULT("site_default"), - - PLAN_DEFAULT("plan_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialEndAction enumValue : TrialEndAction.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder registeredForGst(Boolean value) { - - formData.put("registered_for_gst", value); - - return this; - } - - @Deprecated - public CustomerBuilder taxability(Taxability value) { - - formData.put("taxability", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - - public enum Taxability { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Taxability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Taxability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Taxability fromString(String value) { - if (value == null) return _UNKNOWN; - for (Taxability enumValue : Taxability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public AddonsBuilder prorationType(ProrationType value) { - - formData.put("proration_type", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - - public enum ProrationType { - FULL_TERM("full_term"), - - PARTIAL_TERM("partial_term"), - - NONE("none"), - - /** An enum member indicating that ProrationType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ProrationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ProrationType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ProrationType enumValue : ProrationType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { - - formData.put("service_period_in_days", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOn(ChargeOn value) { - - formData.put("charge_on", value); - - return this; - } - - public EventBasedAddonsBuilder onEvent(OnEvent value) { - - formData.put("on_event", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - - public enum ChargeOn { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOn(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOn fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOn enumValue : ChargeOn.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OnEvent { - SUBSCRIPTION_CREATION("subscription_creation"), - - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** An enum member indicating that OnEvent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OnEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OnEvent fromString(String value) { - if (value == null) return _UNKNOWN; - for (OnEvent enumValue : OnEvent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportAddonsParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportAddonsParams.java deleted file mode 100644 index 5d72fd3b..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportAddonsParams.java +++ /dev/null @@ -1,1081 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportAddonsParams { - - private final Map formData; - - private ExportAddonsParams(ExportAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportAddonsBuilder builder() { - return new ExportAddonsBuilder(); - } - - public static final class ExportAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportAddonsBuilder() {} - - public ExportAddonsBuilder currencyCode(CurrencyCodeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "currency_code[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportAddonsBuilder addon(AddonParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "addon[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportAddonsParams build() { - return new ExportAddonsParams(this); - } - } - - public static final class CurrencyCodeParams { - - private final Map formData; - - private CurrencyCodeParams(CurrencyCodeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CurrencyCodeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CurrencyCodeBuilder builder() { - return new CurrencyCodeBuilder(); - } - - public static final class CurrencyCodeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CurrencyCodeBuilder() {} - - public CurrencyCodeBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CurrencyCodeBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CurrencyCodeBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CurrencyCodeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CurrencyCodeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CurrencyCodeParams build() { - return new CurrencyCodeParams(this); - } - } - } - - public static final class AddonParams { - - private final Map formData; - - private AddonParams(AddonBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonBuilder builder() { - return new AddonBuilder(); - } - - public static final class AddonBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonBuilder() {} - - public AddonBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public AddonBuilder name(NameParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "name[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public AddonBuilder chargeType(ChargeTypeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "charge_type[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public AddonBuilder price(PriceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "price[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public AddonBuilder period(PeriodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "period[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public AddonBuilder periodUnit(PeriodUnitParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "period_unit[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public AddonBuilder status(StatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public AddonBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public AddonBuilder channel(ChannelParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "channel[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public AddonParams build() { - return new AddonParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class NameParams { - - private final Map formData; - - private NameParams(NameBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NameParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NameBuilder builder() { - return new NameBuilder(); - } - - public static final class NameBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NameBuilder() {} - - public NameBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public NameBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public NameBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public NameBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public NameBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public NameParams build() { - return new NameParams(this); - } - } - } - - public static final class ChargeTypeParams { - - private final Map formData; - - private ChargeTypeParams(ChargeTypeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargeTypeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargeTypeBuilder builder() { - return new ChargeTypeBuilder(); - } - - public static final class ChargeTypeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargeTypeBuilder() {} - - public ChargeTypeBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ChargeTypeBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ChargeTypeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ChargeTypeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ChargeTypeParams build() { - return new ChargeTypeParams(this); - } - } - - public enum Is { - RECURRING("recurring"), - - NON_RECURRING("non_recurring"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - RECURRING("recurring"), - - NON_RECURRING("non_recurring"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PriceParams { - - private final Map formData; - - private PriceParams(PriceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PriceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PriceBuilder builder() { - return new PriceBuilder(); - } - - public static final class PriceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PriceBuilder() {} - - public PriceBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PriceBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PriceBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public PriceBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public PriceBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public PriceBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public PriceBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public PriceParams build() { - return new PriceParams(this); - } - } - } - - public static final class PeriodParams { - - private final Map formData; - - private PeriodParams(PeriodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PeriodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PeriodBuilder builder() { - return new PeriodBuilder(); - } - - public static final class PeriodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PeriodBuilder() {} - - public PeriodBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PeriodBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PeriodBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public PeriodBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public PeriodBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public PeriodBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public PeriodBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public PeriodParams build() { - return new PeriodParams(this); - } - } - } - - public static final class PeriodUnitParams { - - private final Map formData; - - private PeriodUnitParams(PeriodUnitBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PeriodUnitParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PeriodUnitBuilder builder() { - return new PeriodUnitBuilder(); - } - - public static final class PeriodUnitBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PeriodUnitBuilder() {} - - public PeriodUnitBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public PeriodUnitBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public PeriodUnitBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PeriodUnitBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PeriodUnitParams build() { - return new PeriodUnitParams(this); - } - } - - public enum Is { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - NOT_APPLICABLE("not_applicable"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - NOT_APPLICABLE("not_applicable"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class StatusParams { - - private final Map formData; - - private StatusParams(StatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatusBuilder builder() { - return new StatusBuilder(); - } - - public static final class StatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatusBuilder() {} - - public StatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public StatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public StatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public StatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public StatusParams build() { - return new StatusParams(this); - } - } - - public enum Is { - ACTIVE("active"), - - ARCHIVED("archived"), - - DELETED("deleted"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - ACTIVE("active"), - - ARCHIVED("archived"), - - DELETED("deleted"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } - - public static final class ChannelParams { - - private final Map formData; - - private ChannelParams(ChannelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChannelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChannelBuilder builder() { - return new ChannelBuilder(); - } - - public static final class ChannelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChannelBuilder() {} - - public ChannelBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ChannelBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ChannelBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ChannelBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ChannelParams build() { - return new ChannelParams(this); - } - } - - public enum Is { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportAttachedItemsParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportAttachedItemsParams.java deleted file mode 100644 index da8655a7..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportAttachedItemsParams.java +++ /dev/null @@ -1,780 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportAttachedItemsParams { - - private final Map formData; - - private ExportAttachedItemsParams(ExportAttachedItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportAttachedItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportAttachedItemsBuilder builder() { - return new ExportAttachedItemsBuilder(); - } - - public static final class ExportAttachedItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportAttachedItemsBuilder() {} - - public ExportAttachedItemsBuilder itemType(ItemTypeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_type[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportAttachedItemsBuilder attachedItem(AttachedItemParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "attached_item[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportAttachedItemsParams build() { - return new ExportAttachedItemsParams(this); - } - } - - public static final class ItemTypeParams { - - private final Map formData; - - private ItemTypeParams(ItemTypeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTypeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTypeBuilder builder() { - return new ItemTypeBuilder(); - } - - public static final class ItemTypeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTypeBuilder() {} - - public ItemTypeBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ItemTypeBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ItemTypeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ItemTypeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ItemTypeParams build() { - return new ItemTypeParams(this); - } - } - - public enum Is { - PLAN("plan"), - - ADDON("addon"), - - CHARGE("charge"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - PLAN("plan"), - - ADDON("addon"), - - CHARGE("charge"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AttachedItemParams { - - private final Map formData; - - private AttachedItemParams(AttachedItemBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AttachedItemParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AttachedItemBuilder builder() { - return new AttachedItemBuilder(); - } - - public static final class AttachedItemBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AttachedItemBuilder() {} - - public AttachedItemBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public AttachedItemBuilder itemId(ItemIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public AttachedItemBuilder type(TypeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "type[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public AttachedItemBuilder chargeOnEvent(ChargeOnEventParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "charge_on_event[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public AttachedItemBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public AttachedItemBuilder parentItemId(ParentItemIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "parent_item_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public AttachedItemParams build() { - return new AttachedItemParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class ItemIdParams { - - private final Map formData; - - private ItemIdParams(ItemIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemIdBuilder builder() { - return new ItemIdBuilder(); - } - - public static final class ItemIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemIdBuilder() {} - - public ItemIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ItemIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ItemIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ItemIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ItemIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ItemIdParams build() { - return new ItemIdParams(this); - } - } - } - - public static final class TypeParams { - - private final Map formData; - - private TypeParams(TypeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TypeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TypeBuilder builder() { - return new TypeBuilder(); - } - - public static final class TypeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TypeBuilder() {} - - public TypeBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public TypeBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public TypeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public TypeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public TypeParams build() { - return new TypeParams(this); - } - } - - public enum Is { - RECOMMENDED("recommended"), - - MANDATORY("mandatory"), - - OPTIONAL("optional"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - RECOMMENDED("recommended"), - - MANDATORY("mandatory"), - - OPTIONAL("optional"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ChargeOnEventParams { - - private final Map formData; - - private ChargeOnEventParams(ChargeOnEventBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargeOnEventParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargeOnEventBuilder builder() { - return new ChargeOnEventBuilder(); - } - - public static final class ChargeOnEventBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargeOnEventBuilder() {} - - public ChargeOnEventBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ChargeOnEventBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ChargeOnEventBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ChargeOnEventBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ChargeOnEventParams build() { - return new ChargeOnEventParams(this); - } - } - - public enum Is { - 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 Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - 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 IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } - - public static final class ParentItemIdParams { - - private final Map formData; - - private ParentItemIdParams(ParentItemIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ParentItemIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ParentItemIdBuilder builder() { - return new ParentItemIdBuilder(); - } - - public static final class ParentItemIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ParentItemIdBuilder() {} - - public ParentItemIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ParentItemIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ParentItemIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ParentItemIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ParentItemIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ParentItemIdParams build() { - return new ParentItemIdParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportCouponsParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportCouponsParams.java deleted file mode 100644 index 4eae80e7..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportCouponsParams.java +++ /dev/null @@ -1,978 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportCouponsParams { - - private final Map formData; - - private ExportCouponsParams(ExportCouponsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportCouponsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportCouponsBuilder builder() { - return new ExportCouponsBuilder(); - } - - public static final class ExportCouponsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportCouponsBuilder() {} - - public ExportCouponsBuilder currencyCode(CurrencyCodeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "currency_code[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportCouponsBuilder coupon(CouponParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "coupon[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportCouponsParams build() { - return new ExportCouponsParams(this); - } - } - - public static final class CurrencyCodeParams { - - private final Map formData; - - private CurrencyCodeParams(CurrencyCodeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CurrencyCodeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CurrencyCodeBuilder builder() { - return new CurrencyCodeBuilder(); - } - - public static final class CurrencyCodeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CurrencyCodeBuilder() {} - - public CurrencyCodeBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CurrencyCodeBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CurrencyCodeBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CurrencyCodeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CurrencyCodeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CurrencyCodeParams build() { - return new CurrencyCodeParams(this); - } - } - } - - public static final class CouponParams { - - private final Map formData; - - private CouponParams(CouponBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponBuilder builder() { - return new CouponBuilder(); - } - - public static final class CouponBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponBuilder() {} - - public CouponBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CouponBuilder name(NameParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "name[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CouponBuilder discountType(DiscountTypeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "discount_type[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CouponBuilder durationType(DurationTypeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "duration_type[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CouponBuilder status(StatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CouponBuilder applyOn(ApplyOnParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "apply_on[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CouponBuilder createdAt(CreatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "created_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CouponBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CouponParams build() { - return new CouponParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class NameParams { - - private final Map formData; - - private NameParams(NameBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NameParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NameBuilder builder() { - return new NameBuilder(); - } - - public static final class NameBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NameBuilder() {} - - public NameBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public NameBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public NameBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public NameBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public NameBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public NameParams build() { - return new NameParams(this); - } - } - } - - public static final class DiscountTypeParams { - - private final Map formData; - - private DiscountTypeParams(DiscountTypeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountTypeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountTypeBuilder builder() { - return new DiscountTypeBuilder(); - } - - public static final class DiscountTypeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountTypeBuilder() {} - - public DiscountTypeBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public DiscountTypeBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public DiscountTypeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public DiscountTypeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public DiscountTypeParams build() { - return new DiscountTypeParams(this); - } - } - - public enum Is { - FIXED_AMOUNT("fixed_amount"), - - PERCENTAGE("percentage"), - - OFFER_QUANTITY("offer_quantity"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - FIXED_AMOUNT("fixed_amount"), - - PERCENTAGE("percentage"), - - OFFER_QUANTITY("offer_quantity"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DurationTypeParams { - - private final Map formData; - - private DurationTypeParams(DurationTypeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DurationTypeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DurationTypeBuilder builder() { - return new DurationTypeBuilder(); - } - - public static final class DurationTypeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DurationTypeBuilder() {} - - public DurationTypeBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public DurationTypeBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public DurationTypeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public DurationTypeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public DurationTypeParams build() { - return new DurationTypeParams(this); - } - } - - public enum Is { - ONE_TIME("one_time"), - - FOREVER("forever"), - - LIMITED_PERIOD("limited_period"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - ONE_TIME("one_time"), - - FOREVER("forever"), - - LIMITED_PERIOD("limited_period"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class StatusParams { - - private final Map formData; - - private StatusParams(StatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatusBuilder builder() { - return new StatusBuilder(); - } - - public static final class StatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatusBuilder() {} - - public StatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public StatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public StatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public StatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public StatusParams build() { - return new StatusParams(this); - } - } - - public enum Is { - ACTIVE("active"), - - EXPIRED("expired"), - - ARCHIVED("archived"), - - DELETED("deleted"), - - FUTURE("future"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - ACTIVE("active"), - - EXPIRED("expired"), - - ARCHIVED("archived"), - - DELETED("deleted"), - - FUTURE("future"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ApplyOnParams { - - private final Map formData; - - private ApplyOnParams(ApplyOnBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ApplyOnParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ApplyOnBuilder builder() { - return new ApplyOnBuilder(); - } - - public static final class ApplyOnBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ApplyOnBuilder() {} - - public ApplyOnBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ApplyOnBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ApplyOnBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ApplyOnBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ApplyOnParams build() { - return new ApplyOnParams(this); - } - } - - public enum Is { - 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 Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - 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 IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CreatedAtParams { - - private final Map formData; - - private CreatedAtParams(CreatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreatedAtBuilder builder() { - return new CreatedAtBuilder(); - } - - public static final class CreatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreatedAtBuilder() {} - - public CreatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public CreatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public CreatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public CreatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public CreatedAtParams build() { - return new CreatedAtParams(this); - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportCreditNotesParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportCreditNotesParams.java deleted file mode 100644 index 5c8630b6..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportCreditNotesParams.java +++ /dev/null @@ -1,1782 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportCreditNotesParams { - - private final Map formData; - - private ExportCreditNotesParams(ExportCreditNotesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportCreditNotesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportCreditNotesBuilder builder() { - return new ExportCreditNotesBuilder(); - } - - public static final class ExportCreditNotesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportCreditNotesBuilder() {} - - public ExportCreditNotesBuilder creditNote(CreditNoteParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "credit_note[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportCreditNotesParams build() { - return new ExportCreditNotesParams(this); - } - } - - public static final class CreditNoteParams { - - private final Map formData; - - private CreditNoteParams(CreditNoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditNoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNoteBuilder builder() { - return new CreditNoteBuilder(); - } - - public static final class CreditNoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditNoteBuilder() {} - - public CreditNoteBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder customerId(CustomerIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder subscriptionId(SubscriptionIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder referenceInvoiceId(ReferenceInvoiceIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "reference_invoice_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder type(TypeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "type[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder reasonCode(ReasonCodeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "reason_code[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder createReasonCode(CreateReasonCodeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "create_reason_code[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder status(StatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder date(DateParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "date[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder total(TotalParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "total[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder priceType(PriceTypeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "price_type[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder amountAllocated(AmountAllocatedParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "amount_allocated[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder amountRefunded(AmountRefundedParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "amount_refunded[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder amountAvailable(AmountAvailableParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "amount_available[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder voidedAt(VoidedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "voided_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteBuilder channel(ChannelParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "channel[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CreditNoteParams build() { - return new CreditNoteParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class CustomerIdParams { - - private final Map formData; - - private CustomerIdParams(CustomerIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerIdBuilder builder() { - return new CustomerIdBuilder(); - } - - public static final class CustomerIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerIdBuilder() {} - - public CustomerIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CustomerIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CustomerIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CustomerIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CustomerIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CustomerIdParams build() { - return new CustomerIdParams(this); - } - } - } - - public static final class SubscriptionIdParams { - - private final Map formData; - - private SubscriptionIdParams(SubscriptionIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionIdBuilder builder() { - return new SubscriptionIdBuilder(); - } - - public static final class SubscriptionIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionIdBuilder() {} - - public SubscriptionIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public SubscriptionIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public SubscriptionIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public SubscriptionIdBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public SubscriptionIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public SubscriptionIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public SubscriptionIdParams build() { - return new SubscriptionIdParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ReferenceInvoiceIdParams { - - private final Map formData; - - private ReferenceInvoiceIdParams(ReferenceInvoiceIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ReferenceInvoiceIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ReferenceInvoiceIdBuilder builder() { - return new ReferenceInvoiceIdBuilder(); - } - - public static final class ReferenceInvoiceIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ReferenceInvoiceIdBuilder() {} - - public ReferenceInvoiceIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ReferenceInvoiceIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ReferenceInvoiceIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ReferenceInvoiceIdBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public ReferenceInvoiceIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ReferenceInvoiceIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ReferenceInvoiceIdParams build() { - return new ReferenceInvoiceIdParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TypeParams { - - private final Map formData; - - private TypeParams(TypeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TypeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TypeBuilder builder() { - return new TypeBuilder(); - } - - public static final class TypeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TypeBuilder() {} - - public TypeBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public TypeBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public TypeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public TypeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public TypeParams build() { - return new TypeParams(this); - } - } - - public enum Is { - ADJUSTMENT("adjustment"), - - REFUNDABLE("refundable"), - - STORE("store"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - ADJUSTMENT("adjustment"), - - REFUNDABLE("refundable"), - - STORE("store"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ReasonCodeParams { - - private final Map formData; - - private ReasonCodeParams(ReasonCodeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ReasonCodeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ReasonCodeBuilder builder() { - return new ReasonCodeBuilder(); - } - - public static final class ReasonCodeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ReasonCodeBuilder() {} - - public ReasonCodeBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ReasonCodeBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ReasonCodeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ReasonCodeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ReasonCodeParams build() { - return new ReasonCodeParams(this); - } - } - - public enum Is { - WRITE_OFF("write_off"), - - SUBSCRIPTION_CHANGE("subscription_change"), - - SUBSCRIPTION_CANCELLATION("subscription_cancellation"), - - SUBSCRIPTION_PAUSE("subscription_pause"), - - CHARGEBACK("chargeback"), - - PRODUCT_UNSATISFACTORY("product_unsatisfactory"), - - SERVICE_UNSATISFACTORY("service_unsatisfactory"), - - ORDER_CHANGE("order_change"), - - ORDER_CANCELLATION("order_cancellation"), - - WAIVER("waiver"), - - OTHER("other"), - - FRAUDULENT("fraudulent"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - WRITE_OFF("write_off"), - - SUBSCRIPTION_CHANGE("subscription_change"), - - SUBSCRIPTION_CANCELLATION("subscription_cancellation"), - - SUBSCRIPTION_PAUSE("subscription_pause"), - - CHARGEBACK("chargeback"), - - PRODUCT_UNSATISFACTORY("product_unsatisfactory"), - - SERVICE_UNSATISFACTORY("service_unsatisfactory"), - - ORDER_CHANGE("order_change"), - - ORDER_CANCELLATION("order_cancellation"), - - WAIVER("waiver"), - - OTHER("other"), - - FRAUDULENT("fraudulent"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CreateReasonCodeParams { - - private final Map formData; - - private CreateReasonCodeParams(CreateReasonCodeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreateReasonCodeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreateReasonCodeBuilder builder() { - return new CreateReasonCodeBuilder(); - } - - public static final class CreateReasonCodeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreateReasonCodeBuilder() {} - - public CreateReasonCodeBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CreateReasonCodeBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CreateReasonCodeBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CreateReasonCodeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CreateReasonCodeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CreateReasonCodeParams build() { - return new CreateReasonCodeParams(this); - } - } - } - - public static final class StatusParams { - - private final Map formData; - - private StatusParams(StatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatusBuilder builder() { - return new StatusBuilder(); - } - - public static final class StatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatusBuilder() {} - - public StatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public StatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public StatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public StatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public StatusParams build() { - return new StatusParams(this); - } - } - - public enum Is { - ADJUSTED("adjusted"), - - REFUNDED("refunded"), - - REFUND_DUE("refund_due"), - - VOIDED("voided"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - ADJUSTED("adjusted"), - - REFUNDED("refunded"), - - REFUND_DUE("refund_due"), - - VOIDED("voided"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DateParams { - - private final Map formData; - - private DateParams(DateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DateBuilder builder() { - return new DateBuilder(); - } - - public static final class DateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DateBuilder() {} - - public DateBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public DateBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public DateBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public DateBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public DateParams build() { - return new DateParams(this); - } - } - } - - public static final class TotalParams { - - private final Map formData; - - private TotalParams(TotalBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TotalParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TotalBuilder builder() { - return new TotalBuilder(); - } - - public static final class TotalBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TotalBuilder() {} - - public TotalBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public TotalBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public TotalBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public TotalBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public TotalBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public TotalBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public TotalBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public TotalParams build() { - return new TotalParams(this); - } - } - } - - public static final class PriceTypeParams { - - private final Map formData; - - private PriceTypeParams(PriceTypeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PriceTypeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PriceTypeBuilder builder() { - return new PriceTypeBuilder(); - } - - public static final class PriceTypeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PriceTypeBuilder() {} - - public PriceTypeBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public PriceTypeBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public PriceTypeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PriceTypeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PriceTypeParams build() { - return new PriceTypeParams(this); - } - } - - public enum Is { - TAX_EXCLUSIVE("tax_exclusive"), - - TAX_INCLUSIVE("tax_inclusive"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - TAX_EXCLUSIVE("tax_exclusive"), - - TAX_INCLUSIVE("tax_inclusive"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AmountAllocatedParams { - - private final Map formData; - - private AmountAllocatedParams(AmountAllocatedBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AmountAllocatedParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AmountAllocatedBuilder builder() { - return new AmountAllocatedBuilder(); - } - - public static final class AmountAllocatedBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AmountAllocatedBuilder() {} - - public AmountAllocatedBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public AmountAllocatedBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public AmountAllocatedBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public AmountAllocatedBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public AmountAllocatedBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public AmountAllocatedBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public AmountAllocatedBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public AmountAllocatedParams build() { - return new AmountAllocatedParams(this); - } - } - } - - public static final class AmountRefundedParams { - - private final Map formData; - - private AmountRefundedParams(AmountRefundedBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AmountRefundedParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AmountRefundedBuilder builder() { - return new AmountRefundedBuilder(); - } - - public static final class AmountRefundedBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AmountRefundedBuilder() {} - - public AmountRefundedBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public AmountRefundedBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public AmountRefundedBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public AmountRefundedBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public AmountRefundedBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public AmountRefundedBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public AmountRefundedBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public AmountRefundedParams build() { - return new AmountRefundedParams(this); - } - } - } - - public static final class AmountAvailableParams { - - private final Map formData; - - private AmountAvailableParams(AmountAvailableBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AmountAvailableParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AmountAvailableBuilder builder() { - return new AmountAvailableBuilder(); - } - - public static final class AmountAvailableBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AmountAvailableBuilder() {} - - public AmountAvailableBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public AmountAvailableBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public AmountAvailableBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public AmountAvailableBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public AmountAvailableBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public AmountAvailableBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public AmountAvailableBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public AmountAvailableParams build() { - return new AmountAvailableParams(this); - } - } - } - - public static final class VoidedAtParams { - - private final Map formData; - - private VoidedAtParams(VoidedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for VoidedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static VoidedAtBuilder builder() { - return new VoidedAtBuilder(); - } - - public static final class VoidedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private VoidedAtBuilder() {} - - public VoidedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public VoidedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public VoidedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public VoidedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public VoidedAtParams build() { - return new VoidedAtParams(this); - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } - - public static final class ChannelParams { - - private final Map formData; - - private ChannelParams(ChannelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChannelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChannelBuilder builder() { - return new ChannelBuilder(); - } - - public static final class ChannelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChannelBuilder() {} - - public ChannelBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ChannelBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ChannelBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ChannelBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ChannelParams build() { - return new ChannelParams(this); - } - } - - public enum Is { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportCustomersParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportCustomersParams.java deleted file mode 100644 index ee35eb10..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportCustomersParams.java +++ /dev/null @@ -1,1731 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportCustomersParams { - - private final Map formData; - - private ExportCustomersParams(ExportCustomersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportCustomersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportCustomersBuilder builder() { - return new ExportCustomersBuilder(); - } - - public static final class ExportCustomersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportCustomersBuilder() {} - - public ExportCustomersBuilder exportType(ExportType value) { - - formData.put("export_type", value); - - return this; - } - - public ExportCustomersBuilder businessEntityId(BusinessEntityIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "business_entity_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportCustomersBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportCustomersBuilder relationship(RelationshipParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "relationship[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportCustomersParams build() { - return new ExportCustomersParams(this); - } - } - - public enum ExportType { - DATA("data"), - - IMPORT_FRIENDLY_DATA("import_friendly_data"), - - /** An enum member indicating that ExportType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ExportType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ExportType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ExportType enumValue : ExportType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class BusinessEntityIdParams { - - private final Map formData; - - private BusinessEntityIdParams(BusinessEntityIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BusinessEntityIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BusinessEntityIdBuilder builder() { - return new BusinessEntityIdBuilder(); - } - - public static final class BusinessEntityIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BusinessEntityIdBuilder() {} - - public BusinessEntityIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public BusinessEntityIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public BusinessEntityIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public BusinessEntityIdParams build() { - return new BusinessEntityIdParams(this); - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder firstName(FirstNameParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "first_name[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder lastName(LastNameParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "last_name[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder email(EmailParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "email[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder company(CompanyParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "company[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder phone(PhoneParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "phone[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder autoCollection(AutoCollectionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "auto_collection[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder taxability(TaxabilityParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "taxability[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder createdAt(CreatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "created_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder offlinePaymentMethod(OfflinePaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "offline_payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder autoCloseInvoices(AutoCloseInvoicesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "auto_close_invoices[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder channel(ChannelParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "channel[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class FirstNameParams { - - private final Map formData; - - private FirstNameParams(FirstNameBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for FirstNameParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static FirstNameBuilder builder() { - return new FirstNameBuilder(); - } - - public static final class FirstNameBuilder { - private final Map formData = new LinkedHashMap<>(); - - private FirstNameBuilder() {} - - public FirstNameBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public FirstNameBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public FirstNameBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public FirstNameBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public FirstNameParams build() { - return new FirstNameParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class LastNameParams { - - private final Map formData; - - private LastNameParams(LastNameBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for LastNameParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static LastNameBuilder builder() { - return new LastNameBuilder(); - } - - public static final class LastNameBuilder { - private final Map formData = new LinkedHashMap<>(); - - private LastNameBuilder() {} - - public LastNameBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public LastNameBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public LastNameBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public LastNameBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public LastNameParams build() { - return new LastNameParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class EmailParams { - - private final Map formData; - - private EmailParams(EmailBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EmailParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EmailBuilder builder() { - return new EmailBuilder(); - } - - public static final class EmailBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EmailBuilder() {} - - public EmailBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public EmailBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public EmailBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public EmailBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public EmailParams build() { - return new EmailParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CompanyParams { - - private final Map formData; - - private CompanyParams(CompanyBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CompanyParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CompanyBuilder builder() { - return new CompanyBuilder(); - } - - public static final class CompanyBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CompanyBuilder() {} - - public CompanyBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CompanyBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CompanyBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CompanyBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public CompanyParams build() { - return new CompanyParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PhoneParams { - - private final Map formData; - - private PhoneParams(PhoneBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PhoneParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PhoneBuilder builder() { - return new PhoneBuilder(); - } - - public static final class PhoneBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PhoneBuilder() {} - - public PhoneBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PhoneBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PhoneBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public PhoneBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public PhoneParams build() { - return new PhoneParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AutoCollectionParams { - - private final Map formData; - - private AutoCollectionParams(AutoCollectionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AutoCollectionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AutoCollectionBuilder builder() { - return new AutoCollectionBuilder(); - } - - public static final class AutoCollectionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AutoCollectionBuilder() {} - - public AutoCollectionBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public AutoCollectionBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public AutoCollectionBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public AutoCollectionBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public AutoCollectionParams build() { - return new AutoCollectionParams(this); - } - } - - public enum Is { - ON("on"), - - OFF("off"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - ON("on"), - - OFF("off"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TaxabilityParams { - - private final Map formData; - - private TaxabilityParams(TaxabilityBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxabilityParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxabilityBuilder builder() { - return new TaxabilityBuilder(); - } - - public static final class TaxabilityBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxabilityBuilder() {} - - public TaxabilityBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public TaxabilityBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public TaxabilityBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public TaxabilityBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public TaxabilityParams build() { - return new TaxabilityParams(this); - } - } - - public enum Is { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CreatedAtParams { - - private final Map formData; - - private CreatedAtParams(CreatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreatedAtBuilder builder() { - return new CreatedAtBuilder(); - } - - public static final class CreatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreatedAtBuilder() {} - - public CreatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public CreatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public CreatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public CreatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public CreatedAtParams build() { - return new CreatedAtParams(this); - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } - - public static final class OfflinePaymentMethodParams { - - private final Map formData; - - private OfflinePaymentMethodParams(OfflinePaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OfflinePaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OfflinePaymentMethodBuilder builder() { - return new OfflinePaymentMethodBuilder(); - } - - public static final class OfflinePaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OfflinePaymentMethodBuilder() {} - - public OfflinePaymentMethodBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public OfflinePaymentMethodBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public OfflinePaymentMethodBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public OfflinePaymentMethodBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public OfflinePaymentMethodParams build() { - return new OfflinePaymentMethodParams(this); - } - } - - public enum Is { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AutoCloseInvoicesParams { - - private final Map formData; - - private AutoCloseInvoicesParams(AutoCloseInvoicesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AutoCloseInvoicesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AutoCloseInvoicesBuilder builder() { - return new AutoCloseInvoicesBuilder(); - } - - public static final class AutoCloseInvoicesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AutoCloseInvoicesBuilder() {} - - public AutoCloseInvoicesBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public AutoCloseInvoicesParams build() { - return new AutoCloseInvoicesParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ChannelParams { - - private final Map formData; - - private ChannelParams(ChannelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChannelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChannelBuilder builder() { - return new ChannelBuilder(); - } - - public static final class ChannelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChannelBuilder() {} - - public ChannelBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ChannelBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ChannelBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ChannelBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ChannelParams build() { - return new ChannelParams(this); - } - } - - public enum Is { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class RelationshipParams { - - private final Map formData; - - private RelationshipParams(RelationshipBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RelationshipParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RelationshipBuilder builder() { - return new RelationshipBuilder(); - } - - public static final class RelationshipBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RelationshipBuilder() {} - - public RelationshipBuilder parentId(ParentIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "parent_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public RelationshipBuilder paymentOwnerId(PaymentOwnerIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_owner_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public RelationshipBuilder invoiceOwnerId(InvoiceOwnerIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "invoice_owner_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public RelationshipParams build() { - return new RelationshipParams(this); - } - } - } - - public static final class ParentIdParams { - - private final Map formData; - - private ParentIdParams(ParentIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ParentIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ParentIdBuilder builder() { - return new ParentIdBuilder(); - } - - public static final class ParentIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ParentIdBuilder() {} - - public ParentIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ParentIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ParentIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ParentIdParams build() { - return new ParentIdParams(this); - } - } - } - - public static final class PaymentOwnerIdParams { - - private final Map formData; - - private PaymentOwnerIdParams(PaymentOwnerIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentOwnerIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentOwnerIdBuilder builder() { - return new PaymentOwnerIdBuilder(); - } - - public static final class PaymentOwnerIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentOwnerIdBuilder() {} - - public PaymentOwnerIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PaymentOwnerIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PaymentOwnerIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public PaymentOwnerIdParams build() { - return new PaymentOwnerIdParams(this); - } - } - } - - public static final class InvoiceOwnerIdParams { - - private final Map formData; - - private InvoiceOwnerIdParams(InvoiceOwnerIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceOwnerIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceOwnerIdBuilder builder() { - return new InvoiceOwnerIdBuilder(); - } - - public static final class InvoiceOwnerIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceOwnerIdBuilder() {} - - public InvoiceOwnerIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public InvoiceOwnerIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public InvoiceOwnerIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public InvoiceOwnerIdParams build() { - return new InvoiceOwnerIdParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportDeferredRevenueParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportDeferredRevenueParams.java deleted file mode 100644 index 74529b77..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportDeferredRevenueParams.java +++ /dev/null @@ -1,5043 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportDeferredRevenueParams { - - private final Map formData; - - private ExportDeferredRevenueParams(ExportDeferredRevenueBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportDeferredRevenueParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportDeferredRevenueBuilder builder() { - return new ExportDeferredRevenueBuilder(); - } - - public static final class ExportDeferredRevenueBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportDeferredRevenueBuilder() {} - - public ExportDeferredRevenueBuilder reportBy(ReportBy value) { - - formData.put("report_by", value); - - return this; - } - - public ExportDeferredRevenueBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public ExportDeferredRevenueBuilder reportFromMonth(Integer value) { - - formData.put("report_from_month", value); - - return this; - } - - public ExportDeferredRevenueBuilder reportFromYear(Integer value) { - - formData.put("report_from_year", value); - - return this; - } - - public ExportDeferredRevenueBuilder reportToMonth(Integer value) { - - formData.put("report_to_month", value); - - return this; - } - - public ExportDeferredRevenueBuilder reportToYear(Integer value) { - - formData.put("report_to_year", value); - - return this; - } - - public ExportDeferredRevenueBuilder includeDiscounts(Boolean value) { - - formData.put("include_discounts", value); - - return this; - } - - public ExportDeferredRevenueBuilder paymentOwner(PaymentOwnerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_owner[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportDeferredRevenueBuilder itemId(ItemIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportDeferredRevenueBuilder itemPriceId(ItemPriceIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_price_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportDeferredRevenueBuilder cancelReasonCode(CancelReasonCodeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "cancel_reason_code[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportDeferredRevenueBuilder businessEntityId(BusinessEntityIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "business_entity_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportDeferredRevenueBuilder invoice(InvoiceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "invoice[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportDeferredRevenueBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportDeferredRevenueBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportDeferredRevenueBuilder relationship(RelationshipParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "relationship[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportDeferredRevenueParams build() { - return new ExportDeferredRevenueParams(this); - } - } - - public enum ReportBy { - CUSTOMER("customer"), - - INVOICE("invoice"), - - PRODUCT("product"), - - SUBSCRIPTION("subscription"), - - /** An enum member indicating that ReportBy was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ReportBy(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ReportBy fromString(String value) { - if (value == null) return _UNKNOWN; - for (ReportBy enumValue : ReportBy.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class PaymentOwnerParams { - - private final Map formData; - - private PaymentOwnerParams(PaymentOwnerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentOwnerParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentOwnerBuilder builder() { - return new PaymentOwnerBuilder(); - } - - public static final class PaymentOwnerBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentOwnerBuilder() {} - - public PaymentOwnerBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PaymentOwnerBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PaymentOwnerBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public PaymentOwnerBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PaymentOwnerBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PaymentOwnerParams build() { - return new PaymentOwnerParams(this); - } - } - } - - public static final class ItemIdParams { - - private final Map formData; - - private ItemIdParams(ItemIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemIdBuilder builder() { - return new ItemIdBuilder(); - } - - public static final class ItemIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemIdBuilder() {} - - public ItemIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ItemIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ItemIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ItemIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ItemIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ItemIdParams build() { - return new ItemIdParams(this); - } - } - } - - public static final class ItemPriceIdParams { - - private final Map formData; - - private ItemPriceIdParams(ItemPriceIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemPriceIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPriceIdBuilder builder() { - return new ItemPriceIdBuilder(); - } - - public static final class ItemPriceIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemPriceIdBuilder() {} - - public ItemPriceIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ItemPriceIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ItemPriceIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ItemPriceIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ItemPriceIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ItemPriceIdParams build() { - return new ItemPriceIdParams(this); - } - } - } - - public static final class CancelReasonCodeParams { - - private final Map formData; - - private CancelReasonCodeParams(CancelReasonCodeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CancelReasonCodeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CancelReasonCodeBuilder builder() { - return new CancelReasonCodeBuilder(); - } - - public static final class CancelReasonCodeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CancelReasonCodeBuilder() {} - - public CancelReasonCodeBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CancelReasonCodeBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CancelReasonCodeBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CancelReasonCodeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CancelReasonCodeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CancelReasonCodeParams build() { - return new CancelReasonCodeParams(this); - } - } - } - - public static final class BusinessEntityIdParams { - - private final Map formData; - - private BusinessEntityIdParams(BusinessEntityIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BusinessEntityIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BusinessEntityIdBuilder builder() { - return new BusinessEntityIdBuilder(); - } - - public static final class BusinessEntityIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BusinessEntityIdBuilder() {} - - public BusinessEntityIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public BusinessEntityIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public BusinessEntityIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public BusinessEntityIdParams build() { - return new BusinessEntityIdParams(this); - } - } - } - - public static final class InvoiceParams { - - private final Map formData; - - private InvoiceParams(InvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceBuilder builder() { - return new InvoiceBuilder(); - } - - public static final class InvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceBuilder() {} - - public InvoiceBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder recurring(RecurringParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "recurring[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder status(StatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder priceType(PriceTypeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "price_type[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder date(DateParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "date[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder paidAt(PaidAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "paid_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder total(TotalParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "total[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder amountPaid(AmountPaidParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "amount_paid[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder amountAdjusted(AmountAdjustedParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "amount_adjusted[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder creditsApplied(CreditsAppliedParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "credits_applied[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder amountDue(AmountDueParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "amount_due[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder dunningStatus(DunningStatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "dunning_status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder channel(ChannelParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "channel[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceParams build() { - return new InvoiceParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class RecurringParams { - - private final Map formData; - - private RecurringParams(RecurringBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RecurringParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RecurringBuilder builder() { - return new RecurringBuilder(); - } - - public static final class RecurringBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RecurringBuilder() {} - - public RecurringBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public RecurringParams build() { - return new RecurringParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class StatusParams { - - private final Map formData; - - private StatusParams(StatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatusBuilder builder() { - return new StatusBuilder(); - } - - public static final class StatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatusBuilder() {} - - public StatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public StatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public StatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public StatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public StatusParams build() { - return new StatusParams(this); - } - } - - public enum Is { - PAID("paid"), - - POSTED("posted"), - - PAYMENT_DUE("payment_due"), - - NOT_PAID("not_paid"), - - VOIDED("voided"), - - PENDING("pending"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - PAID("paid"), - - POSTED("posted"), - - PAYMENT_DUE("payment_due"), - - NOT_PAID("not_paid"), - - VOIDED("voided"), - - PENDING("pending"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PriceTypeParams { - - private final Map formData; - - private PriceTypeParams(PriceTypeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PriceTypeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PriceTypeBuilder builder() { - return new PriceTypeBuilder(); - } - - public static final class PriceTypeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PriceTypeBuilder() {} - - public PriceTypeBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public PriceTypeBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public PriceTypeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PriceTypeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PriceTypeParams build() { - return new PriceTypeParams(this); - } - } - - public enum Is { - TAX_EXCLUSIVE("tax_exclusive"), - - TAX_INCLUSIVE("tax_inclusive"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - TAX_EXCLUSIVE("tax_exclusive"), - - TAX_INCLUSIVE("tax_inclusive"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DateParams { - - private final Map formData; - - private DateParams(DateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DateBuilder builder() { - return new DateBuilder(); - } - - public static final class DateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DateBuilder() {} - - public DateBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public DateBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public DateBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public DateBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public DateParams build() { - return new DateParams(this); - } - } - } - - public static final class PaidAtParams { - - private final Map formData; - - private PaidAtParams(PaidAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaidAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaidAtBuilder builder() { - return new PaidAtBuilder(); - } - - public static final class PaidAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaidAtBuilder() {} - - public PaidAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public PaidAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public PaidAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public PaidAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public PaidAtParams build() { - return new PaidAtParams(this); - } - } - } - - public static final class TotalParams { - - private final Map formData; - - private TotalParams(TotalBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TotalParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TotalBuilder builder() { - return new TotalBuilder(); - } - - public static final class TotalBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TotalBuilder() {} - - public TotalBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public TotalBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public TotalBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public TotalBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public TotalBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public TotalBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public TotalBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public TotalParams build() { - return new TotalParams(this); - } - } - } - - public static final class AmountPaidParams { - - private final Map formData; - - private AmountPaidParams(AmountPaidBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AmountPaidParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AmountPaidBuilder builder() { - return new AmountPaidBuilder(); - } - - public static final class AmountPaidBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AmountPaidBuilder() {} - - public AmountPaidBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public AmountPaidBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public AmountPaidBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public AmountPaidBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public AmountPaidBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public AmountPaidBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public AmountPaidBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public AmountPaidParams build() { - return new AmountPaidParams(this); - } - } - } - - public static final class AmountAdjustedParams { - - private final Map formData; - - private AmountAdjustedParams(AmountAdjustedBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AmountAdjustedParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AmountAdjustedBuilder builder() { - return new AmountAdjustedBuilder(); - } - - public static final class AmountAdjustedBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AmountAdjustedBuilder() {} - - public AmountAdjustedBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public AmountAdjustedBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public AmountAdjustedBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public AmountAdjustedBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public AmountAdjustedBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public AmountAdjustedBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public AmountAdjustedBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public AmountAdjustedParams build() { - return new AmountAdjustedParams(this); - } - } - } - - public static final class CreditsAppliedParams { - - private final Map formData; - - private CreditsAppliedParams(CreditsAppliedBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditsAppliedParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditsAppliedBuilder builder() { - return new CreditsAppliedBuilder(); - } - - public static final class CreditsAppliedBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditsAppliedBuilder() {} - - public CreditsAppliedBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CreditsAppliedBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CreditsAppliedBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public CreditsAppliedBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public CreditsAppliedBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public CreditsAppliedBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public CreditsAppliedBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public CreditsAppliedParams build() { - return new CreditsAppliedParams(this); - } - } - } - - public static final class AmountDueParams { - - private final Map formData; - - private AmountDueParams(AmountDueBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AmountDueParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AmountDueBuilder builder() { - return new AmountDueBuilder(); - } - - public static final class AmountDueBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AmountDueBuilder() {} - - public AmountDueBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public AmountDueBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public AmountDueBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public AmountDueBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public AmountDueBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public AmountDueBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public AmountDueBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public AmountDueParams build() { - return new AmountDueParams(this); - } - } - } - - public static final class DunningStatusParams { - - private final Map formData; - - private DunningStatusParams(DunningStatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DunningStatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DunningStatusBuilder builder() { - return new DunningStatusBuilder(); - } - - public static final class DunningStatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DunningStatusBuilder() {} - - public DunningStatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public DunningStatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public DunningStatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public DunningStatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public DunningStatusBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public DunningStatusParams build() { - return new DunningStatusParams(this); - } - } - - public enum Is { - IN_PROGRESS("in_progress"), - - EXHAUSTED("exhausted"), - - STOPPED("stopped"), - - SUCCESS("success"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - IN_PROGRESS("in_progress"), - - EXHAUSTED("exhausted"), - - STOPPED("stopped"), - - SUCCESS("success"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } - - public static final class ChannelParams { - - private final Map formData; - - private ChannelParams(ChannelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChannelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChannelBuilder builder() { - return new ChannelBuilder(); - } - - public static final class ChannelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChannelBuilder() {} - - public ChannelBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ChannelBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ChannelBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ChannelBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ChannelParams build() { - return new ChannelParams(this); - } - } - - public enum Is { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(ExportIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder customerId(CustomerIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder status(ExportStatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder cancelReason(CancelReasonParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "cancel_reason[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder remainingBillingCycles(RemainingBillingCyclesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "remaining_billing_cycles[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder createdAt(CreatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "created_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder activatedAt(ActivatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "activated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder nextBillingAt(NextBillingAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "next_billing_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder cancelledAt(CancelledAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "cancelled_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder hasScheduledChanges(HasScheduledChangesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "has_scheduled_changes[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder updatedAt(ExportUpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "offline_payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder autoCloseInvoices(AutoCloseInvoicesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "auto_close_invoices[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder channel(ExportChannelParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "channel[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder planId(PlanIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "plan_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - } - - public static final class ExportIdParams { - - private final Map formData; - - private ExportIdParams(ExportIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportIdBuilder builder() { - return new ExportIdBuilder(); - } - - public static final class ExportIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportIdBuilder() {} - - public ExportIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ExportIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ExportIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ExportIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ExportIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ExportIdParams build() { - return new ExportIdParams(this); - } - } - } - - public static final class CustomerIdParams { - - private final Map formData; - - private CustomerIdParams(CustomerIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerIdBuilder builder() { - return new CustomerIdBuilder(); - } - - public static final class CustomerIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerIdBuilder() {} - - public CustomerIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CustomerIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CustomerIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CustomerIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CustomerIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CustomerIdParams build() { - return new CustomerIdParams(this); - } - } - } - - public static final class ExportStatusParams { - - private final Map formData; - - private ExportStatusParams(ExportStatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportStatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportStatusBuilder builder() { - return new ExportStatusBuilder(); - } - - public static final class ExportStatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportStatusBuilder() {} - - public ExportStatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ExportStatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ExportStatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ExportStatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ExportStatusParams build() { - return new ExportStatusParams(this); - } - } - - public enum Is { - FUTURE("future"), - - IN_TRIAL("in_trial"), - - ACTIVE("active"), - - NON_RENEWING("non_renewing"), - - PAUSED("paused"), - - CANCELLED("cancelled"), - - TRANSFERRED("transferred"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - FUTURE("future"), - - IN_TRIAL("in_trial"), - - ACTIVE("active"), - - NON_RENEWING("non_renewing"), - - PAUSED("paused"), - - CANCELLED("cancelled"), - - TRANSFERRED("transferred"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CancelReasonParams { - - private final Map formData; - - private CancelReasonParams(CancelReasonBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CancelReasonParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CancelReasonBuilder builder() { - return new CancelReasonBuilder(); - } - - public static final class CancelReasonBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CancelReasonBuilder() {} - - public CancelReasonBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public CancelReasonBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public CancelReasonBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CancelReasonBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CancelReasonBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public CancelReasonParams build() { - return new CancelReasonParams(this); - } - } - - public enum Is { - NOT_PAID("not_paid"), - - NO_CARD("no_card"), - - FRAUD_REVIEW_FAILED("fraud_review_failed"), - - NON_COMPLIANT_EU_CUSTOMER("non_compliant_eu_customer"), - - TAX_CALCULATION_FAILED("tax_calculation_failed"), - - CURRENCY_INCOMPATIBLE_WITH_GATEWAY("currency_incompatible_with_gateway"), - - NON_COMPLIANT_CUSTOMER("non_compliant_customer"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - NOT_PAID("not_paid"), - - NO_CARD("no_card"), - - FRAUD_REVIEW_FAILED("fraud_review_failed"), - - NON_COMPLIANT_EU_CUSTOMER("non_compliant_eu_customer"), - - TAX_CALCULATION_FAILED("tax_calculation_failed"), - - CURRENCY_INCOMPATIBLE_WITH_GATEWAY("currency_incompatible_with_gateway"), - - NON_COMPLIANT_CUSTOMER("non_compliant_customer"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class RemainingBillingCyclesParams { - - private final Map formData; - - private RemainingBillingCyclesParams(RemainingBillingCyclesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RemainingBillingCyclesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RemainingBillingCyclesBuilder builder() { - return new RemainingBillingCyclesBuilder(); - } - - public static final class RemainingBillingCyclesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RemainingBillingCyclesBuilder() {} - - public RemainingBillingCyclesBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public RemainingBillingCyclesBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public RemainingBillingCyclesBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public RemainingBillingCyclesBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public RemainingBillingCyclesBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public RemainingBillingCyclesBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public RemainingBillingCyclesBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public RemainingBillingCyclesBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public RemainingBillingCyclesParams build() { - return new RemainingBillingCyclesParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CreatedAtParams { - - private final Map formData; - - private CreatedAtParams(CreatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreatedAtBuilder builder() { - return new CreatedAtBuilder(); - } - - public static final class CreatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreatedAtBuilder() {} - - public CreatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public CreatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public CreatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public CreatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public CreatedAtParams build() { - return new CreatedAtParams(this); - } - } - } - - public static final class ActivatedAtParams { - - private final Map formData; - - private ActivatedAtParams(ActivatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ActivatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ActivatedAtBuilder builder() { - return new ActivatedAtBuilder(); - } - - public static final class ActivatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ActivatedAtBuilder() {} - - public ActivatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public ActivatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public ActivatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public ActivatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public ActivatedAtBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public ActivatedAtParams build() { - return new ActivatedAtParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class NextBillingAtParams { - - private final Map formData; - - private NextBillingAtParams(NextBillingAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NextBillingAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NextBillingAtBuilder builder() { - return new NextBillingAtBuilder(); - } - - public static final class NextBillingAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NextBillingAtBuilder() {} - - public NextBillingAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public NextBillingAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public NextBillingAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public NextBillingAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public NextBillingAtParams build() { - return new NextBillingAtParams(this); - } - } - } - - public static final class CancelledAtParams { - - private final Map formData; - - private CancelledAtParams(CancelledAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CancelledAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CancelledAtBuilder builder() { - return new CancelledAtBuilder(); - } - - public static final class CancelledAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CancelledAtBuilder() {} - - public CancelledAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public CancelledAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public CancelledAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public CancelledAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public CancelledAtParams build() { - return new CancelledAtParams(this); - } - } - } - - public static final class HasScheduledChangesParams { - - private final Map formData; - - private HasScheduledChangesParams(HasScheduledChangesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HasScheduledChangesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HasScheduledChangesBuilder builder() { - return new HasScheduledChangesBuilder(); - } - - public static final class HasScheduledChangesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HasScheduledChangesBuilder() {} - - public HasScheduledChangesBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public HasScheduledChangesParams build() { - return new HasScheduledChangesParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ExportUpdatedAtParams { - - private final Map formData; - - private ExportUpdatedAtParams(ExportUpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportUpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportUpdatedAtBuilder builder() { - return new ExportUpdatedAtBuilder(); - } - - public static final class ExportUpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportUpdatedAtBuilder() {} - - public ExportUpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public ExportUpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public ExportUpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public ExportUpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public ExportUpdatedAtParams build() { - return new ExportUpdatedAtParams(this); - } - } - } - - public static final class OfflinePaymentMethodParams { - - private final Map formData; - - private OfflinePaymentMethodParams(OfflinePaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OfflinePaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OfflinePaymentMethodBuilder builder() { - return new OfflinePaymentMethodBuilder(); - } - - public static final class OfflinePaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OfflinePaymentMethodBuilder() {} - - public OfflinePaymentMethodBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public OfflinePaymentMethodBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public OfflinePaymentMethodBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public OfflinePaymentMethodBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public OfflinePaymentMethodParams build() { - return new OfflinePaymentMethodParams(this); - } - } - - public enum Is { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AutoCloseInvoicesParams { - - private final Map formData; - - private AutoCloseInvoicesParams(AutoCloseInvoicesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AutoCloseInvoicesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AutoCloseInvoicesBuilder builder() { - return new AutoCloseInvoicesBuilder(); - } - - public static final class AutoCloseInvoicesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AutoCloseInvoicesBuilder() {} - - public AutoCloseInvoicesBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public AutoCloseInvoicesParams build() { - return new AutoCloseInvoicesParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ExportChannelParams { - - private final Map formData; - - private ExportChannelParams(ExportChannelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportChannelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportChannelBuilder builder() { - return new ExportChannelBuilder(); - } - - public static final class ExportChannelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportChannelBuilder() {} - - public ExportChannelBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ExportChannelBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ExportChannelBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ExportChannelBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ExportChannelParams build() { - return new ExportChannelParams(this); - } - } - - public enum Is { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PlanIdParams { - - private final Map formData; - - private PlanIdParams(PlanIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PlanIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PlanIdBuilder builder() { - return new PlanIdBuilder(); - } - - public static final class PlanIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PlanIdBuilder() {} - - public PlanIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PlanIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PlanIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public PlanIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PlanIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PlanIdParams build() { - return new PlanIdParams(this); - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(ExportId2Params value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder firstName(FirstNameParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "first_name[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder lastName(LastNameParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "last_name[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder email(EmailParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "email[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder company(CompanyParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "company[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder phone(PhoneParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "phone[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder autoCollection(AutoCollectionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "auto_collection[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder taxability(TaxabilityParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "taxability[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder createdAt(ExportCreatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "created_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder updatedAt(ExportUpdatedAt2Params value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder offlinePaymentMethod(ExportOfflinePaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "offline_payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder autoCloseInvoices(ExportAutoCloseInvoicesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "auto_close_invoices[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder channel(ExportChannel2Params value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "channel[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } - - public static final class ExportId2Params { - - private final Map formData; - - private ExportId2Params(ExportId2Builder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportId2Params. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportId2Builder builder() { - return new ExportId2Builder(); - } - - public static final class ExportId2Builder { - private final Map formData = new LinkedHashMap<>(); - - private ExportId2Builder() {} - - public ExportId2Builder is(String value) { - - formData.put("is", value); - - return this; - } - - public ExportId2Builder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ExportId2Builder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ExportId2Builder in(String value) { - - formData.put("in", value); - - return this; - } - - public ExportId2Builder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ExportId2Params build() { - return new ExportId2Params(this); - } - } - } - - public static final class FirstNameParams { - - private final Map formData; - - private FirstNameParams(FirstNameBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for FirstNameParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static FirstNameBuilder builder() { - return new FirstNameBuilder(); - } - - public static final class FirstNameBuilder { - private final Map formData = new LinkedHashMap<>(); - - private FirstNameBuilder() {} - - public FirstNameBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public FirstNameBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public FirstNameBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public FirstNameBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public FirstNameParams build() { - return new FirstNameParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class LastNameParams { - - private final Map formData; - - private LastNameParams(LastNameBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for LastNameParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static LastNameBuilder builder() { - return new LastNameBuilder(); - } - - public static final class LastNameBuilder { - private final Map formData = new LinkedHashMap<>(); - - private LastNameBuilder() {} - - public LastNameBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public LastNameBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public LastNameBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public LastNameBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public LastNameParams build() { - return new LastNameParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class EmailParams { - - private final Map formData; - - private EmailParams(EmailBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EmailParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EmailBuilder builder() { - return new EmailBuilder(); - } - - public static final class EmailBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EmailBuilder() {} - - public EmailBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public EmailBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public EmailBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public EmailBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public EmailParams build() { - return new EmailParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CompanyParams { - - private final Map formData; - - private CompanyParams(CompanyBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CompanyParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CompanyBuilder builder() { - return new CompanyBuilder(); - } - - public static final class CompanyBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CompanyBuilder() {} - - public CompanyBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CompanyBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CompanyBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CompanyBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public CompanyParams build() { - return new CompanyParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PhoneParams { - - private final Map formData; - - private PhoneParams(PhoneBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PhoneParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PhoneBuilder builder() { - return new PhoneBuilder(); - } - - public static final class PhoneBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PhoneBuilder() {} - - public PhoneBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PhoneBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PhoneBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public PhoneBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public PhoneParams build() { - return new PhoneParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AutoCollectionParams { - - private final Map formData; - - private AutoCollectionParams(AutoCollectionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AutoCollectionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AutoCollectionBuilder builder() { - return new AutoCollectionBuilder(); - } - - public static final class AutoCollectionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AutoCollectionBuilder() {} - - public AutoCollectionBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public AutoCollectionBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public AutoCollectionBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public AutoCollectionBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public AutoCollectionParams build() { - return new AutoCollectionParams(this); - } - } - - public enum Is { - ON("on"), - - OFF("off"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - ON("on"), - - OFF("off"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TaxabilityParams { - - private final Map formData; - - private TaxabilityParams(TaxabilityBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxabilityParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxabilityBuilder builder() { - return new TaxabilityBuilder(); - } - - public static final class TaxabilityBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxabilityBuilder() {} - - public TaxabilityBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public TaxabilityBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public TaxabilityBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public TaxabilityBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public TaxabilityParams build() { - return new TaxabilityParams(this); - } - } - - public enum Is { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ExportCreatedAtParams { - - private final Map formData; - - private ExportCreatedAtParams(ExportCreatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportCreatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportCreatedAtBuilder builder() { - return new ExportCreatedAtBuilder(); - } - - public static final class ExportCreatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportCreatedAtBuilder() {} - - public ExportCreatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public ExportCreatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public ExportCreatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public ExportCreatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public ExportCreatedAtParams build() { - return new ExportCreatedAtParams(this); - } - } - } - - public static final class ExportUpdatedAt2Params { - - private final Map formData; - - private ExportUpdatedAt2Params(ExportUpdatedAt2Builder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportUpdatedAt2Params. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportUpdatedAt2Builder builder() { - return new ExportUpdatedAt2Builder(); - } - - public static final class ExportUpdatedAt2Builder { - private final Map formData = new LinkedHashMap<>(); - - private ExportUpdatedAt2Builder() {} - - public ExportUpdatedAt2Builder after(String value) { - - formData.put("after", value); - - return this; - } - - public ExportUpdatedAt2Builder before(String value) { - - formData.put("before", value); - - return this; - } - - public ExportUpdatedAt2Builder on(String value) { - - formData.put("on", value); - - return this; - } - - public ExportUpdatedAt2Builder between(String value) { - - formData.put("between", value); - - return this; - } - - public ExportUpdatedAt2Params build() { - return new ExportUpdatedAt2Params(this); - } - } - } - - public static final class ExportOfflinePaymentMethodParams { - - private final Map formData; - - private ExportOfflinePaymentMethodParams(ExportOfflinePaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportOfflinePaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportOfflinePaymentMethodBuilder builder() { - return new ExportOfflinePaymentMethodBuilder(); - } - - public static final class ExportOfflinePaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportOfflinePaymentMethodBuilder() {} - - public ExportOfflinePaymentMethodBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ExportOfflinePaymentMethodBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ExportOfflinePaymentMethodBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ExportOfflinePaymentMethodBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ExportOfflinePaymentMethodParams build() { - return new ExportOfflinePaymentMethodParams(this); - } - } - - public enum Is { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ExportAutoCloseInvoicesParams { - - private final Map formData; - - private ExportAutoCloseInvoicesParams(ExportAutoCloseInvoicesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportAutoCloseInvoicesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportAutoCloseInvoicesBuilder builder() { - return new ExportAutoCloseInvoicesBuilder(); - } - - public static final class ExportAutoCloseInvoicesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportAutoCloseInvoicesBuilder() {} - - public ExportAutoCloseInvoicesBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ExportAutoCloseInvoicesParams build() { - return new ExportAutoCloseInvoicesParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ExportChannel2Params { - - private final Map formData; - - private ExportChannel2Params(ExportChannel2Builder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportChannel2Params. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportChannel2Builder builder() { - return new ExportChannel2Builder(); - } - - public static final class ExportChannel2Builder { - private final Map formData = new LinkedHashMap<>(); - - private ExportChannel2Builder() {} - - public ExportChannel2Builder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ExportChannel2Builder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ExportChannel2Builder in(String value) { - - formData.put("in", value); - - return this; - } - - public ExportChannel2Builder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ExportChannel2Params build() { - return new ExportChannel2Params(this); - } - } - - public enum Is { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class RelationshipParams { - - private final Map formData; - - private RelationshipParams(RelationshipBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RelationshipParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RelationshipBuilder builder() { - return new RelationshipBuilder(); - } - - public static final class RelationshipBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RelationshipBuilder() {} - - public RelationshipBuilder parentId(ParentIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "parent_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public RelationshipBuilder paymentOwnerId(PaymentOwnerIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_owner_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public RelationshipBuilder invoiceOwnerId(InvoiceOwnerIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "invoice_owner_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public RelationshipParams build() { - return new RelationshipParams(this); - } - } - } - - public static final class ParentIdParams { - - private final Map formData; - - private ParentIdParams(ParentIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ParentIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ParentIdBuilder builder() { - return new ParentIdBuilder(); - } - - public static final class ParentIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ParentIdBuilder() {} - - public ParentIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ParentIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ParentIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ParentIdParams build() { - return new ParentIdParams(this); - } - } - } - - public static final class PaymentOwnerIdParams { - - private final Map formData; - - private PaymentOwnerIdParams(PaymentOwnerIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentOwnerIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentOwnerIdBuilder builder() { - return new PaymentOwnerIdBuilder(); - } - - public static final class PaymentOwnerIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentOwnerIdBuilder() {} - - public PaymentOwnerIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PaymentOwnerIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PaymentOwnerIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public PaymentOwnerIdParams build() { - return new PaymentOwnerIdParams(this); - } - } - } - - public static final class InvoiceOwnerIdParams { - - private final Map formData; - - private InvoiceOwnerIdParams(InvoiceOwnerIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceOwnerIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceOwnerIdBuilder builder() { - return new InvoiceOwnerIdBuilder(); - } - - public static final class InvoiceOwnerIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceOwnerIdBuilder() {} - - public InvoiceOwnerIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public InvoiceOwnerIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public InvoiceOwnerIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public InvoiceOwnerIdParams build() { - return new InvoiceOwnerIdParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportDifferentialPricesParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportDifferentialPricesParams.java deleted file mode 100644 index f4342f3d..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportDifferentialPricesParams.java +++ /dev/null @@ -1,388 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportDifferentialPricesParams { - - private final Map formData; - - private ExportDifferentialPricesParams(ExportDifferentialPricesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportDifferentialPricesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportDifferentialPricesBuilder builder() { - return new ExportDifferentialPricesBuilder(); - } - - public static final class ExportDifferentialPricesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportDifferentialPricesBuilder() {} - - public ExportDifferentialPricesBuilder itemId(ItemIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportDifferentialPricesBuilder differentialPrice(DifferentialPriceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "differential_price[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportDifferentialPricesParams build() { - return new ExportDifferentialPricesParams(this); - } - } - - public static final class ItemIdParams { - - private final Map formData; - - private ItemIdParams(ItemIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemIdBuilder builder() { - return new ItemIdBuilder(); - } - - public static final class ItemIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemIdBuilder() {} - - public ItemIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ItemIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ItemIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ItemIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ItemIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ItemIdParams build() { - return new ItemIdParams(this); - } - } - } - - public static final class DifferentialPriceParams { - - private final Map formData; - - private DifferentialPriceParams(DifferentialPriceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DifferentialPriceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DifferentialPriceBuilder builder() { - return new DifferentialPriceBuilder(); - } - - public static final class DifferentialPriceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DifferentialPriceBuilder() {} - - public DifferentialPriceBuilder itemPriceId(ItemPriceIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_price_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public DifferentialPriceBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public DifferentialPriceBuilder parentItemId(ParentItemIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "parent_item_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public DifferentialPriceParams build() { - return new DifferentialPriceParams(this); - } - } - } - - public static final class ItemPriceIdParams { - - private final Map formData; - - private ItemPriceIdParams(ItemPriceIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemPriceIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPriceIdBuilder builder() { - return new ItemPriceIdBuilder(); - } - - public static final class ItemPriceIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemPriceIdBuilder() {} - - public ItemPriceIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ItemPriceIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ItemPriceIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ItemPriceIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ItemPriceIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ItemPriceIdParams build() { - return new ItemPriceIdParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class ParentItemIdParams { - - private final Map formData; - - private ParentItemIdParams(ParentItemIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ParentItemIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ParentItemIdBuilder builder() { - return new ParentItemIdBuilder(); - } - - public static final class ParentItemIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ParentItemIdBuilder() {} - - public ParentItemIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ParentItemIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ParentItemIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ParentItemIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ParentItemIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ParentItemIdParams build() { - return new ParentItemIdParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportInvoicesParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportInvoicesParams.java deleted file mode 100644 index 60ade2df..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportInvoicesParams.java +++ /dev/null @@ -1,1719 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportInvoicesParams { - - private final Map formData; - - private ExportInvoicesParams(ExportInvoicesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportInvoicesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportInvoicesBuilder builder() { - return new ExportInvoicesBuilder(); - } - - public static final class ExportInvoicesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportInvoicesBuilder() {} - - public ExportInvoicesBuilder paymentOwner(PaymentOwnerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_owner[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportInvoicesBuilder invoice(InvoiceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "invoice[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportInvoicesParams build() { - return new ExportInvoicesParams(this); - } - } - - public static final class PaymentOwnerParams { - - private final Map formData; - - private PaymentOwnerParams(PaymentOwnerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentOwnerParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentOwnerBuilder builder() { - return new PaymentOwnerBuilder(); - } - - public static final class PaymentOwnerBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentOwnerBuilder() {} - - public PaymentOwnerBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PaymentOwnerBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PaymentOwnerBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public PaymentOwnerBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PaymentOwnerBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PaymentOwnerParams build() { - return new PaymentOwnerParams(this); - } - } - } - - public static final class InvoiceParams { - - private final Map formData; - - private InvoiceParams(InvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceBuilder builder() { - return new InvoiceBuilder(); - } - - public static final class InvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceBuilder() {} - - public InvoiceBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder subscriptionId(SubscriptionIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder customerId(CustomerIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder recurring(RecurringParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "recurring[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder status(StatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder priceType(PriceTypeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "price_type[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder date(DateParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "date[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder paidAt(PaidAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "paid_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder total(TotalParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "total[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder amountPaid(AmountPaidParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "amount_paid[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder amountAdjusted(AmountAdjustedParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "amount_adjusted[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder creditsApplied(CreditsAppliedParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "credits_applied[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder amountDue(AmountDueParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "amount_due[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder dunningStatus(DunningStatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "dunning_status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder channel(ChannelParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "channel[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceParams build() { - return new InvoiceParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class SubscriptionIdParams { - - private final Map formData; - - private SubscriptionIdParams(SubscriptionIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionIdBuilder builder() { - return new SubscriptionIdBuilder(); - } - - public static final class SubscriptionIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionIdBuilder() {} - - public SubscriptionIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public SubscriptionIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public SubscriptionIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public SubscriptionIdBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public SubscriptionIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public SubscriptionIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public SubscriptionIdParams build() { - return new SubscriptionIdParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CustomerIdParams { - - private final Map formData; - - private CustomerIdParams(CustomerIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerIdBuilder builder() { - return new CustomerIdBuilder(); - } - - public static final class CustomerIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerIdBuilder() {} - - public CustomerIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CustomerIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CustomerIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CustomerIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CustomerIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CustomerIdParams build() { - return new CustomerIdParams(this); - } - } - } - - public static final class RecurringParams { - - private final Map formData; - - private RecurringParams(RecurringBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RecurringParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RecurringBuilder builder() { - return new RecurringBuilder(); - } - - public static final class RecurringBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RecurringBuilder() {} - - public RecurringBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public RecurringParams build() { - return new RecurringParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class StatusParams { - - private final Map formData; - - private StatusParams(StatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatusBuilder builder() { - return new StatusBuilder(); - } - - public static final class StatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatusBuilder() {} - - public StatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public StatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public StatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public StatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public StatusParams build() { - return new StatusParams(this); - } - } - - public enum Is { - PAID("paid"), - - POSTED("posted"), - - PAYMENT_DUE("payment_due"), - - NOT_PAID("not_paid"), - - VOIDED("voided"), - - PENDING("pending"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - PAID("paid"), - - POSTED("posted"), - - PAYMENT_DUE("payment_due"), - - NOT_PAID("not_paid"), - - VOIDED("voided"), - - PENDING("pending"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PriceTypeParams { - - private final Map formData; - - private PriceTypeParams(PriceTypeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PriceTypeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PriceTypeBuilder builder() { - return new PriceTypeBuilder(); - } - - public static final class PriceTypeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PriceTypeBuilder() {} - - public PriceTypeBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public PriceTypeBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public PriceTypeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PriceTypeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PriceTypeParams build() { - return new PriceTypeParams(this); - } - } - - public enum Is { - TAX_EXCLUSIVE("tax_exclusive"), - - TAX_INCLUSIVE("tax_inclusive"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - TAX_EXCLUSIVE("tax_exclusive"), - - TAX_INCLUSIVE("tax_inclusive"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DateParams { - - private final Map formData; - - private DateParams(DateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DateBuilder builder() { - return new DateBuilder(); - } - - public static final class DateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DateBuilder() {} - - public DateBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public DateBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public DateBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public DateBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public DateParams build() { - return new DateParams(this); - } - } - } - - public static final class PaidAtParams { - - private final Map formData; - - private PaidAtParams(PaidAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaidAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaidAtBuilder builder() { - return new PaidAtBuilder(); - } - - public static final class PaidAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaidAtBuilder() {} - - public PaidAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public PaidAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public PaidAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public PaidAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public PaidAtParams build() { - return new PaidAtParams(this); - } - } - } - - public static final class TotalParams { - - private final Map formData; - - private TotalParams(TotalBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TotalParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TotalBuilder builder() { - return new TotalBuilder(); - } - - public static final class TotalBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TotalBuilder() {} - - public TotalBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public TotalBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public TotalBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public TotalBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public TotalBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public TotalBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public TotalBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public TotalParams build() { - return new TotalParams(this); - } - } - } - - public static final class AmountPaidParams { - - private final Map formData; - - private AmountPaidParams(AmountPaidBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AmountPaidParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AmountPaidBuilder builder() { - return new AmountPaidBuilder(); - } - - public static final class AmountPaidBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AmountPaidBuilder() {} - - public AmountPaidBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public AmountPaidBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public AmountPaidBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public AmountPaidBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public AmountPaidBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public AmountPaidBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public AmountPaidBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public AmountPaidParams build() { - return new AmountPaidParams(this); - } - } - } - - public static final class AmountAdjustedParams { - - private final Map formData; - - private AmountAdjustedParams(AmountAdjustedBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AmountAdjustedParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AmountAdjustedBuilder builder() { - return new AmountAdjustedBuilder(); - } - - public static final class AmountAdjustedBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AmountAdjustedBuilder() {} - - public AmountAdjustedBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public AmountAdjustedBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public AmountAdjustedBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public AmountAdjustedBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public AmountAdjustedBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public AmountAdjustedBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public AmountAdjustedBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public AmountAdjustedParams build() { - return new AmountAdjustedParams(this); - } - } - } - - public static final class CreditsAppliedParams { - - private final Map formData; - - private CreditsAppliedParams(CreditsAppliedBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditsAppliedParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditsAppliedBuilder builder() { - return new CreditsAppliedBuilder(); - } - - public static final class CreditsAppliedBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditsAppliedBuilder() {} - - public CreditsAppliedBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CreditsAppliedBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CreditsAppliedBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public CreditsAppliedBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public CreditsAppliedBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public CreditsAppliedBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public CreditsAppliedBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public CreditsAppliedParams build() { - return new CreditsAppliedParams(this); - } - } - } - - public static final class AmountDueParams { - - private final Map formData; - - private AmountDueParams(AmountDueBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AmountDueParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AmountDueBuilder builder() { - return new AmountDueBuilder(); - } - - public static final class AmountDueBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AmountDueBuilder() {} - - public AmountDueBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public AmountDueBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public AmountDueBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public AmountDueBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public AmountDueBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public AmountDueBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public AmountDueBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public AmountDueParams build() { - return new AmountDueParams(this); - } - } - } - - public static final class DunningStatusParams { - - private final Map formData; - - private DunningStatusParams(DunningStatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DunningStatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DunningStatusBuilder builder() { - return new DunningStatusBuilder(); - } - - public static final class DunningStatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DunningStatusBuilder() {} - - public DunningStatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public DunningStatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public DunningStatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public DunningStatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public DunningStatusBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public DunningStatusParams build() { - return new DunningStatusParams(this); - } - } - - public enum Is { - IN_PROGRESS("in_progress"), - - EXHAUSTED("exhausted"), - - STOPPED("stopped"), - - SUCCESS("success"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - IN_PROGRESS("in_progress"), - - EXHAUSTED("exhausted"), - - STOPPED("stopped"), - - SUCCESS("success"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } - - public static final class ChannelParams { - - private final Map formData; - - private ChannelParams(ChannelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChannelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChannelBuilder builder() { - return new ChannelBuilder(); - } - - public static final class ChannelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChannelBuilder() {} - - public ChannelBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ChannelBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ChannelBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ChannelBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ChannelParams build() { - return new ChannelParams(this); - } - } - - public enum Is { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportItemFamiliesParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportItemFamiliesParams.java deleted file mode 100644 index b1a33717..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportItemFamiliesParams.java +++ /dev/null @@ -1,451 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportItemFamiliesParams { - - private final Map formData; - - private ExportItemFamiliesParams(ExportItemFamiliesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportItemFamiliesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportItemFamiliesBuilder builder() { - return new ExportItemFamiliesBuilder(); - } - - public static final class ExportItemFamiliesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportItemFamiliesBuilder() {} - - public ExportItemFamiliesBuilder businessEntityId(BusinessEntityIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "business_entity_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportItemFamiliesBuilder includeSiteLevelResources( - IncludeSiteLevelResourcesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "include_site_level_resources[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportItemFamiliesBuilder itemFamily(ItemFamilyParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_family[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportItemFamiliesParams build() { - return new ExportItemFamiliesParams(this); - } - } - - public static final class BusinessEntityIdParams { - - private final Map formData; - - private BusinessEntityIdParams(BusinessEntityIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BusinessEntityIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BusinessEntityIdBuilder builder() { - return new BusinessEntityIdBuilder(); - } - - public static final class BusinessEntityIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BusinessEntityIdBuilder() {} - - public BusinessEntityIdBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public BusinessEntityIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public BusinessEntityIdParams build() { - return new BusinessEntityIdParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class IncludeSiteLevelResourcesParams { - - private final Map formData; - - private IncludeSiteLevelResourcesParams(IncludeSiteLevelResourcesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IncludeSiteLevelResourcesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IncludeSiteLevelResourcesBuilder builder() { - return new IncludeSiteLevelResourcesBuilder(); - } - - public static final class IncludeSiteLevelResourcesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IncludeSiteLevelResourcesBuilder() {} - - public IncludeSiteLevelResourcesBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public IncludeSiteLevelResourcesParams build() { - return new IncludeSiteLevelResourcesParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemFamilyParams { - - private final Map formData; - - private ItemFamilyParams(ItemFamilyBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemFamilyParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemFamilyBuilder builder() { - return new ItemFamilyBuilder(); - } - - public static final class ItemFamilyBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemFamilyBuilder() {} - - public ItemFamilyBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemFamilyBuilder name(NameParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "name[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemFamilyBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemFamilyParams build() { - return new ItemFamilyParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class NameParams { - - private final Map formData; - - private NameParams(NameBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NameParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NameBuilder builder() { - return new NameBuilder(); - } - - public static final class NameBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NameBuilder() {} - - public NameBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public NameBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public NameBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public NameParams build() { - return new NameParams(this); - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportItemPricesParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportItemPricesParams.java deleted file mode 100644 index a782e253..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportItemPricesParams.java +++ /dev/null @@ -1,1731 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportItemPricesParams { - - private final Map formData; - - private ExportItemPricesParams(ExportItemPricesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportItemPricesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportItemPricesBuilder builder() { - return new ExportItemPricesBuilder(); - } - - public static final class ExportItemPricesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportItemPricesBuilder() {} - - public ExportItemPricesBuilder itemFamilyId(ItemFamilyIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_family_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportItemPricesBuilder itemType(ItemTypeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_type[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportItemPricesBuilder currencyCode(CurrencyCodeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "currency_code[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportItemPricesBuilder businessEntityId(BusinessEntityIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "business_entity_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportItemPricesBuilder includeSiteLevelResources( - IncludeSiteLevelResourcesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "include_site_level_resources[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportItemPricesBuilder itemPrice(ItemPriceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_price[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportItemPricesParams build() { - return new ExportItemPricesParams(this); - } - } - - public static final class ItemFamilyIdParams { - - private final Map formData; - - private ItemFamilyIdParams(ItemFamilyIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemFamilyIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemFamilyIdBuilder builder() { - return new ItemFamilyIdBuilder(); - } - - public static final class ItemFamilyIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemFamilyIdBuilder() {} - - public ItemFamilyIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ItemFamilyIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ItemFamilyIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ItemFamilyIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ItemFamilyIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ItemFamilyIdParams build() { - return new ItemFamilyIdParams(this); - } - } - } - - public static final class ItemTypeParams { - - private final Map formData; - - private ItemTypeParams(ItemTypeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTypeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTypeBuilder builder() { - return new ItemTypeBuilder(); - } - - public static final class ItemTypeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTypeBuilder() {} - - public ItemTypeBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ItemTypeBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ItemTypeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ItemTypeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ItemTypeParams build() { - return new ItemTypeParams(this); - } - } - - public enum Is { - PLAN("plan"), - - ADDON("addon"), - - CHARGE("charge"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - PLAN("plan"), - - ADDON("addon"), - - CHARGE("charge"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CurrencyCodeParams { - - private final Map formData; - - private CurrencyCodeParams(CurrencyCodeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CurrencyCodeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CurrencyCodeBuilder builder() { - return new CurrencyCodeBuilder(); - } - - public static final class CurrencyCodeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CurrencyCodeBuilder() {} - - public CurrencyCodeBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CurrencyCodeBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CurrencyCodeBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CurrencyCodeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CurrencyCodeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CurrencyCodeParams build() { - return new CurrencyCodeParams(this); - } - } - } - - public static final class BusinessEntityIdParams { - - private final Map formData; - - private BusinessEntityIdParams(BusinessEntityIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BusinessEntityIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BusinessEntityIdBuilder builder() { - return new BusinessEntityIdBuilder(); - } - - public static final class BusinessEntityIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BusinessEntityIdBuilder() {} - - public BusinessEntityIdBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public BusinessEntityIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public BusinessEntityIdParams build() { - return new BusinessEntityIdParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class IncludeSiteLevelResourcesParams { - - private final Map formData; - - private IncludeSiteLevelResourcesParams(IncludeSiteLevelResourcesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IncludeSiteLevelResourcesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IncludeSiteLevelResourcesBuilder builder() { - return new IncludeSiteLevelResourcesBuilder(); - } - - public static final class IncludeSiteLevelResourcesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IncludeSiteLevelResourcesBuilder() {} - - public IncludeSiteLevelResourcesBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public IncludeSiteLevelResourcesParams build() { - return new IncludeSiteLevelResourcesParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemPriceParams { - - private final Map formData; - - private ItemPriceParams(ItemPriceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemPriceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPriceBuilder builder() { - return new ItemPriceBuilder(); - } - - public static final class ItemPriceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemPriceBuilder() {} - - public ItemPriceBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceBuilder name(NameParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "name[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceBuilder pricingModel(PricingModelParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "pricing_model[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceBuilder itemId(ItemIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceBuilder priceVariantId(PriceVariantIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "price_variant_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceBuilder trialPeriod(TrialPeriodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "trial_period[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceBuilder trialPeriodUnit(TrialPeriodUnitParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "trial_period_unit[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceBuilder status(StatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceBuilder periodUnit(PeriodUnitParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "period_unit[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceBuilder period(PeriodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "period[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceBuilder channel(ChannelParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "channel[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceParams build() { - return new ItemPriceParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class NameParams { - - private final Map formData; - - private NameParams(NameBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NameParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NameBuilder builder() { - return new NameBuilder(); - } - - public static final class NameBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NameBuilder() {} - - public NameBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public NameBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public NameBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public NameBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public NameBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public NameParams build() { - return new NameParams(this); - } - } - } - - public static final class PricingModelParams { - - private final Map formData; - - private PricingModelParams(PricingModelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PricingModelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PricingModelBuilder builder() { - return new PricingModelBuilder(); - } - - public static final class PricingModelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PricingModelBuilder() {} - - public PricingModelBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public PricingModelBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public PricingModelBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PricingModelBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PricingModelParams build() { - return new PricingModelParams(this); - } - } - - public enum Is { - FLAT_FEE("flat_fee"), - - PER_UNIT("per_unit"), - - TIERED("tiered"), - - VOLUME("volume"), - - STAIRSTEP("stairstep"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - FLAT_FEE("flat_fee"), - - PER_UNIT("per_unit"), - - TIERED("tiered"), - - VOLUME("volume"), - - STAIRSTEP("stairstep"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemIdParams { - - private final Map formData; - - private ItemIdParams(ItemIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemIdBuilder builder() { - return new ItemIdBuilder(); - } - - public static final class ItemIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemIdBuilder() {} - - public ItemIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ItemIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ItemIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ItemIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ItemIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ItemIdParams build() { - return new ItemIdParams(this); - } - } - } - - public static final class PriceVariantIdParams { - - private final Map formData; - - private PriceVariantIdParams(PriceVariantIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PriceVariantIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PriceVariantIdBuilder builder() { - return new PriceVariantIdBuilder(); - } - - public static final class PriceVariantIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PriceVariantIdBuilder() {} - - public PriceVariantIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PriceVariantIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PriceVariantIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public PriceVariantIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PriceVariantIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PriceVariantIdParams build() { - return new PriceVariantIdParams(this); - } - } - } - - public static final class TrialPeriodParams { - - private final Map formData; - - private TrialPeriodParams(TrialPeriodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TrialPeriodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TrialPeriodBuilder builder() { - return new TrialPeriodBuilder(); - } - - public static final class TrialPeriodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TrialPeriodBuilder() {} - - public TrialPeriodBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public TrialPeriodBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public TrialPeriodBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public TrialPeriodBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public TrialPeriodBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public TrialPeriodBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public TrialPeriodBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public TrialPeriodParams build() { - return new TrialPeriodParams(this); - } - } - } - - public static final class TrialPeriodUnitParams { - - private final Map formData; - - private TrialPeriodUnitParams(TrialPeriodUnitBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TrialPeriodUnitParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TrialPeriodUnitBuilder builder() { - return new TrialPeriodUnitBuilder(); - } - - public static final class TrialPeriodUnitBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TrialPeriodUnitBuilder() {} - - public TrialPeriodUnitBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public TrialPeriodUnitBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public TrialPeriodUnitBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public TrialPeriodUnitBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public TrialPeriodUnitParams build() { - return new TrialPeriodUnitParams(this); - } - } - - public enum Is { - DAY("day"), - - MONTH("month"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - DAY("day"), - - MONTH("month"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class StatusParams { - - private final Map formData; - - private StatusParams(StatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatusBuilder builder() { - return new StatusBuilder(); - } - - public static final class StatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatusBuilder() {} - - public StatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public StatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public StatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public StatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public StatusParams build() { - return new StatusParams(this); - } - } - - public enum Is { - ACTIVE("active"), - - ARCHIVED("archived"), - - DELETED("deleted"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - ACTIVE("active"), - - ARCHIVED("archived"), - - DELETED("deleted"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } - - public static final class PeriodUnitParams { - - private final Map formData; - - private PeriodUnitParams(PeriodUnitBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PeriodUnitParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PeriodUnitBuilder builder() { - return new PeriodUnitBuilder(); - } - - public static final class PeriodUnitBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PeriodUnitBuilder() {} - - public PeriodUnitBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public PeriodUnitBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public PeriodUnitBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PeriodUnitBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PeriodUnitParams build() { - return new PeriodUnitParams(this); - } - } - - public enum Is { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PeriodParams { - - private final Map formData; - - private PeriodParams(PeriodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PeriodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PeriodBuilder builder() { - return new PeriodBuilder(); - } - - public static final class PeriodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PeriodBuilder() {} - - public PeriodBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PeriodBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PeriodBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public PeriodBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public PeriodBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public PeriodBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public PeriodBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public PeriodParams build() { - return new PeriodParams(this); - } - } - } - - public static final class ChannelParams { - - private final Map formData; - - private ChannelParams(ChannelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChannelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChannelBuilder builder() { - return new ChannelBuilder(); - } - - public static final class ChannelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChannelBuilder() {} - - public ChannelBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ChannelBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ChannelBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ChannelBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ChannelParams build() { - return new ChannelParams(this); - } - } - - public enum Is { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportItemsParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportItemsParams.java deleted file mode 100644 index c72bfb26..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportItemsParams.java +++ /dev/null @@ -1,1471 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportItemsParams { - - private final Map formData; - - private ExportItemsParams(ExportItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportItemsBuilder builder() { - return new ExportItemsBuilder(); - } - - public static final class ExportItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportItemsBuilder() {} - - public ExportItemsBuilder businessEntityId(BusinessEntityIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "business_entity_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportItemsBuilder includeSiteLevelResources(IncludeSiteLevelResourcesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "include_site_level_resources[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportItemsBuilder item(ItemParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportItemsParams build() { - return new ExportItemsParams(this); - } - } - - public static final class BusinessEntityIdParams { - - private final Map formData; - - private BusinessEntityIdParams(BusinessEntityIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BusinessEntityIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BusinessEntityIdBuilder builder() { - return new BusinessEntityIdBuilder(); - } - - public static final class BusinessEntityIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BusinessEntityIdBuilder() {} - - public BusinessEntityIdBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public BusinessEntityIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public BusinessEntityIdParams build() { - return new BusinessEntityIdParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class IncludeSiteLevelResourcesParams { - - private final Map formData; - - private IncludeSiteLevelResourcesParams(IncludeSiteLevelResourcesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IncludeSiteLevelResourcesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IncludeSiteLevelResourcesBuilder builder() { - return new IncludeSiteLevelResourcesBuilder(); - } - - public static final class IncludeSiteLevelResourcesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IncludeSiteLevelResourcesBuilder() {} - - public IncludeSiteLevelResourcesBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public IncludeSiteLevelResourcesParams build() { - return new IncludeSiteLevelResourcesParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemParams { - - private final Map formData; - - private ItemParams(ItemBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemBuilder builder() { - return new ItemBuilder(); - } - - public static final class ItemBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemBuilder() {} - - public ItemBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemBuilder itemFamilyId(ItemFamilyIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_family_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemBuilder type(TypeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "type[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemBuilder name(NameParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "name[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemBuilder itemApplicability(ItemApplicabilityParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_applicability[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemBuilder status(StatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemBuilder isGiftable(IsGiftableParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "is_giftable[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemBuilder enabledForCheckout(EnabledForCheckoutParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "enabled_for_checkout[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemBuilder enabledInPortal(EnabledInPortalParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "enabled_in_portal[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemBuilder metered(MeteredParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "metered[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemBuilder usageCalculation(UsageCalculationParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "usage_calculation[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemBuilder channel(ChannelParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "channel[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemParams build() { - return new ItemParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class ItemFamilyIdParams { - - private final Map formData; - - private ItemFamilyIdParams(ItemFamilyIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemFamilyIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemFamilyIdBuilder builder() { - return new ItemFamilyIdBuilder(); - } - - public static final class ItemFamilyIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemFamilyIdBuilder() {} - - public ItemFamilyIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ItemFamilyIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ItemFamilyIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ItemFamilyIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ItemFamilyIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ItemFamilyIdParams build() { - return new ItemFamilyIdParams(this); - } - } - } - - public static final class TypeParams { - - private final Map formData; - - private TypeParams(TypeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TypeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TypeBuilder builder() { - return new TypeBuilder(); - } - - public static final class TypeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TypeBuilder() {} - - public TypeBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public TypeBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public TypeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public TypeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public TypeParams build() { - return new TypeParams(this); - } - } - - public enum Is { - PLAN("plan"), - - ADDON("addon"), - - CHARGE("charge"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - PLAN("plan"), - - ADDON("addon"), - - CHARGE("charge"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class NameParams { - - private final Map formData; - - private NameParams(NameBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NameParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NameBuilder builder() { - return new NameBuilder(); - } - - public static final class NameBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NameBuilder() {} - - public NameBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public NameBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public NameBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public NameParams build() { - return new NameParams(this); - } - } - } - - public static final class ItemApplicabilityParams { - - private final Map formData; - - private ItemApplicabilityParams(ItemApplicabilityBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemApplicabilityParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemApplicabilityBuilder builder() { - return new ItemApplicabilityBuilder(); - } - - public static final class ItemApplicabilityBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemApplicabilityBuilder() {} - - public ItemApplicabilityBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ItemApplicabilityBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ItemApplicabilityBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ItemApplicabilityBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ItemApplicabilityParams build() { - return new ItemApplicabilityParams(this); - } - } - - public enum Is { - ALL("all"), - - RESTRICTED("restricted"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - ALL("all"), - - RESTRICTED("restricted"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class StatusParams { - - private final Map formData; - - private StatusParams(StatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatusBuilder builder() { - return new StatusBuilder(); - } - - public static final class StatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatusBuilder() {} - - public StatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public StatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public StatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public StatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public StatusParams build() { - return new StatusParams(this); - } - } - - public enum Is { - ACTIVE("active"), - - ARCHIVED("archived"), - - DELETED("deleted"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - ACTIVE("active"), - - ARCHIVED("archived"), - - DELETED("deleted"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class IsGiftableParams { - - private final Map formData; - - private IsGiftableParams(IsGiftableBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IsGiftableParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IsGiftableBuilder builder() { - return new IsGiftableBuilder(); - } - - public static final class IsGiftableBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IsGiftableBuilder() {} - - public IsGiftableBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public IsGiftableParams build() { - return new IsGiftableParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } - - public static final class EnabledForCheckoutParams { - - private final Map formData; - - private EnabledForCheckoutParams(EnabledForCheckoutBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EnabledForCheckoutParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EnabledForCheckoutBuilder builder() { - return new EnabledForCheckoutBuilder(); - } - - public static final class EnabledForCheckoutBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EnabledForCheckoutBuilder() {} - - public EnabledForCheckoutBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public EnabledForCheckoutParams build() { - return new EnabledForCheckoutParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class EnabledInPortalParams { - - private final Map formData; - - private EnabledInPortalParams(EnabledInPortalBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EnabledInPortalParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EnabledInPortalBuilder builder() { - return new EnabledInPortalBuilder(); - } - - public static final class EnabledInPortalBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EnabledInPortalBuilder() {} - - public EnabledInPortalBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public EnabledInPortalParams build() { - return new EnabledInPortalParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class MeteredParams { - - private final Map formData; - - private MeteredParams(MeteredBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for MeteredParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static MeteredBuilder builder() { - return new MeteredBuilder(); - } - - public static final class MeteredBuilder { - private final Map formData = new LinkedHashMap<>(); - - private MeteredBuilder() {} - - public MeteredBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public MeteredParams build() { - return new MeteredParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class UsageCalculationParams { - - private final Map formData; - - private UsageCalculationParams(UsageCalculationBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UsageCalculationParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UsageCalculationBuilder builder() { - return new UsageCalculationBuilder(); - } - - public static final class UsageCalculationBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UsageCalculationBuilder() {} - - public UsageCalculationBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public UsageCalculationBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public UsageCalculationBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public UsageCalculationBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public UsageCalculationParams build() { - return new UsageCalculationParams(this); - } - } - - public enum Is { - SUM_OF_USAGES("sum_of_usages"), - - LAST_USAGE("last_usage"), - - MAX_USAGE("max_usage"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - SUM_OF_USAGES("sum_of_usages"), - - LAST_USAGE("last_usage"), - - MAX_USAGE("max_usage"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ChannelParams { - - private final Map formData; - - private ChannelParams(ChannelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChannelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChannelBuilder builder() { - return new ChannelBuilder(); - } - - public static final class ChannelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChannelBuilder() {} - - public ChannelBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ChannelBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ChannelBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ChannelBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ChannelParams build() { - return new ChannelParams(this); - } - } - - public enum Is { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportOrdersParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportOrdersParams.java deleted file mode 100644 index 661ebd9e..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportOrdersParams.java +++ /dev/null @@ -1,1674 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportOrdersParams { - - private final Map formData; - - private ExportOrdersParams(ExportOrdersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportOrdersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportOrdersBuilder builder() { - return new ExportOrdersBuilder(); - } - - public static final class ExportOrdersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportOrdersBuilder() {} - - public ExportOrdersBuilder total(TotalParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "total[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportOrdersBuilder order(OrderParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "order[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportOrdersParams build() { - return new ExportOrdersParams(this); - } - } - - public static final class TotalParams { - - private final Map formData; - - private TotalParams(TotalBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TotalParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TotalBuilder builder() { - return new TotalBuilder(); - } - - public static final class TotalBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TotalBuilder() {} - - public TotalBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public TotalBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public TotalBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public TotalBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public TotalBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public TotalBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public TotalBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public TotalParams build() { - return new TotalParams(this); - } - } - } - - public static final class OrderParams { - - private final Map formData; - - private OrderParams(OrderBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OrderParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OrderBuilder builder() { - return new OrderBuilder(); - } - - public static final class OrderBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OrderBuilder() {} - - public OrderBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder subscriptionId(SubscriptionIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder customerId(CustomerIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder status(StatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder priceType(PriceTypeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "price_type[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder orderDate(OrderDateParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "order_date[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder shippingDate(ShippingDateParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_date[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder shippedAt(ShippedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipped_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder deliveredAt(DeliveredAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "delivered_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder cancelledAt(CancelledAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "cancelled_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder amountPaid(AmountPaidParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "amount_paid[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder refundableCredits(RefundableCreditsParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "refundable_credits[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder refundableCreditsIssued(RefundableCreditsIssuedParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "refundable_credits_issued[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder resentStatus(ResentStatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "resent_status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder isResent(IsResentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "is_resent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderBuilder originalOrderId(OriginalOrderIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "original_order_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderParams build() { - return new OrderParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class SubscriptionIdParams { - - private final Map formData; - - private SubscriptionIdParams(SubscriptionIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionIdBuilder builder() { - return new SubscriptionIdBuilder(); - } - - public static final class SubscriptionIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionIdBuilder() {} - - public SubscriptionIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public SubscriptionIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public SubscriptionIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public SubscriptionIdBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public SubscriptionIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public SubscriptionIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public SubscriptionIdParams build() { - return new SubscriptionIdParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CustomerIdParams { - - private final Map formData; - - private CustomerIdParams(CustomerIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerIdBuilder builder() { - return new CustomerIdBuilder(); - } - - public static final class CustomerIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerIdBuilder() {} - - public CustomerIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CustomerIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CustomerIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CustomerIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CustomerIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CustomerIdParams build() { - return new CustomerIdParams(this); - } - } - } - - public static final class StatusParams { - - private final Map formData; - - private StatusParams(StatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatusBuilder builder() { - return new StatusBuilder(); - } - - public static final class StatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatusBuilder() {} - - public StatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public StatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public StatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public StatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public StatusParams build() { - return new StatusParams(this); - } - } - - public enum Is { - NEW("new"), - - PROCESSING("processing"), - - COMPLETE("complete"), - - CANCELLED("cancelled"), - - VOIDED("voided"), - - QUEUED("queued"), - - AWAITING_SHIPMENT("awaiting_shipment"), - - ON_HOLD("on_hold"), - - DELIVERED("delivered"), - - SHIPPED("shipped"), - - PARTIALLY_DELIVERED("partially_delivered"), - - RETURNED("returned"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - NEW("new"), - - PROCESSING("processing"), - - COMPLETE("complete"), - - CANCELLED("cancelled"), - - VOIDED("voided"), - - QUEUED("queued"), - - AWAITING_SHIPMENT("awaiting_shipment"), - - ON_HOLD("on_hold"), - - DELIVERED("delivered"), - - SHIPPED("shipped"), - - PARTIALLY_DELIVERED("partially_delivered"), - - RETURNED("returned"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PriceTypeParams { - - private final Map formData; - - private PriceTypeParams(PriceTypeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PriceTypeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PriceTypeBuilder builder() { - return new PriceTypeBuilder(); - } - - public static final class PriceTypeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PriceTypeBuilder() {} - - public PriceTypeBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public PriceTypeBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public PriceTypeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PriceTypeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PriceTypeParams build() { - return new PriceTypeParams(this); - } - } - - public enum Is { - TAX_EXCLUSIVE("tax_exclusive"), - - TAX_INCLUSIVE("tax_inclusive"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - TAX_EXCLUSIVE("tax_exclusive"), - - TAX_INCLUSIVE("tax_inclusive"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class OrderDateParams { - - private final Map formData; - - private OrderDateParams(OrderDateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OrderDateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OrderDateBuilder builder() { - return new OrderDateBuilder(); - } - - public static final class OrderDateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OrderDateBuilder() {} - - public OrderDateBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public OrderDateBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public OrderDateBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public OrderDateBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public OrderDateParams build() { - return new OrderDateParams(this); - } - } - } - - public static final class ShippingDateParams { - - private final Map formData; - - private ShippingDateParams(ShippingDateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingDateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingDateBuilder builder() { - return new ShippingDateBuilder(); - } - - public static final class ShippingDateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingDateBuilder() {} - - public ShippingDateBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public ShippingDateBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public ShippingDateBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public ShippingDateBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public ShippingDateParams build() { - return new ShippingDateParams(this); - } - } - } - - public static final class ShippedAtParams { - - private final Map formData; - - private ShippedAtParams(ShippedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippedAtBuilder builder() { - return new ShippedAtBuilder(); - } - - public static final class ShippedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippedAtBuilder() {} - - public ShippedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public ShippedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public ShippedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public ShippedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public ShippedAtParams build() { - return new ShippedAtParams(this); - } - } - } - - public static final class DeliveredAtParams { - - private final Map formData; - - private DeliveredAtParams(DeliveredAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DeliveredAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DeliveredAtBuilder builder() { - return new DeliveredAtBuilder(); - } - - public static final class DeliveredAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DeliveredAtBuilder() {} - - public DeliveredAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public DeliveredAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public DeliveredAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public DeliveredAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public DeliveredAtParams build() { - return new DeliveredAtParams(this); - } - } - } - - public static final class CancelledAtParams { - - private final Map formData; - - private CancelledAtParams(CancelledAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CancelledAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CancelledAtBuilder builder() { - return new CancelledAtBuilder(); - } - - public static final class CancelledAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CancelledAtBuilder() {} - - public CancelledAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public CancelledAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public CancelledAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public CancelledAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public CancelledAtParams build() { - return new CancelledAtParams(this); - } - } - } - - public static final class AmountPaidParams { - - private final Map formData; - - private AmountPaidParams(AmountPaidBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AmountPaidParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AmountPaidBuilder builder() { - return new AmountPaidBuilder(); - } - - public static final class AmountPaidBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AmountPaidBuilder() {} - - public AmountPaidBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public AmountPaidBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public AmountPaidBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public AmountPaidBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public AmountPaidBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public AmountPaidBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public AmountPaidBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public AmountPaidParams build() { - return new AmountPaidParams(this); - } - } - } - - public static final class RefundableCreditsParams { - - private final Map formData; - - private RefundableCreditsParams(RefundableCreditsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RefundableCreditsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RefundableCreditsBuilder builder() { - return new RefundableCreditsBuilder(); - } - - public static final class RefundableCreditsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RefundableCreditsBuilder() {} - - public RefundableCreditsBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public RefundableCreditsBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public RefundableCreditsBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public RefundableCreditsBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public RefundableCreditsBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public RefundableCreditsBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public RefundableCreditsBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public RefundableCreditsParams build() { - return new RefundableCreditsParams(this); - } - } - } - - public static final class RefundableCreditsIssuedParams { - - private final Map formData; - - private RefundableCreditsIssuedParams(RefundableCreditsIssuedBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RefundableCreditsIssuedParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RefundableCreditsIssuedBuilder builder() { - return new RefundableCreditsIssuedBuilder(); - } - - public static final class RefundableCreditsIssuedBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RefundableCreditsIssuedBuilder() {} - - public RefundableCreditsIssuedBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public RefundableCreditsIssuedBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public RefundableCreditsIssuedBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public RefundableCreditsIssuedBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public RefundableCreditsIssuedBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public RefundableCreditsIssuedBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public RefundableCreditsIssuedBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public RefundableCreditsIssuedParams build() { - return new RefundableCreditsIssuedParams(this); - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } - - public static final class ResentStatusParams { - - private final Map formData; - - private ResentStatusParams(ResentStatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ResentStatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ResentStatusBuilder builder() { - return new ResentStatusBuilder(); - } - - public static final class ResentStatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ResentStatusBuilder() {} - - public ResentStatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ResentStatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ResentStatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ResentStatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ResentStatusParams build() { - return new ResentStatusParams(this); - } - } - - public enum Is { - FULLY_RESENT("fully_resent"), - - PARTIALLY_RESENT("partially_resent"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - FULLY_RESENT("fully_resent"), - - PARTIALLY_RESENT("partially_resent"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class IsResentParams { - - private final Map formData; - - private IsResentParams(IsResentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IsResentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IsResentBuilder builder() { - return new IsResentBuilder(); - } - - public static final class IsResentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IsResentBuilder() {} - - public IsResentBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public IsResentParams build() { - return new IsResentParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class OriginalOrderIdParams { - - private final Map formData; - - private OriginalOrderIdParams(OriginalOrderIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OriginalOrderIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OriginalOrderIdBuilder builder() { - return new OriginalOrderIdBuilder(); - } - - public static final class OriginalOrderIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OriginalOrderIdBuilder() {} - - public OriginalOrderIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public OriginalOrderIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public OriginalOrderIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public OriginalOrderIdParams build() { - return new OriginalOrderIdParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportPlansParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportPlansParams.java deleted file mode 100644 index c0c12c47..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportPlansParams.java +++ /dev/null @@ -1,1403 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportPlansParams { - - private final Map formData; - - private ExportPlansParams(ExportPlansBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportPlansParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportPlansBuilder builder() { - return new ExportPlansBuilder(); - } - - public static final class ExportPlansBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportPlansBuilder() {} - - public ExportPlansBuilder currencyCode(CurrencyCodeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "currency_code[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportPlansBuilder plan(PlanParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "plan[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportPlansParams build() { - return new ExportPlansParams(this); - } - } - - public static final class CurrencyCodeParams { - - private final Map formData; - - private CurrencyCodeParams(CurrencyCodeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CurrencyCodeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CurrencyCodeBuilder builder() { - return new CurrencyCodeBuilder(); - } - - public static final class CurrencyCodeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CurrencyCodeBuilder() {} - - public CurrencyCodeBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CurrencyCodeBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CurrencyCodeBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CurrencyCodeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CurrencyCodeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CurrencyCodeParams build() { - return new CurrencyCodeParams(this); - } - } - } - - public static final class PlanParams { - - private final Map formData; - - private PlanParams(PlanBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PlanParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PlanBuilder builder() { - return new PlanBuilder(); - } - - public static final class PlanBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PlanBuilder() {} - - public PlanBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PlanBuilder name(NameParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "name[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PlanBuilder price(PriceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "price[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PlanBuilder period(PeriodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "period[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PlanBuilder periodUnit(PeriodUnitParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "period_unit[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PlanBuilder trialPeriod(TrialPeriodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "trial_period[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PlanBuilder trialPeriodUnit(TrialPeriodUnitParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "trial_period_unit[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PlanBuilder addonApplicability(AddonApplicabilityParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "addon_applicability[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PlanBuilder giftable(GiftableParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "giftable[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PlanBuilder status(StatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PlanBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PlanBuilder channel(ChannelParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "channel[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PlanParams build() { - return new PlanParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class NameParams { - - private final Map formData; - - private NameParams(NameBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NameParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NameBuilder builder() { - return new NameBuilder(); - } - - public static final class NameBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NameBuilder() {} - - public NameBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public NameBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public NameBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public NameBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public NameBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public NameParams build() { - return new NameParams(this); - } - } - } - - public static final class PriceParams { - - private final Map formData; - - private PriceParams(PriceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PriceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PriceBuilder builder() { - return new PriceBuilder(); - } - - public static final class PriceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PriceBuilder() {} - - public PriceBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PriceBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PriceBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public PriceBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public PriceBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public PriceBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public PriceBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public PriceParams build() { - return new PriceParams(this); - } - } - } - - public static final class PeriodParams { - - private final Map formData; - - private PeriodParams(PeriodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PeriodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PeriodBuilder builder() { - return new PeriodBuilder(); - } - - public static final class PeriodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PeriodBuilder() {} - - public PeriodBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PeriodBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PeriodBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public PeriodBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public PeriodBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public PeriodBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public PeriodBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public PeriodParams build() { - return new PeriodParams(this); - } - } - } - - public static final class PeriodUnitParams { - - private final Map formData; - - private PeriodUnitParams(PeriodUnitBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PeriodUnitParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PeriodUnitBuilder builder() { - return new PeriodUnitBuilder(); - } - - public static final class PeriodUnitBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PeriodUnitBuilder() {} - - public PeriodUnitBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public PeriodUnitBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public PeriodUnitBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PeriodUnitBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PeriodUnitParams build() { - return new PeriodUnitParams(this); - } - } - - public enum Is { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TrialPeriodParams { - - private final Map formData; - - private TrialPeriodParams(TrialPeriodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TrialPeriodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TrialPeriodBuilder builder() { - return new TrialPeriodBuilder(); - } - - public static final class TrialPeriodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TrialPeriodBuilder() {} - - public TrialPeriodBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public TrialPeriodBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public TrialPeriodBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public TrialPeriodBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public TrialPeriodBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public TrialPeriodBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public TrialPeriodBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public TrialPeriodBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public TrialPeriodParams build() { - return new TrialPeriodParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TrialPeriodUnitParams { - - private final Map formData; - - private TrialPeriodUnitParams(TrialPeriodUnitBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TrialPeriodUnitParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TrialPeriodUnitBuilder builder() { - return new TrialPeriodUnitBuilder(); - } - - public static final class TrialPeriodUnitBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TrialPeriodUnitBuilder() {} - - public TrialPeriodUnitBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public TrialPeriodUnitBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public TrialPeriodUnitBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public TrialPeriodUnitBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public TrialPeriodUnitParams build() { - return new TrialPeriodUnitParams(this); - } - } - - public enum Is { - DAY("day"), - - MONTH("month"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - DAY("day"), - - MONTH("month"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AddonApplicabilityParams { - - private final Map formData; - - private AddonApplicabilityParams(AddonApplicabilityBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonApplicabilityParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonApplicabilityBuilder builder() { - return new AddonApplicabilityBuilder(); - } - - public static final class AddonApplicabilityBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonApplicabilityBuilder() {} - - public AddonApplicabilityBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public AddonApplicabilityBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public AddonApplicabilityBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public AddonApplicabilityBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public AddonApplicabilityParams build() { - return new AddonApplicabilityParams(this); - } - } - - public enum Is { - ALL("all"), - - RESTRICTED("restricted"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - ALL("all"), - - RESTRICTED("restricted"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class GiftableParams { - - private final Map formData; - - private GiftableParams(GiftableBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GiftableParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GiftableBuilder builder() { - return new GiftableBuilder(); - } - - public static final class GiftableBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GiftableBuilder() {} - - public GiftableBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public GiftableParams build() { - return new GiftableParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class StatusParams { - - private final Map formData; - - private StatusParams(StatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatusBuilder builder() { - return new StatusBuilder(); - } - - public static final class StatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatusBuilder() {} - - public StatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public StatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public StatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public StatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public StatusParams build() { - return new StatusParams(this); - } - } - - public enum Is { - ACTIVE("active"), - - ARCHIVED("archived"), - - DELETED("deleted"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - ACTIVE("active"), - - ARCHIVED("archived"), - - DELETED("deleted"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } - - public static final class ChannelParams { - - private final Map formData; - - private ChannelParams(ChannelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChannelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChannelBuilder builder() { - return new ChannelBuilder(); - } - - public static final class ChannelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChannelBuilder() {} - - public ChannelBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ChannelBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ChannelBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ChannelBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ChannelParams build() { - return new ChannelParams(this); - } - } - - public enum Is { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportPriceVariantsParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportPriceVariantsParams.java deleted file mode 100644 index 7b6893c3..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportPriceVariantsParams.java +++ /dev/null @@ -1,659 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportPriceVariantsParams { - - private final Map formData; - - private ExportPriceVariantsParams(ExportPriceVariantsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportPriceVariantsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportPriceVariantsBuilder builder() { - return new ExportPriceVariantsBuilder(); - } - - public static final class ExportPriceVariantsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportPriceVariantsBuilder() {} - - public ExportPriceVariantsBuilder businessEntityId(BusinessEntityIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "business_entity_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportPriceVariantsBuilder includeSiteLevelResources( - IncludeSiteLevelResourcesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "include_site_level_resources[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportPriceVariantsBuilder priceVariant(PriceVariantParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "price_variant[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportPriceVariantsParams build() { - return new ExportPriceVariantsParams(this); - } - } - - public static final class BusinessEntityIdParams { - - private final Map formData; - - private BusinessEntityIdParams(BusinessEntityIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BusinessEntityIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BusinessEntityIdBuilder builder() { - return new BusinessEntityIdBuilder(); - } - - public static final class BusinessEntityIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BusinessEntityIdBuilder() {} - - public BusinessEntityIdBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public BusinessEntityIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public BusinessEntityIdParams build() { - return new BusinessEntityIdParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class IncludeSiteLevelResourcesParams { - - private final Map formData; - - private IncludeSiteLevelResourcesParams(IncludeSiteLevelResourcesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IncludeSiteLevelResourcesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IncludeSiteLevelResourcesBuilder builder() { - return new IncludeSiteLevelResourcesBuilder(); - } - - public static final class IncludeSiteLevelResourcesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IncludeSiteLevelResourcesBuilder() {} - - public IncludeSiteLevelResourcesBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public IncludeSiteLevelResourcesParams build() { - return new IncludeSiteLevelResourcesParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PriceVariantParams { - - private final Map formData; - - private PriceVariantParams(PriceVariantBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PriceVariantParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PriceVariantBuilder builder() { - return new PriceVariantBuilder(); - } - - public static final class PriceVariantBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PriceVariantBuilder() {} - - public PriceVariantBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PriceVariantBuilder name(NameParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "name[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PriceVariantBuilder status(StatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PriceVariantBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PriceVariantBuilder createdAt(CreatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "created_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PriceVariantParams build() { - return new PriceVariantParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class NameParams { - - private final Map formData; - - private NameParams(NameBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NameParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NameBuilder builder() { - return new NameBuilder(); - } - - public static final class NameBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NameBuilder() {} - - public NameBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public NameBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public NameBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public NameBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public NameBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public NameParams build() { - return new NameParams(this); - } - } - } - - public static final class StatusParams { - - private final Map formData; - - private StatusParams(StatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatusBuilder builder() { - return new StatusBuilder(); - } - - public static final class StatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatusBuilder() {} - - public StatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public StatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public StatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public StatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public StatusParams build() { - return new StatusParams(this); - } - } - - public enum Is { - ACTIVE("active"), - - ARCHIVED("archived"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - ACTIVE("active"), - - ARCHIVED("archived"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } - - public static final class CreatedAtParams { - - private final Map formData; - - private CreatedAtParams(CreatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreatedAtBuilder builder() { - return new CreatedAtBuilder(); - } - - public static final class CreatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreatedAtBuilder() {} - - public CreatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public CreatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public CreatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public CreatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public CreatedAtParams build() { - return new CreatedAtParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportRevenueRecognitionParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportRevenueRecognitionParams.java deleted file mode 100644 index 0e3b2c97..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportRevenueRecognitionParams.java +++ /dev/null @@ -1,5043 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportRevenueRecognitionParams { - - private final Map formData; - - private ExportRevenueRecognitionParams(ExportRevenueRecognitionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportRevenueRecognitionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportRevenueRecognitionBuilder builder() { - return new ExportRevenueRecognitionBuilder(); - } - - public static final class ExportRevenueRecognitionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportRevenueRecognitionBuilder() {} - - public ExportRevenueRecognitionBuilder reportBy(ReportBy value) { - - formData.put("report_by", value); - - return this; - } - - public ExportRevenueRecognitionBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public ExportRevenueRecognitionBuilder reportFromMonth(Integer value) { - - formData.put("report_from_month", value); - - return this; - } - - public ExportRevenueRecognitionBuilder reportFromYear(Integer value) { - - formData.put("report_from_year", value); - - return this; - } - - public ExportRevenueRecognitionBuilder reportToMonth(Integer value) { - - formData.put("report_to_month", value); - - return this; - } - - public ExportRevenueRecognitionBuilder reportToYear(Integer value) { - - formData.put("report_to_year", value); - - return this; - } - - public ExportRevenueRecognitionBuilder includeDiscounts(Boolean value) { - - formData.put("include_discounts", value); - - return this; - } - - public ExportRevenueRecognitionBuilder paymentOwner(PaymentOwnerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_owner[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportRevenueRecognitionBuilder itemId(ItemIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportRevenueRecognitionBuilder itemPriceId(ItemPriceIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_price_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportRevenueRecognitionBuilder cancelReasonCode(CancelReasonCodeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "cancel_reason_code[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportRevenueRecognitionBuilder businessEntityId(BusinessEntityIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "business_entity_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportRevenueRecognitionBuilder invoice(InvoiceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "invoice[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportRevenueRecognitionBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportRevenueRecognitionBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportRevenueRecognitionBuilder relationship(RelationshipParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "relationship[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportRevenueRecognitionParams build() { - return new ExportRevenueRecognitionParams(this); - } - } - - public enum ReportBy { - CUSTOMER("customer"), - - INVOICE("invoice"), - - PRODUCT("product"), - - SUBSCRIPTION("subscription"), - - /** An enum member indicating that ReportBy was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ReportBy(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ReportBy fromString(String value) { - if (value == null) return _UNKNOWN; - for (ReportBy enumValue : ReportBy.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class PaymentOwnerParams { - - private final Map formData; - - private PaymentOwnerParams(PaymentOwnerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentOwnerParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentOwnerBuilder builder() { - return new PaymentOwnerBuilder(); - } - - public static final class PaymentOwnerBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentOwnerBuilder() {} - - public PaymentOwnerBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PaymentOwnerBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PaymentOwnerBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public PaymentOwnerBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PaymentOwnerBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PaymentOwnerParams build() { - return new PaymentOwnerParams(this); - } - } - } - - public static final class ItemIdParams { - - private final Map formData; - - private ItemIdParams(ItemIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemIdBuilder builder() { - return new ItemIdBuilder(); - } - - public static final class ItemIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemIdBuilder() {} - - public ItemIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ItemIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ItemIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ItemIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ItemIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ItemIdParams build() { - return new ItemIdParams(this); - } - } - } - - public static final class ItemPriceIdParams { - - private final Map formData; - - private ItemPriceIdParams(ItemPriceIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemPriceIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPriceIdBuilder builder() { - return new ItemPriceIdBuilder(); - } - - public static final class ItemPriceIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemPriceIdBuilder() {} - - public ItemPriceIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ItemPriceIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ItemPriceIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ItemPriceIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ItemPriceIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ItemPriceIdParams build() { - return new ItemPriceIdParams(this); - } - } - } - - public static final class CancelReasonCodeParams { - - private final Map formData; - - private CancelReasonCodeParams(CancelReasonCodeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CancelReasonCodeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CancelReasonCodeBuilder builder() { - return new CancelReasonCodeBuilder(); - } - - public static final class CancelReasonCodeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CancelReasonCodeBuilder() {} - - public CancelReasonCodeBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CancelReasonCodeBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CancelReasonCodeBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CancelReasonCodeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CancelReasonCodeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CancelReasonCodeParams build() { - return new CancelReasonCodeParams(this); - } - } - } - - public static final class BusinessEntityIdParams { - - private final Map formData; - - private BusinessEntityIdParams(BusinessEntityIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BusinessEntityIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BusinessEntityIdBuilder builder() { - return new BusinessEntityIdBuilder(); - } - - public static final class BusinessEntityIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BusinessEntityIdBuilder() {} - - public BusinessEntityIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public BusinessEntityIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public BusinessEntityIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public BusinessEntityIdParams build() { - return new BusinessEntityIdParams(this); - } - } - } - - public static final class InvoiceParams { - - private final Map formData; - - private InvoiceParams(InvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceBuilder builder() { - return new InvoiceBuilder(); - } - - public static final class InvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceBuilder() {} - - public InvoiceBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder recurring(RecurringParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "recurring[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder status(StatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder priceType(PriceTypeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "price_type[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder date(DateParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "date[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder paidAt(PaidAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "paid_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder total(TotalParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "total[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder amountPaid(AmountPaidParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "amount_paid[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder amountAdjusted(AmountAdjustedParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "amount_adjusted[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder creditsApplied(CreditsAppliedParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "credits_applied[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder amountDue(AmountDueParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "amount_due[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder dunningStatus(DunningStatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "dunning_status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceBuilder channel(ChannelParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "channel[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceParams build() { - return new InvoiceParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class RecurringParams { - - private final Map formData; - - private RecurringParams(RecurringBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RecurringParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RecurringBuilder builder() { - return new RecurringBuilder(); - } - - public static final class RecurringBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RecurringBuilder() {} - - public RecurringBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public RecurringParams build() { - return new RecurringParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class StatusParams { - - private final Map formData; - - private StatusParams(StatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatusBuilder builder() { - return new StatusBuilder(); - } - - public static final class StatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatusBuilder() {} - - public StatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public StatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public StatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public StatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public StatusParams build() { - return new StatusParams(this); - } - } - - public enum Is { - PAID("paid"), - - POSTED("posted"), - - PAYMENT_DUE("payment_due"), - - NOT_PAID("not_paid"), - - VOIDED("voided"), - - PENDING("pending"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - PAID("paid"), - - POSTED("posted"), - - PAYMENT_DUE("payment_due"), - - NOT_PAID("not_paid"), - - VOIDED("voided"), - - PENDING("pending"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PriceTypeParams { - - private final Map formData; - - private PriceTypeParams(PriceTypeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PriceTypeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PriceTypeBuilder builder() { - return new PriceTypeBuilder(); - } - - public static final class PriceTypeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PriceTypeBuilder() {} - - public PriceTypeBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public PriceTypeBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public PriceTypeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PriceTypeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PriceTypeParams build() { - return new PriceTypeParams(this); - } - } - - public enum Is { - TAX_EXCLUSIVE("tax_exclusive"), - - TAX_INCLUSIVE("tax_inclusive"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - TAX_EXCLUSIVE("tax_exclusive"), - - TAX_INCLUSIVE("tax_inclusive"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DateParams { - - private final Map formData; - - private DateParams(DateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DateBuilder builder() { - return new DateBuilder(); - } - - public static final class DateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DateBuilder() {} - - public DateBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public DateBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public DateBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public DateBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public DateParams build() { - return new DateParams(this); - } - } - } - - public static final class PaidAtParams { - - private final Map formData; - - private PaidAtParams(PaidAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaidAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaidAtBuilder builder() { - return new PaidAtBuilder(); - } - - public static final class PaidAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaidAtBuilder() {} - - public PaidAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public PaidAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public PaidAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public PaidAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public PaidAtParams build() { - return new PaidAtParams(this); - } - } - } - - public static final class TotalParams { - - private final Map formData; - - private TotalParams(TotalBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TotalParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TotalBuilder builder() { - return new TotalBuilder(); - } - - public static final class TotalBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TotalBuilder() {} - - public TotalBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public TotalBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public TotalBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public TotalBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public TotalBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public TotalBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public TotalBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public TotalParams build() { - return new TotalParams(this); - } - } - } - - public static final class AmountPaidParams { - - private final Map formData; - - private AmountPaidParams(AmountPaidBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AmountPaidParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AmountPaidBuilder builder() { - return new AmountPaidBuilder(); - } - - public static final class AmountPaidBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AmountPaidBuilder() {} - - public AmountPaidBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public AmountPaidBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public AmountPaidBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public AmountPaidBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public AmountPaidBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public AmountPaidBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public AmountPaidBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public AmountPaidParams build() { - return new AmountPaidParams(this); - } - } - } - - public static final class AmountAdjustedParams { - - private final Map formData; - - private AmountAdjustedParams(AmountAdjustedBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AmountAdjustedParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AmountAdjustedBuilder builder() { - return new AmountAdjustedBuilder(); - } - - public static final class AmountAdjustedBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AmountAdjustedBuilder() {} - - public AmountAdjustedBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public AmountAdjustedBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public AmountAdjustedBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public AmountAdjustedBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public AmountAdjustedBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public AmountAdjustedBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public AmountAdjustedBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public AmountAdjustedParams build() { - return new AmountAdjustedParams(this); - } - } - } - - public static final class CreditsAppliedParams { - - private final Map formData; - - private CreditsAppliedParams(CreditsAppliedBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditsAppliedParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditsAppliedBuilder builder() { - return new CreditsAppliedBuilder(); - } - - public static final class CreditsAppliedBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditsAppliedBuilder() {} - - public CreditsAppliedBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CreditsAppliedBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CreditsAppliedBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public CreditsAppliedBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public CreditsAppliedBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public CreditsAppliedBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public CreditsAppliedBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public CreditsAppliedParams build() { - return new CreditsAppliedParams(this); - } - } - } - - public static final class AmountDueParams { - - private final Map formData; - - private AmountDueParams(AmountDueBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AmountDueParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AmountDueBuilder builder() { - return new AmountDueBuilder(); - } - - public static final class AmountDueBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AmountDueBuilder() {} - - public AmountDueBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public AmountDueBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public AmountDueBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public AmountDueBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public AmountDueBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public AmountDueBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public AmountDueBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public AmountDueParams build() { - return new AmountDueParams(this); - } - } - } - - public static final class DunningStatusParams { - - private final Map formData; - - private DunningStatusParams(DunningStatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DunningStatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DunningStatusBuilder builder() { - return new DunningStatusBuilder(); - } - - public static final class DunningStatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DunningStatusBuilder() {} - - public DunningStatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public DunningStatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public DunningStatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public DunningStatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public DunningStatusBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public DunningStatusParams build() { - return new DunningStatusParams(this); - } - } - - public enum Is { - IN_PROGRESS("in_progress"), - - EXHAUSTED("exhausted"), - - STOPPED("stopped"), - - SUCCESS("success"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - IN_PROGRESS("in_progress"), - - EXHAUSTED("exhausted"), - - STOPPED("stopped"), - - SUCCESS("success"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } - - public static final class ChannelParams { - - private final Map formData; - - private ChannelParams(ChannelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChannelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChannelBuilder builder() { - return new ChannelBuilder(); - } - - public static final class ChannelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChannelBuilder() {} - - public ChannelBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ChannelBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ChannelBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ChannelBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ChannelParams build() { - return new ChannelParams(this); - } - } - - public enum Is { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(ExportIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder customerId(CustomerIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder status(ExportStatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder cancelReason(CancelReasonParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "cancel_reason[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder remainingBillingCycles(RemainingBillingCyclesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "remaining_billing_cycles[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder createdAt(CreatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "created_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder activatedAt(ActivatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "activated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder nextBillingAt(NextBillingAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "next_billing_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder cancelledAt(CancelledAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "cancelled_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder hasScheduledChanges(HasScheduledChangesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "has_scheduled_changes[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder updatedAt(ExportUpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "offline_payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder autoCloseInvoices(AutoCloseInvoicesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "auto_close_invoices[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder channel(ExportChannelParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "channel[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder planId(PlanIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "plan_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - } - - public static final class ExportIdParams { - - private final Map formData; - - private ExportIdParams(ExportIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportIdBuilder builder() { - return new ExportIdBuilder(); - } - - public static final class ExportIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportIdBuilder() {} - - public ExportIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ExportIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ExportIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ExportIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ExportIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ExportIdParams build() { - return new ExportIdParams(this); - } - } - } - - public static final class CustomerIdParams { - - private final Map formData; - - private CustomerIdParams(CustomerIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerIdBuilder builder() { - return new CustomerIdBuilder(); - } - - public static final class CustomerIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerIdBuilder() {} - - public CustomerIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CustomerIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CustomerIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CustomerIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CustomerIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CustomerIdParams build() { - return new CustomerIdParams(this); - } - } - } - - public static final class ExportStatusParams { - - private final Map formData; - - private ExportStatusParams(ExportStatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportStatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportStatusBuilder builder() { - return new ExportStatusBuilder(); - } - - public static final class ExportStatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportStatusBuilder() {} - - public ExportStatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ExportStatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ExportStatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ExportStatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ExportStatusParams build() { - return new ExportStatusParams(this); - } - } - - public enum Is { - FUTURE("future"), - - IN_TRIAL("in_trial"), - - ACTIVE("active"), - - NON_RENEWING("non_renewing"), - - PAUSED("paused"), - - CANCELLED("cancelled"), - - TRANSFERRED("transferred"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - FUTURE("future"), - - IN_TRIAL("in_trial"), - - ACTIVE("active"), - - NON_RENEWING("non_renewing"), - - PAUSED("paused"), - - CANCELLED("cancelled"), - - TRANSFERRED("transferred"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CancelReasonParams { - - private final Map formData; - - private CancelReasonParams(CancelReasonBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CancelReasonParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CancelReasonBuilder builder() { - return new CancelReasonBuilder(); - } - - public static final class CancelReasonBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CancelReasonBuilder() {} - - public CancelReasonBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public CancelReasonBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public CancelReasonBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CancelReasonBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CancelReasonBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public CancelReasonParams build() { - return new CancelReasonParams(this); - } - } - - public enum Is { - NOT_PAID("not_paid"), - - NO_CARD("no_card"), - - FRAUD_REVIEW_FAILED("fraud_review_failed"), - - NON_COMPLIANT_EU_CUSTOMER("non_compliant_eu_customer"), - - TAX_CALCULATION_FAILED("tax_calculation_failed"), - - CURRENCY_INCOMPATIBLE_WITH_GATEWAY("currency_incompatible_with_gateway"), - - NON_COMPLIANT_CUSTOMER("non_compliant_customer"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - NOT_PAID("not_paid"), - - NO_CARD("no_card"), - - FRAUD_REVIEW_FAILED("fraud_review_failed"), - - NON_COMPLIANT_EU_CUSTOMER("non_compliant_eu_customer"), - - TAX_CALCULATION_FAILED("tax_calculation_failed"), - - CURRENCY_INCOMPATIBLE_WITH_GATEWAY("currency_incompatible_with_gateway"), - - NON_COMPLIANT_CUSTOMER("non_compliant_customer"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class RemainingBillingCyclesParams { - - private final Map formData; - - private RemainingBillingCyclesParams(RemainingBillingCyclesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RemainingBillingCyclesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RemainingBillingCyclesBuilder builder() { - return new RemainingBillingCyclesBuilder(); - } - - public static final class RemainingBillingCyclesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RemainingBillingCyclesBuilder() {} - - public RemainingBillingCyclesBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public RemainingBillingCyclesBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public RemainingBillingCyclesBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public RemainingBillingCyclesBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public RemainingBillingCyclesBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public RemainingBillingCyclesBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public RemainingBillingCyclesBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public RemainingBillingCyclesBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public RemainingBillingCyclesParams build() { - return new RemainingBillingCyclesParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CreatedAtParams { - - private final Map formData; - - private CreatedAtParams(CreatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreatedAtBuilder builder() { - return new CreatedAtBuilder(); - } - - public static final class CreatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreatedAtBuilder() {} - - public CreatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public CreatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public CreatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public CreatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public CreatedAtParams build() { - return new CreatedAtParams(this); - } - } - } - - public static final class ActivatedAtParams { - - private final Map formData; - - private ActivatedAtParams(ActivatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ActivatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ActivatedAtBuilder builder() { - return new ActivatedAtBuilder(); - } - - public static final class ActivatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ActivatedAtBuilder() {} - - public ActivatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public ActivatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public ActivatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public ActivatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public ActivatedAtBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public ActivatedAtParams build() { - return new ActivatedAtParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class NextBillingAtParams { - - private final Map formData; - - private NextBillingAtParams(NextBillingAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NextBillingAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NextBillingAtBuilder builder() { - return new NextBillingAtBuilder(); - } - - public static final class NextBillingAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NextBillingAtBuilder() {} - - public NextBillingAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public NextBillingAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public NextBillingAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public NextBillingAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public NextBillingAtParams build() { - return new NextBillingAtParams(this); - } - } - } - - public static final class CancelledAtParams { - - private final Map formData; - - private CancelledAtParams(CancelledAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CancelledAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CancelledAtBuilder builder() { - return new CancelledAtBuilder(); - } - - public static final class CancelledAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CancelledAtBuilder() {} - - public CancelledAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public CancelledAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public CancelledAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public CancelledAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public CancelledAtParams build() { - return new CancelledAtParams(this); - } - } - } - - public static final class HasScheduledChangesParams { - - private final Map formData; - - private HasScheduledChangesParams(HasScheduledChangesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HasScheduledChangesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HasScheduledChangesBuilder builder() { - return new HasScheduledChangesBuilder(); - } - - public static final class HasScheduledChangesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HasScheduledChangesBuilder() {} - - public HasScheduledChangesBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public HasScheduledChangesParams build() { - return new HasScheduledChangesParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ExportUpdatedAtParams { - - private final Map formData; - - private ExportUpdatedAtParams(ExportUpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportUpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportUpdatedAtBuilder builder() { - return new ExportUpdatedAtBuilder(); - } - - public static final class ExportUpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportUpdatedAtBuilder() {} - - public ExportUpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public ExportUpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public ExportUpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public ExportUpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public ExportUpdatedAtParams build() { - return new ExportUpdatedAtParams(this); - } - } - } - - public static final class OfflinePaymentMethodParams { - - private final Map formData; - - private OfflinePaymentMethodParams(OfflinePaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OfflinePaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OfflinePaymentMethodBuilder builder() { - return new OfflinePaymentMethodBuilder(); - } - - public static final class OfflinePaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OfflinePaymentMethodBuilder() {} - - public OfflinePaymentMethodBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public OfflinePaymentMethodBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public OfflinePaymentMethodBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public OfflinePaymentMethodBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public OfflinePaymentMethodParams build() { - return new OfflinePaymentMethodParams(this); - } - } - - public enum Is { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AutoCloseInvoicesParams { - - private final Map formData; - - private AutoCloseInvoicesParams(AutoCloseInvoicesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AutoCloseInvoicesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AutoCloseInvoicesBuilder builder() { - return new AutoCloseInvoicesBuilder(); - } - - public static final class AutoCloseInvoicesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AutoCloseInvoicesBuilder() {} - - public AutoCloseInvoicesBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public AutoCloseInvoicesParams build() { - return new AutoCloseInvoicesParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ExportChannelParams { - - private final Map formData; - - private ExportChannelParams(ExportChannelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportChannelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportChannelBuilder builder() { - return new ExportChannelBuilder(); - } - - public static final class ExportChannelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportChannelBuilder() {} - - public ExportChannelBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ExportChannelBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ExportChannelBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ExportChannelBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ExportChannelParams build() { - return new ExportChannelParams(this); - } - } - - public enum Is { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PlanIdParams { - - private final Map formData; - - private PlanIdParams(PlanIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PlanIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PlanIdBuilder builder() { - return new PlanIdBuilder(); - } - - public static final class PlanIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PlanIdBuilder() {} - - public PlanIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PlanIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PlanIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public PlanIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PlanIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PlanIdParams build() { - return new PlanIdParams(this); - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(ExportId2Params value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder firstName(FirstNameParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "first_name[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder lastName(LastNameParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "last_name[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder email(EmailParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "email[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder company(CompanyParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "company[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder phone(PhoneParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "phone[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder autoCollection(AutoCollectionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "auto_collection[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder taxability(TaxabilityParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "taxability[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder createdAt(ExportCreatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "created_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder updatedAt(ExportUpdatedAt2Params value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder offlinePaymentMethod(ExportOfflinePaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "offline_payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder autoCloseInvoices(ExportAutoCloseInvoicesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "auto_close_invoices[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerBuilder channel(ExportChannel2Params value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "channel[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } - - public static final class ExportId2Params { - - private final Map formData; - - private ExportId2Params(ExportId2Builder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportId2Params. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportId2Builder builder() { - return new ExportId2Builder(); - } - - public static final class ExportId2Builder { - private final Map formData = new LinkedHashMap<>(); - - private ExportId2Builder() {} - - public ExportId2Builder is(String value) { - - formData.put("is", value); - - return this; - } - - public ExportId2Builder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ExportId2Builder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ExportId2Builder in(String value) { - - formData.put("in", value); - - return this; - } - - public ExportId2Builder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ExportId2Params build() { - return new ExportId2Params(this); - } - } - } - - public static final class FirstNameParams { - - private final Map formData; - - private FirstNameParams(FirstNameBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for FirstNameParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static FirstNameBuilder builder() { - return new FirstNameBuilder(); - } - - public static final class FirstNameBuilder { - private final Map formData = new LinkedHashMap<>(); - - private FirstNameBuilder() {} - - public FirstNameBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public FirstNameBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public FirstNameBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public FirstNameBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public FirstNameParams build() { - return new FirstNameParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class LastNameParams { - - private final Map formData; - - private LastNameParams(LastNameBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for LastNameParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static LastNameBuilder builder() { - return new LastNameBuilder(); - } - - public static final class LastNameBuilder { - private final Map formData = new LinkedHashMap<>(); - - private LastNameBuilder() {} - - public LastNameBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public LastNameBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public LastNameBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public LastNameBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public LastNameParams build() { - return new LastNameParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class EmailParams { - - private final Map formData; - - private EmailParams(EmailBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EmailParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EmailBuilder builder() { - return new EmailBuilder(); - } - - public static final class EmailBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EmailBuilder() {} - - public EmailBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public EmailBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public EmailBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public EmailBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public EmailParams build() { - return new EmailParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CompanyParams { - - private final Map formData; - - private CompanyParams(CompanyBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CompanyParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CompanyBuilder builder() { - return new CompanyBuilder(); - } - - public static final class CompanyBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CompanyBuilder() {} - - public CompanyBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CompanyBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CompanyBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CompanyBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public CompanyParams build() { - return new CompanyParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PhoneParams { - - private final Map formData; - - private PhoneParams(PhoneBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PhoneParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PhoneBuilder builder() { - return new PhoneBuilder(); - } - - public static final class PhoneBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PhoneBuilder() {} - - public PhoneBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PhoneBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PhoneBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public PhoneBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public PhoneParams build() { - return new PhoneParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AutoCollectionParams { - - private final Map formData; - - private AutoCollectionParams(AutoCollectionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AutoCollectionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AutoCollectionBuilder builder() { - return new AutoCollectionBuilder(); - } - - public static final class AutoCollectionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AutoCollectionBuilder() {} - - public AutoCollectionBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public AutoCollectionBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public AutoCollectionBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public AutoCollectionBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public AutoCollectionParams build() { - return new AutoCollectionParams(this); - } - } - - public enum Is { - ON("on"), - - OFF("off"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - ON("on"), - - OFF("off"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TaxabilityParams { - - private final Map formData; - - private TaxabilityParams(TaxabilityBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxabilityParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxabilityBuilder builder() { - return new TaxabilityBuilder(); - } - - public static final class TaxabilityBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxabilityBuilder() {} - - public TaxabilityBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public TaxabilityBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public TaxabilityBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public TaxabilityBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public TaxabilityParams build() { - return new TaxabilityParams(this); - } - } - - public enum Is { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ExportCreatedAtParams { - - private final Map formData; - - private ExportCreatedAtParams(ExportCreatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportCreatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportCreatedAtBuilder builder() { - return new ExportCreatedAtBuilder(); - } - - public static final class ExportCreatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportCreatedAtBuilder() {} - - public ExportCreatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public ExportCreatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public ExportCreatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public ExportCreatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public ExportCreatedAtParams build() { - return new ExportCreatedAtParams(this); - } - } - } - - public static final class ExportUpdatedAt2Params { - - private final Map formData; - - private ExportUpdatedAt2Params(ExportUpdatedAt2Builder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportUpdatedAt2Params. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportUpdatedAt2Builder builder() { - return new ExportUpdatedAt2Builder(); - } - - public static final class ExportUpdatedAt2Builder { - private final Map formData = new LinkedHashMap<>(); - - private ExportUpdatedAt2Builder() {} - - public ExportUpdatedAt2Builder after(String value) { - - formData.put("after", value); - - return this; - } - - public ExportUpdatedAt2Builder before(String value) { - - formData.put("before", value); - - return this; - } - - public ExportUpdatedAt2Builder on(String value) { - - formData.put("on", value); - - return this; - } - - public ExportUpdatedAt2Builder between(String value) { - - formData.put("between", value); - - return this; - } - - public ExportUpdatedAt2Params build() { - return new ExportUpdatedAt2Params(this); - } - } - } - - public static final class ExportOfflinePaymentMethodParams { - - private final Map formData; - - private ExportOfflinePaymentMethodParams(ExportOfflinePaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportOfflinePaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportOfflinePaymentMethodBuilder builder() { - return new ExportOfflinePaymentMethodBuilder(); - } - - public static final class ExportOfflinePaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportOfflinePaymentMethodBuilder() {} - - public ExportOfflinePaymentMethodBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ExportOfflinePaymentMethodBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ExportOfflinePaymentMethodBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ExportOfflinePaymentMethodBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ExportOfflinePaymentMethodParams build() { - return new ExportOfflinePaymentMethodParams(this); - } - } - - public enum Is { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ExportAutoCloseInvoicesParams { - - private final Map formData; - - private ExportAutoCloseInvoicesParams(ExportAutoCloseInvoicesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportAutoCloseInvoicesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportAutoCloseInvoicesBuilder builder() { - return new ExportAutoCloseInvoicesBuilder(); - } - - public static final class ExportAutoCloseInvoicesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportAutoCloseInvoicesBuilder() {} - - public ExportAutoCloseInvoicesBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ExportAutoCloseInvoicesParams build() { - return new ExportAutoCloseInvoicesParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ExportChannel2Params { - - private final Map formData; - - private ExportChannel2Params(ExportChannel2Builder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportChannel2Params. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportChannel2Builder builder() { - return new ExportChannel2Builder(); - } - - public static final class ExportChannel2Builder { - private final Map formData = new LinkedHashMap<>(); - - private ExportChannel2Builder() {} - - public ExportChannel2Builder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ExportChannel2Builder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ExportChannel2Builder in(String value) { - - formData.put("in", value); - - return this; - } - - public ExportChannel2Builder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ExportChannel2Params build() { - return new ExportChannel2Params(this); - } - } - - public enum Is { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class RelationshipParams { - - private final Map formData; - - private RelationshipParams(RelationshipBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RelationshipParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RelationshipBuilder builder() { - return new RelationshipBuilder(); - } - - public static final class RelationshipBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RelationshipBuilder() {} - - public RelationshipBuilder parentId(ParentIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "parent_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public RelationshipBuilder paymentOwnerId(PaymentOwnerIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_owner_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public RelationshipBuilder invoiceOwnerId(InvoiceOwnerIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "invoice_owner_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public RelationshipParams build() { - return new RelationshipParams(this); - } - } - } - - public static final class ParentIdParams { - - private final Map formData; - - private ParentIdParams(ParentIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ParentIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ParentIdBuilder builder() { - return new ParentIdBuilder(); - } - - public static final class ParentIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ParentIdBuilder() {} - - public ParentIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ParentIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ParentIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ParentIdParams build() { - return new ParentIdParams(this); - } - } - } - - public static final class PaymentOwnerIdParams { - - private final Map formData; - - private PaymentOwnerIdParams(PaymentOwnerIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentOwnerIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentOwnerIdBuilder builder() { - return new PaymentOwnerIdBuilder(); - } - - public static final class PaymentOwnerIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentOwnerIdBuilder() {} - - public PaymentOwnerIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PaymentOwnerIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PaymentOwnerIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public PaymentOwnerIdParams build() { - return new PaymentOwnerIdParams(this); - } - } - } - - public static final class InvoiceOwnerIdParams { - - private final Map formData; - - private InvoiceOwnerIdParams(InvoiceOwnerIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceOwnerIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceOwnerIdBuilder builder() { - return new InvoiceOwnerIdBuilder(); - } - - public static final class InvoiceOwnerIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceOwnerIdBuilder() {} - - public InvoiceOwnerIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public InvoiceOwnerIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public InvoiceOwnerIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public InvoiceOwnerIdParams build() { - return new InvoiceOwnerIdParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportSubscriptionsParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportSubscriptionsParams.java deleted file mode 100644 index c7702dec..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportSubscriptionsParams.java +++ /dev/null @@ -1,1855 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportSubscriptionsParams { - - private final Map formData; - - private ExportSubscriptionsParams(ExportSubscriptionsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportSubscriptionsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportSubscriptionsBuilder builder() { - return new ExportSubscriptionsBuilder(); - } - - public static final class ExportSubscriptionsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportSubscriptionsBuilder() {} - - public ExportSubscriptionsBuilder exportType(ExportType value) { - - formData.put("export_type", value); - - return this; - } - - public ExportSubscriptionsBuilder itemId(ItemIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportSubscriptionsBuilder itemPriceId(ItemPriceIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_price_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportSubscriptionsBuilder cancelReasonCode(CancelReasonCodeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "cancel_reason_code[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportSubscriptionsBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportSubscriptionsParams build() { - return new ExportSubscriptionsParams(this); - } - } - - public enum ExportType { - DATA("data"), - - IMPORT_FRIENDLY_DATA("import_friendly_data"), - - /** An enum member indicating that ExportType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ExportType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ExportType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ExportType enumValue : ExportType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class ItemIdParams { - - private final Map formData; - - private ItemIdParams(ItemIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemIdBuilder builder() { - return new ItemIdBuilder(); - } - - public static final class ItemIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemIdBuilder() {} - - public ItemIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ItemIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ItemIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ItemIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ItemIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ItemIdParams build() { - return new ItemIdParams(this); - } - } - } - - public static final class ItemPriceIdParams { - - private final Map formData; - - private ItemPriceIdParams(ItemPriceIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemPriceIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPriceIdBuilder builder() { - return new ItemPriceIdBuilder(); - } - - public static final class ItemPriceIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemPriceIdBuilder() {} - - public ItemPriceIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ItemPriceIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ItemPriceIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ItemPriceIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ItemPriceIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ItemPriceIdParams build() { - return new ItemPriceIdParams(this); - } - } - } - - public static final class CancelReasonCodeParams { - - private final Map formData; - - private CancelReasonCodeParams(CancelReasonCodeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CancelReasonCodeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CancelReasonCodeBuilder builder() { - return new CancelReasonCodeBuilder(); - } - - public static final class CancelReasonCodeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CancelReasonCodeBuilder() {} - - public CancelReasonCodeBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CancelReasonCodeBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CancelReasonCodeBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CancelReasonCodeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CancelReasonCodeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CancelReasonCodeParams build() { - return new CancelReasonCodeParams(this); - } - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder customerId(CustomerIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder status(StatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder cancelReason(CancelReasonParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "cancel_reason[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder remainingBillingCycles(RemainingBillingCyclesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "remaining_billing_cycles[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder createdAt(CreatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "created_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder activatedAt(ActivatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "activated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder nextBillingAt(NextBillingAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "next_billing_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder cancelledAt(CancelledAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "cancelled_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder hasScheduledChanges(HasScheduledChangesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "has_scheduled_changes[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "offline_payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder autoCloseInvoices(AutoCloseInvoicesParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "auto_close_invoices[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder channel(ChannelParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "channel[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionBuilder planId(PlanIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "plan_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class CustomerIdParams { - - private final Map formData; - - private CustomerIdParams(CustomerIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerIdBuilder builder() { - return new CustomerIdBuilder(); - } - - public static final class CustomerIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerIdBuilder() {} - - public CustomerIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CustomerIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CustomerIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CustomerIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CustomerIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CustomerIdParams build() { - return new CustomerIdParams(this); - } - } - } - - public static final class StatusParams { - - private final Map formData; - - private StatusParams(StatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatusBuilder builder() { - return new StatusBuilder(); - } - - public static final class StatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatusBuilder() {} - - public StatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public StatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public StatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public StatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public StatusParams build() { - return new StatusParams(this); - } - } - - public enum Is { - FUTURE("future"), - - IN_TRIAL("in_trial"), - - ACTIVE("active"), - - NON_RENEWING("non_renewing"), - - PAUSED("paused"), - - CANCELLED("cancelled"), - - TRANSFERRED("transferred"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - FUTURE("future"), - - IN_TRIAL("in_trial"), - - ACTIVE("active"), - - NON_RENEWING("non_renewing"), - - PAUSED("paused"), - - CANCELLED("cancelled"), - - TRANSFERRED("transferred"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CancelReasonParams { - - private final Map formData; - - private CancelReasonParams(CancelReasonBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CancelReasonParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CancelReasonBuilder builder() { - return new CancelReasonBuilder(); - } - - public static final class CancelReasonBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CancelReasonBuilder() {} - - public CancelReasonBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public CancelReasonBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public CancelReasonBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CancelReasonBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CancelReasonBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public CancelReasonParams build() { - return new CancelReasonParams(this); - } - } - - public enum Is { - NOT_PAID("not_paid"), - - NO_CARD("no_card"), - - FRAUD_REVIEW_FAILED("fraud_review_failed"), - - NON_COMPLIANT_EU_CUSTOMER("non_compliant_eu_customer"), - - TAX_CALCULATION_FAILED("tax_calculation_failed"), - - CURRENCY_INCOMPATIBLE_WITH_GATEWAY("currency_incompatible_with_gateway"), - - NON_COMPLIANT_CUSTOMER("non_compliant_customer"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - NOT_PAID("not_paid"), - - NO_CARD("no_card"), - - FRAUD_REVIEW_FAILED("fraud_review_failed"), - - NON_COMPLIANT_EU_CUSTOMER("non_compliant_eu_customer"), - - TAX_CALCULATION_FAILED("tax_calculation_failed"), - - CURRENCY_INCOMPATIBLE_WITH_GATEWAY("currency_incompatible_with_gateway"), - - NON_COMPLIANT_CUSTOMER("non_compliant_customer"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class RemainingBillingCyclesParams { - - private final Map formData; - - private RemainingBillingCyclesParams(RemainingBillingCyclesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RemainingBillingCyclesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RemainingBillingCyclesBuilder builder() { - return new RemainingBillingCyclesBuilder(); - } - - public static final class RemainingBillingCyclesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RemainingBillingCyclesBuilder() {} - - public RemainingBillingCyclesBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public RemainingBillingCyclesBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public RemainingBillingCyclesBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public RemainingBillingCyclesBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public RemainingBillingCyclesBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public RemainingBillingCyclesBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public RemainingBillingCyclesBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public RemainingBillingCyclesBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public RemainingBillingCyclesParams build() { - return new RemainingBillingCyclesParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CreatedAtParams { - - private final Map formData; - - private CreatedAtParams(CreatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreatedAtBuilder builder() { - return new CreatedAtBuilder(); - } - - public static final class CreatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreatedAtBuilder() {} - - public CreatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public CreatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public CreatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public CreatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public CreatedAtParams build() { - return new CreatedAtParams(this); - } - } - } - - public static final class ActivatedAtParams { - - private final Map formData; - - private ActivatedAtParams(ActivatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ActivatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ActivatedAtBuilder builder() { - return new ActivatedAtBuilder(); - } - - public static final class ActivatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ActivatedAtBuilder() {} - - public ActivatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public ActivatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public ActivatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public ActivatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public ActivatedAtBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public ActivatedAtParams build() { - return new ActivatedAtParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class NextBillingAtParams { - - private final Map formData; - - private NextBillingAtParams(NextBillingAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NextBillingAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NextBillingAtBuilder builder() { - return new NextBillingAtBuilder(); - } - - public static final class NextBillingAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NextBillingAtBuilder() {} - - public NextBillingAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public NextBillingAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public NextBillingAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public NextBillingAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public NextBillingAtParams build() { - return new NextBillingAtParams(this); - } - } - } - - public static final class CancelledAtParams { - - private final Map formData; - - private CancelledAtParams(CancelledAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CancelledAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CancelledAtBuilder builder() { - return new CancelledAtBuilder(); - } - - public static final class CancelledAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CancelledAtBuilder() {} - - public CancelledAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public CancelledAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public CancelledAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public CancelledAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public CancelledAtParams build() { - return new CancelledAtParams(this); - } - } - } - - public static final class HasScheduledChangesParams { - - private final Map formData; - - private HasScheduledChangesParams(HasScheduledChangesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HasScheduledChangesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HasScheduledChangesBuilder builder() { - return new HasScheduledChangesBuilder(); - } - - public static final class HasScheduledChangesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HasScheduledChangesBuilder() {} - - public HasScheduledChangesBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public HasScheduledChangesParams build() { - return new HasScheduledChangesParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } - - public static final class OfflinePaymentMethodParams { - - private final Map formData; - - private OfflinePaymentMethodParams(OfflinePaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OfflinePaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OfflinePaymentMethodBuilder builder() { - return new OfflinePaymentMethodBuilder(); - } - - public static final class OfflinePaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OfflinePaymentMethodBuilder() {} - - public OfflinePaymentMethodBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public OfflinePaymentMethodBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public OfflinePaymentMethodBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public OfflinePaymentMethodBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public OfflinePaymentMethodParams build() { - return new OfflinePaymentMethodParams(this); - } - } - - public enum Is { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AutoCloseInvoicesParams { - - private final Map formData; - - private AutoCloseInvoicesParams(AutoCloseInvoicesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AutoCloseInvoicesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AutoCloseInvoicesBuilder builder() { - return new AutoCloseInvoicesBuilder(); - } - - public static final class AutoCloseInvoicesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AutoCloseInvoicesBuilder() {} - - public AutoCloseInvoicesBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public AutoCloseInvoicesParams build() { - return new AutoCloseInvoicesParams(this); - } - } - - public enum Is { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ChannelParams { - - private final Map formData; - - private ChannelParams(ChannelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChannelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChannelBuilder builder() { - return new ChannelBuilder(); - } - - public static final class ChannelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChannelBuilder() {} - - public ChannelBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public ChannelBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public ChannelBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public ChannelBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public ChannelParams build() { - return new ChannelParams(this); - } - } - - public enum Is { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - WEB("web"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PlanIdParams { - - private final Map formData; - - private PlanIdParams(PlanIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PlanIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PlanIdBuilder builder() { - return new PlanIdBuilder(); - } - - public static final class PlanIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PlanIdBuilder() {} - - public PlanIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PlanIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PlanIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public PlanIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PlanIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PlanIdParams build() { - return new PlanIdParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportTransactionsParams.java b/src/main/java/com/chargebee/v4/core/models/export/params/ExportTransactionsParams.java deleted file mode 100644 index 4e97dd53..00000000 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportTransactionsParams.java +++ /dev/null @@ -1,1922 +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.core.models.export.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ExportTransactionsParams { - - private final Map formData; - - private ExportTransactionsParams(ExportTransactionsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ExportTransactionsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ExportTransactionsBuilder builder() { - return new ExportTransactionsBuilder(); - } - - public static final class ExportTransactionsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ExportTransactionsBuilder() {} - - public ExportTransactionsBuilder transaction(TransactionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "transaction[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ExportTransactionsParams build() { - return new ExportTransactionsParams(this); - } - } - - public static final class TransactionParams { - - private final Map formData; - - private TransactionParams(TransactionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionBuilder builder() { - return new TransactionBuilder(); - } - - public static final class TransactionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionBuilder() {} - - public TransactionBuilder id(IdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public TransactionBuilder customerId(CustomerIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public TransactionBuilder subscriptionId(SubscriptionIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public TransactionBuilder paymentSourceId(PaymentSourceIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_source_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public TransactionBuilder paymentMethod(PaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public TransactionBuilder gateway(GatewayParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "gateway[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public TransactionBuilder gatewayAccountId(GatewayAccountIdParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "gateway_account_id[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public TransactionBuilder idAtGateway(IdAtGatewayParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "id_at_gateway[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public TransactionBuilder referenceNumber(ReferenceNumberParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "reference_number[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public TransactionBuilder type(TypeParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "type[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public TransactionBuilder date(DateParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "date[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public TransactionBuilder amount(AmountParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "amount[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public TransactionBuilder amountCapturable(AmountCapturableParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "amount_capturable[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public TransactionBuilder status(StatusParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "status[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public TransactionBuilder updatedAt(UpdatedAtParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "updated_at[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public TransactionParams build() { - return new TransactionParams(this); - } - } - } - - public static final class IdParams { - - private final Map formData; - - private IdParams(IdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdBuilder builder() { - return new IdBuilder(); - } - - public static final class IdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdBuilder() {} - - public IdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public IdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public IdParams build() { - return new IdParams(this); - } - } - } - - public static final class CustomerIdParams { - - private final Map formData; - - private CustomerIdParams(CustomerIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CustomerIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CustomerIdBuilder builder() { - return new CustomerIdBuilder(); - } - - public static final class CustomerIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CustomerIdBuilder() {} - - public CustomerIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public CustomerIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public CustomerIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public CustomerIdBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public CustomerIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public CustomerIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public CustomerIdParams build() { - return new CustomerIdParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class SubscriptionIdParams { - - private final Map formData; - - private SubscriptionIdParams(SubscriptionIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionIdBuilder builder() { - return new SubscriptionIdBuilder(); - } - - public static final class SubscriptionIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionIdBuilder() {} - - public SubscriptionIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public SubscriptionIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public SubscriptionIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public SubscriptionIdBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public SubscriptionIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public SubscriptionIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public SubscriptionIdParams build() { - return new SubscriptionIdParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PaymentSourceIdParams { - - private final Map formData; - - private PaymentSourceIdParams(PaymentSourceIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentSourceIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentSourceIdBuilder builder() { - return new PaymentSourceIdBuilder(); - } - - public static final class PaymentSourceIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentSourceIdBuilder() {} - - public PaymentSourceIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public PaymentSourceIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public PaymentSourceIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public PaymentSourceIdBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public PaymentSourceIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PaymentSourceIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PaymentSourceIdParams build() { - return new PaymentSourceIdParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PaymentMethodParams { - - private final Map formData; - - private PaymentMethodParams(PaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentMethodBuilder builder() { - return new PaymentMethodBuilder(); - } - - public static final class PaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentMethodBuilder() {} - - public PaymentMethodBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public PaymentMethodBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public PaymentMethodBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public PaymentMethodBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public PaymentMethodParams build() { - return new PaymentMethodParams(this); - } - } - - public enum Is { - CARD("card"), - - CASH("cash"), - - CHECK("check"), - - CHARGEBACK("chargeback"), - - BANK_TRANSFER("bank_transfer"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - ALIPAY("alipay"), - - UNIONPAY("unionpay"), - - APPLE_PAY("apple_pay"), - - WECHAT_PAY("wechat_pay"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - IDEAL("ideal"), - - GOOGLE_PAY("google_pay"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GIROPAY("giropay"), - - DOTPAY("dotpay"), - - OTHER("other"), - - APP_STORE("app_store"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PLAY_STORE("play_store"), - - CUSTOM("custom"), - - BOLETO("boleto"), - - VENMO("venmo"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - CARD("card"), - - CASH("cash"), - - CHECK("check"), - - CHARGEBACK("chargeback"), - - BANK_TRANSFER("bank_transfer"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - ALIPAY("alipay"), - - UNIONPAY("unionpay"), - - APPLE_PAY("apple_pay"), - - WECHAT_PAY("wechat_pay"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - IDEAL("ideal"), - - GOOGLE_PAY("google_pay"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GIROPAY("giropay"), - - DOTPAY("dotpay"), - - OTHER("other"), - - APP_STORE("app_store"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PLAY_STORE("play_store"), - - CUSTOM("custom"), - - BOLETO("boleto"), - - VENMO("venmo"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class GatewayParams { - - private final Map formData; - - private GatewayParams(GatewayBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GatewayParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GatewayBuilder builder() { - return new GatewayBuilder(); - } - - public static final class GatewayBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GatewayBuilder() {} - - public GatewayBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public GatewayBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public GatewayBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public GatewayBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public GatewayParams build() { - return new GatewayParams(this); - } - } - - public enum Is { - 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"), - - GOCARDLESS("gocardless"), - - 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"), - - NOT_APPLICABLE("not_applicable"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - 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"), - - GOCARDLESS("gocardless"), - - 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"), - - NOT_APPLICABLE("not_applicable"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class GatewayAccountIdParams { - - private final Map formData; - - private GatewayAccountIdParams(GatewayAccountIdBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GatewayAccountIdParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GatewayAccountIdBuilder builder() { - return new GatewayAccountIdBuilder(); - } - - public static final class GatewayAccountIdBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GatewayAccountIdBuilder() {} - - public GatewayAccountIdBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public GatewayAccountIdBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public GatewayAccountIdBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public GatewayAccountIdBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public GatewayAccountIdBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public GatewayAccountIdParams build() { - return new GatewayAccountIdParams(this); - } - } - } - - public static final class IdAtGatewayParams { - - private final Map formData; - - private IdAtGatewayParams(IdAtGatewayBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for IdAtGatewayParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static IdAtGatewayBuilder builder() { - return new IdAtGatewayBuilder(); - } - - public static final class IdAtGatewayBuilder { - private final Map formData = new LinkedHashMap<>(); - - private IdAtGatewayBuilder() {} - - public IdAtGatewayBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public IdAtGatewayBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public IdAtGatewayBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public IdAtGatewayParams build() { - return new IdAtGatewayParams(this); - } - } - } - - public static final class ReferenceNumberParams { - - private final Map formData; - - private ReferenceNumberParams(ReferenceNumberBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ReferenceNumberParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ReferenceNumberBuilder builder() { - return new ReferenceNumberBuilder(); - } - - public static final class ReferenceNumberBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ReferenceNumberBuilder() {} - - public ReferenceNumberBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public ReferenceNumberBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public ReferenceNumberBuilder startsWith(String value) { - - formData.put("starts_with", value); - - return this; - } - - public ReferenceNumberBuilder isPresent(IsPresent value) { - - formData.put("is_present", value); - - return this; - } - - public ReferenceNumberParams build() { - return new ReferenceNumberParams(this); - } - } - - public enum IsPresent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsPresent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsPresent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsPresent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsPresent enumValue : IsPresent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TypeParams { - - private final Map formData; - - private TypeParams(TypeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TypeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TypeBuilder builder() { - return new TypeBuilder(); - } - - public static final class TypeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TypeBuilder() {} - - public TypeBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public TypeBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public TypeBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public TypeBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public TypeParams build() { - return new TypeParams(this); - } - } - - public enum Is { - AUTHORIZATION("authorization"), - - PAYMENT("payment"), - - REFUND("refund"), - - PAYMENT_REVERSAL("payment_reversal"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - AUTHORIZATION("authorization"), - - PAYMENT("payment"), - - REFUND("refund"), - - PAYMENT_REVERSAL("payment_reversal"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DateParams { - - private final Map formData; - - private DateParams(DateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DateBuilder builder() { - return new DateBuilder(); - } - - public static final class DateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DateBuilder() {} - - public DateBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public DateBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public DateBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public DateBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public DateParams build() { - return new DateParams(this); - } - } - } - - public static final class AmountParams { - - private final Map formData; - - private AmountParams(AmountBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AmountParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AmountBuilder builder() { - return new AmountBuilder(); - } - - public static final class AmountBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AmountBuilder() {} - - public AmountBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public AmountBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public AmountBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public AmountBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public AmountBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public AmountBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public AmountBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public AmountParams build() { - return new AmountParams(this); - } - } - } - - public static final class AmountCapturableParams { - - private final Map formData; - - private AmountCapturableParams(AmountCapturableBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AmountCapturableParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AmountCapturableBuilder builder() { - return new AmountCapturableBuilder(); - } - - public static final class AmountCapturableBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AmountCapturableBuilder() {} - - public AmountCapturableBuilder is(String value) { - - formData.put("is", value); - - return this; - } - - public AmountCapturableBuilder isNot(String value) { - - formData.put("is_not", value); - - return this; - } - - public AmountCapturableBuilder lt(String value) { - - formData.put("lt", value); - - return this; - } - - public AmountCapturableBuilder lte(String value) { - - formData.put("lte", value); - - return this; - } - - public AmountCapturableBuilder gt(String value) { - - formData.put("gt", value); - - return this; - } - - public AmountCapturableBuilder gte(String value) { - - formData.put("gte", value); - - return this; - } - - public AmountCapturableBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public AmountCapturableParams build() { - return new AmountCapturableParams(this); - } - } - } - - public static final class StatusParams { - - private final Map formData; - - private StatusParams(StatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatusParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatusBuilder builder() { - return new StatusBuilder(); - } - - public static final class StatusBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatusBuilder() {} - - public StatusBuilder is(Is value) { - - formData.put("is", value); - - return this; - } - - public StatusBuilder isNot(IsNot value) { - - formData.put("is_not", value); - - return this; - } - - public StatusBuilder in(String value) { - - formData.put("in", value); - - return this; - } - - public StatusBuilder notIn(String value) { - - formData.put("not_in", value); - - return this; - } - - public StatusParams build() { - return new StatusParams(this); - } - } - - public enum Is { - IN_PROGRESS("in_progress"), - - SUCCESS("success"), - - VOIDED("voided"), - - FAILURE("failure"), - - TIMEOUT("timeout"), - - NEEDS_ATTENTION("needs_attention"), - - LATE_FAILURE("late_failure"), - - /** An enum member indicating that Is was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Is(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Is fromString(String value) { - if (value == null) return _UNKNOWN; - for (Is enumValue : Is.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum IsNot { - IN_PROGRESS("in_progress"), - - SUCCESS("success"), - - VOIDED("voided"), - - FAILURE("failure"), - - TIMEOUT("timeout"), - - NEEDS_ATTENTION("needs_attention"), - - LATE_FAILURE("late_failure"), - - /** An enum member indicating that IsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsNot enumValue : IsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class UpdatedAtParams { - - private final Map formData; - - private UpdatedAtParams(UpdatedAtBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UpdatedAtParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UpdatedAtBuilder builder() { - return new UpdatedAtBuilder(); - } - - public static final class UpdatedAtBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UpdatedAtBuilder() {} - - public UpdatedAtBuilder after(String value) { - - formData.put("after", value); - - return this; - } - - public UpdatedAtBuilder before(String value) { - - formData.put("before", value); - - return this; - } - - public UpdatedAtBuilder on(String value) { - - formData.put("on", value); - - return this; - } - - public UpdatedAtBuilder between(String value) { - - formData.put("between", value); - - return this; - } - - public UpdatedAtParams build() { - return new UpdatedAtParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureArchiveParams.java b/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureArchiveParams.java deleted file mode 100644 index 9550bab1..00000000 --- a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureArchiveParams.java +++ /dev/null @@ -1,43 +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.core.models.feature.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class FeatureArchiveParams { - - private final Map formData; - - private FeatureArchiveParams(FeatureArchiveBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for FeatureArchiveParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static FeatureArchiveBuilder builder() { - return new FeatureArchiveBuilder(); - } - - public static final class FeatureArchiveBuilder { - private final Map formData = new LinkedHashMap<>(); - - private FeatureArchiveBuilder() {} - - public FeatureArchiveParams build() { - return new FeatureArchiveParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureCreateParams.java b/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureCreateParams.java deleted file mode 100644 index f76069fb..00000000 --- a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureCreateParams.java +++ /dev/null @@ -1,221 +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.core.models.feature.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class FeatureCreateParams { - - private final Map formData; - - private FeatureCreateParams(FeatureCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for FeatureCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static FeatureCreateBuilder builder() { - return new FeatureCreateBuilder(); - } - - public static final class FeatureCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private FeatureCreateBuilder() {} - - public FeatureCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public FeatureCreateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public FeatureCreateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public FeatureCreateBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public FeatureCreateBuilder unit(String value) { - - formData.put("unit", value); - - return this; - } - - public FeatureCreateBuilder levels(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - LevelsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "levels[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 FeatureCreateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 FeatureCreateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public FeatureCreateParams build() { - return new FeatureCreateParams(this); - } - } - - public enum Type { - SWITCH("switch"), - - CUSTOM("custom"), - - QUANTITY("quantity"), - - RANGE("range"), - - /** 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 static final class LevelsParams { - - private final Map formData; - - private LevelsParams(LevelsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for LevelsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static LevelsBuilder builder() { - return new LevelsBuilder(); - } - - public static final class LevelsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private LevelsBuilder() {} - - public LevelsBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public LevelsBuilder value(String value) { - - formData.put("value", value); - - return this; - } - - public LevelsBuilder isUnlimited(Boolean value) { - - formData.put("is_unlimited", value); - - return this; - } - - public LevelsBuilder level(Integer value) { - - formData.put("level", value); - - return this; - } - - public LevelsParams build() { - return new LevelsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureDeleteParams.java deleted file mode 100644 index 5739dd21..00000000 --- a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureDeleteParams.java +++ /dev/null @@ -1,43 +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.core.models.feature.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class FeatureDeleteParams { - - private final Map formData; - - private FeatureDeleteParams(FeatureDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for FeatureDeleteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static FeatureDeleteBuilder builder() { - return new FeatureDeleteBuilder(); - } - - public static final class FeatureDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private FeatureDeleteBuilder() {} - - public FeatureDeleteParams build() { - return new FeatureDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureUpdateParams.java deleted file mode 100644 index 634c2764..00000000 --- a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureUpdateParams.java +++ /dev/null @@ -1,175 +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.core.models.feature.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class FeatureUpdateParams { - - private final Map formData; - - private FeatureUpdateParams(FeatureUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for FeatureUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static FeatureUpdateBuilder builder() { - return new FeatureUpdateBuilder(); - } - - public static final class FeatureUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private FeatureUpdateBuilder() {} - - public FeatureUpdateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public FeatureUpdateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public FeatureUpdateBuilder unit(String value) { - - formData.put("unit", value); - - return this; - } - - public FeatureUpdateBuilder levels(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - LevelsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "levels[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 FeatureUpdateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 FeatureUpdateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public FeatureUpdateParams build() { - return new FeatureUpdateParams(this); - } - } - - public static final class LevelsParams { - - private final Map formData; - - private LevelsParams(LevelsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for LevelsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static LevelsBuilder builder() { - return new LevelsBuilder(); - } - - public static final class LevelsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private LevelsBuilder() {} - - public LevelsBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public LevelsBuilder value(String value) { - - formData.put("value", value); - - return this; - } - - public LevelsBuilder isUnlimited(Boolean value) { - - formData.put("is_unlimited", value); - - return this; - } - - public LevelsBuilder level(Integer value) { - - formData.put("level", value); - - return this; - } - - public LevelsParams build() { - return new LevelsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/gift/params/GiftCancelParams.java b/src/main/java/com/chargebee/v4/core/models/gift/params/GiftCancelParams.java deleted file mode 100644 index 3579fa9b..00000000 --- a/src/main/java/com/chargebee/v4/core/models/gift/params/GiftCancelParams.java +++ /dev/null @@ -1,43 +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.core.models.gift.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class GiftCancelParams { - - private final Map formData; - - private GiftCancelParams(GiftCancelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GiftCancelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GiftCancelBuilder builder() { - return new GiftCancelBuilder(); - } - - public static final class GiftCancelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GiftCancelBuilder() {} - - public GiftCancelParams build() { - return new GiftCancelParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/gift/params/GiftClaimParams.java b/src/main/java/com/chargebee/v4/core/models/gift/params/GiftClaimParams.java deleted file mode 100644 index 811393ea..00000000 --- a/src/main/java/com/chargebee/v4/core/models/gift/params/GiftClaimParams.java +++ /dev/null @@ -1,43 +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.core.models.gift.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class GiftClaimParams { - - private final Map formData; - - private GiftClaimParams(GiftClaimBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GiftClaimParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GiftClaimBuilder builder() { - return new GiftClaimBuilder(); - } - - public static final class GiftClaimBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GiftClaimBuilder() {} - - public GiftClaimParams build() { - return new GiftClaimParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/gift/params/GiftCreateForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/gift/params/GiftCreateForItemsParams.java deleted file mode 100644 index 487b2fbe..00000000 --- a/src/main/java/com/chargebee/v4/core/models/gift/params/GiftCreateForItemsParams.java +++ /dev/null @@ -1,616 +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.core.models.gift.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 GiftCreateForItemsParams { - - private final Map formData; - - private GiftCreateForItemsParams(GiftCreateForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GiftCreateForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GiftCreateForItemsBuilder builder() { - return new GiftCreateForItemsBuilder(); - } - - public static final class GiftCreateForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GiftCreateForItemsBuilder() {} - - public GiftCreateForItemsBuilder scheduledAt(Timestamp value) { - - formData.put("scheduled_at", value); - - return this; - } - - public GiftCreateForItemsBuilder autoClaim(Boolean value) { - - formData.put("auto_claim", value); - - return this; - } - - public GiftCreateForItemsBuilder noExpiry(Boolean value) { - - formData.put("no_expiry", value); - - return this; - } - - public GiftCreateForItemsBuilder claimExpiryDate(Timestamp value) { - - formData.put("claim_expiry_date", value); - - return this; - } - - public GiftCreateForItemsBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public GiftCreateForItemsBuilder gifter(GifterParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "gifter[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public GiftCreateForItemsBuilder giftReceiver(GiftReceiverParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "gift_receiver[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public GiftCreateForItemsBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public GiftCreateForItemsBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public GiftCreateForItemsBuilder subscriptionItems(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public GiftCreateForItemsParams build() { - return new GiftCreateForItemsParams(this); - } - } - - public static final class GifterParams { - - private final Map formData; - - private GifterParams(GifterBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GifterParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GifterBuilder builder() { - return new GifterBuilder(); - } - - public static final class GifterBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GifterBuilder() {} - - public GifterBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public GifterBuilder signature(String value) { - - formData.put("signature", value); - - return this; - } - - public GifterBuilder note(String value) { - - formData.put("note", value); - - return this; - } - - public GifterBuilder paymentSrcId(String value) { - - formData.put("payment_src_id", value); - - return this; - } - - public GifterParams build() { - return new GifterParams(this); - } - } - } - - public static final class GiftReceiverParams { - - private final Map formData; - - private GiftReceiverParams(GiftReceiverBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GiftReceiverParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GiftReceiverBuilder builder() { - return new GiftReceiverBuilder(); - } - - public static final class GiftReceiverBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GiftReceiverBuilder() {} - - public GiftReceiverBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public GiftReceiverBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public GiftReceiverBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public GiftReceiverBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public GiftReceiverParams build() { - return new GiftReceiverParams(this); - } - } - } - - public static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/gift/params/GiftCreateParams.java b/src/main/java/com/chargebee/v4/core/models/gift/params/GiftCreateParams.java deleted file mode 100644 index b898e4c6..00000000 --- a/src/main/java/com/chargebee/v4/core/models/gift/params/GiftCreateParams.java +++ /dev/null @@ -1,678 +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.core.models.gift.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 GiftCreateParams { - - private final Map formData; - - private GiftCreateParams(GiftCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GiftCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GiftCreateBuilder builder() { - return new GiftCreateBuilder(); - } - - public static final class GiftCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GiftCreateBuilder() {} - - public GiftCreateBuilder scheduledAt(Timestamp value) { - - formData.put("scheduled_at", value); - - return this; - } - - public GiftCreateBuilder autoClaim(Boolean value) { - - formData.put("auto_claim", value); - - return this; - } - - public GiftCreateBuilder noExpiry(Boolean value) { - - formData.put("no_expiry", value); - - return this; - } - - public GiftCreateBuilder claimExpiryDate(Timestamp value) { - - formData.put("claim_expiry_date", value); - - return this; - } - - public GiftCreateBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public GiftCreateBuilder gifter(GifterParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "gifter[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public GiftCreateBuilder giftReceiver(GiftReceiverParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "gift_receiver[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public GiftCreateBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public GiftCreateBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public GiftCreateBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public GiftCreateBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public GiftCreateParams build() { - return new GiftCreateParams(this); - } - } - - public static final class GifterParams { - - private final Map formData; - - private GifterParams(GifterBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GifterParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GifterBuilder builder() { - return new GifterBuilder(); - } - - public static final class GifterBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GifterBuilder() {} - - public GifterBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public GifterBuilder signature(String value) { - - formData.put("signature", value); - - return this; - } - - public GifterBuilder note(String value) { - - formData.put("note", value); - - return this; - } - - public GifterBuilder paymentSrcId(String value) { - - formData.put("payment_src_id", value); - - return this; - } - - public GifterParams build() { - return new GifterParams(this); - } - } - } - - public static final class GiftReceiverParams { - - private final Map formData; - - private GiftReceiverParams(GiftReceiverBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GiftReceiverParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GiftReceiverBuilder builder() { - return new GiftReceiverBuilder(); - } - - public static final class GiftReceiverBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GiftReceiverBuilder() {} - - public GiftReceiverBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public GiftReceiverBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public GiftReceiverBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public GiftReceiverBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public GiftReceiverParams build() { - return new GiftReceiverParams(this); - } - } - } - - public static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/gift/params/GiftUpdateGiftParams.java b/src/main/java/com/chargebee/v4/core/models/gift/params/GiftUpdateGiftParams.java deleted file mode 100644 index fe0ad96a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/gift/params/GiftUpdateGiftParams.java +++ /dev/null @@ -1,58 +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.core.models.gift.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class GiftUpdateGiftParams { - - private final Map formData; - - private GiftUpdateGiftParams(GiftUpdateGiftBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GiftUpdateGiftParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GiftUpdateGiftBuilder builder() { - return new GiftUpdateGiftBuilder(); - } - - public static final class GiftUpdateGiftBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GiftUpdateGiftBuilder() {} - - public GiftUpdateGiftBuilder scheduledAt(Timestamp value) { - - formData.put("scheduled_at", value); - - return this; - } - - public GiftUpdateGiftBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public GiftUpdateGiftParams build() { - return new GiftUpdateGiftParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageAcceptQuoteParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageAcceptQuoteParams.java deleted file mode 100644 index ca61bd03..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageAcceptQuoteParams.java +++ /dev/null @@ -1,133 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class HostedPageAcceptQuoteParams { - - private final Map formData; - - private HostedPageAcceptQuoteParams(HostedPageAcceptQuoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageAcceptQuoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageAcceptQuoteBuilder builder() { - return new HostedPageAcceptQuoteBuilder(); - } - - public static final class HostedPageAcceptQuoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageAcceptQuoteBuilder() {} - - public HostedPageAcceptQuoteBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public HostedPageAcceptQuoteBuilder layout(Layout value) { - - formData.put("layout", value); - - return this; - } - - public HostedPageAcceptQuoteBuilder quote(QuoteParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "quote[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageAcceptQuoteParams build() { - return new HostedPageAcceptQuoteParams(this); - } - } - - public enum Layout { - IN_APP("in_app"), - - FULL_PAGE("full_page"), - - /** An enum member indicating that Layout was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Layout(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Layout fromString(String value) { - if (value == null) return _UNKNOWN; - for (Layout enumValue : Layout.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class QuoteParams { - - private final Map formData; - - private QuoteParams(QuoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteBuilder builder() { - return new QuoteBuilder(); - } - - public static final class QuoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteBuilder() {} - - public QuoteBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public QuoteParams build() { - return new QuoteParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutExistingForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutExistingForItemsParams.java deleted file mode 100644 index da484cd6..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutExistingForItemsParams.java +++ /dev/null @@ -1,1511 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class HostedPageCheckoutExistingForItemsParams { - - private final Map formData; - - private HostedPageCheckoutExistingForItemsParams( - HostedPageCheckoutExistingForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageCheckoutExistingForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageCheckoutExistingForItemsBuilder builder() { - return new HostedPageCheckoutExistingForItemsBuilder(); - } - - public static final class HostedPageCheckoutExistingForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageCheckoutExistingForItemsBuilder() {} - - public HostedPageCheckoutExistingForItemsBuilder layout(Layout value) { - - formData.put("layout", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder mandatoryItemsToRemove(List value) { - - formData.put("mandatory_items_to_remove", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder replaceItemsList(Boolean value) { - - formData.put("replace_items_list", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder reactivateFrom(Timestamp value) { - - formData.put("reactivate_from", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder billingAlignmentMode( - BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder replaceCouponList(Boolean value) { - - formData.put("replace_coupon_list", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder reactivate(Boolean value) { - - formData.put("reactivate", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder forceTermReset(Boolean value) { - - formData.put("force_term_reset", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder changeOption(ChangeOption value) { - - formData.put("change_option", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder changesScheduledAt(Timestamp value) { - - formData.put("changes_scheduled_at", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder cancelUrl(String value) { - - formData.put("cancel_url", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder passThruContent(String value) { - - formData.put("pass_thru_content", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder allowOfflinePaymentMethods(Boolean value) { - - formData.put("allow_offline_payment_methods", value); - - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutExistingForItemsBuilder entityIdentifiers( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EntityIdentifiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "entity_identifiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutExistingForItemsParams build() { - return new HostedPageCheckoutExistingForItemsParams(this); - } - } - - public enum Layout { - IN_APP("in_app"), - - FULL_PAGE("full_page"), - - /** An enum member indicating that Layout was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Layout(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Layout fromString(String value) { - if (value == null) return _UNKNOWN; - for (Layout enumValue : Layout.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChangeOption { - IMMEDIATELY("immediately"), - - END_OF_TERM("end_of_term"), - - SPECIFIC_DATE("specific_date"), - - /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChangeOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChangeOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChangeOption enumValue : ChangeOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder isEinvoiceEnabled(Boolean value) { - - formData.put("is_einvoice_enabled", value); - - return this; - } - - public CustomerBuilder entityIdentifierScheme(String value) { - - formData.put("entity_identifier_scheme", value); - - return this; - } - - public CustomerBuilder entityIdentifierStandard(String value) { - - formData.put("entity_identifier_standard", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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 static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public SubscriptionItemsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionItemsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionItemsBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { - - formData.put("charge_on_option", value); - - return this; - } - - public SubscriptionItemsBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - - 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"), - - /** 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; - } - } - - public enum ChargeOnOption { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOnOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOnOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOnOption enumValue : ChargeOnOption.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 DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder operationType(OperationType value) { - - formData.put("operation_type", value); - - return this; - } - - public DiscountsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 enum OperationType { - ADD("add"), - - REMOVE("remove"), - - /** An enum member indicating that OperationType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OperationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OperationType fromString(String value) { - if (value == null) return _UNKNOWN; - for (OperationType enumValue : OperationType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class EntityIdentifiersParams { - - private final Map formData; - - private EntityIdentifiersParams(EntityIdentifiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EntityIdentifiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EntityIdentifiersBuilder builder() { - return new EntityIdentifiersBuilder(); - } - - public static final class EntityIdentifiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EntityIdentifiersBuilder() {} - - public EntityIdentifiersBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EntityIdentifiersBuilder scheme(String value) { - - formData.put("scheme", value); - - return this; - } - - public EntityIdentifiersBuilder value(String value) { - - formData.put("value", value); - - return this; - } - - public EntityIdentifiersBuilder operation(Operation value) { - - formData.put("operation", value); - - return this; - } - - public EntityIdentifiersBuilder standard(String value) { - - formData.put("standard", value); - - return this; - } - - public EntityIdentifiersParams build() { - return new EntityIdentifiersParams(this); - } - } - - public enum Operation { - CREATE("create"), - - UPDATE("update"), - - DELETE("delete"), - - /** An enum member indicating that Operation was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Operation(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Operation fromString(String value) { - if (value == null) return _UNKNOWN; - for (Operation enumValue : Operation.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutExistingParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutExistingParams.java deleted file mode 100644 index f5b815af..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutExistingParams.java +++ /dev/null @@ -1,1001 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class HostedPageCheckoutExistingParams { - - private final Map formData; - - private HostedPageCheckoutExistingParams(HostedPageCheckoutExistingBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageCheckoutExistingParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageCheckoutExistingBuilder builder() { - return new HostedPageCheckoutExistingBuilder(); - } - - public static final class HostedPageCheckoutExistingBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageCheckoutExistingBuilder() {} - - public HostedPageCheckoutExistingBuilder replaceAddonList(Boolean value) { - - formData.put("replace_addon_list", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder mandatoryAddonsToRemove(List value) { - - formData.put("mandatory_addons_to_remove", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder reactivateFrom(Timestamp value) { - - formData.put("reactivate_from", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder billingAlignmentMode(BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder replaceCouponList(Boolean value) { - - formData.put("replace_coupon_list", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder reactivate(Boolean value) { - - formData.put("reactivate", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder forceTermReset(Boolean value) { - - formData.put("force_term_reset", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder cancelUrl(String value) { - - formData.put("cancel_url", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder passThruContent(String value) { - - formData.put("pass_thru_content", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder embed(Boolean value) { - - formData.put("embed", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder iframeMessaging(Boolean value) { - - formData.put("iframe_messaging", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder allowOfflinePaymentMethods(Boolean value) { - - formData.put("allow_offline_payment_methods", value); - - return this; - } - - public HostedPageCheckoutExistingBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutExistingBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutExistingBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutExistingBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutExistingBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutExistingBuilder eventBasedAddons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutExistingParams build() { - return new HostedPageCheckoutExistingParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionBuilder planUnitPrice(Long value) { - - formData.put("plan_unit_price", value); - - return this; - } - - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - public SubscriptionBuilder planUnitPriceInDecimal(String value) { - - formData.put("plan_unit_price_in_decimal", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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 static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { - - formData.put("service_period_in_days", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOn(ChargeOn value) { - - formData.put("charge_on", value); - - return this; - } - - public EventBasedAddonsBuilder onEvent(OnEvent value) { - - formData.put("on_event", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - - public enum ChargeOn { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOn(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOn fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOn enumValue : ChargeOn.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OnEvent { - SUBSCRIPTION_CREATION("subscription_creation"), - - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** An enum member indicating that OnEvent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OnEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OnEvent fromString(String value) { - if (value == null) return _UNKNOWN; - for (OnEvent enumValue : OnEvent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutGiftForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutGiftForItemsParams.java deleted file mode 100644 index 52d3fa59..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutGiftForItemsParams.java +++ /dev/null @@ -1,181 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class HostedPageCheckoutGiftForItemsParams { - - private final Map formData; - - private HostedPageCheckoutGiftForItemsParams(HostedPageCheckoutGiftForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageCheckoutGiftForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageCheckoutGiftForItemsBuilder builder() { - return new HostedPageCheckoutGiftForItemsBuilder(); - } - - public static final class HostedPageCheckoutGiftForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageCheckoutGiftForItemsBuilder() {} - - public HostedPageCheckoutGiftForItemsBuilder businessEntityId(String value) { - - formData.put("business_entity_id", value); - - return this; - } - - public HostedPageCheckoutGiftForItemsBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public HostedPageCheckoutGiftForItemsBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public HostedPageCheckoutGiftForItemsBuilder gifter(GifterParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "gifter[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutGiftForItemsBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutGiftForItemsParams build() { - return new HostedPageCheckoutGiftForItemsParams(this); - } - } - - public static final class GifterParams { - - private final Map formData; - - private GifterParams(GifterBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GifterParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GifterBuilder builder() { - return new GifterBuilder(); - } - - public static final class GifterBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GifterBuilder() {} - - public GifterBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public GifterParams build() { - return new GifterParams(this); - } - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutGiftParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutGiftParams.java deleted file mode 100644 index 73e84a69..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutGiftParams.java +++ /dev/null @@ -1,243 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class HostedPageCheckoutGiftParams { - - private final Map formData; - - private HostedPageCheckoutGiftParams(HostedPageCheckoutGiftBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageCheckoutGiftParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageCheckoutGiftBuilder builder() { - return new HostedPageCheckoutGiftBuilder(); - } - - public static final class HostedPageCheckoutGiftBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageCheckoutGiftBuilder() {} - - public HostedPageCheckoutGiftBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public HostedPageCheckoutGiftBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public HostedPageCheckoutGiftBuilder gifter(GifterParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "gifter[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutGiftBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutGiftBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutGiftParams build() { - return new HostedPageCheckoutGiftParams(this); - } - } - - public static final class GifterParams { - - private final Map formData; - - private GifterParams(GifterBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GifterParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GifterBuilder builder() { - return new GifterBuilder(); - } - - public static final class GifterBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GifterBuilder() {} - - public GifterBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public GifterParams build() { - return new GifterParams(this); - } - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutNewForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutNewForItemsParams.java deleted file mode 100644 index 5bceb233..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutNewForItemsParams.java +++ /dev/null @@ -1,1857 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class HostedPageCheckoutNewForItemsParams { - - private final Map formData; - - private HostedPageCheckoutNewForItemsParams(HostedPageCheckoutNewForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageCheckoutNewForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageCheckoutNewForItemsBuilder builder() { - return new HostedPageCheckoutNewForItemsBuilder(); - } - - public static final class HostedPageCheckoutNewForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageCheckoutNewForItemsBuilder() {} - - public HostedPageCheckoutNewForItemsBuilder layout(Layout value) { - - formData.put("layout", value); - - return this; - } - - public HostedPageCheckoutNewForItemsBuilder businessEntityId(String value) { - - formData.put("business_entity_id", value); - - return this; - } - - public HostedPageCheckoutNewForItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public HostedPageCheckoutNewForItemsBuilder mandatoryItemsToRemove(List value) { - - formData.put("mandatory_items_to_remove", value); - - return this; - } - - public HostedPageCheckoutNewForItemsBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public HostedPageCheckoutNewForItemsBuilder billingAlignmentMode(BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public HostedPageCheckoutNewForItemsBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public HostedPageCheckoutNewForItemsBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public HostedPageCheckoutNewForItemsBuilder cancelUrl(String value) { - - formData.put("cancel_url", value); - - return this; - } - - public HostedPageCheckoutNewForItemsBuilder passThruContent(String value) { - - formData.put("pass_thru_content", value); - - return this; - } - - public HostedPageCheckoutNewForItemsBuilder allowOfflinePaymentMethods(Boolean value) { - - formData.put("allow_offline_payment_methods", value); - - return this; - } - - public HostedPageCheckoutNewForItemsBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutNewForItemsBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutNewForItemsBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutNewForItemsBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutNewForItemsBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutNewForItemsBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutNewForItemsBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutNewForItemsBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutNewForItemsBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutNewForItemsBuilder entityIdentifiers( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EntityIdentifiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "entity_identifiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutNewForItemsParams build() { - return new HostedPageCheckoutNewForItemsParams(this); - } - } - - public enum Layout { - IN_APP("in_app"), - - FULL_PAGE("full_page"), - - /** An enum member indicating that Layout was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Layout(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Layout fromString(String value) { - if (value == null) return _UNKNOWN; - for (Layout enumValue : Layout.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public SubscriptionBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public CustomerBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CustomerBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CustomerBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public CustomerBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public CustomerBuilder locale(String value) { - - formData.put("locale", value); - - return this; - } - - public CustomerBuilder taxability(Taxability value) { - - formData.put("taxability", value); - - return this; - } - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder isEinvoiceEnabled(Boolean value) { - - formData.put("is_einvoice_enabled", value); - - return this; - } - - public CustomerBuilder entityIdentifierScheme(String value) { - - formData.put("entity_identifier_scheme", value); - - return this; - } - - public CustomerBuilder entityIdentifierStandard(String value) { - - formData.put("entity_identifier_standard", value); - - return this; - } - - public CustomerBuilder einvoicingMethod(EinvoicingMethod value) { - - formData.put("einvoicing_method", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - - public enum Taxability { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Taxability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Taxability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Taxability fromString(String value) { - if (value == null) return _UNKNOWN; - for (Taxability enumValue : Taxability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EinvoicingMethod { - AUTOMATIC("automatic"), - - MANUAL("manual"), - - SITE_DEFAULT("site_default"), - - /** An enum member indicating that EinvoicingMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EinvoicingMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EinvoicingMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (EinvoicingMethod enumValue : EinvoicingMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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 static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public SubscriptionItemsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionItemsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionItemsBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public SubscriptionItemsBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { - - formData.put("charge_on_option", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - - 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"), - - /** 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; - } - } - - 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 enum ChargeOnOption { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOnOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOnOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOnOption enumValue : ChargeOnOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class EntityIdentifiersParams { - - private final Map formData; - - private EntityIdentifiersParams(EntityIdentifiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EntityIdentifiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EntityIdentifiersBuilder builder() { - return new EntityIdentifiersBuilder(); - } - - public static final class EntityIdentifiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EntityIdentifiersBuilder() {} - - public EntityIdentifiersBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EntityIdentifiersBuilder scheme(String value) { - - formData.put("scheme", value); - - return this; - } - - public EntityIdentifiersBuilder value(String value) { - - formData.put("value", value); - - return this; - } - - public EntityIdentifiersBuilder operation(Operation value) { - - formData.put("operation", value); - - return this; - } - - public EntityIdentifiersBuilder standard(String value) { - - formData.put("standard", value); - - return this; - } - - public EntityIdentifiersParams build() { - return new EntityIdentifiersParams(this); - } - } - - public enum Operation { - CREATE("create"), - - UPDATE("update"), - - DELETE("delete"), - - /** An enum member indicating that Operation was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Operation(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Operation fromString(String value) { - if (value == null) return _UNKNOWN; - for (Operation enumValue : Operation.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutNewParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutNewParams.java deleted file mode 100644 index 6149c8fa..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutNewParams.java +++ /dev/null @@ -1,1399 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class HostedPageCheckoutNewParams { - - private final Map formData; - - private HostedPageCheckoutNewParams(HostedPageCheckoutNewBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageCheckoutNewParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageCheckoutNewBuilder builder() { - return new HostedPageCheckoutNewBuilder(); - } - - public static final class HostedPageCheckoutNewBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageCheckoutNewBuilder() {} - - public HostedPageCheckoutNewBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public HostedPageCheckoutNewBuilder mandatoryAddonsToRemove(List value) { - - formData.put("mandatory_addons_to_remove", value); - - return this; - } - - public HostedPageCheckoutNewBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public HostedPageCheckoutNewBuilder billingAlignmentMode(BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public HostedPageCheckoutNewBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public HostedPageCheckoutNewBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public HostedPageCheckoutNewBuilder cancelUrl(String value) { - - formData.put("cancel_url", value); - - return this; - } - - public HostedPageCheckoutNewBuilder passThruContent(String value) { - - formData.put("pass_thru_content", value); - - return this; - } - - public HostedPageCheckoutNewBuilder embed(Boolean value) { - - formData.put("embed", value); - - return this; - } - - public HostedPageCheckoutNewBuilder iframeMessaging(Boolean value) { - - formData.put("iframe_messaging", value); - - return this; - } - - public HostedPageCheckoutNewBuilder allowOfflinePaymentMethods(Boolean value) { - - formData.put("allow_offline_payment_methods", value); - - return this; - } - - public HostedPageCheckoutNewBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutNewBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutNewBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutNewBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutNewBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutNewBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutNewBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutNewBuilder eventBasedAddons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutNewParams build() { - return new HostedPageCheckoutNewParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - public SubscriptionBuilder planUnitPrice(Long value) { - - formData.put("plan_unit_price", value); - - return this; - } - - public SubscriptionBuilder planUnitPriceInDecimal(String value) { - - formData.put("plan_unit_price_in_decimal", value); - - return this; - } - - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public SubscriptionBuilder affiliateToken(String value) { - - formData.put("affiliate_token", value); - - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public CustomerBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CustomerBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CustomerBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public CustomerBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public CustomerBuilder locale(String value) { - - formData.put("locale", value); - - return this; - } - - public CustomerBuilder taxability(Taxability value) { - - formData.put("taxability", value); - - return this; - } - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder consolidatedInvoicing(Boolean value) { - - formData.put("consolidated_invoicing", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - - public enum Taxability { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Taxability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Taxability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Taxability fromString(String value) { - if (value == null) return _UNKNOWN; - for (Taxability enumValue : Taxability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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 static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { - - formData.put("service_period_in_days", value); - - return this; - } - - public EventBasedAddonsBuilder onEvent(OnEvent value) { - - formData.put("on_event", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOn(ChargeOn value) { - - formData.put("charge_on", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - - public enum OnEvent { - SUBSCRIPTION_CREATION("subscription_creation"), - - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** An enum member indicating that OnEvent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OnEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OnEvent fromString(String value) { - if (value == null) return _UNKNOWN; - for (OnEvent enumValue : OnEvent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChargeOn { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOn(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOn fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOn enumValue : ChargeOn.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutOneTimeForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutOneTimeForItemsParams.java deleted file mode 100644 index 00e360a3..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutOneTimeForItemsParams.java +++ /dev/null @@ -1,1544 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class HostedPageCheckoutOneTimeForItemsParams { - - private final Map formData; - - private HostedPageCheckoutOneTimeForItemsParams( - HostedPageCheckoutOneTimeForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageCheckoutOneTimeForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageCheckoutOneTimeForItemsBuilder builder() { - return new HostedPageCheckoutOneTimeForItemsBuilder(); - } - - public static final class HostedPageCheckoutOneTimeForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageCheckoutOneTimeForItemsBuilder() {} - - public HostedPageCheckoutOneTimeForItemsBuilder businessEntityId(String value) { - - formData.put("business_entity_id", value); - - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder layout(Layout value) { - - formData.put("layout", value); - - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder invoiceNote(String value) { - - formData.put("invoice_note", value); - - return this; - } - - @Deprecated - public HostedPageCheckoutOneTimeForItemsBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder cancelUrl(String value) { - - formData.put("cancel_url", value); - - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder passThruContent(String value) { - - formData.put("pass_thru_content", value); - - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder invoice(InvoiceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "invoice[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder itemPrices(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemPricesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_prices[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder charges(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ChargesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutOneTimeForItemsBuilder entityIdentifiers( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EntityIdentifiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "entity_identifiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutOneTimeForItemsParams build() { - return new HostedPageCheckoutOneTimeForItemsParams(this); - } - } - - public enum Layout { - IN_APP("in_app"), - - FULL_PAGE("full_page"), - - /** An enum member indicating that Layout was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Layout(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Layout fromString(String value) { - if (value == null) return _UNKNOWN; - for (Layout enumValue : Layout.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public CustomerBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CustomerBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CustomerBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public CustomerBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public CustomerBuilder locale(String value) { - - formData.put("locale", value); - - return this; - } - - public CustomerBuilder taxability(Taxability value) { - - formData.put("taxability", value); - - return this; - } - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder einvoicingMethod(EinvoicingMethod value) { - - formData.put("einvoicing_method", value); - - return this; - } - - public CustomerBuilder isEinvoiceEnabled(Boolean value) { - - formData.put("is_einvoice_enabled", value); - - return this; - } - - public CustomerBuilder entityIdentifierScheme(String value) { - - formData.put("entity_identifier_scheme", value); - - return this; - } - - public CustomerBuilder entityIdentifierStandard(String value) { - - formData.put("entity_identifier_standard", value); - - return this; - } - - public CustomerBuilder consolidatedInvoicing(Boolean value) { - - formData.put("consolidated_invoicing", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - - public enum Taxability { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Taxability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Taxability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Taxability fromString(String value) { - if (value == null) return _UNKNOWN; - for (Taxability enumValue : Taxability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EinvoicingMethod { - AUTOMATIC("automatic"), - - MANUAL("manual"), - - SITE_DEFAULT("site_default"), - - /** An enum member indicating that EinvoicingMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EinvoicingMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EinvoicingMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (EinvoicingMethod enumValue : EinvoicingMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class InvoiceParams { - - private final Map formData; - - private InvoiceParams(InvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceBuilder builder() { - return new InvoiceBuilder(); - } - - public static final class InvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceBuilder() {} - - public InvoiceBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public InvoiceParams build() { - return new InvoiceParams(this); - } - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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 static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class ItemPricesParams { - - private final Map formData; - - private ItemPricesParams(ItemPricesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemPricesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPricesBuilder builder() { - return new ItemPricesBuilder(); - } - - public static final class ItemPricesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemPricesBuilder() {} - - public ItemPricesBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemPricesBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public ItemPricesBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public ItemPricesBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public ItemPricesBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public ItemPricesBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public ItemPricesBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public ItemPricesParams build() { - return new ItemPricesParams(this); - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ChargesParams { - - private final Map formData; - - private ChargesParams(ChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargesBuilder builder() { - return new ChargesBuilder(); - } - - public static final class ChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargesBuilder() {} - - public ChargesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public ChargesBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public ChargesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ChargesBuilder taxable(Boolean value) { - - formData.put("taxable", value); - - return this; - } - - public ChargesBuilder taxProfileId(String value) { - - formData.put("tax_profile_id", value); - - return this; - } - - public ChargesBuilder avalaraTaxCode(String value) { - - formData.put("avalara_tax_code", value); - - return this; - } - - public ChargesBuilder hsnCode(String value) { - - formData.put("hsn_code", value); - - return this; - } - - public ChargesBuilder taxjarProductCode(String value) { - - formData.put("taxjar_product_code", value); - - return this; - } - - public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public ChargesBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public ChargesBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public ChargesBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public ChargesBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public ChargesParams build() { - return new ChargesParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 static final class EntityIdentifiersParams { - - private final Map formData; - - private EntityIdentifiersParams(EntityIdentifiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EntityIdentifiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EntityIdentifiersBuilder builder() { - return new EntityIdentifiersBuilder(); - } - - public static final class EntityIdentifiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EntityIdentifiersBuilder() {} - - public EntityIdentifiersBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EntityIdentifiersBuilder scheme(String value) { - - formData.put("scheme", value); - - return this; - } - - public EntityIdentifiersBuilder value(String value) { - - formData.put("value", value); - - return this; - } - - public EntityIdentifiersBuilder operation(Operation value) { - - formData.put("operation", value); - - return this; - } - - public EntityIdentifiersBuilder standard(String value) { - - formData.put("standard", value); - - return this; - } - - public EntityIdentifiersParams build() { - return new EntityIdentifiersParams(this); - } - } - - public enum Operation { - CREATE("create"), - - UPDATE("update"), - - DELETE("delete"), - - /** An enum member indicating that Operation was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Operation(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Operation fromString(String value) { - if (value == null) return _UNKNOWN; - for (Operation enumValue : Operation.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutOneTimeParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutOneTimeParams.java deleted file mode 100644 index 0563f072..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCheckoutOneTimeParams.java +++ /dev/null @@ -1,1097 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class HostedPageCheckoutOneTimeParams { - - private final Map formData; - - private HostedPageCheckoutOneTimeParams(HostedPageCheckoutOneTimeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageCheckoutOneTimeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageCheckoutOneTimeBuilder builder() { - return new HostedPageCheckoutOneTimeBuilder(); - } - - public static final class HostedPageCheckoutOneTimeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageCheckoutOneTimeBuilder() {} - - public HostedPageCheckoutOneTimeBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public HostedPageCheckoutOneTimeBuilder invoiceNote(String value) { - - formData.put("invoice_note", value); - - return this; - } - - @Deprecated - public HostedPageCheckoutOneTimeBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public HostedPageCheckoutOneTimeBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public HostedPageCheckoutOneTimeBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public HostedPageCheckoutOneTimeBuilder cancelUrl(String value) { - - formData.put("cancel_url", value); - - return this; - } - - public HostedPageCheckoutOneTimeBuilder passThruContent(String value) { - - formData.put("pass_thru_content", value); - - return this; - } - - public HostedPageCheckoutOneTimeBuilder embed(Boolean value) { - - formData.put("embed", value); - - return this; - } - - public HostedPageCheckoutOneTimeBuilder iframeMessaging(Boolean value) { - - formData.put("iframe_messaging", value); - - return this; - } - - public HostedPageCheckoutOneTimeBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutOneTimeBuilder invoice(InvoiceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "invoice[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutOneTimeBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutOneTimeBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutOneTimeBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCheckoutOneTimeBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutOneTimeBuilder charges(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ChargesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public HostedPageCheckoutOneTimeParams build() { - return new HostedPageCheckoutOneTimeParams(this); - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public CustomerBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CustomerBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CustomerBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public CustomerBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public CustomerBuilder locale(String value) { - - formData.put("locale", value); - - return this; - } - - public CustomerBuilder taxability(Taxability value) { - - formData.put("taxability", value); - - return this; - } - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder consolidatedInvoicing(Boolean value) { - - formData.put("consolidated_invoicing", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - - public enum Taxability { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Taxability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Taxability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Taxability fromString(String value) { - if (value == null) return _UNKNOWN; - for (Taxability enumValue : Taxability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class InvoiceParams { - - private final Map formData; - - private InvoiceParams(InvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceBuilder builder() { - return new InvoiceBuilder(); - } - - public static final class InvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceBuilder() {} - - public InvoiceBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public InvoiceParams build() { - return new InvoiceParams(this); - } - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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 static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public AddonsBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class ChargesParams { - - private final Map formData; - - private ChargesParams(ChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargesBuilder builder() { - return new ChargesBuilder(); - } - - public static final class ChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargesBuilder() {} - - public ChargesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public ChargesBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public ChargesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ChargesBuilder taxable(Boolean value) { - - formData.put("taxable", value); - - return this; - } - - public ChargesBuilder taxProfileId(String value) { - - formData.put("tax_profile_id", value); - - return this; - } - - public ChargesBuilder avalaraTaxCode(String value) { - - formData.put("avalara_tax_code", value); - - return this; - } - - public ChargesBuilder hsnCode(String value) { - - formData.put("hsn_code", value); - - return this; - } - - public ChargesBuilder taxjarProductCode(String value) { - - formData.put("taxjar_product_code", value); - - return this; - } - - public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public ChargesBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public ChargesBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public ChargesBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public ChargesBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public ChargesParams build() { - return new ChargesParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageClaimGiftParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageClaimGiftParams.java deleted file mode 100644 index 3568f24d..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageClaimGiftParams.java +++ /dev/null @@ -1,146 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class HostedPageClaimGiftParams { - - private final Map formData; - - private HostedPageClaimGiftParams(HostedPageClaimGiftBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageClaimGiftParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageClaimGiftBuilder builder() { - return new HostedPageClaimGiftBuilder(); - } - - public static final class HostedPageClaimGiftBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageClaimGiftBuilder() {} - - public HostedPageClaimGiftBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public HostedPageClaimGiftBuilder gift(GiftParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "gift[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageClaimGiftBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageClaimGiftParams build() { - return new HostedPageClaimGiftParams(this); - } - } - - public static final class GiftParams { - - private final Map formData; - - private GiftParams(GiftBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GiftParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GiftBuilder builder() { - return new GiftBuilder(); - } - - public static final class GiftBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GiftBuilder() {} - - public GiftBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public GiftParams build() { - return new GiftParams(this); - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder locale(String value) { - - formData.put("locale", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCollectNowParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCollectNowParams.java deleted file mode 100644 index 62317455..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageCollectNowParams.java +++ /dev/null @@ -1,293 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class HostedPageCollectNowParams { - - private final Map formData; - - private HostedPageCollectNowParams(HostedPageCollectNowBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageCollectNowParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageCollectNowBuilder builder() { - return new HostedPageCollectNowBuilder(); - } - - public static final class HostedPageCollectNowBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageCollectNowBuilder() {} - - public HostedPageCollectNowBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public HostedPageCollectNowBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public HostedPageCollectNowBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCollectNowBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageCollectNowParams build() { - return new HostedPageCollectNowParams(this); - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageEventsParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageEventsParams.java deleted file mode 100644 index 1384de64..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageEventsParams.java +++ /dev/null @@ -1,92 +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.core.models.hostedPage.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.sql.Timestamp; - -public final class HostedPageEventsParams { - - private final Map formData; - - private HostedPageEventsParams(HostedPageEventsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageEventsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageEventsBuilder builder() { - return new HostedPageEventsBuilder(); - } - - public static final class HostedPageEventsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageEventsBuilder() {} - - public HostedPageEventsBuilder eventName(EventName value) { - - formData.put("event_name", value); - - return this; - } - - public HostedPageEventsBuilder occurredAt(Timestamp value) { - - formData.put("occurred_at", value); - - return this; - } - - public HostedPageEventsBuilder eventData(java.util.Map value) { - - formData.put("event_data", JsonUtil.toJson(value)); - - return this; - } - - public HostedPageEventsParams build() { - return new HostedPageEventsParams(this); - } - } - - public enum EventName { - CANCELLATION_PAGE_LOADED("cancellation_page_loaded"), - - /** An enum member indicating that EventName was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EventName(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EventName fromString(String value) { - if (value == null) return _UNKNOWN; - for (EventName enumValue : EventName.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageExtendSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageExtendSubscriptionParams.java deleted file mode 100644 index 42eba194..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageExtendSubscriptionParams.java +++ /dev/null @@ -1,105 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class HostedPageExtendSubscriptionParams { - - private final Map formData; - - private HostedPageExtendSubscriptionParams(HostedPageExtendSubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageExtendSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageExtendSubscriptionBuilder builder() { - return new HostedPageExtendSubscriptionBuilder(); - } - - public static final class HostedPageExtendSubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageExtendSubscriptionBuilder() {} - - public HostedPageExtendSubscriptionBuilder expiry(Integer value) { - - formData.put("expiry", value); - - return this; - } - - public HostedPageExtendSubscriptionBuilder billingCycle(Integer value) { - - formData.put("billing_cycle", value); - - return this; - } - - public HostedPageExtendSubscriptionBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageExtendSubscriptionParams build() { - return new HostedPageExtendSubscriptionParams(this); - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageManagePaymentSourcesParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageManagePaymentSourcesParams.java deleted file mode 100644 index 878af052..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageManagePaymentSourcesParams.java +++ /dev/null @@ -1,286 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class HostedPageManagePaymentSourcesParams { - - private final Map formData; - - private HostedPageManagePaymentSourcesParams(HostedPageManagePaymentSourcesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageManagePaymentSourcesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageManagePaymentSourcesBuilder builder() { - return new HostedPageManagePaymentSourcesBuilder(); - } - - public static final class HostedPageManagePaymentSourcesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageManagePaymentSourcesBuilder() {} - - public HostedPageManagePaymentSourcesBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public HostedPageManagePaymentSourcesBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageManagePaymentSourcesBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageManagePaymentSourcesParams build() { - return new HostedPageManagePaymentSourcesParams(this); - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPagePreCancelParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPagePreCancelParams.java deleted file mode 100644 index c807d26c..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPagePreCancelParams.java +++ /dev/null @@ -1,112 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class HostedPagePreCancelParams { - - private final Map formData; - - private HostedPagePreCancelParams(HostedPagePreCancelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPagePreCancelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPagePreCancelBuilder builder() { - return new HostedPagePreCancelBuilder(); - } - - public static final class HostedPagePreCancelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPagePreCancelBuilder() {} - - public HostedPagePreCancelBuilder passThruContent(String value) { - - formData.put("pass_thru_content", value); - - return this; - } - - public HostedPagePreCancelBuilder cancelUrl(String value) { - - formData.put("cancel_url", value); - - return this; - } - - public HostedPagePreCancelBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public HostedPagePreCancelBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPagePreCancelParams build() { - return new HostedPagePreCancelParams(this); - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageRetrieveAgreementPdfParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageRetrieveAgreementPdfParams.java deleted file mode 100644 index 3f3b61c5..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageRetrieveAgreementPdfParams.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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class HostedPageRetrieveAgreementPdfParams { - - private final Map formData; - - private HostedPageRetrieveAgreementPdfParams(HostedPageRetrieveAgreementPdfBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageRetrieveAgreementPdfParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageRetrieveAgreementPdfBuilder builder() { - return new HostedPageRetrieveAgreementPdfBuilder(); - } - - public static final class HostedPageRetrieveAgreementPdfBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageRetrieveAgreementPdfBuilder() {} - - public HostedPageRetrieveAgreementPdfBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public HostedPageRetrieveAgreementPdfParams build() { - return new HostedPageRetrieveAgreementPdfParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageUpdateCardParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageUpdateCardParams.java deleted file mode 100644 index 6d60f6be..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageUpdateCardParams.java +++ /dev/null @@ -1,330 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class HostedPageUpdateCardParams { - - private final Map formData; - - private HostedPageUpdateCardParams(HostedPageUpdateCardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageUpdateCardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageUpdateCardBuilder builder() { - return new HostedPageUpdateCardBuilder(); - } - - public static final class HostedPageUpdateCardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageUpdateCardBuilder() {} - - public HostedPageUpdateCardBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public HostedPageUpdateCardBuilder cancelUrl(String value) { - - formData.put("cancel_url", value); - - return this; - } - - public HostedPageUpdateCardBuilder passThruContent(String value) { - - formData.put("pass_thru_content", value); - - return this; - } - - public HostedPageUpdateCardBuilder iframeMessaging(Boolean value) { - - formData.put("iframe_messaging", value); - - return this; - } - - public HostedPageUpdateCardBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageUpdateCardBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageUpdateCardBuilder embed(Boolean value) { - - formData.put("embed", value); - - return this; - } - - public HostedPageUpdateCardParams build() { - return new HostedPageUpdateCardParams(this); - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - @Deprecated - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - @Deprecated - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageUpdatePaymentMethodParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageUpdatePaymentMethodParams.java deleted file mode 100644 index d372ef6f..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageUpdatePaymentMethodParams.java +++ /dev/null @@ -1,330 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class HostedPageUpdatePaymentMethodParams { - - private final Map formData; - - private HostedPageUpdatePaymentMethodParams(HostedPageUpdatePaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageUpdatePaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageUpdatePaymentMethodBuilder builder() { - return new HostedPageUpdatePaymentMethodBuilder(); - } - - public static final class HostedPageUpdatePaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageUpdatePaymentMethodBuilder() {} - - public HostedPageUpdatePaymentMethodBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public HostedPageUpdatePaymentMethodBuilder cancelUrl(String value) { - - formData.put("cancel_url", value); - - return this; - } - - public HostedPageUpdatePaymentMethodBuilder passThruContent(String value) { - - formData.put("pass_thru_content", value); - - return this; - } - - public HostedPageUpdatePaymentMethodBuilder iframeMessaging(Boolean value) { - - formData.put("iframe_messaging", value); - - return this; - } - - public HostedPageUpdatePaymentMethodBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageUpdatePaymentMethodBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageUpdatePaymentMethodBuilder embed(Boolean value) { - - formData.put("embed", value); - - return this; - } - - public HostedPageUpdatePaymentMethodParams build() { - return new HostedPageUpdatePaymentMethodParams(this); - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - @Deprecated - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - @Deprecated - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageViewVoucherParams.java b/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageViewVoucherParams.java deleted file mode 100644 index ffe92703..00000000 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageViewVoucherParams.java +++ /dev/null @@ -1,139 +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.core.models.hostedPage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class HostedPageViewVoucherParams { - - private final Map formData; - - private HostedPageViewVoucherParams(HostedPageViewVoucherBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for HostedPageViewVoucherParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static HostedPageViewVoucherBuilder builder() { - return new HostedPageViewVoucherBuilder(); - } - - public static final class HostedPageViewVoucherBuilder { - private final Map formData = new LinkedHashMap<>(); - - private HostedPageViewVoucherBuilder() {} - - public HostedPageViewVoucherBuilder paymentVoucher(PaymentVoucherParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_voucher[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageViewVoucherBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public HostedPageViewVoucherParams build() { - return new HostedPageViewVoucherParams(this); - } - } - - public static final class PaymentVoucherParams { - - private final Map formData; - - private PaymentVoucherParams(PaymentVoucherBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentVoucherParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentVoucherBuilder builder() { - return new PaymentVoucherBuilder(); - } - - public static final class PaymentVoucherBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentVoucherBuilder() {} - - public PaymentVoucherBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentVoucherParams build() { - return new PaymentVoucherParams(this); - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder locale(String value) { - - formData.put("locale", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/inAppSubscription/params/InAppSubscriptionImportReceiptParams.java b/src/main/java/com/chargebee/v4/core/models/inAppSubscription/params/InAppSubscriptionImportReceiptParams.java deleted file mode 100644 index 230fbad5..00000000 --- a/src/main/java/com/chargebee/v4/core/models/inAppSubscription/params/InAppSubscriptionImportReceiptParams.java +++ /dev/null @@ -1,153 +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.core.models.inAppSubscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InAppSubscriptionImportReceiptParams { - - private final Map formData; - - private InAppSubscriptionImportReceiptParams(InAppSubscriptionImportReceiptBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InAppSubscriptionImportReceiptParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InAppSubscriptionImportReceiptBuilder builder() { - return new InAppSubscriptionImportReceiptBuilder(); - } - - public static final class InAppSubscriptionImportReceiptBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InAppSubscriptionImportReceiptBuilder() {} - - public InAppSubscriptionImportReceiptBuilder receipt(String value) { - - formData.put("receipt", value); - - return this; - } - - public InAppSubscriptionImportReceiptBuilder product(ProductParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "product[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InAppSubscriptionImportReceiptBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InAppSubscriptionImportReceiptParams build() { - return new InAppSubscriptionImportReceiptParams(this); - } - } - - public static final class ProductParams { - - private final Map formData; - - private ProductParams(ProductBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ProductParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ProductBuilder builder() { - return new ProductBuilder(); - } - - public static final class ProductBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ProductBuilder() {} - - public ProductBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public ProductParams build() { - return new ProductParams(this); - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/inAppSubscription/params/InAppSubscriptionImportSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/inAppSubscription/params/InAppSubscriptionImportSubscriptionParams.java deleted file mode 100644 index f61e5f43..00000000 --- a/src/main/java/com/chargebee/v4/core/models/inAppSubscription/params/InAppSubscriptionImportSubscriptionParams.java +++ /dev/null @@ -1,197 +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.core.models.inAppSubscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class InAppSubscriptionImportSubscriptionParams { - - private final Map formData; - - private InAppSubscriptionImportSubscriptionParams( - InAppSubscriptionImportSubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InAppSubscriptionImportSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InAppSubscriptionImportSubscriptionBuilder builder() { - return new InAppSubscriptionImportSubscriptionBuilder(); - } - - public static final class InAppSubscriptionImportSubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InAppSubscriptionImportSubscriptionBuilder() {} - - public InAppSubscriptionImportSubscriptionBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InAppSubscriptionImportSubscriptionBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InAppSubscriptionImportSubscriptionParams build() { - return new InAppSubscriptionImportSubscriptionParams(this); - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionBuilder startedAt(Timestamp value) { - - formData.put("started_at", value); - - return this; - } - - public SubscriptionBuilder termStart(Timestamp value) { - - formData.put("term_start", value); - - return this; - } - - public SubscriptionBuilder termEnd(Timestamp value) { - - formData.put("term_end", value); - - return this; - } - - public SubscriptionBuilder productId(String value) { - - formData.put("product_id", value); - - return this; - } - - public SubscriptionBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public SubscriptionBuilder transactionId(String value) { - - formData.put("transaction_id", value); - - return this; - } - - public SubscriptionBuilder isTrial(Boolean value) { - - formData.put("is_trial", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/inAppSubscription/params/InAppSubscriptionProcessReceiptParams.java b/src/main/java/com/chargebee/v4/core/models/inAppSubscription/params/InAppSubscriptionProcessReceiptParams.java deleted file mode 100644 index b9dce9aa..00000000 --- a/src/main/java/com/chargebee/v4/core/models/inAppSubscription/params/InAppSubscriptionProcessReceiptParams.java +++ /dev/null @@ -1,209 +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.core.models.inAppSubscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InAppSubscriptionProcessReceiptParams { - - private final Map formData; - - private InAppSubscriptionProcessReceiptParams(InAppSubscriptionProcessReceiptBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InAppSubscriptionProcessReceiptParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InAppSubscriptionProcessReceiptBuilder builder() { - return new InAppSubscriptionProcessReceiptBuilder(); - } - - public static final class InAppSubscriptionProcessReceiptBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InAppSubscriptionProcessReceiptBuilder() {} - - public InAppSubscriptionProcessReceiptBuilder receipt(String value) { - - formData.put("receipt", value); - - return this; - } - - public InAppSubscriptionProcessReceiptBuilder product(ProductParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "product[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InAppSubscriptionProcessReceiptBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InAppSubscriptionProcessReceiptParams build() { - return new InAppSubscriptionProcessReceiptParams(this); - } - } - - public static final class ProductParams { - - private final Map formData; - - private ProductParams(ProductBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ProductParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ProductBuilder builder() { - return new ProductBuilder(); - } - - public static final class ProductBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ProductBuilder() {} - - public ProductBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ProductBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public ProductBuilder price(Integer value) { - - formData.put("price", value); - - return this; - } - - public ProductBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public ProductBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ProductBuilder period(String value) { - - formData.put("period", value); - - return this; - } - - public ProductBuilder periodUnit(String value) { - - formData.put("period_unit", value); - - return this; - } - - public ProductParams build() { - return new ProductParams(this); - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public CustomerBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CustomerBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/inAppSubscription/params/InAppSubscriptionRetrieveStoreSubsParams.java b/src/main/java/com/chargebee/v4/core/models/inAppSubscription/params/InAppSubscriptionRetrieveStoreSubsParams.java deleted file mode 100644 index 1276aa7a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/inAppSubscription/params/InAppSubscriptionRetrieveStoreSubsParams.java +++ /dev/null @@ -1,51 +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.core.models.inAppSubscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InAppSubscriptionRetrieveStoreSubsParams { - - private final Map formData; - - private InAppSubscriptionRetrieveStoreSubsParams( - InAppSubscriptionRetrieveStoreSubsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InAppSubscriptionRetrieveStoreSubsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InAppSubscriptionRetrieveStoreSubsBuilder builder() { - return new InAppSubscriptionRetrieveStoreSubsBuilder(); - } - - public static final class InAppSubscriptionRetrieveStoreSubsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InAppSubscriptionRetrieveStoreSubsBuilder() {} - - public InAppSubscriptionRetrieveStoreSubsBuilder receipt(String value) { - - formData.put("receipt", value); - - return this; - } - - public InAppSubscriptionRetrieveStoreSubsParams build() { - return new InAppSubscriptionRetrieveStoreSubsParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceAddAddonChargeParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceAddAddonChargeParams.java deleted file mode 100644 index f67b61cd..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceAddAddonChargeParams.java +++ /dev/null @@ -1,148 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class InvoiceAddAddonChargeParams { - - private final Map formData; - - private InvoiceAddAddonChargeParams(InvoiceAddAddonChargeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceAddAddonChargeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceAddAddonChargeBuilder builder() { - return new InvoiceAddAddonChargeBuilder(); - } - - public static final class InvoiceAddAddonChargeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceAddAddonChargeBuilder() {} - - public InvoiceAddAddonChargeBuilder addonId(String value) { - - formData.put("addon_id", value); - - return this; - } - - public InvoiceAddAddonChargeBuilder addonQuantity(Integer value) { - - formData.put("addon_quantity", value); - - return this; - } - - public InvoiceAddAddonChargeBuilder addonUnitPrice(Long value) { - - formData.put("addon_unit_price", value); - - return this; - } - - public InvoiceAddAddonChargeBuilder addonQuantityInDecimal(String value) { - - formData.put("addon_quantity_in_decimal", value); - - return this; - } - - public InvoiceAddAddonChargeBuilder addonUnitPriceInDecimal(String value) { - - formData.put("addon_unit_price_in_decimal", value); - - return this; - } - - public InvoiceAddAddonChargeBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoiceAddAddonChargeBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public InvoiceAddAddonChargeBuilder lineItem(LineItemParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "line_item[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceAddAddonChargeParams build() { - return new InvoiceAddAddonChargeParams(this); - } - } - - public static final class LineItemParams { - - private final Map formData; - - private LineItemParams(LineItemBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for LineItemParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static LineItemBuilder builder() { - return new LineItemBuilder(); - } - - public static final class LineItemBuilder { - private final Map formData = new LinkedHashMap<>(); - - private LineItemBuilder() {} - - public LineItemBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public LineItemBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public LineItemParams build() { - return new LineItemParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceAddChargeItemParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceAddChargeItemParams.java deleted file mode 100644 index 31e9f9e1..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceAddChargeItemParams.java +++ /dev/null @@ -1,281 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class InvoiceAddChargeItemParams { - - private final Map formData; - - private InvoiceAddChargeItemParams(InvoiceAddChargeItemBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceAddChargeItemParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceAddChargeItemBuilder builder() { - return new InvoiceAddChargeItemBuilder(); - } - - public static final class InvoiceAddChargeItemBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceAddChargeItemBuilder() {} - - public InvoiceAddChargeItemBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoiceAddChargeItemBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public InvoiceAddChargeItemBuilder itemPrice(ItemPriceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_price[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceAddChargeItemBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceAddChargeItemParams build() { - return new InvoiceAddChargeItemParams(this); - } - } - - public static final class ItemPriceParams { - - private final Map formData; - - private ItemPriceParams(ItemPriceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemPriceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPriceBuilder builder() { - return new ItemPriceBuilder(); - } - - public static final class ItemPriceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemPriceBuilder() {} - - public ItemPriceBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemPriceBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public ItemPriceBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public ItemPriceBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public ItemPriceBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public ItemPriceBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public ItemPriceBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public ItemPriceParams build() { - return new ItemPriceParams(this); - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceAddChargeParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceAddChargeParams.java deleted file mode 100644 index d80c8295..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceAddChargeParams.java +++ /dev/null @@ -1,201 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class InvoiceAddChargeParams { - - private final Map formData; - - private InvoiceAddChargeParams(InvoiceAddChargeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceAddChargeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceAddChargeBuilder builder() { - return new InvoiceAddChargeBuilder(); - } - - public static final class InvoiceAddChargeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceAddChargeBuilder() {} - - public InvoiceAddChargeBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public InvoiceAddChargeBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public InvoiceAddChargeBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public InvoiceAddChargeBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public InvoiceAddChargeBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public InvoiceAddChargeBuilder avalaraTaxCode(String value) { - - formData.put("avalara_tax_code", value); - - return this; - } - - public InvoiceAddChargeBuilder hsnCode(String value) { - - formData.put("hsn_code", value); - - return this; - } - - public InvoiceAddChargeBuilder taxjarProductCode(String value) { - - formData.put("taxjar_product_code", value); - - return this; - } - - public InvoiceAddChargeBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoiceAddChargeBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public InvoiceAddChargeBuilder lineItem(LineItemParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "line_item[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceAddChargeParams build() { - return new InvoiceAddChargeParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class LineItemParams { - - private final Map formData; - - private LineItemParams(LineItemBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for LineItemParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static LineItemBuilder builder() { - return new LineItemBuilder(); - } - - public static final class LineItemBuilder { - private final Map formData = new LinkedHashMap<>(); - - private LineItemBuilder() {} - - public LineItemBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public LineItemBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public LineItemParams build() { - return new LineItemParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceApplyCreditsParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceApplyCreditsParams.java deleted file mode 100644 index 54c5e5b9..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceApplyCreditsParams.java +++ /dev/null @@ -1,104 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class InvoiceApplyCreditsParams { - - private final Map formData; - - private InvoiceApplyCreditsParams(InvoiceApplyCreditsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceApplyCreditsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceApplyCreditsBuilder builder() { - return new InvoiceApplyCreditsBuilder(); - } - - public static final class InvoiceApplyCreditsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceApplyCreditsBuilder() {} - - public InvoiceApplyCreditsBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoiceApplyCreditsBuilder creditNotes(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CreditNotesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "credit_notes[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceApplyCreditsParams build() { - return new InvoiceApplyCreditsParams(this); - } - } - - public static final class CreditNotesParams { - - private final Map formData; - - private CreditNotesParams(CreditNotesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditNotesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNotesBuilder builder() { - return new CreditNotesBuilder(); - } - - public static final class CreditNotesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditNotesBuilder() {} - - public CreditNotesBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CreditNotesParams build() { - return new CreditNotesParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceApplyPaymentScheduleSchemeParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceApplyPaymentScheduleSchemeParams.java deleted file mode 100644 index e5236383..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceApplyPaymentScheduleSchemeParams.java +++ /dev/null @@ -1,58 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceApplyPaymentScheduleSchemeParams { - - private final Map formData; - - private InvoiceApplyPaymentScheduleSchemeParams( - InvoiceApplyPaymentScheduleSchemeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceApplyPaymentScheduleSchemeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceApplyPaymentScheduleSchemeBuilder builder() { - return new InvoiceApplyPaymentScheduleSchemeBuilder(); - } - - public static final class InvoiceApplyPaymentScheduleSchemeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceApplyPaymentScheduleSchemeBuilder() {} - - public InvoiceApplyPaymentScheduleSchemeBuilder schemeId(String value) { - - formData.put("scheme_id", value); - - return this; - } - - public InvoiceApplyPaymentScheduleSchemeBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public InvoiceApplyPaymentScheduleSchemeParams build() { - return new InvoiceApplyPaymentScheduleSchemeParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceApplyPaymentsParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceApplyPaymentsParams.java deleted file mode 100644 index d66ed693..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceApplyPaymentsParams.java +++ /dev/null @@ -1,111 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class InvoiceApplyPaymentsParams { - - private final Map formData; - - private InvoiceApplyPaymentsParams(InvoiceApplyPaymentsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceApplyPaymentsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceApplyPaymentsBuilder builder() { - return new InvoiceApplyPaymentsBuilder(); - } - - public static final class InvoiceApplyPaymentsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceApplyPaymentsBuilder() {} - - public InvoiceApplyPaymentsBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoiceApplyPaymentsBuilder transactions(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TransactionsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "transactions[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceApplyPaymentsParams build() { - return new InvoiceApplyPaymentsParams(this); - } - } - - public static final class TransactionsParams { - - private final Map formData; - - private TransactionsParams(TransactionsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionsBuilder builder() { - return new TransactionsBuilder(); - } - - public static final class TransactionsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionsBuilder() {} - - public TransactionsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public TransactionsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public TransactionsParams build() { - return new TransactionsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceChargeAddonParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceChargeAddonParams.java deleted file mode 100644 index 47b6c6c4..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceChargeAddonParams.java +++ /dev/null @@ -1,179 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class InvoiceChargeAddonParams { - - private final Map formData; - - private InvoiceChargeAddonParams(InvoiceChargeAddonBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceChargeAddonParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceChargeAddonBuilder builder() { - return new InvoiceChargeAddonBuilder(); - } - - public static final class InvoiceChargeAddonBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceChargeAddonBuilder() {} - - public InvoiceChargeAddonBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public InvoiceChargeAddonBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public InvoiceChargeAddonBuilder addonId(String value) { - - formData.put("addon_id", value); - - return this; - } - - public InvoiceChargeAddonBuilder addonQuantity(Integer value) { - - formData.put("addon_quantity", value); - - return this; - } - - public InvoiceChargeAddonBuilder addonUnitPrice(Long value) { - - formData.put("addon_unit_price", value); - - return this; - } - - public InvoiceChargeAddonBuilder addonQuantityInDecimal(String value) { - - formData.put("addon_quantity_in_decimal", value); - - return this; - } - - public InvoiceChargeAddonBuilder addonUnitPriceInDecimal(String value) { - - formData.put("addon_unit_price_in_decimal", value); - - return this; - } - - public InvoiceChargeAddonBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public InvoiceChargeAddonBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public InvoiceChargeAddonBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - @Deprecated - public InvoiceChargeAddonBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public InvoiceChargeAddonBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public InvoiceChargeAddonBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public InvoiceChargeAddonBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public InvoiceChargeAddonBuilder paymentInitiator(PaymentInitiator value) { - - formData.put("payment_initiator", value); - - return this; - } - - public InvoiceChargeAddonParams build() { - return new InvoiceChargeAddonParams(this); - } - } - - public enum PaymentInitiator { - CUSTOMER("customer"), - - MERCHANT("merchant"), - - /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentInitiator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentInitiator fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentInitiator enumValue : PaymentInitiator.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceChargeParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceChargeParams.java deleted file mode 100644 index 9e0169b9..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceChargeParams.java +++ /dev/null @@ -1,292 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class InvoiceChargeParams { - - private final Map formData; - - private InvoiceChargeParams(InvoiceChargeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceChargeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceChargeBuilder builder() { - return new InvoiceChargeBuilder(); - } - - public static final class InvoiceChargeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceChargeBuilder() {} - - public InvoiceChargeBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public InvoiceChargeBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public InvoiceChargeBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public InvoiceChargeBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public InvoiceChargeBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public InvoiceChargeBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public InvoiceChargeBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public InvoiceChargeBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public InvoiceChargeBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - @Deprecated - public InvoiceChargeBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public InvoiceChargeBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public InvoiceChargeBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public InvoiceChargeBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public InvoiceChargeBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public InvoiceChargeBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public InvoiceChargeBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public InvoiceChargeBuilder paymentInitiator(PaymentInitiator value) { - - formData.put("payment_initiator", value); - - return this; - } - - public InvoiceChargeBuilder taxProvidersFields(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceChargeParams build() { - return new InvoiceChargeParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PaymentInitiator { - CUSTOMER("customer"), - - MERCHANT("merchant"), - - /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentInitiator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentInitiator fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentInitiator enumValue : PaymentInitiator.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceCloseParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceCloseParams.java deleted file mode 100644 index 9b19aae1..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceCloseParams.java +++ /dev/null @@ -1,209 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class InvoiceCloseParams { - - private final Map formData; - - private InvoiceCloseParams(InvoiceCloseBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceCloseParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceCloseBuilder builder() { - return new InvoiceCloseBuilder(); - } - - public static final class InvoiceCloseBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceCloseBuilder() {} - - public InvoiceCloseBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoiceCloseBuilder invoiceNote(String value) { - - formData.put("invoice_note", value); - - return this; - } - - public InvoiceCloseBuilder removeGeneralNote(Boolean value) { - - formData.put("remove_general_note", value); - - return this; - } - - public InvoiceCloseBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public InvoiceCloseBuilder notesToRemove(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - NotesToRemoveParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "notes_to_remove[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 InvoiceCloseBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 InvoiceCloseBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public InvoiceCloseParams build() { - return new InvoiceCloseParams(this); - } - } - - public static final class NotesToRemoveParams { - - private final Map formData; - - private NotesToRemoveParams(NotesToRemoveBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NotesToRemoveParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NotesToRemoveBuilder builder() { - return new NotesToRemoveBuilder(); - } - - public static final class NotesToRemoveBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NotesToRemoveBuilder() {} - - public NotesToRemoveBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public NotesToRemoveBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public NotesToRemoveParams build() { - return new NotesToRemoveParams(this); - } - } - - public enum EntityType { - CUSTOMER("customer"), - - SUBSCRIPTION("subscription"), - - COUPON("coupon"), - - PLAN_ITEM_PRICE("plan_item_price"), - - ADDON_ITEM_PRICE("addon_item_price"), - - CHARGE_ITEM_PRICE("charge_item_price"), - - PLAN("plan"), - - ADDON("addon"), - - /** 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceCollectPaymentParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceCollectPaymentParams.java deleted file mode 100644 index 8d733020..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceCollectPaymentParams.java +++ /dev/null @@ -1,106 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceCollectPaymentParams { - - private final Map formData; - - private InvoiceCollectPaymentParams(InvoiceCollectPaymentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceCollectPaymentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceCollectPaymentBuilder builder() { - return new InvoiceCollectPaymentBuilder(); - } - - public static final class InvoiceCollectPaymentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceCollectPaymentBuilder() {} - - public InvoiceCollectPaymentBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public InvoiceCollectPaymentBuilder authorizationTransactionId(String value) { - - formData.put("authorization_transaction_id", value); - - return this; - } - - public InvoiceCollectPaymentBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public InvoiceCollectPaymentBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoiceCollectPaymentBuilder paymentInitiator(PaymentInitiator value) { - - formData.put("payment_initiator", value); - - return this; - } - - public InvoiceCollectPaymentParams build() { - return new InvoiceCollectPaymentParams(this); - } - } - - public enum PaymentInitiator { - CUSTOMER("customer"), - - MERCHANT("merchant"), - - /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentInitiator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentInitiator fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentInitiator enumValue : PaymentInitiator.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceCreateForChargeItemParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceCreateForChargeItemParams.java deleted file mode 100644 index d2780371..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceCreateForChargeItemParams.java +++ /dev/null @@ -1,344 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class InvoiceCreateForChargeItemParams { - - private final Map formData; - - private InvoiceCreateForChargeItemParams(InvoiceCreateForChargeItemBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceCreateForChargeItemParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceCreateForChargeItemBuilder builder() { - return new InvoiceCreateForChargeItemBuilder(); - } - - public static final class InvoiceCreateForChargeItemBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceCreateForChargeItemBuilder() {} - - public InvoiceCreateForChargeItemBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public InvoiceCreateForChargeItemBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public InvoiceCreateForChargeItemBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public InvoiceCreateForChargeItemBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public InvoiceCreateForChargeItemBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public InvoiceCreateForChargeItemBuilder paymentInitiator(PaymentInitiator value) { - - formData.put("payment_initiator", value); - - return this; - } - - public InvoiceCreateForChargeItemBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public InvoiceCreateForChargeItemBuilder itemPrice(ItemPriceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_price[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceCreateForChargeItemBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceCreateForChargeItemParams build() { - return new InvoiceCreateForChargeItemParams(this); - } - } - - public enum PaymentInitiator { - CUSTOMER("customer"), - - MERCHANT("merchant"), - - /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentInitiator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentInitiator fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentInitiator enumValue : PaymentInitiator.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class ItemPriceParams { - - private final Map formData; - - private ItemPriceParams(ItemPriceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemPriceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPriceBuilder builder() { - return new ItemPriceBuilder(); - } - - public static final class ItemPriceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemPriceBuilder() {} - - public ItemPriceBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemPriceBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public ItemPriceBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public ItemPriceBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public ItemPriceBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public ItemPriceBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public ItemPriceBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public ItemPriceParams build() { - return new ItemPriceParams(this); - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java deleted file mode 100644 index fc011d44..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java +++ /dev/null @@ -1,2199 +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.core.models.invoice.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 InvoiceCreateForChargeItemsAndChargesParams { - - private final Map formData; - - private InvoiceCreateForChargeItemsAndChargesParams( - InvoiceCreateForChargeItemsAndChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceCreateForChargeItemsAndChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceCreateForChargeItemsAndChargesBuilder builder() { - return new InvoiceCreateForChargeItemsAndChargesBuilder(); - } - - public static final class InvoiceCreateForChargeItemsAndChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceCreateForChargeItemsAndChargesBuilder() {} - - public InvoiceCreateForChargeItemsAndChargesBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder invoiceNote(String value) { - - formData.put("invoice_note", value); - - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder removeGeneralNote(Boolean value) { - - formData.put("remove_general_note", value); - - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - @Deprecated - public InvoiceCreateForChargeItemsAndChargesBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder authorizationTransactionId(String value) { - - formData.put("authorization_transaction_id", value); - - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder tokenId(String value) { - - formData.put("token_id", value); - - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder replacePrimaryPaymentSource(Boolean value) { - - formData.put("replace_primary_payment_source", value); - - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder retainPaymentSource(Boolean value) { - - formData.put("retain_payment_source", value); - - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder paymentInitiator(PaymentInitiator value) { - - formData.put("payment_initiator", value); - - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder shippingAddress( - ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder statementDescriptor( - StatementDescriptorParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder bankAccount(BankAccountParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "bank_account[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder paymentMethod(PaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder itemPrices(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemPricesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_prices[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder charges(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ChargesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder notesToRemove( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - NotesToRemoveParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "notes_to_remove[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder taxProvidersFields( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceCreateForChargeItemsAndChargesBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 InvoiceCreateForChargeItemsAndChargesBuilder customField( - String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 InvoiceCreateForChargeItemsAndChargesBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public InvoiceCreateForChargeItemsAndChargesParams build() { - return new InvoiceCreateForChargeItemsAndChargesParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PaymentInitiator { - CUSTOMER("customer"), - - MERCHANT("merchant"), - - /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentInitiator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentInitiator fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentInitiator enumValue : PaymentInitiator.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class StatementDescriptorParams { - - private final Map formData; - - private StatementDescriptorParams(StatementDescriptorBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatementDescriptorParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatementDescriptorBuilder builder() { - return new StatementDescriptorBuilder(); - } - - public static final class StatementDescriptorBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatementDescriptorBuilder() {} - - public StatementDescriptorBuilder descriptor(String value) { - - formData.put("descriptor", value); - - return this; - } - - public StatementDescriptorParams build() { - return new StatementDescriptorParams(this); - } - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - @Deprecated - public CardBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public CardBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CardBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CardBuilder number(String value) { - - formData.put("number", value); - - return this; - } - - public CardBuilder expiryMonth(Integer value) { - - formData.put("expiry_month", value); - - return this; - } - - public CardBuilder expiryYear(Integer value) { - - formData.put("expiry_year", value); - - return this; - } - - public CardBuilder cvv(String value) { - - formData.put("cvv", value); - - return this; - } - - public CardBuilder preferredScheme(PreferredScheme value) { - - formData.put("preferred_scheme", value); - - return this; - } - - public CardBuilder billingAddr1(String value) { - - formData.put("billing_addr1", value); - - return this; - } - - public CardBuilder billingAddr2(String value) { - - formData.put("billing_addr2", value); - - return this; - } - - public CardBuilder billingCity(String value) { - - formData.put("billing_city", value); - - return this; - } - - public CardBuilder billingStateCode(String value) { - - formData.put("billing_state_code", value); - - return this; - } - - public CardBuilder billingState(String value) { - - formData.put("billing_state", value); - - return this; - } - - public CardBuilder billingZip(String value) { - - formData.put("billing_zip", value); - - return this; - } - - public CardBuilder billingCountry(String value) { - - formData.put("billing_country", value); - - return this; - } - - @Deprecated - public CardBuilder ipAddress(String value) { - - formData.put("ip_address", value); - - return this; - } - - public CardBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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 BankAccountParams { - - private final Map formData; - - private BankAccountParams(BankAccountBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BankAccountParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BankAccountBuilder builder() { - return new BankAccountBuilder(); - } - - public static final class BankAccountBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BankAccountBuilder() {} - - public BankAccountBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public BankAccountBuilder iban(String value) { - - formData.put("iban", value); - - return this; - } - - public BankAccountBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BankAccountBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BankAccountBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BankAccountBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BankAccountBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BankAccountBuilder bankName(String value) { - - formData.put("bank_name", value); - - return this; - } - - public BankAccountBuilder accountNumber(String value) { - - formData.put("account_number", value); - - return this; - } - - public BankAccountBuilder routingNumber(String value) { - - formData.put("routing_number", value); - - return this; - } - - public BankAccountBuilder bankCode(String value) { - - formData.put("bank_code", value); - - return this; - } - - public BankAccountBuilder accountType(AccountType value) { - - formData.put("account_type", value); - - return this; - } - - public BankAccountBuilder accountHolderType(AccountHolderType value) { - - formData.put("account_holder_type", value); - - return this; - } - - public BankAccountBuilder echeckType(EcheckType value) { - - formData.put("echeck_type", value); - - return this; - } - - public BankAccountBuilder issuingCountry(String value) { - - formData.put("issuing_country", value); - - return this; - } - - public BankAccountBuilder swedishIdentityNumber(String value) { - - formData.put("swedish_identity_number", value); - - return this; - } - - public BankAccountBuilder billingAddress(java.util.Map value) { - - formData.put("billing_address", JsonUtil.toJson(value)); - - return this; - } - - public BankAccountParams build() { - return new BankAccountParams(this); - } - } - - public enum AccountType { - CHECKING("checking"), - - SAVINGS("savings"), - - BUSINESS_CHECKING("business_checking"), - - CURRENT("current"), - - /** An enum member indicating that AccountType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AccountType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AccountType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AccountType enumValue : AccountType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AccountHolderType { - INDIVIDUAL("individual"), - - COMPANY("company"), - - /** - * An enum member indicating that AccountHolderType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - AccountHolderType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AccountHolderType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AccountHolderType enumValue : AccountHolderType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EcheckType { - WEB("web"), - - PPD("ppd"), - - CCD("ccd"), - - /** An enum member indicating that EcheckType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EcheckType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EcheckType fromString(String value) { - if (value == null) return _UNKNOWN; - for (EcheckType enumValue : EcheckType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PaymentMethodParams { - - private final Map formData; - - private PaymentMethodParams(PaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentMethodBuilder builder() { - return new PaymentMethodBuilder(); - } - - public static final class PaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentMethodBuilder() {} - - public PaymentMethodBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - @Deprecated - public PaymentMethodBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public PaymentMethodBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentMethodBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public PaymentMethodBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public PaymentMethodBuilder issuingCountry(String value) { - - formData.put("issuing_country", value); - - return this; - } - - public PaymentMethodBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentMethodParams build() { - return new PaymentMethodParams(this); - } - } - - public enum Type { - CARD("card"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - AMAZON_PAYMENTS("amazon_payments"), - - DIRECT_DEBIT("direct_debit"), - - GENERIC("generic"), - - ALIPAY("alipay"), - - UNIONPAY("unionpay"), - - APPLE_PAY("apple_pay"), - - WECHAT_PAY("wechat_pay"), - - IDEAL("ideal"), - - GOOGLE_PAY("google_pay"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GIROPAY("giropay"), - - DOTPAY("dotpay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - VENMO("venmo"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** 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 Gateway { - 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"), - - GOCARDLESS("gocardless"), - - 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"), - - /** 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 static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemPricesParams { - - private final Map formData; - - private ItemPricesParams(ItemPricesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemPricesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPricesBuilder builder() { - return new ItemPricesBuilder(); - } - - public static final class ItemPricesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemPricesBuilder() {} - - public ItemPricesBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemPricesBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public ItemPricesBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public ItemPricesBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public ItemPricesBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public ItemPricesBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public ItemPricesBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public ItemPricesParams build() { - return new ItemPricesParams(this); - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ChargesParams { - - private final Map formData; - - private ChargesParams(ChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargesBuilder builder() { - return new ChargesBuilder(); - } - - public static final class ChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargesBuilder() {} - - public ChargesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public ChargesBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public ChargesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ChargesBuilder taxable(Boolean value) { - - formData.put("taxable", value); - - return this; - } - - public ChargesBuilder taxProfileId(String value) { - - formData.put("tax_profile_id", value); - - return this; - } - - public ChargesBuilder avalaraTaxCode(String value) { - - formData.put("avalara_tax_code", value); - - return this; - } - - public ChargesBuilder hsnCode(String value) { - - formData.put("hsn_code", value); - - return this; - } - - public ChargesBuilder taxjarProductCode(String value) { - - formData.put("taxjar_product_code", value); - - return this; - } - - public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public ChargesBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public ChargesBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public ChargesBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public ChargesBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public ChargesParams build() { - return new ChargesParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class NotesToRemoveParams { - - private final Map formData; - - private NotesToRemoveParams(NotesToRemoveBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NotesToRemoveParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NotesToRemoveBuilder builder() { - return new NotesToRemoveBuilder(); - } - - public static final class NotesToRemoveBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NotesToRemoveBuilder() {} - - public NotesToRemoveBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public NotesToRemoveBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public NotesToRemoveParams build() { - return new NotesToRemoveParams(this); - } - } - - public enum EntityType { - CUSTOMER("customer"), - - SUBSCRIPTION("subscription"), - - COUPON("coupon"), - - PLAN_ITEM_PRICE("plan_item_price"), - - ADDON_ITEM_PRICE("addon_item_price"), - - CHARGE_ITEM_PRICE("charge_item_price"), - - /** 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 static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceCreateParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceCreateParams.java deleted file mode 100644 index 25398cd0..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceCreateParams.java +++ /dev/null @@ -1,1906 +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.core.models.invoice.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 InvoiceCreateParams { - - private final Map formData; - - private InvoiceCreateParams(InvoiceCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceCreateBuilder builder() { - return new InvoiceCreateBuilder(); - } - - public static final class InvoiceCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceCreateBuilder() {} - - public InvoiceCreateBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public InvoiceCreateBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public InvoiceCreateBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public InvoiceCreateBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public InvoiceCreateBuilder invoiceNote(String value) { - - formData.put("invoice_note", value); - - return this; - } - - public InvoiceCreateBuilder removeGeneralNote(Boolean value) { - - formData.put("remove_general_note", value); - - return this; - } - - public InvoiceCreateBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - @Deprecated - public InvoiceCreateBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public InvoiceCreateBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public InvoiceCreateBuilder authorizationTransactionId(String value) { - - formData.put("authorization_transaction_id", value); - - return this; - } - - public InvoiceCreateBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public InvoiceCreateBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public InvoiceCreateBuilder tokenId(String value) { - - formData.put("token_id", value); - - return this; - } - - public InvoiceCreateBuilder replacePrimaryPaymentSource(Boolean value) { - - formData.put("replace_primary_payment_source", value); - - return this; - } - - public InvoiceCreateBuilder retainPaymentSource(Boolean value) { - - formData.put("retain_payment_source", value); - - return this; - } - - public InvoiceCreateBuilder paymentInitiator(PaymentInitiator value) { - - formData.put("payment_initiator", value); - - return this; - } - - public InvoiceCreateBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceCreateBuilder statementDescriptor(StatementDescriptorParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceCreateBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceCreateBuilder bankAccount(BankAccountParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "bank_account[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceCreateBuilder paymentMethod(PaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceCreateBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceCreateBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceCreateBuilder charges(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ChargesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceCreateBuilder taxProvidersFields(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceCreateBuilder notesToRemove(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - NotesToRemoveParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "notes_to_remove[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceCreateParams build() { - return new InvoiceCreateParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PaymentInitiator { - CUSTOMER("customer"), - - MERCHANT("merchant"), - - /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentInitiator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentInitiator fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentInitiator enumValue : PaymentInitiator.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class StatementDescriptorParams { - - private final Map formData; - - private StatementDescriptorParams(StatementDescriptorBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatementDescriptorParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatementDescriptorBuilder builder() { - return new StatementDescriptorBuilder(); - } - - public static final class StatementDescriptorBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatementDescriptorBuilder() {} - - public StatementDescriptorBuilder descriptor(String value) { - - formData.put("descriptor", value); - - return this; - } - - public StatementDescriptorParams build() { - return new StatementDescriptorParams(this); - } - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - @Deprecated - public CardBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public CardBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CardBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CardBuilder number(String value) { - - formData.put("number", value); - - return this; - } - - public CardBuilder expiryMonth(Integer value) { - - formData.put("expiry_month", value); - - return this; - } - - public CardBuilder expiryYear(Integer value) { - - formData.put("expiry_year", value); - - return this; - } - - public CardBuilder cvv(String value) { - - formData.put("cvv", value); - - return this; - } - - public CardBuilder preferredScheme(PreferredScheme value) { - - formData.put("preferred_scheme", value); - - return this; - } - - public CardBuilder billingAddr1(String value) { - - formData.put("billing_addr1", value); - - return this; - } - - public CardBuilder billingAddr2(String value) { - - formData.put("billing_addr2", value); - - return this; - } - - public CardBuilder billingCity(String value) { - - formData.put("billing_city", value); - - return this; - } - - public CardBuilder billingStateCode(String value) { - - formData.put("billing_state_code", value); - - return this; - } - - public CardBuilder billingState(String value) { - - formData.put("billing_state", value); - - return this; - } - - public CardBuilder billingZip(String value) { - - formData.put("billing_zip", value); - - return this; - } - - public CardBuilder billingCountry(String value) { - - formData.put("billing_country", value); - - return this; - } - - @Deprecated - public CardBuilder ipAddress(String value) { - - formData.put("ip_address", value); - - return this; - } - - public CardBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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 BankAccountParams { - - private final Map formData; - - private BankAccountParams(BankAccountBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BankAccountParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BankAccountBuilder builder() { - return new BankAccountBuilder(); - } - - public static final class BankAccountBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BankAccountBuilder() {} - - public BankAccountBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public BankAccountBuilder iban(String value) { - - formData.put("iban", value); - - return this; - } - - public BankAccountBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BankAccountBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BankAccountBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BankAccountBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BankAccountBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BankAccountBuilder bankName(String value) { - - formData.put("bank_name", value); - - return this; - } - - public BankAccountBuilder accountNumber(String value) { - - formData.put("account_number", value); - - return this; - } - - public BankAccountBuilder routingNumber(String value) { - - formData.put("routing_number", value); - - return this; - } - - public BankAccountBuilder bankCode(String value) { - - formData.put("bank_code", value); - - return this; - } - - public BankAccountBuilder accountType(AccountType value) { - - formData.put("account_type", value); - - return this; - } - - public BankAccountBuilder accountHolderType(AccountHolderType value) { - - formData.put("account_holder_type", value); - - return this; - } - - public BankAccountBuilder echeckType(EcheckType value) { - - formData.put("echeck_type", value); - - return this; - } - - public BankAccountBuilder issuingCountry(String value) { - - formData.put("issuing_country", value); - - return this; - } - - public BankAccountBuilder swedishIdentityNumber(String value) { - - formData.put("swedish_identity_number", value); - - return this; - } - - public BankAccountBuilder billingAddress(java.util.Map value) { - - formData.put("billing_address", JsonUtil.toJson(value)); - - return this; - } - - public BankAccountParams build() { - return new BankAccountParams(this); - } - } - - public enum AccountType { - CHECKING("checking"), - - SAVINGS("savings"), - - BUSINESS_CHECKING("business_checking"), - - CURRENT("current"), - - /** An enum member indicating that AccountType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AccountType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AccountType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AccountType enumValue : AccountType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AccountHolderType { - INDIVIDUAL("individual"), - - COMPANY("company"), - - /** - * An enum member indicating that AccountHolderType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - AccountHolderType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AccountHolderType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AccountHolderType enumValue : AccountHolderType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EcheckType { - WEB("web"), - - PPD("ppd"), - - CCD("ccd"), - - /** An enum member indicating that EcheckType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EcheckType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EcheckType fromString(String value) { - if (value == null) return _UNKNOWN; - for (EcheckType enumValue : EcheckType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PaymentMethodParams { - - private final Map formData; - - private PaymentMethodParams(PaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentMethodBuilder builder() { - return new PaymentMethodBuilder(); - } - - public static final class PaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentMethodBuilder() {} - - public PaymentMethodBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - @Deprecated - public PaymentMethodBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public PaymentMethodBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentMethodBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public PaymentMethodBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public PaymentMethodBuilder issuingCountry(String value) { - - formData.put("issuing_country", value); - - return this; - } - - public PaymentMethodBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentMethodParams build() { - return new PaymentMethodParams(this); - } - } - - public enum Type { - CARD("card"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - AMAZON_PAYMENTS("amazon_payments"), - - DIRECT_DEBIT("direct_debit"), - - GENERIC("generic"), - - ALIPAY("alipay"), - - UNIONPAY("unionpay"), - - APPLE_PAY("apple_pay"), - - WECHAT_PAY("wechat_pay"), - - IDEAL("ideal"), - - GOOGLE_PAY("google_pay"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GIROPAY("giropay"), - - DOTPAY("dotpay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - VENMO("venmo"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** 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 Gateway { - 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"), - - GOCARDLESS("gocardless"), - - 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"), - - /** 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 static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public AddonsBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class ChargesParams { - - private final Map formData; - - private ChargesParams(ChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargesBuilder builder() { - return new ChargesBuilder(); - } - - public static final class ChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargesBuilder() {} - - public ChargesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public ChargesBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public ChargesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ChargesBuilder taxable(Boolean value) { - - formData.put("taxable", value); - - return this; - } - - public ChargesBuilder taxProfileId(String value) { - - formData.put("tax_profile_id", value); - - return this; - } - - public ChargesBuilder avalaraTaxCode(String value) { - - formData.put("avalara_tax_code", value); - - return this; - } - - public ChargesBuilder hsnCode(String value) { - - formData.put("hsn_code", value); - - return this; - } - - public ChargesBuilder taxjarProductCode(String value) { - - formData.put("taxjar_product_code", value); - - return this; - } - - public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public ChargesBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public ChargesBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public ChargesBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public ChargesBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public ChargesParams build() { - return new ChargesParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } - - public static final class NotesToRemoveParams { - - private final Map formData; - - private NotesToRemoveParams(NotesToRemoveBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NotesToRemoveParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NotesToRemoveBuilder builder() { - return new NotesToRemoveBuilder(); - } - - public static final class NotesToRemoveBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NotesToRemoveBuilder() {} - - public NotesToRemoveBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public NotesToRemoveBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public NotesToRemoveParams build() { - return new NotesToRemoveParams(this); - } - } - - public enum EntityType { - PLAN("plan"), - - ADDON("addon"), - - CUSTOMER("customer"), - - SUBSCRIPTION("subscription"), - - COUPON("coupon"), - - /** 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceDeleteLineItemsParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceDeleteLineItemsParams.java deleted file mode 100644 index 53915b27..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceDeleteLineItemsParams.java +++ /dev/null @@ -1,97 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class InvoiceDeleteLineItemsParams { - - private final Map formData; - - private InvoiceDeleteLineItemsParams(InvoiceDeleteLineItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceDeleteLineItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceDeleteLineItemsBuilder builder() { - return new InvoiceDeleteLineItemsBuilder(); - } - - public static final class InvoiceDeleteLineItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceDeleteLineItemsBuilder() {} - - public InvoiceDeleteLineItemsBuilder lineItems(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - LineItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "line_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceDeleteLineItemsParams build() { - return new InvoiceDeleteLineItemsParams(this); - } - } - - public static final class LineItemsParams { - - private final Map formData; - - private LineItemsParams(LineItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for LineItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static LineItemsBuilder builder() { - return new LineItemsBuilder(); - } - - public static final class LineItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private LineItemsBuilder() {} - - public LineItemsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public LineItemsParams build() { - return new LineItemsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceDeleteParams.java deleted file mode 100644 index 9db1a811..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceDeleteParams.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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceDeleteParams { - - private final Map formData; - - private InvoiceDeleteParams(InvoiceDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceDeleteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceDeleteBuilder builder() { - return new InvoiceDeleteBuilder(); - } - - public static final class InvoiceDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceDeleteBuilder() {} - - public InvoiceDeleteBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoiceDeleteParams build() { - return new InvoiceDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceDownloadEinvoiceParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceDownloadEinvoiceParams.java deleted file mode 100644 index a5202d4b..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceDownloadEinvoiceParams.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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceDownloadEinvoiceParams { - - private final Map queryParams; - - private InvoiceDownloadEinvoiceParams(InvoiceDownloadEinvoiceBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public InvoiceDownloadEinvoiceBuilder toBuilder() { - InvoiceDownloadEinvoiceBuilder builder = new InvoiceDownloadEinvoiceBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for InvoiceDownloadEinvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceDownloadEinvoiceBuilder builder() { - return new InvoiceDownloadEinvoiceBuilder(); - } - - public static final class InvoiceDownloadEinvoiceBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private InvoiceDownloadEinvoiceBuilder() {} - - public InvoiceDownloadEinvoiceParams build() { - return new InvoiceDownloadEinvoiceParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceImportInvoiceParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceImportInvoiceParams.java deleted file mode 100644 index 5bab1e4b..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceImportInvoiceParams.java +++ /dev/null @@ -1,1928 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class InvoiceImportInvoiceParams { - - private final Map formData; - - private InvoiceImportInvoiceParams(InvoiceImportInvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceImportInvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceImportInvoiceBuilder builder() { - return new InvoiceImportInvoiceBuilder(); - } - - public static final class InvoiceImportInvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceImportInvoiceBuilder() {} - - public InvoiceImportInvoiceBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public InvoiceImportInvoiceBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public InvoiceImportInvoiceBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public InvoiceImportInvoiceBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public InvoiceImportInvoiceBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public InvoiceImportInvoiceBuilder priceType(PriceType value) { - - formData.put("price_type", value); - - return this; - } - - public InvoiceImportInvoiceBuilder taxOverrideReason(TaxOverrideReason value) { - - formData.put("tax_override_reason", value); - - return this; - } - - public InvoiceImportInvoiceBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public InvoiceImportInvoiceBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public InvoiceImportInvoiceBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public InvoiceImportInvoiceBuilder total(Long value) { - - formData.put("total", value); - - return this; - } - - public InvoiceImportInvoiceBuilder roundOff(Long value) { - - formData.put("round_off", value); - - return this; - } - - public InvoiceImportInvoiceBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public InvoiceImportInvoiceBuilder voidedAt(Timestamp value) { - - formData.put("voided_at", value); - - return this; - } - - public InvoiceImportInvoiceBuilder voidReasonCode(String value) { - - formData.put("void_reason_code", value); - - return this; - } - - public InvoiceImportInvoiceBuilder isWrittenOff(Boolean value) { - - formData.put("is_written_off", value); - - return this; - } - - public InvoiceImportInvoiceBuilder writeOffAmount(Long value) { - - formData.put("write_off_amount", value); - - return this; - } - - public InvoiceImportInvoiceBuilder writeOffDate(Timestamp value) { - - formData.put("write_off_date", value); - - return this; - } - - public InvoiceImportInvoiceBuilder dueDate(Timestamp value) { - - formData.put("due_date", value); - - return this; - } - - public InvoiceImportInvoiceBuilder netTermDays(Integer value) { - - formData.put("net_term_days", value); - - return this; - } - - public InvoiceImportInvoiceBuilder hasAdvanceCharges(Boolean value) { - - formData.put("has_advance_charges", value); - - return this; - } - - public InvoiceImportInvoiceBuilder useForProration(Boolean value) { - - formData.put("use_for_proration", value); - - return this; - } - - public InvoiceImportInvoiceBuilder creditNote(CreditNoteParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "credit_note[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceImportInvoiceBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceImportInvoiceBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceImportInvoiceBuilder lineItems(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - LineItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "line_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceImportInvoiceBuilder paymentReferenceNumbers( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - PaymentReferenceNumbersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "payment_reference_numbers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceImportInvoiceBuilder lineItemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - LineItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "line_item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceImportInvoiceBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceImportInvoiceBuilder taxes(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "taxes[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceImportInvoiceBuilder payments(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - PaymentsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "payments[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceImportInvoiceBuilder notes(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - NotesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "notes[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public InvoiceImportInvoiceBuilder lineItemAddresses(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - LineItemAddressesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "line_item_addresses[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 InvoiceImportInvoiceBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 InvoiceImportInvoiceBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public InvoiceImportInvoiceParams build() { - return new InvoiceImportInvoiceParams(this); - } - } - - public enum PriceType { - TAX_EXCLUSIVE("tax_exclusive"), - - TAX_INCLUSIVE("tax_inclusive"), - - /** An enum member indicating that PriceType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PriceType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PriceType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PriceType enumValue : PriceType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TaxOverrideReason { - ID_EXEMPT("id_exempt"), - - CUSTOMER_EXEMPT("customer_exempt"), - - EXPORT("export"), - - /** An enum member indicating that TaxOverrideReason was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TaxOverrideReason(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TaxOverrideReason fromString(String value) { - if (value == null) return _UNKNOWN; - for (TaxOverrideReason enumValue : TaxOverrideReason.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Status { - PAID("paid"), - - POSTED("posted"), - - PAYMENT_DUE("payment_due"), - - NOT_PAID("not_paid"), - - VOIDED("voided"), - - PENDING("pending"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class CreditNoteParams { - - private final Map formData; - - private CreditNoteParams(CreditNoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditNoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNoteBuilder builder() { - return new CreditNoteBuilder(); - } - - public static final class CreditNoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditNoteBuilder() {} - - public CreditNoteBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CreditNoteParams build() { - return new CreditNoteParams(this); - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class LineItemsParams { - - private final Map formData; - - private LineItemsParams(LineItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for LineItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static LineItemsBuilder builder() { - return new LineItemsBuilder(); - } - - public static final class LineItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private LineItemsBuilder() {} - - public LineItemsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public LineItemsBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public LineItemsBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public LineItemsBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public LineItemsBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public LineItemsBuilder unitAmount(Long value) { - - formData.put("unit_amount", value); - - return this; - } - - public LineItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public LineItemsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public LineItemsBuilder unitAmountInDecimal(String value) { - - formData.put("unit_amount_in_decimal", value); - - return this; - } - - public LineItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public LineItemsBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public LineItemsBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public LineItemsBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public LineItemsBuilder itemLevelDiscount1EntityId(String value) { - - formData.put("item_level_discount1_entity_id", value); - - return this; - } - - public LineItemsBuilder itemLevelDiscount1Amount(Long value) { - - formData.put("item_level_discount1_amount", value); - - return this; - } - - public LineItemsBuilder itemLevelDiscount2EntityId(String value) { - - formData.put("item_level_discount2_entity_id", value); - - return this; - } - - public LineItemsBuilder itemLevelDiscount2Amount(Long value) { - - formData.put("item_level_discount2_amount", value); - - return this; - } - - public LineItemsBuilder tax1Name(String value) { - - formData.put("tax1_name", value); - - return this; - } - - public LineItemsBuilder tax1Amount(Long value) { - - formData.put("tax1_amount", value); - - return this; - } - - public LineItemsBuilder tax2Name(String value) { - - formData.put("tax2_name", value); - - return this; - } - - public LineItemsBuilder tax2Amount(Long value) { - - formData.put("tax2_amount", value); - - return this; - } - - public LineItemsBuilder tax3Name(String value) { - - formData.put("tax3_name", value); - - return this; - } - - public LineItemsBuilder tax3Amount(Long value) { - - formData.put("tax3_amount", value); - - return this; - } - - public LineItemsBuilder tax4Name(String value) { - - formData.put("tax4_name", value); - - return this; - } - - public LineItemsBuilder tax4Amount(Long value) { - - formData.put("tax4_amount", value); - - return this; - } - - public LineItemsBuilder tax5Name(String value) { - - formData.put("tax5_name", value); - - return this; - } - - public LineItemsBuilder tax5Amount(Long value) { - - formData.put("tax5_amount", value); - - return this; - } - - public LineItemsBuilder tax6Name(String value) { - - formData.put("tax6_name", value); - - return this; - } - - public LineItemsBuilder tax6Amount(Long value) { - - formData.put("tax6_amount", value); - - return this; - } - - public LineItemsBuilder tax7Name(String value) { - - formData.put("tax7_name", value); - - return this; - } - - public LineItemsBuilder tax7Amount(Long value) { - - formData.put("tax7_amount", value); - - return this; - } - - public LineItemsBuilder tax8Name(String value) { - - formData.put("tax8_name", value); - - return this; - } - - public LineItemsBuilder tax8Amount(Long value) { - - formData.put("tax8_amount", value); - - return this; - } - - public LineItemsBuilder tax9Name(String value) { - - formData.put("tax9_name", value); - - return this; - } - - public LineItemsBuilder tax9Amount(Long value) { - - formData.put("tax9_amount", value); - - return this; - } - - public LineItemsBuilder tax10Name(String value) { - - formData.put("tax10_name", value); - - return this; - } - - public LineItemsBuilder tax10Amount(Long value) { - - formData.put("tax10_amount", value); - - return this; - } - - public LineItemsBuilder createdAt(Timestamp value) { - - formData.put("created_at", value); - - return this; - } - - public LineItemsParams build() { - return new LineItemsParams(this); - } - } - - public enum EntityType { - ADHOC("adhoc"), - - PLAN_ITEM_PRICE("plan_item_price"), - - ADDON_ITEM_PRICE("addon_item_price"), - - CHARGE_ITEM_PRICE("charge_item_price"), - - PLAN_SETUP("plan_setup"), - - PLAN("plan"), - - ADDON("addon"), - - /** 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 static final class PaymentReferenceNumbersParams { - - private final Map formData; - - private PaymentReferenceNumbersParams(PaymentReferenceNumbersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentReferenceNumbersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentReferenceNumbersBuilder builder() { - return new PaymentReferenceNumbersBuilder(); - } - - public static final class PaymentReferenceNumbersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentReferenceNumbersBuilder() {} - - public PaymentReferenceNumbersBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentReferenceNumbersBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public PaymentReferenceNumbersBuilder number(String value) { - - formData.put("number", value); - - return this; - } - - public PaymentReferenceNumbersParams build() { - return new PaymentReferenceNumbersParams(this); - } - } - - public enum Type { - KID("kid"), - - OCR("ocr"), - - FRN("frn"), - - FIK("fik"), - - SWISS_REFERENCE("swiss_reference"), - - /** 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 static final class LineItemTiersParams { - - private final Map formData; - - private LineItemTiersParams(LineItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for LineItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static LineItemTiersBuilder builder() { - return new LineItemTiersBuilder(); - } - - public static final class LineItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private LineItemTiersBuilder() {} - - public LineItemTiersBuilder lineItemId(String value) { - - formData.put("line_item_id", value); - - return this; - } - - public LineItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public LineItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public LineItemTiersBuilder quantityUsed(Integer value) { - - formData.put("quantity_used", value); - - return this; - } - - public LineItemTiersBuilder unitAmount(Long value) { - - formData.put("unit_amount", value); - - return this; - } - - public LineItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public LineItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public LineItemTiersBuilder quantityUsedInDecimal(String value) { - - formData.put("quantity_used_in_decimal", value); - - return this; - } - - public LineItemTiersBuilder unitAmountInDecimal(String value) { - - formData.put("unit_amount_in_decimal", value); - - return this; - } - - public LineItemTiersParams build() { - return new LineItemTiersParams(this); - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public DiscountsBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public DiscountsBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum EntityType { - ITEM_LEVEL_COUPON("item_level_coupon"), - - DOCUMENT_LEVEL_COUPON("document_level_coupon"), - - PROMOTIONAL_CREDITS("promotional_credits"), - - ITEM_LEVEL_DISCOUNT("item_level_discount"), - - DOCUMENT_LEVEL_DISCOUNT("document_level_discount"), - - /** 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 static final class TaxesParams { - - private final Map formData; - - private TaxesParams(TaxesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxesBuilder builder() { - return new TaxesBuilder(); - } - - public static final class TaxesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxesBuilder() {} - - public TaxesBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public TaxesBuilder rate(Number value) { - - formData.put("rate", value); - - return this; - } - - public TaxesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public TaxesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public TaxesBuilder jurisType(JurisType value) { - - formData.put("juris_type", value); - - return this; - } - - public TaxesBuilder jurisName(String value) { - - formData.put("juris_name", value); - - return this; - } - - public TaxesBuilder jurisCode(String value) { - - formData.put("juris_code", value); - - return this; - } - - public TaxesParams build() { - return new TaxesParams(this); - } - } - - public enum JurisType { - COUNTRY("country"), - - FEDERAL("federal"), - - STATE("state"), - - COUNTY("county"), - - CITY("city"), - - SPECIAL("special"), - - UNINCORPORATED("unincorporated"), - - OTHER("other"), - - /** An enum member indicating that JurisType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - JurisType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static JurisType fromString(String value) { - if (value == null) return _UNKNOWN; - for (JurisType enumValue : JurisType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PaymentsParams { - - private final Map formData; - - private PaymentsParams(PaymentsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentsBuilder builder() { - return new PaymentsBuilder(); - } - - public static final class PaymentsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentsBuilder() {} - - public PaymentsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public PaymentsBuilder paymentMethod(PaymentMethod value) { - - formData.put("payment_method", value); - - return this; - } - - public PaymentsBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public PaymentsBuilder referenceNumber(String value) { - - formData.put("reference_number", value); - - return this; - } - - public PaymentsParams build() { - return new PaymentsParams(this); - } - } - - public enum PaymentMethod { - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - OTHER("other"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - CUSTOM("custom"), - - /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethod enumValue : PaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class NotesParams { - - private final Map formData; - - private NotesParams(NotesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NotesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NotesBuilder builder() { - return new NotesBuilder(); - } - - public static final class NotesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NotesBuilder() {} - - public NotesBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public NotesBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public NotesBuilder note(String value) { - - formData.put("note", value); - - return this; - } - - public NotesParams build() { - return new NotesParams(this); - } - } - - public enum EntityType { - COUPON("coupon"), - - PLAN_ITEM_PRICE("plan_item_price"), - - ADDON_ITEM_PRICE("addon_item_price"), - - CHARGE_ITEM_PRICE("charge_item_price"), - - PLAN("plan"), - - ADDON("addon"), - - /** 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 static final class LineItemAddressesParams { - - private final Map formData; - - private LineItemAddressesParams(LineItemAddressesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for LineItemAddressesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static LineItemAddressesBuilder builder() { - return new LineItemAddressesBuilder(); - } - - public static final class LineItemAddressesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private LineItemAddressesBuilder() {} - - public LineItemAddressesBuilder lineItemId(String value) { - - formData.put("line_item_id", value); - - return this; - } - - public LineItemAddressesBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public LineItemAddressesBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public LineItemAddressesBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public LineItemAddressesBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public LineItemAddressesBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public LineItemAddressesBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public LineItemAddressesBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public LineItemAddressesBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public LineItemAddressesBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public LineItemAddressesBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public LineItemAddressesBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public LineItemAddressesBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public LineItemAddressesBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public LineItemAddressesBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public LineItemAddressesParams build() { - return new LineItemAddressesParams(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/core/models/invoice/params/InvoiceInvoicesForCustomerParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceInvoicesForCustomerParams.java deleted file mode 100644 index a15b8750..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceInvoicesForCustomerParams.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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceInvoicesForCustomerParams { - - private final Map queryParams; - - private InvoiceInvoicesForCustomerParams(InvoiceInvoicesForCustomerBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public InvoiceInvoicesForCustomerBuilder toBuilder() { - InvoiceInvoicesForCustomerBuilder builder = new InvoiceInvoicesForCustomerBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for InvoiceInvoicesForCustomerParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceInvoicesForCustomerBuilder builder() { - return new InvoiceInvoicesForCustomerBuilder(); - } - - public static final class InvoiceInvoicesForCustomerBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private InvoiceInvoicesForCustomerBuilder() {} - - public InvoiceInvoicesForCustomerBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public InvoiceInvoicesForCustomerBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public InvoiceInvoicesForCustomerParams build() { - return new InvoiceInvoicesForCustomerParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceInvoicesForSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceInvoicesForSubscriptionParams.java deleted file mode 100644 index 8bb61239..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceInvoicesForSubscriptionParams.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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceInvoicesForSubscriptionParams { - - private final Map queryParams; - - private InvoiceInvoicesForSubscriptionParams(InvoiceInvoicesForSubscriptionBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public InvoiceInvoicesForSubscriptionBuilder toBuilder() { - InvoiceInvoicesForSubscriptionBuilder builder = new InvoiceInvoicesForSubscriptionBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for InvoiceInvoicesForSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceInvoicesForSubscriptionBuilder builder() { - return new InvoiceInvoicesForSubscriptionBuilder(); - } - - public static final class InvoiceInvoicesForSubscriptionBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private InvoiceInvoicesForSubscriptionBuilder() {} - - public InvoiceInvoicesForSubscriptionBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public InvoiceInvoicesForSubscriptionBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public InvoiceInvoicesForSubscriptionParams build() { - return new InvoiceInvoicesForSubscriptionParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoicePauseDunningParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoicePauseDunningParams.java deleted file mode 100644 index ef9ffb17..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoicePauseDunningParams.java +++ /dev/null @@ -1,58 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class InvoicePauseDunningParams { - - private final Map formData; - - private InvoicePauseDunningParams(InvoicePauseDunningBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoicePauseDunningParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoicePauseDunningBuilder builder() { - return new InvoicePauseDunningBuilder(); - } - - public static final class InvoicePauseDunningBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoicePauseDunningBuilder() {} - - public InvoicePauseDunningBuilder expectedPaymentDate(Timestamp value) { - - formData.put("expected_payment_date", value); - - return this; - } - - public InvoicePauseDunningBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoicePauseDunningParams build() { - return new InvoicePauseDunningParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRecordPaymentParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRecordPaymentParams.java deleted file mode 100644 index e3362607..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRecordPaymentParams.java +++ /dev/null @@ -1,223 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class InvoiceRecordPaymentParams { - - private final Map formData; - - private InvoiceRecordPaymentParams(InvoiceRecordPaymentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceRecordPaymentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceRecordPaymentBuilder builder() { - return new InvoiceRecordPaymentBuilder(); - } - - public static final class InvoiceRecordPaymentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceRecordPaymentBuilder() {} - - public InvoiceRecordPaymentBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoiceRecordPaymentBuilder transaction(TransactionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "transaction[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceRecordPaymentParams build() { - return new InvoiceRecordPaymentParams(this); - } - } - - public static final class TransactionParams { - - private final Map formData; - - private TransactionParams(TransactionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionBuilder builder() { - return new TransactionBuilder(); - } - - public static final class TransactionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionBuilder() {} - - public TransactionBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public TransactionBuilder paymentMethod(PaymentMethod value) { - - formData.put("payment_method", value); - - return this; - } - - public TransactionBuilder referenceNumber(String value) { - - formData.put("reference_number", value); - - return this; - } - - public TransactionBuilder customPaymentMethodId(String value) { - - formData.put("custom_payment_method_id", value); - - return this; - } - - public TransactionBuilder idAtGateway(String value) { - - formData.put("id_at_gateway", value); - - return this; - } - - public TransactionBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public TransactionBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public TransactionBuilder errorCode(String value) { - - formData.put("error_code", value); - - return this; - } - - public TransactionBuilder errorText(String value) { - - formData.put("error_text", value); - - return this; - } - - public TransactionParams build() { - return new TransactionParams(this); - } - } - - public enum PaymentMethod { - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - OTHER("other"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - CUSTOM("custom"), - - /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethod enumValue : PaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Status { - SUCCESS("success"), - - FAILURE("failure"), - - LATE_FAILURE("late_failure"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRecordRefundParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRecordRefundParams.java deleted file mode 100644 index 343b185a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRecordRefundParams.java +++ /dev/null @@ -1,267 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class InvoiceRecordRefundParams { - - private final Map formData; - - private InvoiceRecordRefundParams(InvoiceRecordRefundBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceRecordRefundParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceRecordRefundBuilder builder() { - return new InvoiceRecordRefundBuilder(); - } - - public static final class InvoiceRecordRefundBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceRecordRefundBuilder() {} - - public InvoiceRecordRefundBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoiceRecordRefundBuilder customerNotes(String value) { - - formData.put("customer_notes", value); - - return this; - } - - public InvoiceRecordRefundBuilder transaction(TransactionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "transaction[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceRecordRefundBuilder creditNote(CreditNoteParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "credit_note[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceRecordRefundParams build() { - return new InvoiceRecordRefundParams(this); - } - } - - public static final class TransactionParams { - - private final Map formData; - - private TransactionParams(TransactionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionBuilder builder() { - return new TransactionBuilder(); - } - - public static final class TransactionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionBuilder() {} - - public TransactionBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public TransactionBuilder paymentMethod(PaymentMethod value) { - - formData.put("payment_method", value); - - return this; - } - - public TransactionBuilder referenceNumber(String value) { - - formData.put("reference_number", value); - - return this; - } - - public TransactionBuilder customPaymentMethodId(String value) { - - formData.put("custom_payment_method_id", value); - - return this; - } - - public TransactionBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public TransactionParams build() { - return new TransactionParams(this); - } - } - - public enum PaymentMethod { - CASH("cash"), - - CHECK("check"), - - CHARGEBACK("chargeback"), - - BANK_TRANSFER("bank_transfer"), - - OTHER("other"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - CUSTOM("custom"), - - /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethod enumValue : PaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CreditNoteParams { - - private final Map formData; - - private CreditNoteParams(CreditNoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditNoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNoteBuilder builder() { - return new CreditNoteBuilder(); - } - - public static final class CreditNoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditNoteBuilder() {} - - public CreditNoteBuilder reasonCode(ReasonCode value) { - - formData.put("reason_code", value); - - return this; - } - - public CreditNoteBuilder createReasonCode(String value) { - - formData.put("create_reason_code", value); - - return this; - } - - public CreditNoteParams build() { - return new CreditNoteParams(this); - } - } - - public enum ReasonCode { - CHARGEBACK("chargeback"), - - PRODUCT_UNSATISFACTORY("product_unsatisfactory"), - - SERVICE_UNSATISFACTORY("service_unsatisfactory"), - - ORDER_CHANGE("order_change"), - - ORDER_CANCELLATION("order_cancellation"), - - WAIVER("waiver"), - - OTHER("other"), - - /** An enum member indicating that ReasonCode was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ReasonCode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ReasonCode fromString(String value) { - if (value == null) return _UNKNOWN; - for (ReasonCode enumValue : ReasonCode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRecordTaxWithheldParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRecordTaxWithheldParams.java deleted file mode 100644 index 19e1b5e4..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRecordTaxWithheldParams.java +++ /dev/null @@ -1,113 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class InvoiceRecordTaxWithheldParams { - - private final Map formData; - - private InvoiceRecordTaxWithheldParams(InvoiceRecordTaxWithheldBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceRecordTaxWithheldParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceRecordTaxWithheldBuilder builder() { - return new InvoiceRecordTaxWithheldBuilder(); - } - - public static final class InvoiceRecordTaxWithheldBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceRecordTaxWithheldBuilder() {} - - public InvoiceRecordTaxWithheldBuilder taxWithheld(TaxWithheldParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "tax_withheld[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceRecordTaxWithheldParams build() { - return new InvoiceRecordTaxWithheldParams(this); - } - } - - public static final class TaxWithheldParams { - - private final Map formData; - - private TaxWithheldParams(TaxWithheldBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxWithheldParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxWithheldBuilder builder() { - return new TaxWithheldBuilder(); - } - - public static final class TaxWithheldBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxWithheldBuilder() {} - - public TaxWithheldBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public TaxWithheldBuilder referenceNumber(String value) { - - formData.put("reference_number", value); - - return this; - } - - public TaxWithheldBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public TaxWithheldBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public TaxWithheldParams build() { - return new TaxWithheldParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRefundParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRefundParams.java deleted file mode 100644 index e3a094ae..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRefundParams.java +++ /dev/null @@ -1,155 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceRefundParams { - - private final Map formData; - - private InvoiceRefundParams(InvoiceRefundBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceRefundParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceRefundBuilder builder() { - return new InvoiceRefundBuilder(); - } - - public static final class InvoiceRefundBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceRefundBuilder() {} - - public InvoiceRefundBuilder refundAmount(Long value) { - - formData.put("refund_amount", value); - - return this; - } - - public InvoiceRefundBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoiceRefundBuilder customerNotes(String value) { - - formData.put("customer_notes", value); - - return this; - } - - public InvoiceRefundBuilder creditNote(CreditNoteParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "credit_note[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceRefundParams build() { - return new InvoiceRefundParams(this); - } - } - - public static final class CreditNoteParams { - - private final Map formData; - - private CreditNoteParams(CreditNoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditNoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNoteBuilder builder() { - return new CreditNoteBuilder(); - } - - public static final class CreditNoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditNoteBuilder() {} - - public CreditNoteBuilder reasonCode(ReasonCode value) { - - formData.put("reason_code", value); - - return this; - } - - public CreditNoteBuilder createReasonCode(String value) { - - formData.put("create_reason_code", value); - - return this; - } - - public CreditNoteParams build() { - return new CreditNoteParams(this); - } - } - - public enum ReasonCode { - PRODUCT_UNSATISFACTORY("product_unsatisfactory"), - - SERVICE_UNSATISFACTORY("service_unsatisfactory"), - - ORDER_CHANGE("order_change"), - - ORDER_CANCELLATION("order_cancellation"), - - WAIVER("waiver"), - - OTHER("other"), - - /** An enum member indicating that ReasonCode was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ReasonCode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ReasonCode fromString(String value) { - if (value == null) return _UNKNOWN; - for (ReasonCode enumValue : ReasonCode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRemoveCreditNoteParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRemoveCreditNoteParams.java deleted file mode 100644 index b8acc218..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRemoveCreditNoteParams.java +++ /dev/null @@ -1,91 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceRemoveCreditNoteParams { - - private final Map formData; - - private InvoiceRemoveCreditNoteParams(InvoiceRemoveCreditNoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceRemoveCreditNoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceRemoveCreditNoteBuilder builder() { - return new InvoiceRemoveCreditNoteBuilder(); - } - - public static final class InvoiceRemoveCreditNoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceRemoveCreditNoteBuilder() {} - - public InvoiceRemoveCreditNoteBuilder creditNote(CreditNoteParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "credit_note[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceRemoveCreditNoteParams build() { - return new InvoiceRemoveCreditNoteParams(this); - } - } - - public static final class CreditNoteParams { - - private final Map formData; - - private CreditNoteParams(CreditNoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditNoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNoteBuilder builder() { - return new CreditNoteBuilder(); - } - - public static final class CreditNoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditNoteBuilder() {} - - public CreditNoteBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CreditNoteParams build() { - return new CreditNoteParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRemovePaymentParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRemovePaymentParams.java deleted file mode 100644 index 2223be10..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRemovePaymentParams.java +++ /dev/null @@ -1,91 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceRemovePaymentParams { - - private final Map formData; - - private InvoiceRemovePaymentParams(InvoiceRemovePaymentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceRemovePaymentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceRemovePaymentBuilder builder() { - return new InvoiceRemovePaymentBuilder(); - } - - public static final class InvoiceRemovePaymentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceRemovePaymentBuilder() {} - - public InvoiceRemovePaymentBuilder transaction(TransactionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "transaction[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceRemovePaymentParams build() { - return new InvoiceRemovePaymentParams(this); - } - } - - public static final class TransactionParams { - - private final Map formData; - - private TransactionParams(TransactionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionBuilder builder() { - return new TransactionBuilder(); - } - - public static final class TransactionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionBuilder() {} - - public TransactionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public TransactionParams build() { - return new TransactionParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRemoveTaxWithheldParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRemoveTaxWithheldParams.java deleted file mode 100644 index 40541aa7..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRemoveTaxWithheldParams.java +++ /dev/null @@ -1,91 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceRemoveTaxWithheldParams { - - private final Map formData; - - private InvoiceRemoveTaxWithheldParams(InvoiceRemoveTaxWithheldBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceRemoveTaxWithheldParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceRemoveTaxWithheldBuilder builder() { - return new InvoiceRemoveTaxWithheldBuilder(); - } - - public static final class InvoiceRemoveTaxWithheldBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceRemoveTaxWithheldBuilder() {} - - public InvoiceRemoveTaxWithheldBuilder taxWithheld(TaxWithheldParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "tax_withheld[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceRemoveTaxWithheldParams build() { - return new InvoiceRemoveTaxWithheldParams(this); - } - } - - public static final class TaxWithheldParams { - - private final Map formData; - - private TaxWithheldParams(TaxWithheldBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxWithheldParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxWithheldBuilder builder() { - return new TaxWithheldBuilder(); - } - - public static final class TaxWithheldBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxWithheldBuilder() {} - - public TaxWithheldBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public TaxWithheldParams build() { - return new TaxWithheldParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceResendEinvoiceParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceResendEinvoiceParams.java deleted file mode 100644 index 28a49f65..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceResendEinvoiceParams.java +++ /dev/null @@ -1,43 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceResendEinvoiceParams { - - private final Map formData; - - private InvoiceResendEinvoiceParams(InvoiceResendEinvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceResendEinvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceResendEinvoiceBuilder builder() { - return new InvoiceResendEinvoiceBuilder(); - } - - public static final class InvoiceResendEinvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceResendEinvoiceBuilder() {} - - public InvoiceResendEinvoiceParams build() { - return new InvoiceResendEinvoiceParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceSendEinvoiceParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceSendEinvoiceParams.java deleted file mode 100644 index 045b31a8..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceSendEinvoiceParams.java +++ /dev/null @@ -1,43 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceSendEinvoiceParams { - - private final Map formData; - - private InvoiceSendEinvoiceParams(InvoiceSendEinvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceSendEinvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceSendEinvoiceBuilder builder() { - return new InvoiceSendEinvoiceBuilder(); - } - - public static final class InvoiceSendEinvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceSendEinvoiceBuilder() {} - - public InvoiceSendEinvoiceParams build() { - return new InvoiceSendEinvoiceParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceStopDunningParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceStopDunningParams.java deleted file mode 100644 index c34a1e40..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceStopDunningParams.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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceStopDunningParams { - - private final Map formData; - - private InvoiceStopDunningParams(InvoiceStopDunningBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceStopDunningParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceStopDunningBuilder builder() { - return new InvoiceStopDunningBuilder(); - } - - public static final class InvoiceStopDunningBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceStopDunningBuilder() {} - - public InvoiceStopDunningBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoiceStopDunningParams build() { - return new InvoiceStopDunningParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceUpdateDetailsParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceUpdateDetailsParams.java deleted file mode 100644 index e5963f6d..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceUpdateDetailsParams.java +++ /dev/null @@ -1,497 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceUpdateDetailsParams { - - private final Map formData; - - private InvoiceUpdateDetailsParams(InvoiceUpdateDetailsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceUpdateDetailsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceUpdateDetailsBuilder builder() { - return new InvoiceUpdateDetailsBuilder(); - } - - public static final class InvoiceUpdateDetailsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceUpdateDetailsBuilder() {} - - public InvoiceUpdateDetailsBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public InvoiceUpdateDetailsBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public InvoiceUpdateDetailsBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public InvoiceUpdateDetailsBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoiceUpdateDetailsBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceUpdateDetailsBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public InvoiceUpdateDetailsBuilder statementDescriptor(StatementDescriptorParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - 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 InvoiceUpdateDetailsBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 InvoiceUpdateDetailsBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public InvoiceUpdateDetailsParams build() { - return new InvoiceUpdateDetailsParams(this); - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class StatementDescriptorParams { - - private final Map formData; - - private StatementDescriptorParams(StatementDescriptorBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatementDescriptorParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatementDescriptorBuilder builder() { - return new StatementDescriptorBuilder(); - } - - public static final class StatementDescriptorBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatementDescriptorBuilder() {} - - public StatementDescriptorBuilder descriptor(String value) { - - formData.put("descriptor", value); - - return this; - } - - public StatementDescriptorParams build() { - return new StatementDescriptorParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceVoidInvoiceParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceVoidInvoiceParams.java deleted file mode 100644 index cd3ba17f..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceVoidInvoiceParams.java +++ /dev/null @@ -1,57 +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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceVoidInvoiceParams { - - private final Map formData; - - private InvoiceVoidInvoiceParams(InvoiceVoidInvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceVoidInvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceVoidInvoiceBuilder builder() { - return new InvoiceVoidInvoiceBuilder(); - } - - public static final class InvoiceVoidInvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceVoidInvoiceBuilder() {} - - public InvoiceVoidInvoiceBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoiceVoidInvoiceBuilder voidReasonCode(String value) { - - formData.put("void_reason_code", value); - - return this; - } - - public InvoiceVoidInvoiceParams build() { - return new InvoiceVoidInvoiceParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceWriteOffParams.java b/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceWriteOffParams.java deleted file mode 100644 index 92d4a284..00000000 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceWriteOffParams.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.core.models.invoice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class InvoiceWriteOffParams { - - private final Map formData; - - private InvoiceWriteOffParams(InvoiceWriteOffBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceWriteOffParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceWriteOffBuilder builder() { - return new InvoiceWriteOffBuilder(); - } - - public static final class InvoiceWriteOffBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceWriteOffBuilder() {} - - public InvoiceWriteOffBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public InvoiceWriteOffParams build() { - return new InvoiceWriteOffParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/item/params/ItemCreateParams.java b/src/main/java/com/chargebee/v4/core/models/item/params/ItemCreateParams.java deleted file mode 100644 index 8c9f493f..00000000 --- a/src/main/java/com/chargebee/v4/core/models/item/params/ItemCreateParams.java +++ /dev/null @@ -1,495 +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.core.models.item.params; - -import com.chargebee.v4.internal.Recommended; -import com.chargebee.v4.internal.JsonUtil; - -import java.math.BigDecimal; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class ItemCreateParams { - - private final Map formData; - - private ItemCreateParams(ItemCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemCreateBuilder builder() { - return new ItemCreateBuilder(); - } - - public static final class ItemCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemCreateBuilder() {} - - public ItemCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ItemCreateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public ItemCreateBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public ItemCreateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ItemCreateBuilder itemFamilyId(String value) { - - formData.put("item_family_id", value); - - return this; - } - - public ItemCreateBuilder isGiftable(Boolean value) { - - formData.put("is_giftable", value); - - return this; - } - - public ItemCreateBuilder isShippable(Boolean value) { - - formData.put("is_shippable", value); - - return this; - } - - public ItemCreateBuilder externalName(String value) { - - formData.put("external_name", value); - - return this; - } - - public ItemCreateBuilder enabledInPortal(Boolean value) { - - formData.put("enabled_in_portal", value); - - return this; - } - - public ItemCreateBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public ItemCreateBuilder enabledForCheckout(Boolean value) { - - formData.put("enabled_for_checkout", value); - - return this; - } - - public ItemCreateBuilder itemApplicability(ItemApplicability value) { - - formData.put("item_applicability", value); - - return this; - } - - public ItemCreateBuilder applicableItems(List value) { - - formData.put("applicable_items", value); - - return this; - } - - public ItemCreateBuilder unit(String value) { - - formData.put("unit", value); - - return this; - } - - public ItemCreateBuilder giftClaimRedirectUrl(String value) { - - formData.put("gift_claim_redirect_url", value); - - return this; - } - - public ItemCreateBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public ItemCreateBuilder metered(Boolean value) { - - formData.put("metered", value); - - return this; - } - - public ItemCreateBuilder usageCalculation(UsageCalculation value) { - - formData.put("usage_calculation", value); - - return this; - } - - public ItemCreateBuilder isPercentagePricing(Boolean value) { - - formData.put("is_percentage_pricing", value); - - return this; - } - - public ItemCreateBuilder metadata(java.util.Map value) { - - formData.put("metadata", JsonUtil.toJson(value)); - - return this; - } - - public ItemCreateBuilder businessEntityId(String value) { - - formData.put("business_entity_id", value); - - return this; - } - - public ItemCreateBuilder bundleConfiguration(BundleConfigurationParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "bundle_configuration[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemCreateBuilder bundleItemsToAdd(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - BundleItemsToAddParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "bundle_items_to_add[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 ItemCreateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 ItemCreateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public ItemCreateParams build() { - return new ItemCreateParams(this); - } - } - - public enum Type { - PLAN("plan"), - - ADDON("addon"), - - CHARGE("charge"), - - /** 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 ItemApplicability { - ALL("all"), - - RESTRICTED("restricted"), - - /** An enum member indicating that ItemApplicability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ItemApplicability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ItemApplicability fromString(String value) { - if (value == null) return _UNKNOWN; - for (ItemApplicability enumValue : ItemApplicability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum UsageCalculation { - SUM_OF_USAGES("sum_of_usages"), - - LAST_USAGE("last_usage"), - - MAX_USAGE("max_usage"), - - /** An enum member indicating that UsageCalculation was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - UsageCalculation(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static UsageCalculation fromString(String value) { - if (value == null) return _UNKNOWN; - for (UsageCalculation enumValue : UsageCalculation.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class BundleConfigurationParams { - - private final Map formData; - - private BundleConfigurationParams(BundleConfigurationBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BundleConfigurationParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BundleConfigurationBuilder builder() { - return new BundleConfigurationBuilder(); - } - - public static final class BundleConfigurationBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BundleConfigurationBuilder() {} - - public BundleConfigurationBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public BundleConfigurationParams build() { - return new BundleConfigurationParams(this); - } - } - - public enum Type { - FIXED("fixed"), - - /** 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 static final class BundleItemsToAddParams { - - private final Map formData; - - private BundleItemsToAddParams(BundleItemsToAddBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BundleItemsToAddParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BundleItemsToAddBuilder builder() { - return new BundleItemsToAddBuilder(); - } - - public static final class BundleItemsToAddBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BundleItemsToAddBuilder() {} - - public BundleItemsToAddBuilder itemId(String value) { - - formData.put("item_id", value); - - return this; - } - - public BundleItemsToAddBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public BundleItemsToAddBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public BundleItemsToAddBuilder priceAllocation(BigDecimal value) { - - formData.put("price_allocation", value); - - return this; - } - - public BundleItemsToAddParams build() { - return new BundleItemsToAddParams(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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/item/params/ItemDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/item/params/ItemDeleteParams.java deleted file mode 100644 index 1f849f3e..00000000 --- a/src/main/java/com/chargebee/v4/core/models/item/params/ItemDeleteParams.java +++ /dev/null @@ -1,43 +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.core.models.item.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ItemDeleteParams { - - private final Map formData; - - private ItemDeleteParams(ItemDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemDeleteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemDeleteBuilder builder() { - return new ItemDeleteBuilder(); - } - - public static final class ItemDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemDeleteBuilder() {} - - public ItemDeleteParams build() { - return new ItemDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/item/params/ItemUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/item/params/ItemUpdateParams.java deleted file mode 100644 index b0cba0ec..00000000 --- a/src/main/java/com/chargebee/v4/core/models/item/params/ItemUpdateParams.java +++ /dev/null @@ -1,630 +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.core.models.item.params; - -import com.chargebee.v4.internal.Recommended; -import com.chargebee.v4.internal.JsonUtil; - -import java.math.BigDecimal; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class ItemUpdateParams { - - private final Map formData; - - private ItemUpdateParams(ItemUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemUpdateBuilder builder() { - return new ItemUpdateBuilder(); - } - - public static final class ItemUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemUpdateBuilder() {} - - public ItemUpdateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public ItemUpdateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ItemUpdateBuilder isShippable(Boolean value) { - - formData.put("is_shippable", value); - - return this; - } - - public ItemUpdateBuilder externalName(String value) { - - formData.put("external_name", value); - - return this; - } - - public ItemUpdateBuilder itemFamilyId(String value) { - - formData.put("item_family_id", value); - - return this; - } - - public ItemUpdateBuilder enabledInPortal(Boolean value) { - - formData.put("enabled_in_portal", value); - - return this; - } - - public ItemUpdateBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public ItemUpdateBuilder enabledForCheckout(Boolean value) { - - formData.put("enabled_for_checkout", value); - - return this; - } - - public ItemUpdateBuilder itemApplicability(ItemApplicability value) { - - formData.put("item_applicability", value); - - return this; - } - - @Deprecated - public ItemUpdateBuilder clearApplicableItems(Boolean value) { - - formData.put("clear_applicable_items", value); - - return this; - } - - public ItemUpdateBuilder applicableItems(List value) { - - formData.put("applicable_items", value); - - return this; - } - - public ItemUpdateBuilder unit(String value) { - - formData.put("unit", value); - - return this; - } - - public ItemUpdateBuilder giftClaimRedirectUrl(String value) { - - formData.put("gift_claim_redirect_url", value); - - return this; - } - - public ItemUpdateBuilder metadata(java.util.Map value) { - - formData.put("metadata", JsonUtil.toJson(value)); - - return this; - } - - public ItemUpdateBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public ItemUpdateBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public ItemUpdateBuilder isPercentagePricing(Boolean value) { - - formData.put("is_percentage_pricing", value); - - return this; - } - - public ItemUpdateBuilder bundleConfiguration(BundleConfigurationParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "bundle_configuration[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemUpdateBuilder bundleItemsToAdd(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - BundleItemsToAddParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "bundle_items_to_add[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public ItemUpdateBuilder bundleItemsToUpdate(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - BundleItemsToUpdateParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "bundle_items_to_update[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public ItemUpdateBuilder bundleItemsToRemove(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - BundleItemsToRemoveParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "bundle_items_to_remove[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 ItemUpdateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 ItemUpdateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public ItemUpdateParams build() { - return new ItemUpdateParams(this); - } - } - - public enum ItemApplicability { - ALL("all"), - - RESTRICTED("restricted"), - - /** An enum member indicating that ItemApplicability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ItemApplicability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ItemApplicability fromString(String value) { - if (value == null) return _UNKNOWN; - for (ItemApplicability enumValue : ItemApplicability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Status { - ACTIVE("active"), - - ARCHIVED("archived"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class BundleConfigurationParams { - - private final Map formData; - - private BundleConfigurationParams(BundleConfigurationBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BundleConfigurationParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BundleConfigurationBuilder builder() { - return new BundleConfigurationBuilder(); - } - - public static final class BundleConfigurationBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BundleConfigurationBuilder() {} - - public BundleConfigurationBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public BundleConfigurationParams build() { - return new BundleConfigurationParams(this); - } - } - - public enum Type { - FIXED("fixed"), - - /** 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 static final class BundleItemsToAddParams { - - private final Map formData; - - private BundleItemsToAddParams(BundleItemsToAddBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BundleItemsToAddParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BundleItemsToAddBuilder builder() { - return new BundleItemsToAddBuilder(); - } - - public static final class BundleItemsToAddBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BundleItemsToAddBuilder() {} - - public BundleItemsToAddBuilder itemId(String value) { - - formData.put("item_id", value); - - return this; - } - - public BundleItemsToAddBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public BundleItemsToAddBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public BundleItemsToAddBuilder priceAllocation(BigDecimal value) { - - formData.put("price_allocation", value); - - return this; - } - - public BundleItemsToAddParams build() { - return new BundleItemsToAddParams(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 BundleItemsToUpdateParams { - - private final Map formData; - - private BundleItemsToUpdateParams(BundleItemsToUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BundleItemsToUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BundleItemsToUpdateBuilder builder() { - return new BundleItemsToUpdateBuilder(); - } - - public static final class BundleItemsToUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BundleItemsToUpdateBuilder() {} - - public BundleItemsToUpdateBuilder itemId(String value) { - - formData.put("item_id", value); - - return this; - } - - public BundleItemsToUpdateBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public BundleItemsToUpdateBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public BundleItemsToUpdateBuilder priceAllocation(BigDecimal value) { - - formData.put("price_allocation", value); - - return this; - } - - public BundleItemsToUpdateParams build() { - return new BundleItemsToUpdateParams(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 BundleItemsToRemoveParams { - - private final Map formData; - - private BundleItemsToRemoveParams(BundleItemsToRemoveBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BundleItemsToRemoveParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BundleItemsToRemoveBuilder builder() { - return new BundleItemsToRemoveBuilder(); - } - - public static final class BundleItemsToRemoveBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BundleItemsToRemoveBuilder() {} - - public BundleItemsToRemoveBuilder itemId(String value) { - - formData.put("item_id", value); - - return this; - } - - public BundleItemsToRemoveBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public BundleItemsToRemoveParams build() { - return new BundleItemsToRemoveParams(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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/itemEntitlement/params/ItemEntitlementAddItemEntitlementsParams.java b/src/main/java/com/chargebee/v4/core/models/itemEntitlement/params/ItemEntitlementAddItemEntitlementsParams.java deleted file mode 100644 index 3c39691a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/itemEntitlement/params/ItemEntitlementAddItemEntitlementsParams.java +++ /dev/null @@ -1,182 +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.core.models.itemEntitlement.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class ItemEntitlementAddItemEntitlementsParams { - - private final Map formData; - - private ItemEntitlementAddItemEntitlementsParams( - ItemEntitlementAddItemEntitlementsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemEntitlementAddItemEntitlementsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemEntitlementAddItemEntitlementsBuilder builder() { - return new ItemEntitlementAddItemEntitlementsBuilder(); - } - - public static final class ItemEntitlementAddItemEntitlementsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemEntitlementAddItemEntitlementsBuilder() {} - - public ItemEntitlementAddItemEntitlementsBuilder action(Action value) { - - formData.put("action", value); - - return this; - } - - public ItemEntitlementAddItemEntitlementsBuilder itemEntitlements( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemEntitlementsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_entitlements[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public ItemEntitlementAddItemEntitlementsParams build() { - return new ItemEntitlementAddItemEntitlementsParams(this); - } - } - - public enum Action { - UPSERT("upsert"), - - REMOVE("remove"), - - /** An enum member indicating that Action was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Action(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Action fromString(String value) { - if (value == null) return _UNKNOWN; - for (Action enumValue : Action.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class ItemEntitlementsParams { - - private final Map formData; - - private ItemEntitlementsParams(ItemEntitlementsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemEntitlementsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemEntitlementsBuilder builder() { - return new ItemEntitlementsBuilder(); - } - - public static final class ItemEntitlementsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemEntitlementsBuilder() {} - - public ItemEntitlementsBuilder itemId(String value) { - - formData.put("item_id", value); - - return this; - } - - public ItemEntitlementsBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public ItemEntitlementsBuilder value(String value) { - - formData.put("value", value); - - return this; - } - - public ItemEntitlementsParams build() { - return new ItemEntitlementsParams(this); - } - } - - public enum ItemType { - PLAN("plan"), - - ADDON("addon"), - - CHARGE("charge"), - - SUBSCRIPTION("subscription"), - - ITEM("item"), - - /** 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/itemEntitlement/params/ItemEntitlementItemEntitlementsForFeatureParams.java b/src/main/java/com/chargebee/v4/core/models/itemEntitlement/params/ItemEntitlementItemEntitlementsForFeatureParams.java deleted file mode 100644 index a4320c8c..00000000 --- a/src/main/java/com/chargebee/v4/core/models/itemEntitlement/params/ItemEntitlementItemEntitlementsForFeatureParams.java +++ /dev/null @@ -1,68 +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.core.models.itemEntitlement.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ItemEntitlementItemEntitlementsForFeatureParams { - - private final Map queryParams; - - private ItemEntitlementItemEntitlementsForFeatureParams( - ItemEntitlementItemEntitlementsForFeatureBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public ItemEntitlementItemEntitlementsForFeatureBuilder toBuilder() { - ItemEntitlementItemEntitlementsForFeatureBuilder builder = - new ItemEntitlementItemEntitlementsForFeatureBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for ItemEntitlementItemEntitlementsForFeatureParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemEntitlementItemEntitlementsForFeatureBuilder builder() { - return new ItemEntitlementItemEntitlementsForFeatureBuilder(); - } - - public static final class ItemEntitlementItemEntitlementsForFeatureBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private ItemEntitlementItemEntitlementsForFeatureBuilder() {} - - public ItemEntitlementItemEntitlementsForFeatureBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public ItemEntitlementItemEntitlementsForFeatureBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - @Deprecated - public ItemEntitlementItemEntitlementsForFeatureBuilder includeDrafts(Boolean value) { - queryParams.put("include_drafts", value); - return this; - } - - public ItemEntitlementItemEntitlementsForFeatureParams build() { - return new ItemEntitlementItemEntitlementsForFeatureParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/itemEntitlement/params/ItemEntitlementItemEntitlementsForItemParams.java b/src/main/java/com/chargebee/v4/core/models/itemEntitlement/params/ItemEntitlementItemEntitlementsForItemParams.java deleted file mode 100644 index 0077dcbd..00000000 --- a/src/main/java/com/chargebee/v4/core/models/itemEntitlement/params/ItemEntitlementItemEntitlementsForItemParams.java +++ /dev/null @@ -1,74 +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.core.models.itemEntitlement.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ItemEntitlementItemEntitlementsForItemParams { - - private final Map queryParams; - - private ItemEntitlementItemEntitlementsForItemParams( - ItemEntitlementItemEntitlementsForItemBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public ItemEntitlementItemEntitlementsForItemBuilder toBuilder() { - ItemEntitlementItemEntitlementsForItemBuilder builder = - new ItemEntitlementItemEntitlementsForItemBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for ItemEntitlementItemEntitlementsForItemParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemEntitlementItemEntitlementsForItemBuilder builder() { - return new ItemEntitlementItemEntitlementsForItemBuilder(); - } - - public static final class ItemEntitlementItemEntitlementsForItemBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private ItemEntitlementItemEntitlementsForItemBuilder() {} - - public ItemEntitlementItemEntitlementsForItemBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public ItemEntitlementItemEntitlementsForItemBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - @Deprecated - public ItemEntitlementItemEntitlementsForItemBuilder includeDrafts(Boolean value) { - queryParams.put("include_drafts", value); - return this; - } - - @Deprecated - public ItemEntitlementItemEntitlementsForItemBuilder embed(String value) { - queryParams.put("embed", value); - return this; - } - - public ItemEntitlementItemEntitlementsForItemParams build() { - return new ItemEntitlementItemEntitlementsForItemParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/itemEntitlement/params/ItemEntitlementUpsertOrRemoveItemEntitlementsForItemParams.java b/src/main/java/com/chargebee/v4/core/models/itemEntitlement/params/ItemEntitlementUpsertOrRemoveItemEntitlementsForItemParams.java deleted file mode 100644 index b58457ff..00000000 --- a/src/main/java/com/chargebee/v4/core/models/itemEntitlement/params/ItemEntitlementUpsertOrRemoveItemEntitlementsForItemParams.java +++ /dev/null @@ -1,141 +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.core.models.itemEntitlement.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class ItemEntitlementUpsertOrRemoveItemEntitlementsForItemParams { - - private final Map formData; - - private ItemEntitlementUpsertOrRemoveItemEntitlementsForItemParams( - ItemEntitlementUpsertOrRemoveItemEntitlementsForItemBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemEntitlementUpsertOrRemoveItemEntitlementsForItemParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemEntitlementUpsertOrRemoveItemEntitlementsForItemBuilder builder() { - return new ItemEntitlementUpsertOrRemoveItemEntitlementsForItemBuilder(); - } - - public static final class ItemEntitlementUpsertOrRemoveItemEntitlementsForItemBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemEntitlementUpsertOrRemoveItemEntitlementsForItemBuilder() {} - - public ItemEntitlementUpsertOrRemoveItemEntitlementsForItemBuilder action(Action value) { - - formData.put("action", value); - - return this; - } - - public ItemEntitlementUpsertOrRemoveItemEntitlementsForItemBuilder itemEntitlements( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemEntitlementsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_entitlements[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public ItemEntitlementUpsertOrRemoveItemEntitlementsForItemParams build() { - return new ItemEntitlementUpsertOrRemoveItemEntitlementsForItemParams(this); - } - } - - public enum Action { - UPSERT("upsert"), - - REMOVE("remove"), - - /** An enum member indicating that Action was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Action(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Action fromString(String value) { - if (value == null) return _UNKNOWN; - for (Action enumValue : Action.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class ItemEntitlementsParams { - - private final Map formData; - - private ItemEntitlementsParams(ItemEntitlementsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemEntitlementsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemEntitlementsBuilder builder() { - return new ItemEntitlementsBuilder(); - } - - public static final class ItemEntitlementsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemEntitlementsBuilder() {} - - public ItemEntitlementsBuilder featureId(String value) { - - formData.put("feature_id", value); - - return this; - } - - public ItemEntitlementsBuilder value(String value) { - - formData.put("value", value); - - return this; - } - - public ItemEntitlementsParams build() { - return new ItemEntitlementsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/itemFamily/params/ItemFamilyCreateParams.java b/src/main/java/com/chargebee/v4/core/models/itemFamily/params/ItemFamilyCreateParams.java deleted file mode 100644 index 547bc9f7..00000000 --- a/src/main/java/com/chargebee/v4/core/models/itemFamily/params/ItemFamilyCreateParams.java +++ /dev/null @@ -1,107 +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.core.models.itemFamily.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ItemFamilyCreateParams { - - private final Map formData; - - private ItemFamilyCreateParams(ItemFamilyCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemFamilyCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemFamilyCreateBuilder builder() { - return new ItemFamilyCreateBuilder(); - } - - public static final class ItemFamilyCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemFamilyCreateBuilder() {} - - public ItemFamilyCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ItemFamilyCreateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public ItemFamilyCreateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ItemFamilyCreateBuilder businessEntityId(String value) { - - formData.put("business_entity_id", 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 ItemFamilyCreateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 ItemFamilyCreateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public ItemFamilyCreateParams build() { - return new ItemFamilyCreateParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/itemFamily/params/ItemFamilyUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/itemFamily/params/ItemFamilyUpdateParams.java deleted file mode 100644 index 85bbba8b..00000000 --- a/src/main/java/com/chargebee/v4/core/models/itemFamily/params/ItemFamilyUpdateParams.java +++ /dev/null @@ -1,93 +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.core.models.itemFamily.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ItemFamilyUpdateParams { - - private final Map formData; - - private ItemFamilyUpdateParams(ItemFamilyUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemFamilyUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemFamilyUpdateBuilder builder() { - return new ItemFamilyUpdateBuilder(); - } - - public static final class ItemFamilyUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemFamilyUpdateBuilder() {} - - public ItemFamilyUpdateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public ItemFamilyUpdateBuilder description(String value) { - - formData.put("description", 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 ItemFamilyUpdateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 ItemFamilyUpdateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public ItemFamilyUpdateParams build() { - return new ItemFamilyUpdateParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceCreateParams.java b/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceCreateParams.java deleted file mode 100644 index 353ebb8a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceCreateParams.java +++ /dev/null @@ -1,899 +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.core.models.itemPrice.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; - -public final class ItemPriceCreateParams { - - private final Map formData; - - private ItemPriceCreateParams(ItemPriceCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemPriceCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPriceCreateBuilder builder() { - return new ItemPriceCreateBuilder(); - } - - public static final class ItemPriceCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemPriceCreateBuilder() {} - - public ItemPriceCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ItemPriceCreateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public ItemPriceCreateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ItemPriceCreateBuilder itemId(String value) { - - formData.put("item_id", value); - - return this; - } - - public ItemPriceCreateBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public ItemPriceCreateBuilder prorationType(ProrationType value) { - - formData.put("proration_type", value); - - return this; - } - - public ItemPriceCreateBuilder externalName(String value) { - - formData.put("external_name", value); - - return this; - } - - public ItemPriceCreateBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public ItemPriceCreateBuilder priceVariantId(String value) { - - formData.put("price_variant_id", value); - - return this; - } - - public ItemPriceCreateBuilder isTaxable(Boolean value) { - - formData.put("is_taxable", value); - - return this; - } - - public ItemPriceCreateBuilder freeQuantity(Integer value) { - - formData.put("free_quantity", value); - - return this; - } - - public ItemPriceCreateBuilder freeQuantityInDecimal(String value) { - - formData.put("free_quantity_in_decimal", value); - - return this; - } - - public ItemPriceCreateBuilder metadata(java.util.Map value) { - - formData.put("metadata", JsonUtil.toJson(value)); - - return this; - } - - public ItemPriceCreateBuilder showDescriptionInInvoices(Boolean value) { - - formData.put("show_description_in_invoices", value); - - return this; - } - - public ItemPriceCreateBuilder showDescriptionInQuotes(Boolean value) { - - formData.put("show_description_in_quotes", value); - - return this; - } - - public ItemPriceCreateBuilder usageAccumulationResetFrequency( - UsageAccumulationResetFrequency value) { - - formData.put("usage_accumulation_reset_frequency", value); - - return this; - } - - public ItemPriceCreateBuilder businessEntityId(String value) { - - formData.put("business_entity_id", value); - - return this; - } - - public ItemPriceCreateBuilder pricingModel(PricingModel value) { - - formData.put("pricing_model", value); - - return this; - } - - public ItemPriceCreateBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemPriceCreateBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemPriceCreateBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public ItemPriceCreateBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public ItemPriceCreateBuilder trialPeriodUnit(TrialPeriodUnit value) { - - formData.put("trial_period_unit", value); - - return this; - } - - public ItemPriceCreateBuilder trialPeriod(Integer value) { - - formData.put("trial_period", value); - - return this; - } - - public ItemPriceCreateBuilder shippingPeriod(Integer value) { - - formData.put("shipping_period", value); - - return this; - } - - public ItemPriceCreateBuilder shippingPeriodUnit(ShippingPeriodUnit value) { - - formData.put("shipping_period_unit", value); - - return this; - } - - public ItemPriceCreateBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public ItemPriceCreateBuilder trialEndAction(TrialEndAction value) { - - formData.put("trial_end_action", value); - - return this; - } - - public ItemPriceCreateBuilder taxDetail(TaxDetailParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "tax_detail[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceCreateBuilder accountingDetail(AccountingDetailParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "accounting_detail[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceCreateBuilder tiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public ItemPriceCreateBuilder taxProvidersFields(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 ItemPriceCreateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 ItemPriceCreateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public ItemPriceCreateParams build() { - return new ItemPriceCreateParams(this); - } - } - - public enum ProrationType { - SITE_DEFAULT("site_default"), - - PARTIAL_TERM("partial_term"), - - FULL_TERM("full_term"), - - /** An enum member indicating that ProrationType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ProrationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ProrationType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ProrationType enumValue : ProrationType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum UsageAccumulationResetFrequency { - NEVER("never"), - - SUBSCRIPTION_BILLING_FREQUENCY("subscription_billing_frequency"), - - /** - * An enum member indicating that UsageAccumulationResetFrequency was instantiated with an - * unknown value. - */ - _UNKNOWN(null); - private final String value; - - UsageAccumulationResetFrequency(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static UsageAccumulationResetFrequency fromString(String value) { - if (value == null) return _UNKNOWN; - for (UsageAccumulationResetFrequency enumValue : UsageAccumulationResetFrequency.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PricingModel { - FLAT_FEE("flat_fee"), - - PER_UNIT("per_unit"), - - TIERED("tiered"), - - VOLUME("volume"), - - STAIRSTEP("stairstep"), - - /** An enum member indicating that PricingModel was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingModel(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingModel fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingModel enumValue : PricingModel.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 enum TrialPeriodUnit { - DAY("day"), - - MONTH("month"), - - /** An enum member indicating that TrialPeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialPeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialPeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialPeriodUnit enumValue : TrialPeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ShippingPeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that ShippingPeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ShippingPeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ShippingPeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (ShippingPeriodUnit enumValue : ShippingPeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TrialEndAction { - SITE_DEFAULT("site_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialEndAction enumValue : TrialEndAction.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class TaxDetailParams { - - private final Map formData; - - private TaxDetailParams(TaxDetailBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxDetailParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxDetailBuilder builder() { - return new TaxDetailBuilder(); - } - - public static final class TaxDetailBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxDetailBuilder() {} - - public TaxDetailBuilder taxProfileId(String value) { - - formData.put("tax_profile_id", value); - - return this; - } - - public TaxDetailBuilder avalaraTaxCode(String value) { - - formData.put("avalara_tax_code", value); - - return this; - } - - public TaxDetailBuilder hsnCode(String value) { - - formData.put("hsn_code", value); - - return this; - } - - public TaxDetailBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public TaxDetailBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public TaxDetailBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public TaxDetailBuilder taxjarProductCode(String value) { - - formData.put("taxjar_product_code", value); - - return this; - } - - public TaxDetailParams build() { - return new TaxDetailParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AccountingDetailParams { - - private final Map formData; - - private AccountingDetailParams(AccountingDetailBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AccountingDetailParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AccountingDetailBuilder builder() { - return new AccountingDetailBuilder(); - } - - public static final class AccountingDetailBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AccountingDetailBuilder() {} - - public AccountingDetailBuilder sku(String value) { - - formData.put("sku", value); - - return this; - } - - public AccountingDetailBuilder accountingCode(String value) { - - formData.put("accounting_code", value); - - return this; - } - - public AccountingDetailBuilder accountingCategory1(String value) { - - formData.put("accounting_category1", value); - - return this; - } - - public AccountingDetailBuilder accountingCategory2(String value) { - - formData.put("accounting_category2", value); - - return this; - } - - public AccountingDetailBuilder accountingCategory3(String value) { - - formData.put("accounting_category3", value); - - return this; - } - - public AccountingDetailBuilder accountingCategory4(String value) { - - formData.put("accounting_category4", value); - - return this; - } - - public AccountingDetailParams build() { - return new AccountingDetailParams(this); - } - } - } - - public static final class TiersParams { - - private final Map formData; - - private TiersParams(TiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TiersBuilder builder() { - return new TiersBuilder(); - } - - public static final class TiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TiersBuilder() {} - - public TiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public TiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public TiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public TiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public TiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public TiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public TiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public TiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public TiersParams build() { - return new TiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceFindApplicableItemPricesParams.java b/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceFindApplicableItemPricesParams.java deleted file mode 100644 index 396b28d0..00000000 --- a/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceFindApplicableItemPricesParams.java +++ /dev/null @@ -1,178 +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.core.models.itemPrice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ItemPriceFindApplicableItemPricesParams { - - private final Map queryParams; - - private ItemPriceFindApplicableItemPricesParams( - ItemPriceFindApplicableItemPricesBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public ItemPriceFindApplicableItemPricesBuilder toBuilder() { - ItemPriceFindApplicableItemPricesBuilder builder = - new ItemPriceFindApplicableItemPricesBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for ItemPriceFindApplicableItemPricesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPriceFindApplicableItemPricesBuilder builder() { - return new ItemPriceFindApplicableItemPricesBuilder(); - } - - public static final class ItemPriceFindApplicableItemPricesBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private ItemPriceFindApplicableItemPricesBuilder() {} - - public ItemPriceFindApplicableItemPricesBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public ItemPriceFindApplicableItemPricesBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public ItemPriceFindApplicableItemPricesBuilder itemId(String value) { - queryParams.put("item_id", value); - return this; - } - - public SortBySortBuilder sortBy() { - return new SortBySortBuilder("sort_by", this); - } - - public ItemPriceFindApplicableItemPricesParams build() { - return new ItemPriceFindApplicableItemPricesParams(this); - } - - public static final class SortBySortBuilder { - private final String fieldName; - private final ItemPriceFindApplicableItemPricesBuilder builder; - - SortBySortBuilder(String fieldName, ItemPriceFindApplicableItemPricesBuilder builder) { - this.fieldName = fieldName; - this.builder = builder; - } - - public SortDirection name() { - return new SortDirection(fieldName, "name", builder); - } - - public SortDirection id() { - return new SortDirection(fieldName, "id", builder); - } - - public SortDirection updated_at() { - return new SortDirection(fieldName, "updated_at", builder); - } - } - - public static final class SortDirection { - private final String fieldName; - private final String selectedField; - private final ItemPriceFindApplicableItemPricesBuilder builder; - - SortDirection( - String fieldName, - String selectedField, - ItemPriceFindApplicableItemPricesBuilder builder) { - this.fieldName = fieldName; - this.selectedField = selectedField; - this.builder = builder; - } - - public ItemPriceFindApplicableItemPricesBuilder asc() { - builder.queryParams.put(fieldName + "[asc]", selectedField); - return builder; - } - - public ItemPriceFindApplicableItemPricesBuilder desc() { - builder.queryParams.put(fieldName + "[desc]", selectedField); - return builder; - } - } - } - - public enum SortByAsc { - NAME("name"), - - ID("id"), - - UPDATED_AT("updated_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 { - NAME("name"), - - ID("id"), - - UPDATED_AT("updated_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/core/models/itemPrice/params/ItemPriceUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceUpdateParams.java deleted file mode 100644 index f0be18d5..00000000 --- a/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceUpdateParams.java +++ /dev/null @@ -1,913 +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.core.models.itemPrice.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; - -public final class ItemPriceUpdateParams { - - private final Map formData; - - private ItemPriceUpdateParams(ItemPriceUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemPriceUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPriceUpdateBuilder builder() { - return new ItemPriceUpdateBuilder(); - } - - public static final class ItemPriceUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemPriceUpdateBuilder() {} - - public ItemPriceUpdateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public ItemPriceUpdateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ItemPriceUpdateBuilder prorationType(ProrationType value) { - - formData.put("proration_type", value); - - return this; - } - - public ItemPriceUpdateBuilder priceVariantId(String value) { - - formData.put("price_variant_id", value); - - return this; - } - - public ItemPriceUpdateBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public ItemPriceUpdateBuilder externalName(String value) { - - formData.put("external_name", value); - - return this; - } - - public ItemPriceUpdateBuilder usageAccumulationResetFrequency( - UsageAccumulationResetFrequency value) { - - formData.put("usage_accumulation_reset_frequency", value); - - return this; - } - - public ItemPriceUpdateBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public ItemPriceUpdateBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public ItemPriceUpdateBuilder isTaxable(Boolean value) { - - formData.put("is_taxable", value); - - return this; - } - - public ItemPriceUpdateBuilder freeQuantity(Integer value) { - - formData.put("free_quantity", value); - - return this; - } - - public ItemPriceUpdateBuilder freeQuantityInDecimal(String value) { - - formData.put("free_quantity_in_decimal", value); - - return this; - } - - public ItemPriceUpdateBuilder metadata(java.util.Map value) { - - formData.put("metadata", JsonUtil.toJson(value)); - - return this; - } - - public ItemPriceUpdateBuilder pricingModel(PricingModel value) { - - formData.put("pricing_model", value); - - return this; - } - - public ItemPriceUpdateBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemPriceUpdateBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemPriceUpdateBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public ItemPriceUpdateBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public ItemPriceUpdateBuilder trialPeriodUnit(TrialPeriodUnit value) { - - formData.put("trial_period_unit", value); - - return this; - } - - public ItemPriceUpdateBuilder trialPeriod(Integer value) { - - formData.put("trial_period", value); - - return this; - } - - public ItemPriceUpdateBuilder shippingPeriod(Integer value) { - - formData.put("shipping_period", value); - - return this; - } - - public ItemPriceUpdateBuilder shippingPeriodUnit(ShippingPeriodUnit value) { - - formData.put("shipping_period_unit", value); - - return this; - } - - public ItemPriceUpdateBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public ItemPriceUpdateBuilder trialEndAction(TrialEndAction value) { - - formData.put("trial_end_action", value); - - return this; - } - - public ItemPriceUpdateBuilder showDescriptionInInvoices(Boolean value) { - - formData.put("show_description_in_invoices", value); - - return this; - } - - public ItemPriceUpdateBuilder showDescriptionInQuotes(Boolean value) { - - formData.put("show_description_in_quotes", value); - - return this; - } - - public ItemPriceUpdateBuilder taxDetail(TaxDetailParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "tax_detail[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceUpdateBuilder accountingDetail(AccountingDetailParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "accounting_detail[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ItemPriceUpdateBuilder tiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public ItemPriceUpdateBuilder taxProvidersFields(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 ItemPriceUpdateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 ItemPriceUpdateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public ItemPriceUpdateParams build() { - return new ItemPriceUpdateParams(this); - } - } - - public enum ProrationType { - SITE_DEFAULT("site_default"), - - PARTIAL_TERM("partial_term"), - - FULL_TERM("full_term"), - - /** An enum member indicating that ProrationType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ProrationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ProrationType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ProrationType enumValue : ProrationType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Status { - ACTIVE("active"), - - ARCHIVED("archived"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum UsageAccumulationResetFrequency { - NEVER("never"), - - SUBSCRIPTION_BILLING_FREQUENCY("subscription_billing_frequency"), - - /** - * An enum member indicating that UsageAccumulationResetFrequency was instantiated with an - * unknown value. - */ - _UNKNOWN(null); - private final String value; - - UsageAccumulationResetFrequency(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static UsageAccumulationResetFrequency fromString(String value) { - if (value == null) return _UNKNOWN; - for (UsageAccumulationResetFrequency enumValue : UsageAccumulationResetFrequency.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PricingModel { - FLAT_FEE("flat_fee"), - - PER_UNIT("per_unit"), - - TIERED("tiered"), - - VOLUME("volume"), - - STAIRSTEP("stairstep"), - - /** An enum member indicating that PricingModel was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingModel(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingModel fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingModel enumValue : PricingModel.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 enum TrialPeriodUnit { - DAY("day"), - - MONTH("month"), - - /** An enum member indicating that TrialPeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialPeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialPeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialPeriodUnit enumValue : TrialPeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ShippingPeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that ShippingPeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ShippingPeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ShippingPeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (ShippingPeriodUnit enumValue : ShippingPeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TrialEndAction { - SITE_DEFAULT("site_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialEndAction enumValue : TrialEndAction.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class TaxDetailParams { - - private final Map formData; - - private TaxDetailParams(TaxDetailBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxDetailParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxDetailBuilder builder() { - return new TaxDetailBuilder(); - } - - public static final class TaxDetailBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxDetailBuilder() {} - - public TaxDetailBuilder taxProfileId(String value) { - - formData.put("tax_profile_id", value); - - return this; - } - - public TaxDetailBuilder avalaraTaxCode(String value) { - - formData.put("avalara_tax_code", value); - - return this; - } - - public TaxDetailBuilder hsnCode(String value) { - - formData.put("hsn_code", value); - - return this; - } - - public TaxDetailBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public TaxDetailBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public TaxDetailBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public TaxDetailBuilder taxjarProductCode(String value) { - - formData.put("taxjar_product_code", value); - - return this; - } - - public TaxDetailParams build() { - return new TaxDetailParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AccountingDetailParams { - - private final Map formData; - - private AccountingDetailParams(AccountingDetailBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AccountingDetailParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AccountingDetailBuilder builder() { - return new AccountingDetailBuilder(); - } - - public static final class AccountingDetailBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AccountingDetailBuilder() {} - - public AccountingDetailBuilder sku(String value) { - - formData.put("sku", value); - - return this; - } - - public AccountingDetailBuilder accountingCode(String value) { - - formData.put("accounting_code", value); - - return this; - } - - public AccountingDetailBuilder accountingCategory1(String value) { - - formData.put("accounting_category1", value); - - return this; - } - - public AccountingDetailBuilder accountingCategory2(String value) { - - formData.put("accounting_category2", value); - - return this; - } - - public AccountingDetailBuilder accountingCategory3(String value) { - - formData.put("accounting_category3", value); - - return this; - } - - public AccountingDetailBuilder accountingCategory4(String value) { - - formData.put("accounting_category4", value); - - return this; - } - - public AccountingDetailParams build() { - return new AccountingDetailParams(this); - } - } - } - - public static final class TiersParams { - - private final Map formData; - - private TiersParams(TiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TiersBuilder builder() { - return new TiersBuilder(); - } - - public static final class TiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TiersBuilder() {} - - public TiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public TiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public TiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public TiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public TiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public TiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public TiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public TiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public TiersParams build() { - return new TiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/media/params/MediaCreateMediaAndAttachToItemParams.java b/src/main/java/com/chargebee/v4/core/models/media/params/MediaCreateMediaAndAttachToItemParams.java deleted file mode 100644 index 1ebc16ff..00000000 --- a/src/main/java/com/chargebee/v4/core/models/media/params/MediaCreateMediaAndAttachToItemParams.java +++ /dev/null @@ -1,64 +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.core.models.media.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class MediaCreateMediaAndAttachToItemParams { - - private final Map formData; - - private MediaCreateMediaAndAttachToItemParams(MediaCreateMediaAndAttachToItemBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for MediaCreateMediaAndAttachToItemParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static MediaCreateMediaAndAttachToItemBuilder builder() { - return new MediaCreateMediaAndAttachToItemBuilder(); - } - - public static final class MediaCreateMediaAndAttachToItemBuilder { - private final Map formData = new LinkedHashMap<>(); - - private MediaCreateMediaAndAttachToItemBuilder() {} - - public MediaCreateMediaAndAttachToItemBuilder url(String value) { - - formData.put("url", value); - - return this; - } - - public MediaCreateMediaAndAttachToItemBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public MediaCreateMediaAndAttachToItemBuilder altText(String value) { - - formData.put("alt_text", value); - - return this; - } - - public MediaCreateMediaAndAttachToItemParams build() { - return new MediaCreateMediaAndAttachToItemParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/nonSubscription/params/NonSubscriptionProcessReceiptParams.java b/src/main/java/com/chargebee/v4/core/models/nonSubscription/params/NonSubscriptionProcessReceiptParams.java deleted file mode 100644 index 818e0f7d..00000000 --- a/src/main/java/com/chargebee/v4/core/models/nonSubscription/params/NonSubscriptionProcessReceiptParams.java +++ /dev/null @@ -1,232 +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.core.models.nonSubscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class NonSubscriptionProcessReceiptParams { - - private final Map formData; - - private NonSubscriptionProcessReceiptParams(NonSubscriptionProcessReceiptBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for NonSubscriptionProcessReceiptParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static NonSubscriptionProcessReceiptBuilder builder() { - return new NonSubscriptionProcessReceiptBuilder(); - } - - public static final class NonSubscriptionProcessReceiptBuilder { - private final Map formData = new LinkedHashMap<>(); - - private NonSubscriptionProcessReceiptBuilder() {} - - public NonSubscriptionProcessReceiptBuilder receipt(String value) { - - formData.put("receipt", value); - - return this; - } - - public NonSubscriptionProcessReceiptBuilder product(ProductParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "product[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public NonSubscriptionProcessReceiptBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public NonSubscriptionProcessReceiptParams build() { - return new NonSubscriptionProcessReceiptParams(this); - } - } - - public static final class ProductParams { - - private final Map formData; - - private ProductParams(ProductBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ProductParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ProductBuilder builder() { - return new ProductBuilder(); - } - - public static final class ProductBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ProductBuilder() {} - - public ProductBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ProductBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public ProductBuilder price(Integer value) { - - formData.put("price", value); - - return this; - } - - public ProductBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public ProductBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public ProductBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ProductParams build() { - return new ProductParams(this); - } - } - - public enum Type { - CONSUMABLE("consumable"), - - NON_CONSUMABLE("non_consumable"), - - NON_RENEWING_SUBSCRIPTION("non_renewing_subscription"), - - /** 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 static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public CustomerBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CustomerBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/offerEvent/params/OfferEventOfferEventsParams.java b/src/main/java/com/chargebee/v4/core/models/offerEvent/params/OfferEventOfferEventsParams.java deleted file mode 100644 index fda3d3f0..00000000 --- a/src/main/java/com/chargebee/v4/core/models/offerEvent/params/OfferEventOfferEventsParams.java +++ /dev/null @@ -1,85 +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.core.models.offerEvent.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class OfferEventOfferEventsParams { - - private final Map formData; - - private OfferEventOfferEventsParams(OfferEventOfferEventsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OfferEventOfferEventsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OfferEventOfferEventsBuilder builder() { - return new OfferEventOfferEventsBuilder(); - } - - public static final class OfferEventOfferEventsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OfferEventOfferEventsBuilder() {} - - public OfferEventOfferEventsBuilder personalizedOfferId(String value) { - - formData.put("personalized_offer_id", value); - - return this; - } - - public OfferEventOfferEventsBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public OfferEventOfferEventsParams build() { - return new OfferEventOfferEventsParams(this); - } - } - - public enum Type { - VIEWED("viewed"), - - DISMISSED("dismissed"), - - /** 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/core/models/offerFulfillment/params/OfferFulfillmentOfferFulfillmentsGetParams.java b/src/main/java/com/chargebee/v4/core/models/offerFulfillment/params/OfferFulfillmentOfferFulfillmentsGetParams.java deleted file mode 100644 index 51f97e39..00000000 --- a/src/main/java/com/chargebee/v4/core/models/offerFulfillment/params/OfferFulfillmentOfferFulfillmentsGetParams.java +++ /dev/null @@ -1,52 +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.core.models.offerFulfillment.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class OfferFulfillmentOfferFulfillmentsGetParams { - - private final Map queryParams; - - private OfferFulfillmentOfferFulfillmentsGetParams( - OfferFulfillmentOfferFulfillmentsGetBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public OfferFulfillmentOfferFulfillmentsGetBuilder toBuilder() { - OfferFulfillmentOfferFulfillmentsGetBuilder builder = - new OfferFulfillmentOfferFulfillmentsGetBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for OfferFulfillmentOfferFulfillmentsGetParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OfferFulfillmentOfferFulfillmentsGetBuilder builder() { - return new OfferFulfillmentOfferFulfillmentsGetBuilder(); - } - - public static final class OfferFulfillmentOfferFulfillmentsGetBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private OfferFulfillmentOfferFulfillmentsGetBuilder() {} - - public OfferFulfillmentOfferFulfillmentsGetParams build() { - return new OfferFulfillmentOfferFulfillmentsGetParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/offerFulfillment/params/OfferFulfillmentOfferFulfillmentsParams.java b/src/main/java/com/chargebee/v4/core/models/offerFulfillment/params/OfferFulfillmentOfferFulfillmentsParams.java deleted file mode 100644 index 916fd849..00000000 --- a/src/main/java/com/chargebee/v4/core/models/offerFulfillment/params/OfferFulfillmentOfferFulfillmentsParams.java +++ /dev/null @@ -1,58 +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.core.models.offerFulfillment.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class OfferFulfillmentOfferFulfillmentsParams { - - private final Map formData; - - private OfferFulfillmentOfferFulfillmentsParams( - OfferFulfillmentOfferFulfillmentsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OfferFulfillmentOfferFulfillmentsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OfferFulfillmentOfferFulfillmentsBuilder builder() { - return new OfferFulfillmentOfferFulfillmentsBuilder(); - } - - public static final class OfferFulfillmentOfferFulfillmentsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OfferFulfillmentOfferFulfillmentsBuilder() {} - - public OfferFulfillmentOfferFulfillmentsBuilder personalizedOfferId(String value) { - - formData.put("personalized_offer_id", value); - - return this; - } - - public OfferFulfillmentOfferFulfillmentsBuilder optionId(String value) { - - formData.put("option_id", value); - - return this; - } - - public OfferFulfillmentOfferFulfillmentsParams build() { - return new OfferFulfillmentOfferFulfillmentsParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/offerFulfillment/params/OfferFulfillmentOfferFulfillmentsUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/offerFulfillment/params/OfferFulfillmentOfferFulfillmentsUpdateParams.java deleted file mode 100644 index c93463e4..00000000 --- a/src/main/java/com/chargebee/v4/core/models/offerFulfillment/params/OfferFulfillmentOfferFulfillmentsUpdateParams.java +++ /dev/null @@ -1,93 +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.core.models.offerFulfillment.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class OfferFulfillmentOfferFulfillmentsUpdateParams { - - private final Map formData; - - private OfferFulfillmentOfferFulfillmentsUpdateParams( - OfferFulfillmentOfferFulfillmentsUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OfferFulfillmentOfferFulfillmentsUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OfferFulfillmentOfferFulfillmentsUpdateBuilder builder() { - return new OfferFulfillmentOfferFulfillmentsUpdateBuilder(); - } - - public static final class OfferFulfillmentOfferFulfillmentsUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OfferFulfillmentOfferFulfillmentsUpdateBuilder() {} - - public OfferFulfillmentOfferFulfillmentsUpdateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public OfferFulfillmentOfferFulfillmentsUpdateBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public OfferFulfillmentOfferFulfillmentsUpdateBuilder failureReason(String value) { - - formData.put("failure_reason", value); - - return this; - } - - public OfferFulfillmentOfferFulfillmentsUpdateParams build() { - return new OfferFulfillmentOfferFulfillmentsUpdateParams(this); - } - } - - public enum Status { - COMPLETED("completed"), - - FAILED("failed"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscription/params/OmnichannelSubscriptionMoveParams.java b/src/main/java/com/chargebee/v4/core/models/omnichannelSubscription/params/OmnichannelSubscriptionMoveParams.java deleted file mode 100644 index 824fee95..00000000 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscription/params/OmnichannelSubscriptionMoveParams.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.core.models.omnichannelSubscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class OmnichannelSubscriptionMoveParams { - - private final Map formData; - - private OmnichannelSubscriptionMoveParams(OmnichannelSubscriptionMoveBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OmnichannelSubscriptionMoveParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OmnichannelSubscriptionMoveBuilder builder() { - return new OmnichannelSubscriptionMoveBuilder(); - } - - public static final class OmnichannelSubscriptionMoveBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OmnichannelSubscriptionMoveBuilder() {} - - public OmnichannelSubscriptionMoveBuilder toCustomerId(String value) { - - formData.put("to_customer_id", value); - - return this; - } - - public OmnichannelSubscriptionMoveParams build() { - return new OmnichannelSubscriptionMoveParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscription/params/OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/omnichannelSubscription/params/OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams.java deleted file mode 100644 index 15857ef2..00000000 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscription/params/OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams.java +++ /dev/null @@ -1,71 +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.core.models.omnichannelSubscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams { - - private final Map queryParams; - - private OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams( - OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionBuilder - toBuilder() { - OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionBuilder builder = - new OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** - * Create a new builder for - * OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams. - */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionBuilder - builder() { - return new OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionBuilder(); - } - - public static final - class OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionBuilder() {} - - public OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionBuilder limit( - Integer value) { - queryParams.put("limit", value); - return this; - } - - public OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionBuilder offset( - String value) { - queryParams.put("offset", value); - return this; - } - - public OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams build() { - return new OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams( - this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItem/params/OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams.java b/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItem/params/OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams.java deleted file mode 100644 index 5a4bb81a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItem/params/OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams.java +++ /dev/null @@ -1,62 +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.core.models.omnichannelSubscriptionItem.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams { - - private final Map queryParams; - - private OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams( - OmnichannelSubscriptionItemListOmniSubItemScheduleChangesBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public OmnichannelSubscriptionItemListOmniSubItemScheduleChangesBuilder toBuilder() { - OmnichannelSubscriptionItemListOmniSubItemScheduleChangesBuilder builder = - new OmnichannelSubscriptionItemListOmniSubItemScheduleChangesBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OmnichannelSubscriptionItemListOmniSubItemScheduleChangesBuilder builder() { - return new OmnichannelSubscriptionItemListOmniSubItemScheduleChangesBuilder(); - } - - public static final class OmnichannelSubscriptionItemListOmniSubItemScheduleChangesBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private OmnichannelSubscriptionItemListOmniSubItemScheduleChangesBuilder() {} - - public OmnichannelSubscriptionItemListOmniSubItemScheduleChangesBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public OmnichannelSubscriptionItemListOmniSubItemScheduleChangesBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams build() { - return new OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/order/params/OrderAssignOrderNumberParams.java b/src/main/java/com/chargebee/v4/core/models/order/params/OrderAssignOrderNumberParams.java deleted file mode 100644 index 78725ae7..00000000 --- a/src/main/java/com/chargebee/v4/core/models/order/params/OrderAssignOrderNumberParams.java +++ /dev/null @@ -1,43 +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.core.models.order.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class OrderAssignOrderNumberParams { - - private final Map formData; - - private OrderAssignOrderNumberParams(OrderAssignOrderNumberBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OrderAssignOrderNumberParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OrderAssignOrderNumberBuilder builder() { - return new OrderAssignOrderNumberBuilder(); - } - - public static final class OrderAssignOrderNumberBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OrderAssignOrderNumberBuilder() {} - - public OrderAssignOrderNumberParams build() { - return new OrderAssignOrderNumberParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/order/params/OrderCancelParams.java b/src/main/java/com/chargebee/v4/core/models/order/params/OrderCancelParams.java deleted file mode 100644 index 5f3a9703..00000000 --- a/src/main/java/com/chargebee/v4/core/models/order/params/OrderCancelParams.java +++ /dev/null @@ -1,172 +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.core.models.order.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class OrderCancelParams { - - private final Map formData; - - private OrderCancelParams(OrderCancelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OrderCancelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OrderCancelBuilder builder() { - return new OrderCancelBuilder(); - } - - public static final class OrderCancelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OrderCancelBuilder() {} - - public OrderCancelBuilder cancellationReason(CancellationReason value) { - - formData.put("cancellation_reason", value); - - return this; - } - - public OrderCancelBuilder customerNotes(String value) { - - formData.put("customer_notes", value); - - return this; - } - - public OrderCancelBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public OrderCancelBuilder cancelledAt(Timestamp value) { - - formData.put("cancelled_at", value); - - return this; - } - - public OrderCancelBuilder creditNote(CreditNoteParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "credit_note[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderCancelParams build() { - return new OrderCancelParams(this); - } - } - - public enum CancellationReason { - SHIPPING_CUT_OFF_PASSED("shipping_cut_off_passed"), - - PRODUCT_UNSATISFACTORY("product_unsatisfactory"), - - THIRD_PARTY_CANCELLATION("third_party_cancellation"), - - PRODUCT_NOT_REQUIRED("product_not_required"), - - DELIVERY_DATE_MISSED("delivery_date_missed"), - - ALTERNATIVE_FOUND("alternative_found"), - - INVOICE_WRITTEN_OFF("invoice_written_off"), - - INVOICE_VOIDED("invoice_voided"), - - FRAUDULENT_TRANSACTION("fraudulent_transaction"), - - PAYMENT_DECLINED("payment_declined"), - - SUBSCRIPTION_CANCELLED("subscription_cancelled"), - - PRODUCT_NOT_AVAILABLE("product_not_available"), - - OTHERS("others"), - - ORDER_RESENT("order_resent"), - - /** An enum member indicating that CancellationReason was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CancellationReason(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CancellationReason fromString(String value) { - if (value == null) return _UNKNOWN; - for (CancellationReason enumValue : CancellationReason.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class CreditNoteParams { - - private final Map formData; - - private CreditNoteParams(CreditNoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditNoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNoteBuilder builder() { - return new CreditNoteBuilder(); - } - - public static final class CreditNoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditNoteBuilder() {} - - public CreditNoteBuilder total(Long value) { - - formData.put("total", value); - - return this; - } - - public CreditNoteParams build() { - return new CreditNoteParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/order/params/OrderCreateParams.java b/src/main/java/com/chargebee/v4/core/models/order/params/OrderCreateParams.java deleted file mode 100644 index b8d473d9..00000000 --- a/src/main/java/com/chargebee/v4/core/models/order/params/OrderCreateParams.java +++ /dev/null @@ -1,140 +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.core.models.order.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class OrderCreateParams { - - private final Map formData; - - private OrderCreateParams(OrderCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OrderCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OrderCreateBuilder builder() { - return new OrderCreateBuilder(); - } - - public static final class OrderCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OrderCreateBuilder() {} - - public OrderCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public OrderCreateBuilder invoiceId(String value) { - - formData.put("invoice_id", value); - - return this; - } - - public OrderCreateBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public OrderCreateBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public OrderCreateBuilder fulfillmentStatus(String value) { - - formData.put("fulfillment_status", value); - - return this; - } - - public OrderCreateBuilder note(String value) { - - formData.put("note", value); - - return this; - } - - public OrderCreateBuilder trackingId(String value) { - - formData.put("tracking_id", value); - - return this; - } - - public OrderCreateBuilder trackingUrl(String value) { - - formData.put("tracking_url", value); - - return this; - } - - public OrderCreateBuilder batchId(String value) { - - formData.put("batch_id", value); - - return this; - } - - public OrderCreateParams build() { - return new OrderCreateParams(this); - } - } - - public enum Status { - NEW("new"), - - PROCESSING("processing"), - - COMPLETE("complete"), - - CANCELLED("cancelled"), - - VOIDED("voided"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/order/params/OrderCreateRefundableCreditNoteParams.java b/src/main/java/com/chargebee/v4/core/models/order/params/OrderCreateRefundableCreditNoteParams.java deleted file mode 100644 index 3b5a1654..00000000 --- a/src/main/java/com/chargebee/v4/core/models/order/params/OrderCreateRefundableCreditNoteParams.java +++ /dev/null @@ -1,160 +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.core.models.order.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class OrderCreateRefundableCreditNoteParams { - - private final Map formData; - - private OrderCreateRefundableCreditNoteParams(OrderCreateRefundableCreditNoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OrderCreateRefundableCreditNoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OrderCreateRefundableCreditNoteBuilder builder() { - return new OrderCreateRefundableCreditNoteBuilder(); - } - - public static final class OrderCreateRefundableCreditNoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OrderCreateRefundableCreditNoteBuilder() {} - - public OrderCreateRefundableCreditNoteBuilder customerNotes(String value) { - - formData.put("customer_notes", value); - - return this; - } - - public OrderCreateRefundableCreditNoteBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public OrderCreateRefundableCreditNoteBuilder creditNote(CreditNoteParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "credit_note[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderCreateRefundableCreditNoteParams build() { - return new OrderCreateRefundableCreditNoteParams(this); - } - } - - public static final class CreditNoteParams { - - private final Map formData; - - private CreditNoteParams(CreditNoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CreditNoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CreditNoteBuilder builder() { - return new CreditNoteBuilder(); - } - - public static final class CreditNoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CreditNoteBuilder() {} - - public CreditNoteBuilder reasonCode(ReasonCode value) { - - formData.put("reason_code", value); - - return this; - } - - public CreditNoteBuilder total(Long value) { - - formData.put("total", value); - - return this; - } - - public CreditNoteParams build() { - return new CreditNoteParams(this); - } - } - - public enum ReasonCode { - WRITE_OFF("write_off"), - - SUBSCRIPTION_CHANGE("subscription_change"), - - SUBSCRIPTION_CANCELLATION("subscription_cancellation"), - - SUBSCRIPTION_PAUSE("subscription_pause"), - - CHARGEBACK("chargeback"), - - PRODUCT_UNSATISFACTORY("product_unsatisfactory"), - - SERVICE_UNSATISFACTORY("service_unsatisfactory"), - - ORDER_CHANGE("order_change"), - - ORDER_CANCELLATION("order_cancellation"), - - WAIVER("waiver"), - - OTHER("other"), - - FRAUDULENT("fraudulent"), - - /** An enum member indicating that ReasonCode was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ReasonCode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ReasonCode fromString(String value) { - if (value == null) return _UNKNOWN; - for (ReasonCode enumValue : ReasonCode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/order/params/OrderDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/order/params/OrderDeleteParams.java deleted file mode 100644 index d752f316..00000000 --- a/src/main/java/com/chargebee/v4/core/models/order/params/OrderDeleteParams.java +++ /dev/null @@ -1,43 +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.core.models.order.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class OrderDeleteParams { - - private final Map formData; - - private OrderDeleteParams(OrderDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OrderDeleteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OrderDeleteBuilder builder() { - return new OrderDeleteBuilder(); - } - - public static final class OrderDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OrderDeleteBuilder() {} - - public OrderDeleteParams build() { - return new OrderDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/order/params/OrderImportOrderParams.java b/src/main/java/com/chargebee/v4/core/models/order/params/OrderImportOrderParams.java deleted file mode 100644 index 2583534d..00000000 --- a/src/main/java/com/chargebee/v4/core/models/order/params/OrderImportOrderParams.java +++ /dev/null @@ -1,632 +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.core.models.order.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class OrderImportOrderParams { - - private final Map formData; - - private OrderImportOrderParams(OrderImportOrderBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OrderImportOrderParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OrderImportOrderBuilder builder() { - return new OrderImportOrderBuilder(); - } - - public static final class OrderImportOrderBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OrderImportOrderBuilder() {} - - public OrderImportOrderBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public OrderImportOrderBuilder documentNumber(String value) { - - formData.put("document_number", value); - - return this; - } - - public OrderImportOrderBuilder invoiceId(String value) { - - formData.put("invoice_id", value); - - return this; - } - - public OrderImportOrderBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public OrderImportOrderBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public OrderImportOrderBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public OrderImportOrderBuilder createdAt(Timestamp value) { - - formData.put("created_at", value); - - return this; - } - - public OrderImportOrderBuilder orderDate(Timestamp value) { - - formData.put("order_date", value); - - return this; - } - - public OrderImportOrderBuilder shippingDate(Timestamp value) { - - formData.put("shipping_date", value); - - return this; - } - - public OrderImportOrderBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public OrderImportOrderBuilder fulfillmentStatus(String value) { - - formData.put("fulfillment_status", value); - - return this; - } - - public OrderImportOrderBuilder note(String value) { - - formData.put("note", value); - - return this; - } - - public OrderImportOrderBuilder trackingId(String value) { - - formData.put("tracking_id", value); - - return this; - } - - public OrderImportOrderBuilder trackingUrl(String value) { - - formData.put("tracking_url", value); - - return this; - } - - public OrderImportOrderBuilder batchId(String value) { - - formData.put("batch_id", value); - - return this; - } - - public OrderImportOrderBuilder shipmentCarrier(String value) { - - formData.put("shipment_carrier", value); - - return this; - } - - public OrderImportOrderBuilder shippingCutOffDate(Timestamp value) { - - formData.put("shipping_cut_off_date", value); - - return this; - } - - public OrderImportOrderBuilder deliveredAt(Timestamp value) { - - formData.put("delivered_at", value); - - return this; - } - - public OrderImportOrderBuilder shippedAt(Timestamp value) { - - formData.put("shipped_at", value); - - return this; - } - - public OrderImportOrderBuilder cancelledAt(Timestamp value) { - - formData.put("cancelled_at", value); - - return this; - } - - public OrderImportOrderBuilder cancellationReason(CancellationReason value) { - - formData.put("cancellation_reason", value); - - return this; - } - - public OrderImportOrderBuilder refundableCreditsIssued(Long value) { - - formData.put("refundable_credits_issued", value); - - return this; - } - - public OrderImportOrderBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderImportOrderBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderImportOrderParams build() { - return new OrderImportOrderParams(this); - } - } - - public enum Status { - CANCELLED("cancelled"), - - QUEUED("queued"), - - AWAITING_SHIPMENT("awaiting_shipment"), - - ON_HOLD("on_hold"), - - DELIVERED("delivered"), - - SHIPPED("shipped"), - - PARTIALLY_DELIVERED("partially_delivered"), - - RETURNED("returned"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum CancellationReason { - SHIPPING_CUT_OFF_PASSED("shipping_cut_off_passed"), - - PRODUCT_UNSATISFACTORY("product_unsatisfactory"), - - THIRD_PARTY_CANCELLATION("third_party_cancellation"), - - PRODUCT_NOT_REQUIRED("product_not_required"), - - DELIVERY_DATE_MISSED("delivery_date_missed"), - - ALTERNATIVE_FOUND("alternative_found"), - - INVOICE_WRITTEN_OFF("invoice_written_off"), - - INVOICE_VOIDED("invoice_voided"), - - FRAUDULENT_TRANSACTION("fraudulent_transaction"), - - PAYMENT_DECLINED("payment_declined"), - - SUBSCRIPTION_CANCELLED("subscription_cancelled"), - - PRODUCT_NOT_AVAILABLE("product_not_available"), - - OTHERS("others"), - - ORDER_RESENT("order_resent"), - - /** An enum member indicating that CancellationReason was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CancellationReason(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CancellationReason fromString(String value) { - if (value == null) return _UNKNOWN; - for (CancellationReason enumValue : CancellationReason.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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/core/models/order/params/OrderOrdersForInvoiceParams.java b/src/main/java/com/chargebee/v4/core/models/order/params/OrderOrdersForInvoiceParams.java deleted file mode 100644 index 595d9dbd..00000000 --- a/src/main/java/com/chargebee/v4/core/models/order/params/OrderOrdersForInvoiceParams.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.core.models.order.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class OrderOrdersForInvoiceParams { - - private final Map queryParams; - - private OrderOrdersForInvoiceParams(OrderOrdersForInvoiceBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public OrderOrdersForInvoiceBuilder toBuilder() { - OrderOrdersForInvoiceBuilder builder = new OrderOrdersForInvoiceBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for OrderOrdersForInvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OrderOrdersForInvoiceBuilder builder() { - return new OrderOrdersForInvoiceBuilder(); - } - - public static final class OrderOrdersForInvoiceBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private OrderOrdersForInvoiceBuilder() {} - - public OrderOrdersForInvoiceBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public OrderOrdersForInvoiceBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public OrderOrdersForInvoiceParams build() { - return new OrderOrdersForInvoiceParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/order/params/OrderReopenParams.java b/src/main/java/com/chargebee/v4/core/models/order/params/OrderReopenParams.java deleted file mode 100644 index 25296bf4..00000000 --- a/src/main/java/com/chargebee/v4/core/models/order/params/OrderReopenParams.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.core.models.order.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class OrderReopenParams { - - private final Map formData; - - private OrderReopenParams(OrderReopenBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OrderReopenParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OrderReopenBuilder builder() { - return new OrderReopenBuilder(); - } - - public static final class OrderReopenBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OrderReopenBuilder() {} - - public OrderReopenBuilder voidCancellationCreditNotes(Boolean value) { - - formData.put("void_cancellation_credit_notes", value); - - return this; - } - - public OrderReopenParams build() { - return new OrderReopenParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/order/params/OrderResendParams.java b/src/main/java/com/chargebee/v4/core/models/order/params/OrderResendParams.java deleted file mode 100644 index 563a9845..00000000 --- a/src/main/java/com/chargebee/v4/core/models/order/params/OrderResendParams.java +++ /dev/null @@ -1,119 +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.core.models.order.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class OrderResendParams { - - private final Map formData; - - private OrderResendParams(OrderResendBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OrderResendParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OrderResendBuilder builder() { - return new OrderResendBuilder(); - } - - public static final class OrderResendBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OrderResendBuilder() {} - - public OrderResendBuilder shippingDate(Timestamp value) { - - formData.put("shipping_date", value); - - return this; - } - - public OrderResendBuilder resendReason(String value) { - - formData.put("resend_reason", value); - - return this; - } - - public OrderResendBuilder orderLineItems(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - OrderLineItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "order_line_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public OrderResendParams build() { - return new OrderResendParams(this); - } - } - - public static final class OrderLineItemsParams { - - private final Map formData; - - private OrderLineItemsParams(OrderLineItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OrderLineItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OrderLineItemsBuilder builder() { - return new OrderLineItemsBuilder(); - } - - public static final class OrderLineItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OrderLineItemsBuilder() {} - - public OrderLineItemsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public OrderLineItemsBuilder fulfillmentQuantity(Integer value) { - - formData.put("fulfillment_quantity", value); - - return this; - } - - public OrderLineItemsParams build() { - return new OrderLineItemsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/order/params/OrderUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/order/params/OrderUpdateParams.java deleted file mode 100644 index 5897c7bb..00000000 --- a/src/main/java/com/chargebee/v4/core/models/order/params/OrderUpdateParams.java +++ /dev/null @@ -1,521 +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.core.models.order.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class OrderUpdateParams { - - private final Map formData; - - private OrderUpdateParams(OrderUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OrderUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OrderUpdateBuilder builder() { - return new OrderUpdateBuilder(); - } - - public static final class OrderUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OrderUpdateBuilder() {} - - public OrderUpdateBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public OrderUpdateBuilder batchId(String value) { - - formData.put("batch_id", value); - - return this; - } - - public OrderUpdateBuilder note(String value) { - - formData.put("note", value); - - return this; - } - - public OrderUpdateBuilder shippingDate(Timestamp value) { - - formData.put("shipping_date", value); - - return this; - } - - public OrderUpdateBuilder orderDate(Timestamp value) { - - formData.put("order_date", value); - - return this; - } - - public OrderUpdateBuilder cancelledAt(Timestamp value) { - - formData.put("cancelled_at", value); - - return this; - } - - public OrderUpdateBuilder cancellationReason(CancellationReason value) { - - formData.put("cancellation_reason", value); - - return this; - } - - public OrderUpdateBuilder shippedAt(Timestamp value) { - - formData.put("shipped_at", value); - - return this; - } - - public OrderUpdateBuilder deliveredAt(Timestamp value) { - - formData.put("delivered_at", value); - - return this; - } - - public OrderUpdateBuilder trackingUrl(String value) { - - formData.put("tracking_url", value); - - return this; - } - - public OrderUpdateBuilder trackingId(String value) { - - formData.put("tracking_id", value); - - return this; - } - - public OrderUpdateBuilder shipmentCarrier(String value) { - - formData.put("shipment_carrier", value); - - return this; - } - - public OrderUpdateBuilder fulfillmentStatus(String value) { - - formData.put("fulfillment_status", value); - - return this; - } - - public OrderUpdateBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public OrderUpdateBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public OrderUpdateBuilder orderLineItems(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - OrderLineItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "order_line_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public OrderUpdateParams build() { - return new OrderUpdateParams(this); - } - } - - public enum CancellationReason { - SHIPPING_CUT_OFF_PASSED("shipping_cut_off_passed"), - - PRODUCT_UNSATISFACTORY("product_unsatisfactory"), - - THIRD_PARTY_CANCELLATION("third_party_cancellation"), - - PRODUCT_NOT_REQUIRED("product_not_required"), - - DELIVERY_DATE_MISSED("delivery_date_missed"), - - ALTERNATIVE_FOUND("alternative_found"), - - INVOICE_WRITTEN_OFF("invoice_written_off"), - - INVOICE_VOIDED("invoice_voided"), - - FRAUDULENT_TRANSACTION("fraudulent_transaction"), - - PAYMENT_DECLINED("payment_declined"), - - SUBSCRIPTION_CANCELLED("subscription_cancelled"), - - PRODUCT_NOT_AVAILABLE("product_not_available"), - - OTHERS("others"), - - ORDER_RESENT("order_resent"), - - /** An enum member indicating that CancellationReason was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CancellationReason(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CancellationReason fromString(String value) { - if (value == null) return _UNKNOWN; - for (CancellationReason enumValue : CancellationReason.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Status { - NEW("new"), - - PROCESSING("processing"), - - COMPLETE("complete"), - - CANCELLED("cancelled"), - - VOIDED("voided"), - - QUEUED("queued"), - - AWAITING_SHIPMENT("awaiting_shipment"), - - ON_HOLD("on_hold"), - - DELIVERED("delivered"), - - SHIPPED("shipped"), - - PARTIALLY_DELIVERED("partially_delivered"), - - RETURNED("returned"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class OrderLineItemsParams { - - private final Map formData; - - private OrderLineItemsParams(OrderLineItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OrderLineItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OrderLineItemsBuilder builder() { - return new OrderLineItemsBuilder(); - } - - public static final class OrderLineItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OrderLineItemsBuilder() {} - - public OrderLineItemsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public OrderLineItemsBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public OrderLineItemsBuilder sku(String value) { - - formData.put("sku", value); - - return this; - } - - public OrderLineItemsParams build() { - return new OrderLineItemsParams(this); - } - } - - public enum Status { - QUEUED("queued"), - - AWAITING_SHIPMENT("awaiting_shipment"), - - ON_HOLD("on_hold"), - - DELIVERED("delivered"), - - SHIPPED("shipped"), - - PARTIALLY_DELIVERED("partially_delivered"), - - RETURNED("returned"), - - CANCELLED("cancelled"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentIntent/params/PaymentIntentCreateParams.java b/src/main/java/com/chargebee/v4/core/models/paymentIntent/params/PaymentIntentCreateParams.java deleted file mode 100644 index b6f37293..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentIntent/params/PaymentIntentCreateParams.java +++ /dev/null @@ -1,172 +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.core.models.paymentIntent.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PaymentIntentCreateParams { - - private final Map formData; - - private PaymentIntentCreateParams(PaymentIntentCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentCreateBuilder builder() { - return new PaymentIntentCreateBuilder(); - } - - public static final class PaymentIntentCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentCreateBuilder() {} - - public PaymentIntentCreateBuilder businessEntityId(String value) { - - formData.put("business_entity_id", value); - - return this; - } - - public PaymentIntentCreateBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public PaymentIntentCreateBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public PaymentIntentCreateBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public PaymentIntentCreateBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentCreateBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public PaymentIntentCreateBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentCreateBuilder successUrl(String value) { - - formData.put("success_url", value); - - return this; - } - - public PaymentIntentCreateBuilder failureUrl(String value) { - - formData.put("failure_url", value); - - return this; - } - - public PaymentIntentCreateParams build() { - return new PaymentIntentCreateParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentIntent/params/PaymentIntentUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/paymentIntent/params/PaymentIntentUpdateParams.java deleted file mode 100644 index 430a2e0c..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentIntent/params/PaymentIntentUpdateParams.java +++ /dev/null @@ -1,151 +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.core.models.paymentIntent.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PaymentIntentUpdateParams { - - private final Map formData; - - private PaymentIntentUpdateParams(PaymentIntentUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentUpdateBuilder builder() { - return new PaymentIntentUpdateBuilder(); - } - - public static final class PaymentIntentUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentUpdateBuilder() {} - - public PaymentIntentUpdateBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public PaymentIntentUpdateBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public PaymentIntentUpdateBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentUpdateBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentUpdateBuilder successUrl(String value) { - - formData.put("success_url", value); - - return this; - } - - public PaymentIntentUpdateBuilder failureUrl(String value) { - - formData.put("failure_url", value); - - return this; - } - - public PaymentIntentUpdateParams build() { - return new PaymentIntentUpdateParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentScheduleScheme/params/PaymentScheduleSchemeCreateParams.java b/src/main/java/com/chargebee/v4/core/models/paymentScheduleScheme/params/PaymentScheduleSchemeCreateParams.java deleted file mode 100644 index 7bfc59d1..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentScheduleScheme/params/PaymentScheduleSchemeCreateParams.java +++ /dev/null @@ -1,164 +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.core.models.paymentScheduleScheme.params; - -import com.chargebee.v4.internal.Recommended; - -import java.math.BigDecimal; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class PaymentScheduleSchemeCreateParams { - - private final Map formData; - - private PaymentScheduleSchemeCreateParams(PaymentScheduleSchemeCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentScheduleSchemeCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentScheduleSchemeCreateBuilder builder() { - return new PaymentScheduleSchemeCreateBuilder(); - } - - public static final class PaymentScheduleSchemeCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentScheduleSchemeCreateBuilder() {} - - public PaymentScheduleSchemeCreateBuilder numberOfSchedules(Integer value) { - - formData.put("number_of_schedules", value); - - return this; - } - - public PaymentScheduleSchemeCreateBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public PaymentScheduleSchemeCreateBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public PaymentScheduleSchemeCreateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public PaymentScheduleSchemeCreateBuilder flexibleSchedules( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - FlexibleSchedulesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "flexible_schedules[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PaymentScheduleSchemeCreateParams build() { - return new PaymentScheduleSchemeCreateParams(this); - } - } - - public enum PeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - /** 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 FlexibleSchedulesParams { - - private final Map formData; - - private FlexibleSchedulesParams(FlexibleSchedulesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for FlexibleSchedulesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static FlexibleSchedulesBuilder builder() { - return new FlexibleSchedulesBuilder(); - } - - public static final class FlexibleSchedulesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private FlexibleSchedulesBuilder() {} - - public FlexibleSchedulesBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public FlexibleSchedulesBuilder amountPercentage(BigDecimal value) { - - formData.put("amount_percentage", value); - - return this; - } - - public FlexibleSchedulesParams build() { - return new FlexibleSchedulesParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateBankAccountParams.java b/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateBankAccountParams.java deleted file mode 100644 index df77ae99..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateBankAccountParams.java +++ /dev/null @@ -1,310 +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.core.models.paymentSource.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; - -public final class PaymentSourceCreateBankAccountParams { - - private final Map formData; - - private PaymentSourceCreateBankAccountParams(PaymentSourceCreateBankAccountBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentSourceCreateBankAccountParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentSourceCreateBankAccountBuilder builder() { - return new PaymentSourceCreateBankAccountBuilder(); - } - - public static final class PaymentSourceCreateBankAccountBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentSourceCreateBankAccountBuilder() {} - - public PaymentSourceCreateBankAccountBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public PaymentSourceCreateBankAccountBuilder issuingCountry(String value) { - - formData.put("issuing_country", value); - - return this; - } - - public PaymentSourceCreateBankAccountBuilder replacePrimaryPaymentSource(Boolean value) { - - formData.put("replace_primary_payment_source", value); - - return this; - } - - public PaymentSourceCreateBankAccountBuilder bankAccount(BankAccountParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "bank_account[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PaymentSourceCreateBankAccountParams build() { - return new PaymentSourceCreateBankAccountParams(this); - } - } - - public static final class BankAccountParams { - - private final Map formData; - - private BankAccountParams(BankAccountBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BankAccountParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BankAccountBuilder builder() { - return new BankAccountBuilder(); - } - - public static final class BankAccountBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BankAccountBuilder() {} - - public BankAccountBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public BankAccountBuilder iban(String value) { - - formData.put("iban", value); - - return this; - } - - public BankAccountBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BankAccountBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BankAccountBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BankAccountBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BankAccountBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BankAccountBuilder bankName(String value) { - - formData.put("bank_name", value); - - return this; - } - - public BankAccountBuilder accountNumber(String value) { - - formData.put("account_number", value); - - return this; - } - - public BankAccountBuilder routingNumber(String value) { - - formData.put("routing_number", value); - - return this; - } - - public BankAccountBuilder bankCode(String value) { - - formData.put("bank_code", value); - - return this; - } - - public BankAccountBuilder accountType(AccountType value) { - - formData.put("account_type", value); - - return this; - } - - public BankAccountBuilder accountHolderType(AccountHolderType value) { - - formData.put("account_holder_type", value); - - return this; - } - - public BankAccountBuilder echeckType(EcheckType value) { - - formData.put("echeck_type", value); - - return this; - } - - public BankAccountBuilder swedishIdentityNumber(String value) { - - formData.put("swedish_identity_number", value); - - return this; - } - - public BankAccountBuilder billingAddress(java.util.Map value) { - - formData.put("billing_address", JsonUtil.toJson(value)); - - return this; - } - - public BankAccountParams build() { - return new BankAccountParams(this); - } - } - - public enum AccountType { - CHECKING("checking"), - - SAVINGS("savings"), - - BUSINESS_CHECKING("business_checking"), - - CURRENT("current"), - - /** An enum member indicating that AccountType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AccountType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AccountType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AccountType enumValue : AccountType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AccountHolderType { - INDIVIDUAL("individual"), - - COMPANY("company"), - - /** - * An enum member indicating that AccountHolderType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - AccountHolderType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AccountHolderType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AccountHolderType enumValue : AccountHolderType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EcheckType { - WEB("web"), - - PPD("ppd"), - - CCD("ccd"), - - /** An enum member indicating that EcheckType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EcheckType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EcheckType fromString(String value) { - if (value == null) return _UNKNOWN; - for (EcheckType enumValue : EcheckType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateCardParams.java b/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateCardParams.java deleted file mode 100644 index 340d2335..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateCardParams.java +++ /dev/null @@ -1,241 +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.core.models.paymentSource.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; - -public final class PaymentSourceCreateCardParams { - - private final Map formData; - - private PaymentSourceCreateCardParams(PaymentSourceCreateCardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentSourceCreateCardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentSourceCreateCardBuilder builder() { - return new PaymentSourceCreateCardBuilder(); - } - - public static final class PaymentSourceCreateCardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentSourceCreateCardBuilder() {} - - public PaymentSourceCreateCardBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public PaymentSourceCreateCardBuilder replacePrimaryPaymentSource(Boolean value) { - - formData.put("replace_primary_payment_source", value); - - return this; - } - - public PaymentSourceCreateCardBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PaymentSourceCreateCardParams build() { - return new PaymentSourceCreateCardParams(this); - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public CardBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CardBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CardBuilder number(String value) { - - formData.put("number", value); - - return this; - } - - public CardBuilder expiryMonth(Integer value) { - - formData.put("expiry_month", value); - - return this; - } - - public CardBuilder expiryYear(Integer value) { - - formData.put("expiry_year", value); - - return this; - } - - public CardBuilder cvv(String value) { - - formData.put("cvv", value); - - return this; - } - - public CardBuilder preferredScheme(PreferredScheme value) { - - formData.put("preferred_scheme", value); - - return this; - } - - public CardBuilder billingAddr1(String value) { - - formData.put("billing_addr1", value); - - return this; - } - - public CardBuilder billingAddr2(String value) { - - formData.put("billing_addr2", value); - - return this; - } - - public CardBuilder billingCity(String value) { - - formData.put("billing_city", value); - - return this; - } - - public CardBuilder billingStateCode(String value) { - - formData.put("billing_state_code", value); - - return this; - } - - public CardBuilder billingState(String value) { - - formData.put("billing_state", value); - - return this; - } - - public CardBuilder billingZip(String value) { - - formData.put("billing_zip", value); - - return this; - } - - public CardBuilder billingCountry(String value) { - - formData.put("billing_country", value); - - return this; - } - - public CardBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public CardParams build() { - return new CardParams(this); - } - } - - 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateUsingPaymentIntentParams.java b/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateUsingPaymentIntentParams.java deleted file mode 100644 index 2f4590b0..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateUsingPaymentIntentParams.java +++ /dev/null @@ -1,225 +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.core.models.paymentSource.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; - -public final class PaymentSourceCreateUsingPaymentIntentParams { - - private final Map formData; - - private PaymentSourceCreateUsingPaymentIntentParams( - PaymentSourceCreateUsingPaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentSourceCreateUsingPaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentSourceCreateUsingPaymentIntentBuilder builder() { - return new PaymentSourceCreateUsingPaymentIntentBuilder(); - } - - public static final class PaymentSourceCreateUsingPaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentSourceCreateUsingPaymentIntentBuilder() {} - - public PaymentSourceCreateUsingPaymentIntentBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public PaymentSourceCreateUsingPaymentIntentBuilder replacePrimaryPaymentSource(Boolean value) { - - formData.put("replace_primary_payment_source", value); - - return this; - } - - public PaymentSourceCreateUsingPaymentIntentBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PaymentSourceCreateUsingPaymentIntentParams build() { - return new PaymentSourceCreateUsingPaymentIntentParams(this); - } - } - - public static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInfo(java.util.Map value) { - - formData.put("additional_info", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateUsingPermanentTokenParams.java b/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateUsingPermanentTokenParams.java deleted file mode 100644 index 946e088e..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateUsingPermanentTokenParams.java +++ /dev/null @@ -1,505 +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.core.models.paymentSource.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; - -public final class PaymentSourceCreateUsingPermanentTokenParams { - - private final Map formData; - - private PaymentSourceCreateUsingPermanentTokenParams( - PaymentSourceCreateUsingPermanentTokenBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentSourceCreateUsingPermanentTokenParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentSourceCreateUsingPermanentTokenBuilder builder() { - return new PaymentSourceCreateUsingPermanentTokenBuilder(); - } - - public static final class PaymentSourceCreateUsingPermanentTokenBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentSourceCreateUsingPermanentTokenBuilder() {} - - public PaymentSourceCreateUsingPermanentTokenBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public PaymentSourceCreateUsingPermanentTokenBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public PaymentSourceCreateUsingPermanentTokenBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentSourceCreateUsingPermanentTokenBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public PaymentSourceCreateUsingPermanentTokenBuilder issuingCountry(String value) { - - formData.put("issuing_country", value); - - return this; - } - - public PaymentSourceCreateUsingPermanentTokenBuilder replacePrimaryPaymentSource( - Boolean value) { - - formData.put("replace_primary_payment_source", value); - - return this; - } - - public PaymentSourceCreateUsingPermanentTokenBuilder paymentMethodToken(String value) { - - formData.put("payment_method_token", value); - - return this; - } - - public PaymentSourceCreateUsingPermanentTokenBuilder customerProfileToken(String value) { - - formData.put("customer_profile_token", value); - - return this; - } - - public PaymentSourceCreateUsingPermanentTokenBuilder networkTransactionId(String value) { - - formData.put("network_transaction_id", value); - - return this; - } - - public PaymentSourceCreateUsingPermanentTokenBuilder mandateId(String value) { - - formData.put("mandate_id", value); - - return this; - } - - public PaymentSourceCreateUsingPermanentTokenBuilder skipRetrieval(Boolean value) { - - formData.put("skip_retrieval", value); - - return this; - } - - public PaymentSourceCreateUsingPermanentTokenBuilder additionalInformation( - java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentSourceCreateUsingPermanentTokenBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PaymentSourceCreateUsingPermanentTokenBuilder billingAddress( - BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PaymentSourceCreateUsingPermanentTokenParams build() { - return new PaymentSourceCreateUsingPermanentTokenParams(this); - } - } - - public enum Type { - CARD("card"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - AMAZON_PAYMENTS("amazon_payments"), - - DIRECT_DEBIT("direct_debit"), - - GENERIC("generic"), - - ALIPAY("alipay"), - - UNIONPAY("unionpay"), - - APPLE_PAY("apple_pay"), - - WECHAT_PAY("wechat_pay"), - - IDEAL("ideal"), - - GOOGLE_PAY("google_pay"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GIROPAY("giropay"), - - DOTPAY("dotpay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - VENMO("venmo"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** 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 static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - public CardBuilder last4(String value) { - - formData.put("last4", value); - - return this; - } - - public CardBuilder iin(String value) { - - formData.put("iin", value); - - return this; - } - - public CardBuilder expiryMonth(Integer value) { - - formData.put("expiry_month", value); - - return this; - } - - public CardBuilder expiryYear(Integer value) { - - formData.put("expiry_year", value); - - return this; - } - - public CardBuilder brand(Brand value) { - - formData.put("brand", value); - - return this; - } - - public CardBuilder fundingType(FundingType value) { - - formData.put("funding_type", value); - - return this; - } - - public CardParams build() { - return new CardParams(this); - } - } - - public enum Brand { - VISA("visa"), - - MASTERCARD("mastercard"), - - AMERICAN_EXPRESS("american_express"), - - DISCOVER("discover"), - - JCB("jcb"), - - DINERS_CLUB("diners_club"), - - OTHER("other"), - - BANCONTACT("bancontact"), - - CMR_FALABELLA("cmr_falabella"), - - TARJETA_NARANJA("tarjeta_naranja"), - - NATIVA("nativa"), - - CENCOSUD("cencosud"), - - CABAL("cabal"), - - ARGENCARD("argencard"), - - ELO("elo"), - - HIPERCARD("hipercard"), - - CARNET("carnet"), - - RUPAY("rupay"), - - MAESTRO("maestro"), - - DANKORT("dankort"), - - CARTES_BANCAIRES("cartes_bancaires"), - - /** An enum member indicating that Brand was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Brand(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Brand fromString(String value) { - if (value == null) return _UNKNOWN; - for (Brand enumValue : Brand.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum FundingType { - CREDIT("credit"), - - DEBIT("debit"), - - PREPAID("prepaid"), - - NOT_KNOWN("not_known"), - - /** An enum member indicating that FundingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - FundingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static FundingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (FundingType enumValue : FundingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateUsingTempTokenParams.java b/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateUsingTempTokenParams.java deleted file mode 100644 index 081f88fe..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateUsingTempTokenParams.java +++ /dev/null @@ -1,169 +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.core.models.paymentSource.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; - -public final class PaymentSourceCreateUsingTempTokenParams { - - private final Map formData; - - private PaymentSourceCreateUsingTempTokenParams( - PaymentSourceCreateUsingTempTokenBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentSourceCreateUsingTempTokenParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentSourceCreateUsingTempTokenBuilder builder() { - return new PaymentSourceCreateUsingTempTokenBuilder(); - } - - public static final class PaymentSourceCreateUsingTempTokenBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentSourceCreateUsingTempTokenBuilder() {} - - public PaymentSourceCreateUsingTempTokenBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public PaymentSourceCreateUsingTempTokenBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentSourceCreateUsingTempTokenBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public PaymentSourceCreateUsingTempTokenBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public PaymentSourceCreateUsingTempTokenBuilder issuingCountry(String value) { - - formData.put("issuing_country", value); - - return this; - } - - public PaymentSourceCreateUsingTempTokenBuilder replacePrimaryPaymentSource(Boolean value) { - - formData.put("replace_primary_payment_source", value); - - return this; - } - - public PaymentSourceCreateUsingTempTokenBuilder additionalInformation( - java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentSourceCreateUsingTempTokenParams build() { - return new PaymentSourceCreateUsingTempTokenParams(this); - } - } - - public enum Type { - CARD("card"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - AMAZON_PAYMENTS("amazon_payments"), - - DIRECT_DEBIT("direct_debit"), - - GENERIC("generic"), - - ALIPAY("alipay"), - - UNIONPAY("unionpay"), - - APPLE_PAY("apple_pay"), - - WECHAT_PAY("wechat_pay"), - - IDEAL("ideal"), - - GOOGLE_PAY("google_pay"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GIROPAY("giropay"), - - DOTPAY("dotpay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - VENMO("venmo"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** 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/core/models/paymentSource/params/PaymentSourceCreateUsingTokenParams.java b/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateUsingTokenParams.java deleted file mode 100644 index 9662deb0..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateUsingTokenParams.java +++ /dev/null @@ -1,64 +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.core.models.paymentSource.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PaymentSourceCreateUsingTokenParams { - - private final Map formData; - - private PaymentSourceCreateUsingTokenParams(PaymentSourceCreateUsingTokenBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentSourceCreateUsingTokenParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentSourceCreateUsingTokenBuilder builder() { - return new PaymentSourceCreateUsingTokenBuilder(); - } - - public static final class PaymentSourceCreateUsingTokenBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentSourceCreateUsingTokenBuilder() {} - - public PaymentSourceCreateUsingTokenBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public PaymentSourceCreateUsingTokenBuilder replacePrimaryPaymentSource(Boolean value) { - - formData.put("replace_primary_payment_source", value); - - return this; - } - - public PaymentSourceCreateUsingTokenBuilder tokenId(String value) { - - formData.put("token_id", value); - - return this; - } - - public PaymentSourceCreateUsingTokenParams build() { - return new PaymentSourceCreateUsingTokenParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateVoucherPaymentSourceParams.java b/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateVoucherPaymentSourceParams.java deleted file mode 100644 index 745f5adc..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceCreateVoucherPaymentSourceParams.java +++ /dev/null @@ -1,148 +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.core.models.paymentSource.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; - -public final class PaymentSourceCreateVoucherPaymentSourceParams { - - private final Map formData; - - private PaymentSourceCreateVoucherPaymentSourceParams( - PaymentSourceCreateVoucherPaymentSourceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentSourceCreateVoucherPaymentSourceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentSourceCreateVoucherPaymentSourceBuilder builder() { - return new PaymentSourceCreateVoucherPaymentSourceBuilder(); - } - - public static final class PaymentSourceCreateVoucherPaymentSourceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentSourceCreateVoucherPaymentSourceBuilder() {} - - public PaymentSourceCreateVoucherPaymentSourceBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public PaymentSourceCreateVoucherPaymentSourceBuilder voucherPaymentSource( - VoucherPaymentSourceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "voucher_payment_source[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PaymentSourceCreateVoucherPaymentSourceParams build() { - return new PaymentSourceCreateVoucherPaymentSourceParams(this); - } - } - - public static final class VoucherPaymentSourceParams { - - private final Map formData; - - private VoucherPaymentSourceParams(VoucherPaymentSourceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for VoucherPaymentSourceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static VoucherPaymentSourceBuilder builder() { - return new VoucherPaymentSourceBuilder(); - } - - public static final class VoucherPaymentSourceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private VoucherPaymentSourceBuilder() {} - - public VoucherPaymentSourceBuilder voucherType(VoucherType value) { - - formData.put("voucher_type", value); - - return this; - } - - public VoucherPaymentSourceBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public VoucherPaymentSourceBuilder taxId(String value) { - - formData.put("tax_id", value); - - return this; - } - - public VoucherPaymentSourceBuilder billingAddress(java.util.Map value) { - - formData.put("billing_address", JsonUtil.toJson(value)); - - return this; - } - - public VoucherPaymentSourceParams build() { - return new VoucherPaymentSourceParams(this); - } - } - - public enum VoucherType { - BOLETO("boleto"), - - /** An enum member indicating that VoucherType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - VoucherType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static VoucherType fromString(String value) { - if (value == null) return _UNKNOWN; - for (VoucherType enumValue : VoucherType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceExportPaymentSourceParams.java b/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceExportPaymentSourceParams.java deleted file mode 100644 index 772162e4..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceExportPaymentSourceParams.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.core.models.paymentSource.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PaymentSourceExportPaymentSourceParams { - - private final Map formData; - - private PaymentSourceExportPaymentSourceParams(PaymentSourceExportPaymentSourceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentSourceExportPaymentSourceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentSourceExportPaymentSourceBuilder builder() { - return new PaymentSourceExportPaymentSourceBuilder(); - } - - public static final class PaymentSourceExportPaymentSourceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentSourceExportPaymentSourceBuilder() {} - - public PaymentSourceExportPaymentSourceBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentSourceExportPaymentSourceParams build() { - return new PaymentSourceExportPaymentSourceParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceSwitchGatewayAccountParams.java b/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceSwitchGatewayAccountParams.java deleted file mode 100644 index 6958e150..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceSwitchGatewayAccountParams.java +++ /dev/null @@ -1,51 +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.core.models.paymentSource.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PaymentSourceSwitchGatewayAccountParams { - - private final Map formData; - - private PaymentSourceSwitchGatewayAccountParams( - PaymentSourceSwitchGatewayAccountBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentSourceSwitchGatewayAccountParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentSourceSwitchGatewayAccountBuilder builder() { - return new PaymentSourceSwitchGatewayAccountBuilder(); - } - - public static final class PaymentSourceSwitchGatewayAccountBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentSourceSwitchGatewayAccountBuilder() {} - - public PaymentSourceSwitchGatewayAccountBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentSourceSwitchGatewayAccountParams build() { - return new PaymentSourceSwitchGatewayAccountParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceUpdateBankAccountParams.java b/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceUpdateBankAccountParams.java deleted file mode 100644 index d3a98d8f..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceUpdateBankAccountParams.java +++ /dev/null @@ -1,105 +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.core.models.paymentSource.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PaymentSourceUpdateBankAccountParams { - - private final Map formData; - - private PaymentSourceUpdateBankAccountParams(PaymentSourceUpdateBankAccountBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentSourceUpdateBankAccountParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentSourceUpdateBankAccountBuilder builder() { - return new PaymentSourceUpdateBankAccountBuilder(); - } - - public static final class PaymentSourceUpdateBankAccountBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentSourceUpdateBankAccountBuilder() {} - - public PaymentSourceUpdateBankAccountBuilder bankAccount(BankAccountParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "bank_account[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PaymentSourceUpdateBankAccountParams build() { - return new PaymentSourceUpdateBankAccountParams(this); - } - } - - public static final class BankAccountParams { - - private final Map formData; - - private BankAccountParams(BankAccountBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BankAccountParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BankAccountBuilder builder() { - return new BankAccountBuilder(); - } - - public static final class BankAccountBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BankAccountBuilder() {} - - public BankAccountBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BankAccountBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BankAccountBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BankAccountParams build() { - return new BankAccountParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceUpdateCardParams.java b/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceUpdateCardParams.java deleted file mode 100644 index 4f9e57f4..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceUpdateCardParams.java +++ /dev/null @@ -1,183 +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.core.models.paymentSource.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; - -public final class PaymentSourceUpdateCardParams { - - private final Map formData; - - private PaymentSourceUpdateCardParams(PaymentSourceUpdateCardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentSourceUpdateCardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentSourceUpdateCardBuilder builder() { - return new PaymentSourceUpdateCardBuilder(); - } - - public static final class PaymentSourceUpdateCardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentSourceUpdateCardBuilder() {} - - public PaymentSourceUpdateCardBuilder gatewayMetaData(java.util.Map value) { - - formData.put("gateway_meta_data", JsonUtil.toJson(value)); - - return this; - } - - public PaymentSourceUpdateCardBuilder referenceTransaction(String value) { - - formData.put("reference_transaction", value); - - return this; - } - - public PaymentSourceUpdateCardBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PaymentSourceUpdateCardParams build() { - return new PaymentSourceUpdateCardParams(this); - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - public CardBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CardBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CardBuilder expiryMonth(Integer value) { - - formData.put("expiry_month", value); - - return this; - } - - public CardBuilder expiryYear(Integer value) { - - formData.put("expiry_year", value); - - return this; - } - - public CardBuilder billingAddr1(String value) { - - formData.put("billing_addr1", value); - - return this; - } - - public CardBuilder billingAddr2(String value) { - - formData.put("billing_addr2", value); - - return this; - } - - public CardBuilder billingCity(String value) { - - formData.put("billing_city", value); - - return this; - } - - public CardBuilder billingZip(String value) { - - formData.put("billing_zip", value); - - return this; - } - - public CardBuilder billingStateCode(String value) { - - formData.put("billing_state_code", value); - - return this; - } - - public CardBuilder billingState(String value) { - - formData.put("billing_state", value); - - return this; - } - - public CardBuilder billingCountry(String value) { - - formData.put("billing_country", value); - - return this; - } - - public CardBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public CardParams build() { - return new CardParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceVerifyBankAccountParams.java b/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceVerifyBankAccountParams.java deleted file mode 100644 index cac92347..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceVerifyBankAccountParams.java +++ /dev/null @@ -1,57 +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.core.models.paymentSource.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PaymentSourceVerifyBankAccountParams { - - private final Map formData; - - private PaymentSourceVerifyBankAccountParams(PaymentSourceVerifyBankAccountBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentSourceVerifyBankAccountParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentSourceVerifyBankAccountBuilder builder() { - return new PaymentSourceVerifyBankAccountBuilder(); - } - - public static final class PaymentSourceVerifyBankAccountBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentSourceVerifyBankAccountBuilder() {} - - public PaymentSourceVerifyBankAccountBuilder amount1(Long value) { - - formData.put("amount1", value); - - return this; - } - - public PaymentSourceVerifyBankAccountBuilder amount2(Long value) { - - formData.put("amount2", value); - - return this; - } - - public PaymentSourceVerifyBankAccountParams build() { - return new PaymentSourceVerifyBankAccountParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentVoucher/params/PaymentVoucherCreateParams.java b/src/main/java/com/chargebee/v4/core/models/paymentVoucher/params/PaymentVoucherCreateParams.java deleted file mode 100644 index e8415f33..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentVoucher/params/PaymentVoucherCreateParams.java +++ /dev/null @@ -1,185 +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.core.models.paymentVoucher.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class PaymentVoucherCreateParams { - - private final Map formData; - - private PaymentVoucherCreateParams(PaymentVoucherCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentVoucherCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentVoucherCreateBuilder builder() { - return new PaymentVoucherCreateBuilder(); - } - - public static final class PaymentVoucherCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentVoucherCreateBuilder() {} - - public PaymentVoucherCreateBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public PaymentVoucherCreateBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public PaymentVoucherCreateBuilder voucherPaymentSource(VoucherPaymentSourceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "voucher_payment_source[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PaymentVoucherCreateBuilder invoiceAllocations(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - InvoiceAllocationsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "invoice_allocations[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PaymentVoucherCreateParams build() { - return new PaymentVoucherCreateParams(this); - } - } - - public static final class VoucherPaymentSourceParams { - - private final Map formData; - - private VoucherPaymentSourceParams(VoucherPaymentSourceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for VoucherPaymentSourceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static VoucherPaymentSourceBuilder builder() { - return new VoucherPaymentSourceBuilder(); - } - - public static final class VoucherPaymentSourceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private VoucherPaymentSourceBuilder() {} - - public VoucherPaymentSourceBuilder voucherType(VoucherType value) { - - formData.put("voucher_type", value); - - return this; - } - - public VoucherPaymentSourceParams build() { - return new VoucherPaymentSourceParams(this); - } - } - - public enum VoucherType { - BOLETO("boleto"), - - /** An enum member indicating that VoucherType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - VoucherType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static VoucherType fromString(String value) { - if (value == null) return _UNKNOWN; - for (VoucherType enumValue : VoucherType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class InvoiceAllocationsParams { - - private final Map formData; - - private InvoiceAllocationsParams(InvoiceAllocationsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceAllocationsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceAllocationsBuilder builder() { - return new InvoiceAllocationsBuilder(); - } - - public static final class InvoiceAllocationsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceAllocationsBuilder() {} - - public InvoiceAllocationsBuilder invoiceId(String value) { - - formData.put("invoice_id", value); - - return this; - } - - public InvoiceAllocationsParams build() { - return new InvoiceAllocationsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentVoucher/params/PaymentVoucherPaymentVouchersForCustomerParams.java b/src/main/java/com/chargebee/v4/core/models/paymentVoucher/params/PaymentVoucherPaymentVouchersForCustomerParams.java deleted file mode 100644 index d71fcb80..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentVoucher/params/PaymentVoucherPaymentVouchersForCustomerParams.java +++ /dev/null @@ -1,263 +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.core.models.paymentVoucher.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PaymentVoucherPaymentVouchersForCustomerParams { - - private final Map queryParams; - - private PaymentVoucherPaymentVouchersForCustomerParams( - PaymentVoucherPaymentVouchersForCustomerBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public PaymentVoucherPaymentVouchersForCustomerBuilder toBuilder() { - PaymentVoucherPaymentVouchersForCustomerBuilder builder = - new PaymentVoucherPaymentVouchersForCustomerBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for PaymentVoucherPaymentVouchersForCustomerParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentVoucherPaymentVouchersForCustomerBuilder builder() { - return new PaymentVoucherPaymentVouchersForCustomerBuilder(); - } - - public static final class PaymentVoucherPaymentVouchersForCustomerBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private PaymentVoucherPaymentVouchersForCustomerBuilder() {} - - public PaymentVoucherPaymentVouchersForCustomerBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public PaymentVoucherPaymentVouchersForCustomerBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public StatusFilter status() { - return new StatusFilter("status", this); - } - - public SortBySortBuilder sortBy() { - return new SortBySortBuilder("sort_by", this); - } - - public PaymentVoucherPaymentVouchersForCustomerParams build() { - return new PaymentVoucherPaymentVouchersForCustomerParams(this); - } - - public static final class StatusFilter { - private final String fieldName; - private final PaymentVoucherPaymentVouchersForCustomerBuilder builder; - - StatusFilter(String fieldName, PaymentVoucherPaymentVouchersForCustomerBuilder builder) { - this.fieldName = fieldName; - this.builder = builder; - } - - public PaymentVoucherPaymentVouchersForCustomerBuilder is(String value) { - builder.queryParams.put(fieldName + "[is]", value); - return builder; - } - - public PaymentVoucherPaymentVouchersForCustomerBuilder isNot(String value) { - builder.queryParams.put(fieldName + "[is_not]", value); - return builder; - } - - public PaymentVoucherPaymentVouchersForCustomerBuilder in(String... values) { - builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); - return builder; - } - - public PaymentVoucherPaymentVouchersForCustomerBuilder notIn(String... values) { - builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); - return builder; - } - } - - public static final class SortBySortBuilder { - private final String fieldName; - private final PaymentVoucherPaymentVouchersForCustomerBuilder builder; - - SortBySortBuilder(String fieldName, PaymentVoucherPaymentVouchersForCustomerBuilder builder) { - this.fieldName = fieldName; - this.builder = builder; - } - - public SortDirection date() { - return new SortDirection(fieldName, "date", builder); - } - - public SortDirection updated_at() { - return new SortDirection(fieldName, "updated_at", builder); - } - } - - public static final class SortDirection { - private final String fieldName; - private final String selectedField; - private final PaymentVoucherPaymentVouchersForCustomerBuilder builder; - - SortDirection( - String fieldName, - String selectedField, - PaymentVoucherPaymentVouchersForCustomerBuilder builder) { - this.fieldName = fieldName; - this.selectedField = selectedField; - this.builder = builder; - } - - public PaymentVoucherPaymentVouchersForCustomerBuilder asc() { - builder.queryParams.put(fieldName + "[asc]", selectedField); - return builder; - } - - public PaymentVoucherPaymentVouchersForCustomerBuilder desc() { - builder.queryParams.put(fieldName + "[desc]", selectedField); - return builder; - } - } - } - - public enum StatusIs { - ACTIVE("active"), - - CONSUMED("consumed"), - - EXPIRED("expired"), - - FAILURE("failure"), - - /** An enum member indicating that StatusIs was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - StatusIs(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static StatusIs fromString(String value) { - if (value == null) return _UNKNOWN; - for (StatusIs enumValue : StatusIs.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum StatusIsNot { - ACTIVE("active"), - - CONSUMED("consumed"), - - EXPIRED("expired"), - - FAILURE("failure"), - - /** An enum member indicating that StatusIsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - StatusIsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static StatusIsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (StatusIsNot enumValue : StatusIsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum SortByAsc { - DATE("date"), - - UPDATED_AT("updated_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 { - DATE("date"), - - UPDATED_AT("updated_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/core/models/paymentVoucher/params/PaymentVoucherPaymentVouchersForInvoiceParams.java b/src/main/java/com/chargebee/v4/core/models/paymentVoucher/params/PaymentVoucherPaymentVouchersForInvoiceParams.java deleted file mode 100644 index 4dd82304..00000000 --- a/src/main/java/com/chargebee/v4/core/models/paymentVoucher/params/PaymentVoucherPaymentVouchersForInvoiceParams.java +++ /dev/null @@ -1,263 +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.core.models.paymentVoucher.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PaymentVoucherPaymentVouchersForInvoiceParams { - - private final Map queryParams; - - private PaymentVoucherPaymentVouchersForInvoiceParams( - PaymentVoucherPaymentVouchersForInvoiceBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public PaymentVoucherPaymentVouchersForInvoiceBuilder toBuilder() { - PaymentVoucherPaymentVouchersForInvoiceBuilder builder = - new PaymentVoucherPaymentVouchersForInvoiceBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for PaymentVoucherPaymentVouchersForInvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentVoucherPaymentVouchersForInvoiceBuilder builder() { - return new PaymentVoucherPaymentVouchersForInvoiceBuilder(); - } - - public static final class PaymentVoucherPaymentVouchersForInvoiceBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private PaymentVoucherPaymentVouchersForInvoiceBuilder() {} - - public PaymentVoucherPaymentVouchersForInvoiceBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public PaymentVoucherPaymentVouchersForInvoiceBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public StatusFilter status() { - return new StatusFilter("status", this); - } - - public SortBySortBuilder sortBy() { - return new SortBySortBuilder("sort_by", this); - } - - public PaymentVoucherPaymentVouchersForInvoiceParams build() { - return new PaymentVoucherPaymentVouchersForInvoiceParams(this); - } - - public static final class StatusFilter { - private final String fieldName; - private final PaymentVoucherPaymentVouchersForInvoiceBuilder builder; - - StatusFilter(String fieldName, PaymentVoucherPaymentVouchersForInvoiceBuilder builder) { - this.fieldName = fieldName; - this.builder = builder; - } - - public PaymentVoucherPaymentVouchersForInvoiceBuilder is(String value) { - builder.queryParams.put(fieldName + "[is]", value); - return builder; - } - - public PaymentVoucherPaymentVouchersForInvoiceBuilder isNot(String value) { - builder.queryParams.put(fieldName + "[is_not]", value); - return builder; - } - - public PaymentVoucherPaymentVouchersForInvoiceBuilder in(String... values) { - builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); - return builder; - } - - public PaymentVoucherPaymentVouchersForInvoiceBuilder notIn(String... values) { - builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); - return builder; - } - } - - public static final class SortBySortBuilder { - private final String fieldName; - private final PaymentVoucherPaymentVouchersForInvoiceBuilder builder; - - SortBySortBuilder(String fieldName, PaymentVoucherPaymentVouchersForInvoiceBuilder builder) { - this.fieldName = fieldName; - this.builder = builder; - } - - public SortDirection date() { - return new SortDirection(fieldName, "date", builder); - } - - public SortDirection updated_at() { - return new SortDirection(fieldName, "updated_at", builder); - } - } - - public static final class SortDirection { - private final String fieldName; - private final String selectedField; - private final PaymentVoucherPaymentVouchersForInvoiceBuilder builder; - - SortDirection( - String fieldName, - String selectedField, - PaymentVoucherPaymentVouchersForInvoiceBuilder builder) { - this.fieldName = fieldName; - this.selectedField = selectedField; - this.builder = builder; - } - - public PaymentVoucherPaymentVouchersForInvoiceBuilder asc() { - builder.queryParams.put(fieldName + "[asc]", selectedField); - return builder; - } - - public PaymentVoucherPaymentVouchersForInvoiceBuilder desc() { - builder.queryParams.put(fieldName + "[desc]", selectedField); - return builder; - } - } - } - - public enum StatusIs { - ACTIVE("active"), - - CONSUMED("consumed"), - - EXPIRED("expired"), - - FAILURE("failure"), - - /** An enum member indicating that StatusIs was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - StatusIs(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static StatusIs fromString(String value) { - if (value == null) return _UNKNOWN; - for (StatusIs enumValue : StatusIs.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum StatusIsNot { - ACTIVE("active"), - - CONSUMED("consumed"), - - EXPIRED("expired"), - - FAILURE("failure"), - - /** An enum member indicating that StatusIsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - StatusIsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static StatusIsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (StatusIsNot enumValue : StatusIsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum SortByAsc { - DATE("date"), - - UPDATED_AT("updated_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 { - DATE("date"), - - UPDATED_AT("updated_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/core/models/pc2MigrationItem/params/Pc2MigrationItemCreateParams.java b/src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemCreateParams.java deleted file mode 100644 index 5e857569..00000000 --- a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemCreateParams.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.core.models.pc2MigrationItem.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class Pc2MigrationItemCreateParams { - - private final Map formData; - - private Pc2MigrationItemCreateParams(Pc2MigrationItemCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for Pc2MigrationItemCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static Pc2MigrationItemCreateBuilder builder() { - return new Pc2MigrationItemCreateBuilder(); - } - - public static final class Pc2MigrationItemCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private Pc2MigrationItemCreateBuilder() {} - - public Pc2MigrationItemCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder pc1Type(Pc1Type value) { - - formData.put("pc1_type", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder pc2MigrationItemFamilyId(String value) { - - formData.put("pc2_migration_item_family_id", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder pc2MigrationId(String value) { - - formData.put("pc2_migration_id", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder metadata(String value) { - - formData.put("metadata", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder isGiftable(Boolean value) { - - formData.put("is_giftable", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder isShippable(Boolean value) { - - formData.put("is_shippable", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder enabledForCheckout(Boolean value) { - - formData.put("enabled_for_checkout", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder enabledInPortal(Boolean value) { - - formData.put("enabled_in_portal", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder isRecurring(Boolean value) { - - formData.put("is_recurring", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder giftClaimRedirectUrl(String value) { - - formData.put("gift_claim_redirect_url", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder unit(String value) { - - formData.put("unit", value); - - return this; - } - - public Pc2MigrationItemCreateBuilder pc2MigrationItemPrices( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - Pc2MigrationItemPricesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "pc2_migration_item_prices[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public Pc2MigrationItemCreateParams build() { - return new Pc2MigrationItemCreateParams(this); - } - } - - public enum Pc1Type { - PLAN("plan"), - - ADDON("addon"), - - /** An enum member indicating that Pc1Type was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Pc1Type(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Pc1Type fromString(String value) { - if (value == null) return _UNKNOWN; - for (Pc1Type enumValue : Pc1Type.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class Pc2MigrationItemPricesParams { - - private final Map formData; - - private Pc2MigrationItemPricesParams(Pc2MigrationItemPricesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for Pc2MigrationItemPricesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static Pc2MigrationItemPricesBuilder builder() { - return new Pc2MigrationItemPricesBuilder(); - } - - public static final class Pc2MigrationItemPricesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private Pc2MigrationItemPricesBuilder() {} - - public Pc2MigrationItemPricesBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public Pc2MigrationItemPricesBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public Pc2MigrationItemPricesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public Pc2MigrationItemPricesBuilder metadata(String value) { - - formData.put("metadata", value); - - return this; - } - - public Pc2MigrationItemPricesBuilder refEntityId(String value) { - - formData.put("ref_entity_id", value); - - return this; - } - - public Pc2MigrationItemPricesParams build() { - return new Pc2MigrationItemPricesParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemUpdateParams.java deleted file mode 100644 index 5910e2bf..00000000 --- a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemUpdateParams.java +++ /dev/null @@ -1,224 +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.core.models.pc2MigrationItem.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class Pc2MigrationItemUpdateParams { - - private final Map formData; - - private Pc2MigrationItemUpdateParams(Pc2MigrationItemUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for Pc2MigrationItemUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static Pc2MigrationItemUpdateBuilder builder() { - return new Pc2MigrationItemUpdateBuilder(); - } - - public static final class Pc2MigrationItemUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private Pc2MigrationItemUpdateBuilder() {} - - public Pc2MigrationItemUpdateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public Pc2MigrationItemUpdateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public Pc2MigrationItemUpdateBuilder pc2MigrationItemFamilyId(String value) { - - formData.put("pc2_migration_item_family_id", value); - - return this; - } - - public Pc2MigrationItemUpdateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public Pc2MigrationItemUpdateBuilder metadata(String value) { - - formData.put("metadata", value); - - return this; - } - - public Pc2MigrationItemUpdateBuilder isGiftable(Boolean value) { - - formData.put("is_giftable", value); - - return this; - } - - public Pc2MigrationItemUpdateBuilder isShippable(Boolean value) { - - formData.put("is_shippable", value); - - return this; - } - - public Pc2MigrationItemUpdateBuilder enabledForCheckout(Boolean value) { - - formData.put("enabled_for_checkout", value); - - return this; - } - - public Pc2MigrationItemUpdateBuilder enabledInPortal(Boolean value) { - - formData.put("enabled_in_portal", value); - - return this; - } - - public Pc2MigrationItemUpdateBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public Pc2MigrationItemUpdateBuilder isRecurring(Boolean value) { - - formData.put("is_recurring", value); - - return this; - } - - public Pc2MigrationItemUpdateBuilder giftClaimRedirectUrl(String value) { - - formData.put("gift_claim_redirect_url", value); - - return this; - } - - public Pc2MigrationItemUpdateBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public Pc2MigrationItemUpdateBuilder unit(String value) { - - formData.put("unit", value); - - return this; - } - - public Pc2MigrationItemUpdateBuilder pc2MigrationItemPrices( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - Pc2MigrationItemPricesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "pc2_migration_item_prices[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public Pc2MigrationItemUpdateParams build() { - return new Pc2MigrationItemUpdateParams(this); - } - } - - public static final class Pc2MigrationItemPricesParams { - - private final Map formData; - - private Pc2MigrationItemPricesParams(Pc2MigrationItemPricesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for Pc2MigrationItemPricesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static Pc2MigrationItemPricesBuilder builder() { - return new Pc2MigrationItemPricesBuilder(); - } - - public static final class Pc2MigrationItemPricesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private Pc2MigrationItemPricesBuilder() {} - - public Pc2MigrationItemPricesBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public Pc2MigrationItemPricesBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public Pc2MigrationItemPricesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public Pc2MigrationItemPricesBuilder metadata(String value) { - - formData.put("metadata", value); - - return this; - } - - public Pc2MigrationItemPricesBuilder refEntityId(String value) { - - formData.put("ref_entity_id", value); - - return this; - } - - public Pc2MigrationItemPricesParams build() { - return new Pc2MigrationItemPricesParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyCreateParams.java b/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyCreateParams.java deleted file mode 100644 index 97f46e8a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyCreateParams.java +++ /dev/null @@ -1,78 +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.core.models.pc2MigrationItemFamily.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class Pc2MigrationItemFamilyCreateParams { - - private final Map formData; - - private Pc2MigrationItemFamilyCreateParams(Pc2MigrationItemFamilyCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for Pc2MigrationItemFamilyCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static Pc2MigrationItemFamilyCreateBuilder builder() { - return new Pc2MigrationItemFamilyCreateBuilder(); - } - - public static final class Pc2MigrationItemFamilyCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private Pc2MigrationItemFamilyCreateBuilder() {} - - public Pc2MigrationItemFamilyCreateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public Pc2MigrationItemFamilyCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public Pc2MigrationItemFamilyCreateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public Pc2MigrationItemFamilyCreateBuilder isDefault(Boolean value) { - - formData.put("is_default", value); - - return this; - } - - public Pc2MigrationItemFamilyCreateBuilder pc2MigrationId(String value) { - - formData.put("pc2_migration_id", value); - - return this; - } - - public Pc2MigrationItemFamilyCreateParams build() { - return new Pc2MigrationItemFamilyCreateParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyUpdateParams.java deleted file mode 100644 index 434c0853..00000000 --- a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyUpdateParams.java +++ /dev/null @@ -1,71 +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.core.models.pc2MigrationItemFamily.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class Pc2MigrationItemFamilyUpdateParams { - - private final Map formData; - - private Pc2MigrationItemFamilyUpdateParams(Pc2MigrationItemFamilyUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for Pc2MigrationItemFamilyUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static Pc2MigrationItemFamilyUpdateBuilder builder() { - return new Pc2MigrationItemFamilyUpdateBuilder(); - } - - public static final class Pc2MigrationItemFamilyUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private Pc2MigrationItemFamilyUpdateBuilder() {} - - public Pc2MigrationItemFamilyUpdateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public Pc2MigrationItemFamilyUpdateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public Pc2MigrationItemFamilyUpdateBuilder isDefault(Boolean value) { - - formData.put("is_default", value); - - return this; - } - - public Pc2MigrationItemFamilyUpdateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public Pc2MigrationItemFamilyUpdateParams build() { - return new Pc2MigrationItemFamilyUpdateParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceUpdateParams.java deleted file mode 100644 index 567bc79d..00000000 --- a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceUpdateParams.java +++ /dev/null @@ -1,85 +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.core.models.pc2MigrationItemPrice.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class Pc2MigrationItemPriceUpdateParams { - - private final Map formData; - - private Pc2MigrationItemPriceUpdateParams(Pc2MigrationItemPriceUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for Pc2MigrationItemPriceUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static Pc2MigrationItemPriceUpdateBuilder builder() { - return new Pc2MigrationItemPriceUpdateBuilder(); - } - - public static final class Pc2MigrationItemPriceUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private Pc2MigrationItemPriceUpdateBuilder() {} - - public Pc2MigrationItemPriceUpdateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public Pc2MigrationItemPriceUpdateBuilder pc2MigrationItemId(String value) { - - formData.put("pc2_migration_item_id", value); - - return this; - } - - public Pc2MigrationItemPriceUpdateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public Pc2MigrationItemPriceUpdateBuilder metadata(String value) { - - formData.put("metadata", value); - - return this; - } - - public Pc2MigrationItemPriceUpdateBuilder sanitizedPc1Id(String value) { - - formData.put("sanitized_pc1_id", value); - - return this; - } - - public Pc2MigrationItemPriceUpdateBuilder isPrimaryAttachedItem(Boolean value) { - - formData.put("is_primary_attached_item", value); - - return this; - } - - public Pc2MigrationItemPriceUpdateParams build() { - return new Pc2MigrationItemPriceUpdateParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/personalizedOffer/params/PersonalizedOfferPersonalizedOffersParams.java b/src/main/java/com/chargebee/v4/core/models/personalizedOffer/params/PersonalizedOfferPersonalizedOffersParams.java deleted file mode 100644 index fc142325..00000000 --- a/src/main/java/com/chargebee/v4/core/models/personalizedOffer/params/PersonalizedOfferPersonalizedOffersParams.java +++ /dev/null @@ -1,178 +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.core.models.personalizedOffer.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; - -public final class PersonalizedOfferPersonalizedOffersParams { - - private final Map formData; - - private PersonalizedOfferPersonalizedOffersParams( - PersonalizedOfferPersonalizedOffersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PersonalizedOfferPersonalizedOffersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PersonalizedOfferPersonalizedOffersBuilder builder() { - return new PersonalizedOfferPersonalizedOffersBuilder(); - } - - public static final class PersonalizedOfferPersonalizedOffersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PersonalizedOfferPersonalizedOffersBuilder() {} - - public PersonalizedOfferPersonalizedOffersBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public PersonalizedOfferPersonalizedOffersBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public PersonalizedOfferPersonalizedOffersBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public PersonalizedOfferPersonalizedOffersBuilder roles(List value) { - - formData.put("roles", value); - - return this; - } - - public PersonalizedOfferPersonalizedOffersBuilder externalUserId(String value) { - - formData.put("external_user_id", value); - - return this; - } - - public PersonalizedOfferPersonalizedOffersBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public PersonalizedOfferPersonalizedOffersBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public PersonalizedOfferPersonalizedOffersBuilder custom(java.util.Map value) { - - formData.put("custom", JsonUtil.toJson(value)); - - return this; - } - - public PersonalizedOfferPersonalizedOffersBuilder requestContext(RequestContextParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "request_context[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PersonalizedOfferPersonalizedOffersParams build() { - return new PersonalizedOfferPersonalizedOffersParams(this); - } - } - - public static final class RequestContextParams { - - private final Map formData; - - private RequestContextParams(RequestContextBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RequestContextParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RequestContextBuilder builder() { - return new RequestContextBuilder(); - } - - public static final class RequestContextBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RequestContextBuilder() {} - - public RequestContextBuilder userAgent(String value) { - - formData.put("user_agent", value); - - return this; - } - - public RequestContextBuilder locale(String value) { - - formData.put("locale", value); - - return this; - } - - public RequestContextBuilder timezone(String value) { - - formData.put("timezone", value); - - return this; - } - - public RequestContextBuilder url(String value) { - - formData.put("url", value); - - return this; - } - - public RequestContextBuilder referrerUrl(String value) { - - formData.put("referrer_url", value); - - return this; - } - - public RequestContextParams build() { - return new RequestContextParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/plan/params/PlanCopyParams.java b/src/main/java/com/chargebee/v4/core/models/plan/params/PlanCopyParams.java deleted file mode 100644 index d229e3f6..00000000 --- a/src/main/java/com/chargebee/v4/core/models/plan/params/PlanCopyParams.java +++ /dev/null @@ -1,71 +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.core.models.plan.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PlanCopyParams { - - private final Map formData; - - private PlanCopyParams(PlanCopyBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PlanCopyParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PlanCopyBuilder builder() { - return new PlanCopyBuilder(); - } - - public static final class PlanCopyBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PlanCopyBuilder() {} - - public PlanCopyBuilder fromSite(String value) { - - formData.put("from_site", value); - - return this; - } - - public PlanCopyBuilder idAtFromSite(String value) { - - formData.put("id_at_from_site", value); - - return this; - } - - public PlanCopyBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PlanCopyBuilder forSiteMerging(Boolean value) { - - formData.put("for_site_merging", value); - - return this; - } - - public PlanCopyParams build() { - return new PlanCopyParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/plan/params/PlanCreateParams.java b/src/main/java/com/chargebee/v4/core/models/plan/params/PlanCreateParams.java deleted file mode 100644 index a987dfac..00000000 --- a/src/main/java/com/chargebee/v4/core/models/plan/params/PlanCreateParams.java +++ /dev/null @@ -1,1125 +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.core.models.plan.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; - -public final class PlanCreateParams { - - private final Map formData; - - private PlanCreateParams(PlanCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PlanCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PlanCreateBuilder builder() { - return new PlanCreateBuilder(); - } - - public static final class PlanCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PlanCreateBuilder() {} - - public PlanCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PlanCreateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public PlanCreateBuilder invoiceName(String value) { - - formData.put("invoice_name", value); - - return this; - } - - public PlanCreateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public PlanCreateBuilder trialPeriod(Integer value) { - - formData.put("trial_period", value); - - return this; - } - - public PlanCreateBuilder trialPeriodUnit(TrialPeriodUnit value) { - - formData.put("trial_period_unit", value); - - return this; - } - - public PlanCreateBuilder trialEndAction(TrialEndAction value) { - - formData.put("trial_end_action", value); - - return this; - } - - public PlanCreateBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public PlanCreateBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public PlanCreateBuilder setupCost(Long value) { - - formData.put("setup_cost", value); - - return this; - } - - public PlanCreateBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public PlanCreateBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public PlanCreateBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public PlanCreateBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public PlanCreateBuilder pricingModel(PricingModel value) { - - formData.put("pricing_model", value); - - return this; - } - - @Deprecated - public PlanCreateBuilder chargeModel(ChargeModel value) { - - formData.put("charge_model", value); - - return this; - } - - public PlanCreateBuilder freeQuantity(Integer value) { - - formData.put("free_quantity", value); - - return this; - } - - public PlanCreateBuilder freeQuantityInDecimal(String value) { - - formData.put("free_quantity_in_decimal", value); - - return this; - } - - public PlanCreateBuilder addonApplicability(AddonApplicability value) { - - formData.put("addon_applicability", value); - - return this; - } - - @Deprecated - public PlanCreateBuilder downgradePenalty(Number value) { - - formData.put("downgrade_penalty", value); - - return this; - } - - public PlanCreateBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public PlanCreateBuilder enabledInHostedPages(Boolean value) { - - formData.put("enabled_in_hosted_pages", value); - - return this; - } - - public PlanCreateBuilder enabledInPortal(Boolean value) { - - formData.put("enabled_in_portal", value); - - return this; - } - - public PlanCreateBuilder taxable(Boolean value) { - - formData.put("taxable", value); - - return this; - } - - public PlanCreateBuilder taxProfileId(String value) { - - formData.put("tax_profile_id", value); - - return this; - } - - public PlanCreateBuilder taxCode(String value) { - - formData.put("tax_code", value); - - return this; - } - - public PlanCreateBuilder hsnCode(String value) { - - formData.put("hsn_code", value); - - return this; - } - - public PlanCreateBuilder taxjarProductCode(String value) { - - formData.put("taxjar_product_code", value); - - return this; - } - - public PlanCreateBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public PlanCreateBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public PlanCreateBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public PlanCreateBuilder sku(String value) { - - formData.put("sku", value); - - return this; - } - - public PlanCreateBuilder accountingCode(String value) { - - formData.put("accounting_code", value); - - return this; - } - - public PlanCreateBuilder accountingCategory1(String value) { - - formData.put("accounting_category1", value); - - return this; - } - - public PlanCreateBuilder accountingCategory2(String value) { - - formData.put("accounting_category2", value); - - return this; - } - - public PlanCreateBuilder accountingCategory3(String value) { - - formData.put("accounting_category3", value); - - return this; - } - - public PlanCreateBuilder accountingCategory4(String value) { - - formData.put("accounting_category4", value); - - return this; - } - - public PlanCreateBuilder isShippable(Boolean value) { - - formData.put("is_shippable", value); - - return this; - } - - public PlanCreateBuilder shippingFrequencyPeriod(Integer value) { - - formData.put("shipping_frequency_period", value); - - return this; - } - - public PlanCreateBuilder shippingFrequencyPeriodUnit(ShippingFrequencyPeriodUnit value) { - - formData.put("shipping_frequency_period_unit", value); - - return this; - } - - public PlanCreateBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public PlanCreateBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public PlanCreateBuilder showDescriptionInInvoices(Boolean value) { - - formData.put("show_description_in_invoices", value); - - return this; - } - - public PlanCreateBuilder showDescriptionInQuotes(Boolean value) { - - formData.put("show_description_in_quotes", value); - - return this; - } - - public PlanCreateBuilder giftable(Boolean value) { - - formData.put("giftable", value); - - return this; - } - - public PlanCreateBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public PlanCreateBuilder claimUrl(String value) { - - formData.put("claim_url", value); - - return this; - } - - public PlanCreateBuilder tiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PlanCreateBuilder taxProvidersFields(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PlanCreateBuilder applicableAddons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ApplicableAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "applicable_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PlanCreateBuilder eventBasedAddons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PlanCreateBuilder attachedAddons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AttachedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "attached_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 PlanCreateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 PlanCreateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public PlanCreateParams build() { - return new PlanCreateParams(this); - } - } - - public enum TrialPeriodUnit { - DAY("day"), - - MONTH("month"), - - /** An enum member indicating that TrialPeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialPeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialPeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialPeriodUnit enumValue : TrialPeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TrialEndAction { - SITE_DEFAULT("site_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialEndAction enumValue : TrialEndAction.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 enum PricingModel { - FLAT_FEE("flat_fee"), - - PER_UNIT("per_unit"), - - TIERED("tiered"), - - VOLUME("volume"), - - STAIRSTEP("stairstep"), - - /** An enum member indicating that PricingModel was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingModel(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingModel fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingModel enumValue : PricingModel.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChargeModel { - FLAT_FEE("flat_fee"), - - PER_UNIT("per_unit"), - - TIERED("tiered"), - - VOLUME("volume"), - - STAIRSTEP("stairstep"), - - /** An enum member indicating that ChargeModel was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeModel(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeModel fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeModel enumValue : ChargeModel.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AddonApplicability { - ALL("all"), - - RESTRICTED("restricted"), - - /** An enum member indicating that AddonApplicability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AddonApplicability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AddonApplicability fromString(String value) { - if (value == null) return _UNKNOWN; - for (AddonApplicability enumValue : AddonApplicability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ShippingFrequencyPeriodUnit { - YEAR("year"), - - MONTH("month"), - - WEEK("week"), - - DAY("day"), - - /** - * An enum member indicating that ShippingFrequencyPeriodUnit was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - ShippingFrequencyPeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ShippingFrequencyPeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (ShippingFrequencyPeriodUnit enumValue : ShippingFrequencyPeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Status { - ACTIVE("active"), - - ARCHIVED("archived"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class TiersParams { - - private final Map formData; - - private TiersParams(TiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TiersBuilder builder() { - return new TiersBuilder(); - } - - public static final class TiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TiersBuilder() {} - - public TiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public TiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public TiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public TiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public TiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public TiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public TiersParams build() { - return new TiersParams(this); - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } - - public static final class ApplicableAddonsParams { - - private final Map formData; - - private ApplicableAddonsParams(ApplicableAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ApplicableAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ApplicableAddonsBuilder builder() { - return new ApplicableAddonsBuilder(); - } - - public static final class ApplicableAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ApplicableAddonsBuilder() {} - - public ApplicableAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ApplicableAddonsParams build() { - return new ApplicableAddonsParams(this); - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder onEvent(OnEvent value) { - - formData.put("on_event", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - - public enum OnEvent { - SUBSCRIPTION_CREATION("subscription_creation"), - - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** An enum member indicating that OnEvent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OnEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OnEvent fromString(String value) { - if (value == null) return _UNKNOWN; - for (OnEvent enumValue : OnEvent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AttachedAddonsParams { - - private final Map formData; - - private AttachedAddonsParams(AttachedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AttachedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AttachedAddonsBuilder builder() { - return new AttachedAddonsBuilder(); - } - - public static final class AttachedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AttachedAddonsBuilder() {} - - public AttachedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AttachedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AttachedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AttachedAddonsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AttachedAddonsBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public AttachedAddonsParams build() { - return new AttachedAddonsParams(this); - } - } - - public enum Type { - RECOMMENDED("recommended"), - - MANDATORY("mandatory"), - - /** 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/core/models/plan/params/PlanDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/plan/params/PlanDeleteParams.java deleted file mode 100644 index 18da32bf..00000000 --- a/src/main/java/com/chargebee/v4/core/models/plan/params/PlanDeleteParams.java +++ /dev/null @@ -1,43 +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.core.models.plan.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PlanDeleteParams { - - private final Map formData; - - private PlanDeleteParams(PlanDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PlanDeleteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PlanDeleteBuilder builder() { - return new PlanDeleteBuilder(); - } - - public static final class PlanDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PlanDeleteBuilder() {} - - public PlanDeleteParams build() { - return new PlanDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/plan/params/PlanUnarchiveParams.java b/src/main/java/com/chargebee/v4/core/models/plan/params/PlanUnarchiveParams.java deleted file mode 100644 index f24e2643..00000000 --- a/src/main/java/com/chargebee/v4/core/models/plan/params/PlanUnarchiveParams.java +++ /dev/null @@ -1,43 +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.core.models.plan.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PlanUnarchiveParams { - - private final Map formData; - - private PlanUnarchiveParams(PlanUnarchiveBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PlanUnarchiveParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PlanUnarchiveBuilder builder() { - return new PlanUnarchiveBuilder(); - } - - public static final class PlanUnarchiveBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PlanUnarchiveBuilder() {} - - public PlanUnarchiveParams build() { - return new PlanUnarchiveParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/plan/params/PlanUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/plan/params/PlanUpdateParams.java deleted file mode 100644 index f363fcb2..00000000 --- a/src/main/java/com/chargebee/v4/core/models/plan/params/PlanUpdateParams.java +++ /dev/null @@ -1,1069 +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.core.models.plan.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; - -public final class PlanUpdateParams { - - private final Map formData; - - private PlanUpdateParams(PlanUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PlanUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PlanUpdateBuilder builder() { - return new PlanUpdateBuilder(); - } - - public static final class PlanUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PlanUpdateBuilder() {} - - public PlanUpdateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public PlanUpdateBuilder invoiceName(String value) { - - formData.put("invoice_name", value); - - return this; - } - - public PlanUpdateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public PlanUpdateBuilder trialPeriod(Integer value) { - - formData.put("trial_period", value); - - return this; - } - - public PlanUpdateBuilder trialPeriodUnit(TrialPeriodUnit value) { - - formData.put("trial_period_unit", value); - - return this; - } - - public PlanUpdateBuilder trialEndAction(TrialEndAction value) { - - formData.put("trial_end_action", value); - - return this; - } - - public PlanUpdateBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public PlanUpdateBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public PlanUpdateBuilder setupCost(Long value) { - - formData.put("setup_cost", value); - - return this; - } - - public PlanUpdateBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public PlanUpdateBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public PlanUpdateBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public PlanUpdateBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public PlanUpdateBuilder pricingModel(PricingModel value) { - - formData.put("pricing_model", value); - - return this; - } - - @Deprecated - public PlanUpdateBuilder chargeModel(ChargeModel value) { - - formData.put("charge_model", value); - - return this; - } - - public PlanUpdateBuilder freeQuantity(Integer value) { - - formData.put("free_quantity", value); - - return this; - } - - public PlanUpdateBuilder freeQuantityInDecimal(String value) { - - formData.put("free_quantity_in_decimal", value); - - return this; - } - - public PlanUpdateBuilder addonApplicability(AddonApplicability value) { - - formData.put("addon_applicability", value); - - return this; - } - - @Deprecated - public PlanUpdateBuilder downgradePenalty(Number value) { - - formData.put("downgrade_penalty", value); - - return this; - } - - public PlanUpdateBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public PlanUpdateBuilder enabledInHostedPages(Boolean value) { - - formData.put("enabled_in_hosted_pages", value); - - return this; - } - - public PlanUpdateBuilder enabledInPortal(Boolean value) { - - formData.put("enabled_in_portal", value); - - return this; - } - - public PlanUpdateBuilder taxable(Boolean value) { - - formData.put("taxable", value); - - return this; - } - - public PlanUpdateBuilder taxProfileId(String value) { - - formData.put("tax_profile_id", value); - - return this; - } - - public PlanUpdateBuilder taxCode(String value) { - - formData.put("tax_code", value); - - return this; - } - - public PlanUpdateBuilder hsnCode(String value) { - - formData.put("hsn_code", value); - - return this; - } - - public PlanUpdateBuilder taxjarProductCode(String value) { - - formData.put("taxjar_product_code", value); - - return this; - } - - public PlanUpdateBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public PlanUpdateBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public PlanUpdateBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public PlanUpdateBuilder sku(String value) { - - formData.put("sku", value); - - return this; - } - - public PlanUpdateBuilder accountingCode(String value) { - - formData.put("accounting_code", value); - - return this; - } - - public PlanUpdateBuilder accountingCategory1(String value) { - - formData.put("accounting_category1", value); - - return this; - } - - public PlanUpdateBuilder accountingCategory2(String value) { - - formData.put("accounting_category2", value); - - return this; - } - - public PlanUpdateBuilder accountingCategory3(String value) { - - formData.put("accounting_category3", value); - - return this; - } - - public PlanUpdateBuilder accountingCategory4(String value) { - - formData.put("accounting_category4", value); - - return this; - } - - public PlanUpdateBuilder isShippable(Boolean value) { - - formData.put("is_shippable", value); - - return this; - } - - public PlanUpdateBuilder shippingFrequencyPeriod(Integer value) { - - formData.put("shipping_frequency_period", value); - - return this; - } - - public PlanUpdateBuilder shippingFrequencyPeriodUnit(ShippingFrequencyPeriodUnit value) { - - formData.put("shipping_frequency_period_unit", value); - - return this; - } - - public PlanUpdateBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public PlanUpdateBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public PlanUpdateBuilder showDescriptionInInvoices(Boolean value) { - - formData.put("show_description_in_invoices", value); - - return this; - } - - public PlanUpdateBuilder showDescriptionInQuotes(Boolean value) { - - formData.put("show_description_in_quotes", value); - - return this; - } - - public PlanUpdateBuilder tiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PlanUpdateBuilder taxProvidersFields(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PlanUpdateBuilder applicableAddons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ApplicableAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "applicable_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PlanUpdateBuilder eventBasedAddons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PlanUpdateBuilder attachedAddons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AttachedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "attached_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 PlanUpdateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 PlanUpdateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public PlanUpdateParams build() { - return new PlanUpdateParams(this); - } - } - - public enum TrialPeriodUnit { - DAY("day"), - - MONTH("month"), - - /** An enum member indicating that TrialPeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialPeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialPeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialPeriodUnit enumValue : TrialPeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TrialEndAction { - SITE_DEFAULT("site_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialEndAction enumValue : TrialEndAction.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 enum PricingModel { - FLAT_FEE("flat_fee"), - - PER_UNIT("per_unit"), - - TIERED("tiered"), - - VOLUME("volume"), - - STAIRSTEP("stairstep"), - - /** An enum member indicating that PricingModel was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingModel(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingModel fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingModel enumValue : PricingModel.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChargeModel { - FLAT_FEE("flat_fee"), - - PER_UNIT("per_unit"), - - TIERED("tiered"), - - VOLUME("volume"), - - STAIRSTEP("stairstep"), - - /** An enum member indicating that ChargeModel was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeModel(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeModel fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeModel enumValue : ChargeModel.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AddonApplicability { - ALL("all"), - - RESTRICTED("restricted"), - - /** An enum member indicating that AddonApplicability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AddonApplicability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AddonApplicability fromString(String value) { - if (value == null) return _UNKNOWN; - for (AddonApplicability enumValue : AddonApplicability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ShippingFrequencyPeriodUnit { - YEAR("year"), - - MONTH("month"), - - WEEK("week"), - - DAY("day"), - - /** - * An enum member indicating that ShippingFrequencyPeriodUnit was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - ShippingFrequencyPeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ShippingFrequencyPeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (ShippingFrequencyPeriodUnit enumValue : ShippingFrequencyPeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class TiersParams { - - private final Map formData; - - private TiersParams(TiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TiersBuilder builder() { - return new TiersBuilder(); - } - - public static final class TiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TiersBuilder() {} - - public TiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public TiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public TiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public TiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public TiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public TiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public TiersParams build() { - return new TiersParams(this); - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } - - public static final class ApplicableAddonsParams { - - private final Map formData; - - private ApplicableAddonsParams(ApplicableAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ApplicableAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ApplicableAddonsBuilder builder() { - return new ApplicableAddonsBuilder(); - } - - public static final class ApplicableAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ApplicableAddonsBuilder() {} - - public ApplicableAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ApplicableAddonsParams build() { - return new ApplicableAddonsParams(this); - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder onEvent(OnEvent value) { - - formData.put("on_event", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - - public enum OnEvent { - SUBSCRIPTION_CREATION("subscription_creation"), - - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** An enum member indicating that OnEvent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OnEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OnEvent fromString(String value) { - if (value == null) return _UNKNOWN; - for (OnEvent enumValue : OnEvent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AttachedAddonsParams { - - private final Map formData; - - private AttachedAddonsParams(AttachedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AttachedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AttachedAddonsBuilder builder() { - return new AttachedAddonsBuilder(); - } - - public static final class AttachedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AttachedAddonsBuilder() {} - - public AttachedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AttachedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AttachedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AttachedAddonsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AttachedAddonsBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - public AttachedAddonsParams build() { - return new AttachedAddonsParams(this); - } - } - - public enum Type { - RECOMMENDED("recommended"), - - MANDATORY("mandatory"), - - /** 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/core/models/portalSession/params/PortalSessionCreateParams.java b/src/main/java/com/chargebee/v4/core/models/portalSession/params/PortalSessionCreateParams.java deleted file mode 100644 index 64549205..00000000 --- a/src/main/java/com/chargebee/v4/core/models/portalSession/params/PortalSessionCreateParams.java +++ /dev/null @@ -1,105 +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.core.models.portalSession.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PortalSessionCreateParams { - - private final Map formData; - - private PortalSessionCreateParams(PortalSessionCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PortalSessionCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PortalSessionCreateBuilder builder() { - return new PortalSessionCreateBuilder(); - } - - public static final class PortalSessionCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PortalSessionCreateBuilder() {} - - public PortalSessionCreateBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public PortalSessionCreateBuilder forwardUrl(String value) { - - formData.put("forward_url", value); - - return this; - } - - public PortalSessionCreateBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PortalSessionCreateParams build() { - return new PortalSessionCreateParams(this); - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/priceVariant/params/PriceVariantCreateParams.java b/src/main/java/com/chargebee/v4/core/models/priceVariant/params/PriceVariantCreateParams.java deleted file mode 100644 index 8a834cae..00000000 --- a/src/main/java/com/chargebee/v4/core/models/priceVariant/params/PriceVariantCreateParams.java +++ /dev/null @@ -1,146 +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.core.models.priceVariant.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class PriceVariantCreateParams { - - private final Map formData; - - private PriceVariantCreateParams(PriceVariantCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PriceVariantCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PriceVariantCreateBuilder builder() { - return new PriceVariantCreateBuilder(); - } - - public static final class PriceVariantCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PriceVariantCreateBuilder() {} - - public PriceVariantCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PriceVariantCreateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public PriceVariantCreateBuilder externalName(String value) { - - formData.put("external_name", value); - - return this; - } - - public PriceVariantCreateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public PriceVariantCreateBuilder variantGroup(String value) { - - formData.put("variant_group", value); - - return this; - } - - public PriceVariantCreateBuilder businessEntityId(String value) { - - formData.put("business_entity_id", value); - - return this; - } - - public PriceVariantCreateBuilder attributes(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AttributesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "attributes[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PriceVariantCreateParams build() { - return new PriceVariantCreateParams(this); - } - } - - public static final class AttributesParams { - - private final Map formData; - - private AttributesParams(AttributesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AttributesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AttributesBuilder builder() { - return new AttributesBuilder(); - } - - public static final class AttributesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AttributesBuilder() {} - - public AttributesBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public AttributesBuilder value(String value) { - - formData.put("value", value); - - return this; - } - - public AttributesParams build() { - return new AttributesParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/priceVariant/params/PriceVariantUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/priceVariant/params/PriceVariantUpdateParams.java deleted file mode 100644 index 5bcf28d9..00000000 --- a/src/main/java/com/chargebee/v4/core/models/priceVariant/params/PriceVariantUpdateParams.java +++ /dev/null @@ -1,167 +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.core.models.priceVariant.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class PriceVariantUpdateParams { - - private final Map formData; - - private PriceVariantUpdateParams(PriceVariantUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PriceVariantUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PriceVariantUpdateBuilder builder() { - return new PriceVariantUpdateBuilder(); - } - - public static final class PriceVariantUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PriceVariantUpdateBuilder() {} - - public PriceVariantUpdateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public PriceVariantUpdateBuilder externalName(String value) { - - formData.put("external_name", value); - - return this; - } - - public PriceVariantUpdateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public PriceVariantUpdateBuilder variantGroup(String value) { - - formData.put("variant_group", value); - - return this; - } - - public PriceVariantUpdateBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public PriceVariantUpdateBuilder attributes(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AttributesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "attributes[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PriceVariantUpdateParams build() { - return new PriceVariantUpdateParams(this); - } - } - - public enum Status { - ACTIVE("active"), - - ARCHIVED("archived"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class AttributesParams { - - private final Map formData; - - private AttributesParams(AttributesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AttributesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AttributesBuilder builder() { - return new AttributesBuilder(); - } - - public static final class AttributesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AttributesBuilder() {} - - public AttributesBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public AttributesBuilder value(String value) { - - formData.put("value", value); - - return this; - } - - public AttributesParams build() { - return new AttributesParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/pricingPageSession/params/PricingPageSessionCreateForExistingSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/pricingPageSession/params/PricingPageSessionCreateForExistingSubscriptionParams.java deleted file mode 100644 index b1530b3f..00000000 --- a/src/main/java/com/chargebee/v4/core/models/pricingPageSession/params/PricingPageSessionCreateForExistingSubscriptionParams.java +++ /dev/null @@ -1,357 +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.core.models.pricingPageSession.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class PricingPageSessionCreateForExistingSubscriptionParams { - - private final Map formData; - - private PricingPageSessionCreateForExistingSubscriptionParams( - PricingPageSessionCreateForExistingSubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PricingPageSessionCreateForExistingSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PricingPageSessionCreateForExistingSubscriptionBuilder builder() { - return new PricingPageSessionCreateForExistingSubscriptionBuilder(); - } - - public static final class PricingPageSessionCreateForExistingSubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PricingPageSessionCreateForExistingSubscriptionBuilder() {} - - public PricingPageSessionCreateForExistingSubscriptionBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public PricingPageSessionCreateForExistingSubscriptionBuilder pricingPage( - PricingPageParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "pricing_page[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PricingPageSessionCreateForExistingSubscriptionBuilder subscription( - SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PricingPageSessionCreateForExistingSubscriptionBuilder discounts( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PricingPageSessionCreateForExistingSubscriptionParams build() { - return new PricingPageSessionCreateForExistingSubscriptionParams(this); - } - } - - public static final class PricingPageParams { - - private final Map formData; - - private PricingPageParams(PricingPageBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PricingPageParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PricingPageBuilder builder() { - return new PricingPageBuilder(); - } - - public static final class PricingPageBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PricingPageBuilder() {} - - public PricingPageBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PricingPageParams build() { - return new PricingPageParams(this); - } - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder label(String value) { - - formData.put("label", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/pricingPageSession/params/PricingPageSessionCreateForNewSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/pricingPageSession/params/PricingPageSessionCreateForNewSubscriptionParams.java deleted file mode 100644 index 95e36d0b..00000000 --- a/src/main/java/com/chargebee/v4/core/models/pricingPageSession/params/PricingPageSessionCreateForNewSubscriptionParams.java +++ /dev/null @@ -1,797 +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.core.models.pricingPageSession.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class PricingPageSessionCreateForNewSubscriptionParams { - - private final Map formData; - - private PricingPageSessionCreateForNewSubscriptionParams( - PricingPageSessionCreateForNewSubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PricingPageSessionCreateForNewSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PricingPageSessionCreateForNewSubscriptionBuilder builder() { - return new PricingPageSessionCreateForNewSubscriptionBuilder(); - } - - public static final class PricingPageSessionCreateForNewSubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PricingPageSessionCreateForNewSubscriptionBuilder() {} - - public PricingPageSessionCreateForNewSubscriptionBuilder redirectUrl(String value) { - - formData.put("redirect_url", value); - - return this; - } - - public PricingPageSessionCreateForNewSubscriptionBuilder businessEntityId(String value) { - - formData.put("business_entity_id", value); - - return this; - } - - public PricingPageSessionCreateForNewSubscriptionBuilder pricingPage(PricingPageParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "pricing_page[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PricingPageSessionCreateForNewSubscriptionBuilder subscription( - SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PricingPageSessionCreateForNewSubscriptionBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PricingPageSessionCreateForNewSubscriptionBuilder billingAddress( - BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PricingPageSessionCreateForNewSubscriptionBuilder shippingAddress( - ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PricingPageSessionCreateForNewSubscriptionBuilder discounts( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PricingPageSessionCreateForNewSubscriptionParams build() { - return new PricingPageSessionCreateForNewSubscriptionParams(this); - } - } - - public static final class PricingPageParams { - - private final Map formData; - - private PricingPageParams(PricingPageBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PricingPageParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PricingPageBuilder builder() { - return new PricingPageBuilder(); - } - - public static final class PricingPageBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PricingPageBuilder() {} - - public PricingPageBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PricingPageParams build() { - return new PricingPageParams(this); - } - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public CustomerBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CustomerBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CustomerBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public CustomerBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public CustomerBuilder locale(String value) { - - formData.put("locale", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder label(String value) { - - formData.put("label", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/product/params/ProductCreateParams.java b/src/main/java/com/chargebee/v4/core/models/product/params/ProductCreateParams.java deleted file mode 100644 index 2868fb88..00000000 --- a/src/main/java/com/chargebee/v4/core/models/product/params/ProductCreateParams.java +++ /dev/null @@ -1,128 +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.core.models.product.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; - -public final class ProductCreateParams { - - private final Map formData; - - private ProductCreateParams(ProductCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ProductCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ProductCreateBuilder builder() { - return new ProductCreateBuilder(); - } - - public static final class ProductCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ProductCreateBuilder() {} - - public ProductCreateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public ProductCreateBuilder externalName(String value) { - - formData.put("external_name", value); - - return this; - } - - public ProductCreateBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public ProductCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ProductCreateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ProductCreateBuilder sku(String value) { - - formData.put("sku", value); - - return this; - } - - public ProductCreateBuilder metadata(java.util.Map value) { - - formData.put("metadata", JsonUtil.toJson(value)); - - return this; - } - - public ProductCreateBuilder shippable(Boolean value) { - - formData.put("shippable", value); - - return this; - } - - public ProductCreateParams build() { - return new ProductCreateParams(this); - } - } - - public enum Status { - ACTIVE("active"), - - INACTIVE("inactive"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/product/params/ProductDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/product/params/ProductDeleteParams.java deleted file mode 100644 index a99204e4..00000000 --- a/src/main/java/com/chargebee/v4/core/models/product/params/ProductDeleteParams.java +++ /dev/null @@ -1,43 +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.core.models.product.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class ProductDeleteParams { - - private final Map formData; - - private ProductDeleteParams(ProductDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ProductDeleteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ProductDeleteBuilder builder() { - return new ProductDeleteBuilder(); - } - - public static final class ProductDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ProductDeleteBuilder() {} - - public ProductDeleteParams build() { - return new ProductDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/product/params/ProductUpdateOptionsParams.java b/src/main/java/com/chargebee/v4/core/models/product/params/ProductUpdateOptionsParams.java deleted file mode 100644 index 6a51dacb..00000000 --- a/src/main/java/com/chargebee/v4/core/models/product/params/ProductUpdateOptionsParams.java +++ /dev/null @@ -1,119 +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.core.models.product.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; - -public final class ProductUpdateOptionsParams { - - private final Map formData; - - private ProductUpdateOptionsParams(ProductUpdateOptionsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ProductUpdateOptionsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ProductUpdateOptionsBuilder builder() { - return new ProductUpdateOptionsBuilder(); - } - - public static final class ProductUpdateOptionsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ProductUpdateOptionsBuilder() {} - - public ProductUpdateOptionsBuilder removeOptions(List value) { - - formData.put("remove_options", value); - - return this; - } - - public ProductUpdateOptionsBuilder options(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - OptionsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "options[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public ProductUpdateOptionsParams build() { - return new ProductUpdateOptionsParams(this); - } - } - - public static final class OptionsParams { - - private final Map formData; - - private OptionsParams(OptionsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OptionsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OptionsBuilder builder() { - return new OptionsBuilder(); - } - - public static final class OptionsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OptionsBuilder() {} - - public OptionsBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public OptionsBuilder values(List value) { - - formData.put("values", JsonUtil.toJson(value)); - - return this; - } - - public OptionsBuilder defaultValue(String value) { - - formData.put("default_value", value); - - return this; - } - - public OptionsParams build() { - return new OptionsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/product/params/ProductUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/product/params/ProductUpdateParams.java deleted file mode 100644 index 2b2c2340..00000000 --- a/src/main/java/com/chargebee/v4/core/models/product/params/ProductUpdateParams.java +++ /dev/null @@ -1,121 +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.core.models.product.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; - -public final class ProductUpdateParams { - - private final Map formData; - - private ProductUpdateParams(ProductUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ProductUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ProductUpdateBuilder builder() { - return new ProductUpdateBuilder(); - } - - public static final class ProductUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ProductUpdateBuilder() {} - - public ProductUpdateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public ProductUpdateBuilder externalName(String value) { - - formData.put("external_name", value); - - return this; - } - - public ProductUpdateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ProductUpdateBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public ProductUpdateBuilder sku(String value) { - - formData.put("sku", value); - - return this; - } - - public ProductUpdateBuilder shippable(Boolean value) { - - formData.put("shippable", value); - - return this; - } - - public ProductUpdateBuilder metadata(java.util.Map value) { - - formData.put("metadata", JsonUtil.toJson(value)); - - return this; - } - - public ProductUpdateParams build() { - return new ProductUpdateParams(this); - } - } - - public enum Status { - ACTIVE("active"), - - INACTIVE("inactive"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/promotionalCredit/params/PromotionalCreditAddParams.java b/src/main/java/com/chargebee/v4/core/models/promotionalCredit/params/PromotionalCreditAddParams.java deleted file mode 100644 index 584093b8..00000000 --- a/src/main/java/com/chargebee/v4/core/models/promotionalCredit/params/PromotionalCreditAddParams.java +++ /dev/null @@ -1,122 +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.core.models.promotionalCredit.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PromotionalCreditAddParams { - - private final Map formData; - - private PromotionalCreditAddParams(PromotionalCreditAddBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PromotionalCreditAddParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PromotionalCreditAddBuilder builder() { - return new PromotionalCreditAddBuilder(); - } - - public static final class PromotionalCreditAddBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PromotionalCreditAddBuilder() {} - - public PromotionalCreditAddBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public PromotionalCreditAddBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public PromotionalCreditAddBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public PromotionalCreditAddBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public PromotionalCreditAddBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public PromotionalCreditAddBuilder creditType(CreditType value) { - - formData.put("credit_type", value); - - return this; - } - - public PromotionalCreditAddBuilder reference(String value) { - - formData.put("reference", value); - - return this; - } - - public PromotionalCreditAddParams build() { - return new PromotionalCreditAddParams(this); - } - } - - public enum CreditType { - LOYALTY_CREDITS("loyalty_credits"), - - REFERRAL_REWARDS("referral_rewards"), - - GENERAL("general"), - - /** An enum member indicating that CreditType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CreditType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CreditType fromString(String value) { - if (value == null) return _UNKNOWN; - for (CreditType enumValue : CreditType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/promotionalCredit/params/PromotionalCreditDeductParams.java b/src/main/java/com/chargebee/v4/core/models/promotionalCredit/params/PromotionalCreditDeductParams.java deleted file mode 100644 index fb875132..00000000 --- a/src/main/java/com/chargebee/v4/core/models/promotionalCredit/params/PromotionalCreditDeductParams.java +++ /dev/null @@ -1,122 +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.core.models.promotionalCredit.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PromotionalCreditDeductParams { - - private final Map formData; - - private PromotionalCreditDeductParams(PromotionalCreditDeductBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PromotionalCreditDeductParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PromotionalCreditDeductBuilder builder() { - return new PromotionalCreditDeductBuilder(); - } - - public static final class PromotionalCreditDeductBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PromotionalCreditDeductBuilder() {} - - public PromotionalCreditDeductBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public PromotionalCreditDeductBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public PromotionalCreditDeductBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public PromotionalCreditDeductBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public PromotionalCreditDeductBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public PromotionalCreditDeductBuilder creditType(CreditType value) { - - formData.put("credit_type", value); - - return this; - } - - public PromotionalCreditDeductBuilder reference(String value) { - - formData.put("reference", value); - - return this; - } - - public PromotionalCreditDeductParams build() { - return new PromotionalCreditDeductParams(this); - } - } - - public enum CreditType { - LOYALTY_CREDITS("loyalty_credits"), - - REFERRAL_REWARDS("referral_rewards"), - - GENERAL("general"), - - /** An enum member indicating that CreditType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CreditType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CreditType fromString(String value) { - if (value == null) return _UNKNOWN; - for (CreditType enumValue : CreditType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/promotionalCredit/params/PromotionalCreditSetParams.java b/src/main/java/com/chargebee/v4/core/models/promotionalCredit/params/PromotionalCreditSetParams.java deleted file mode 100644 index a7b41ea2..00000000 --- a/src/main/java/com/chargebee/v4/core/models/promotionalCredit/params/PromotionalCreditSetParams.java +++ /dev/null @@ -1,122 +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.core.models.promotionalCredit.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class PromotionalCreditSetParams { - - private final Map formData; - - private PromotionalCreditSetParams(PromotionalCreditSetBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PromotionalCreditSetParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PromotionalCreditSetBuilder builder() { - return new PromotionalCreditSetBuilder(); - } - - public static final class PromotionalCreditSetBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PromotionalCreditSetBuilder() {} - - public PromotionalCreditSetBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public PromotionalCreditSetBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public PromotionalCreditSetBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public PromotionalCreditSetBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public PromotionalCreditSetBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public PromotionalCreditSetBuilder creditType(CreditType value) { - - formData.put("credit_type", value); - - return this; - } - - public PromotionalCreditSetBuilder reference(String value) { - - formData.put("reference", value); - - return this; - } - - public PromotionalCreditSetParams build() { - return new PromotionalCreditSetParams(this); - } - } - - public enum CreditType { - LOYALTY_CREDITS("loyalty_credits"), - - REFERRAL_REWARDS("referral_rewards"), - - GENERAL("general"), - - /** An enum member indicating that CreditType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CreditType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CreditType fromString(String value) { - if (value == null) return _UNKNOWN; - for (CreditType enumValue : CreditType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/purchase/params/PurchaseCreateParams.java b/src/main/java/com/chargebee/v4/core/models/purchase/params/PurchaseCreateParams.java deleted file mode 100644 index b2688e82..00000000 --- a/src/main/java/com/chargebee/v4/core/models/purchase/params/PurchaseCreateParams.java +++ /dev/null @@ -1,1017 +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.core.models.purchase.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; - -public final class PurchaseCreateParams { - - private final Map formData; - - private PurchaseCreateParams(PurchaseCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PurchaseCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PurchaseCreateBuilder builder() { - return new PurchaseCreateBuilder(); - } - - public static final class PurchaseCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PurchaseCreateBuilder() {} - - public PurchaseCreateBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public PurchaseCreateBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public PurchaseCreateBuilder replacePrimaryPaymentSource(Boolean value) { - - formData.put("replace_primary_payment_source", value); - - return this; - } - - public PurchaseCreateBuilder invoiceInfo(InvoiceInfoParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "invoice_info[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PurchaseCreateBuilder paymentSchedule(PaymentScheduleParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_schedule[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PurchaseCreateBuilder statementDescriptor(StatementDescriptorParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PurchaseCreateBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PurchaseCreateBuilder purchaseItems(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - PurchaseItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "purchase_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PurchaseCreateBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PurchaseCreateBuilder shippingAddresses(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ShippingAddressesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "shipping_addresses[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PurchaseCreateBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PurchaseCreateBuilder subscriptionInfo(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionInfoParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_info[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PurchaseCreateBuilder contractTerms(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ContractTermsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "contract_terms[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PurchaseCreateParams build() { - return new PurchaseCreateParams(this); - } - } - - public static final class InvoiceInfoParams { - - private final Map formData; - - private InvoiceInfoParams(InvoiceInfoBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceInfoParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceInfoBuilder builder() { - return new InvoiceInfoBuilder(); - } - - public static final class InvoiceInfoBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceInfoBuilder() {} - - public InvoiceInfoBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public InvoiceInfoBuilder notes(String value) { - - formData.put("notes", value); - - return this; - } - - public InvoiceInfoParams build() { - return new InvoiceInfoParams(this); - } - } - } - - public static final class PaymentScheduleParams { - - private final Map formData; - - private PaymentScheduleParams(PaymentScheduleBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentScheduleParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentScheduleBuilder builder() { - return new PaymentScheduleBuilder(); - } - - public static final class PaymentScheduleBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentScheduleBuilder() {} - - public PaymentScheduleBuilder schemeId(String value) { - - formData.put("scheme_id", value); - - return this; - } - - public PaymentScheduleBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public PaymentScheduleParams build() { - return new PaymentScheduleParams(this); - } - } - } - - public static final class StatementDescriptorParams { - - private final Map formData; - - private StatementDescriptorParams(StatementDescriptorBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatementDescriptorParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatementDescriptorBuilder builder() { - return new StatementDescriptorBuilder(); - } - - public static final class StatementDescriptorBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatementDescriptorBuilder() {} - - public StatementDescriptorBuilder descriptor(String value) { - - formData.put("descriptor", value); - - return this; - } - - public StatementDescriptorParams build() { - return new StatementDescriptorParams(this); - } - } - } - - public static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PurchaseItemsParams { - - private final Map formData; - - private PurchaseItemsParams(PurchaseItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PurchaseItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PurchaseItemsBuilder builder() { - return new PurchaseItemsBuilder(); - } - - public static final class PurchaseItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PurchaseItemsBuilder() {} - - public PurchaseItemsBuilder index(Integer value) { - - formData.put("index", value); - - return this; - } - - public PurchaseItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public PurchaseItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public PurchaseItemsBuilder unitAmount(Integer value) { - - formData.put("unit_amount", value); - - return this; - } - - public PurchaseItemsBuilder unitAmountInDecimal(String value) { - - formData.put("unit_amount_in_decimal", value); - - return this; - } - - public PurchaseItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public PurchaseItemsParams build() { - return new PurchaseItemsParams(this); - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder index(Integer value) { - - formData.put("index", value); - - return this; - } - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - } - - public static final class ShippingAddressesParams { - - private final Map formData; - - private ShippingAddressesParams(ShippingAddressesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressesBuilder builder() { - return new ShippingAddressesBuilder(); - } - - public static final class ShippingAddressesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressesBuilder() {} - - public ShippingAddressesBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressesBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressesBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressesBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressesBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressesBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressesBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressesBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressesBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressesBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressesBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressesBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressesBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressesBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressesParams build() { - return new ShippingAddressesParams(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; - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder index(Integer value) { - - formData.put("index", value); - - return this; - } - - public DiscountsBuilder couponId(String value) { - - formData.put("coupon_id", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - } - - public static final class SubscriptionInfoParams { - - private final Map formData; - - private SubscriptionInfoParams(SubscriptionInfoBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionInfoParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionInfoBuilder builder() { - return new SubscriptionInfoBuilder(); - } - - public static final class SubscriptionInfoBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionInfoBuilder() {} - - public SubscriptionInfoBuilder index(Integer value) { - - formData.put("index", value); - - return this; - } - - public SubscriptionInfoBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public SubscriptionInfoBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionInfoBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionInfoBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public SubscriptionInfoParams build() { - return new SubscriptionInfoParams(this); - } - } - } - - public static final class ContractTermsParams { - - private final Map formData; - - private ContractTermsParams(ContractTermsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermsBuilder builder() { - return new ContractTermsBuilder(); - } - - public static final class ContractTermsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermsBuilder() {} - - public ContractTermsBuilder index(Integer value) { - - formData.put("index", value); - - return this; - } - - public ContractTermsBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermsBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermsParams build() { - return new ContractTermsParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - RENEW_ONCE("renew_once"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/purchase/params/PurchaseEstimateParams.java b/src/main/java/com/chargebee/v4/core/models/purchase/params/PurchaseEstimateParams.java deleted file mode 100644 index 28465b20..00000000 --- a/src/main/java/com/chargebee/v4/core/models/purchase/params/PurchaseEstimateParams.java +++ /dev/null @@ -1,1034 +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.core.models.purchase.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; - -public final class PurchaseEstimateParams { - - private final Map formData; - - private PurchaseEstimateParams(PurchaseEstimateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PurchaseEstimateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PurchaseEstimateBuilder builder() { - return new PurchaseEstimateBuilder(); - } - - public static final class PurchaseEstimateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PurchaseEstimateBuilder() {} - - public PurchaseEstimateBuilder clientProfileId(String value) { - - formData.put("client_profile_id", value); - - return this; - } - - public PurchaseEstimateBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public PurchaseEstimateBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PurchaseEstimateBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public PurchaseEstimateBuilder purchaseItems(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - PurchaseItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "purchase_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PurchaseEstimateBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PurchaseEstimateBuilder shippingAddresses(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ShippingAddressesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "shipping_addresses[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PurchaseEstimateBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PurchaseEstimateBuilder subscriptionInfo(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionInfoParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_info[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PurchaseEstimateBuilder contractTerms(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ContractTermsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "contract_terms[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public PurchaseEstimateParams build() { - return new PurchaseEstimateParams(this); - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder registeredForGst(Boolean value) { - - formData.put("registered_for_gst", value); - - return this; - } - - public CustomerBuilder taxability(Taxability value) { - - formData.put("taxability", value); - - return this; - } - - public CustomerBuilder entityCode(EntityCode value) { - - formData.put("entity_code", value); - - return this; - } - - public CustomerBuilder exemptNumber(String value) { - - formData.put("exempt_number", value); - - return this; - } - - public CustomerBuilder exemptionDetails(List value) { - - formData.put("exemption_details", JsonUtil.toJson(value)); - - return this; - } - - public CustomerBuilder customerType(CustomerType value) { - - formData.put("customer_type", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - - public enum Taxability { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Taxability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Taxability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Taxability fromString(String value) { - if (value == null) return _UNKNOWN; - for (Taxability enumValue : Taxability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EntityCode { - A("a"), - - B("b"), - - C("c"), - - D("d"), - - E("e"), - - F("f"), - - G("g"), - - H("h"), - - I("i"), - - J("j"), - - K("k"), - - L("l"), - - M("m"), - - N("n"), - - P("p"), - - Q("q"), - - R("r"), - - MED_1("med1"), - - MED_2("med2"), - - /** An enum member indicating that EntityCode was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EntityCode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EntityCode fromString(String value) { - if (value == null) return _UNKNOWN; - for (EntityCode enumValue : EntityCode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum CustomerType { - RESIDENTIAL("residential"), - - BUSINESS("business"), - - SENIOR_CITIZEN("senior_citizen"), - - INDUSTRIAL("industrial"), - - /** An enum member indicating that CustomerType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CustomerType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CustomerType fromString(String value) { - if (value == null) return _UNKNOWN; - for (CustomerType enumValue : CustomerType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class PurchaseItemsParams { - - private final Map formData; - - private PurchaseItemsParams(PurchaseItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PurchaseItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PurchaseItemsBuilder builder() { - return new PurchaseItemsBuilder(); - } - - public static final class PurchaseItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PurchaseItemsBuilder() {} - - public PurchaseItemsBuilder index(Integer value) { - - formData.put("index", value); - - return this; - } - - public PurchaseItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public PurchaseItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public PurchaseItemsBuilder unitAmount(Integer value) { - - formData.put("unit_amount", value); - - return this; - } - - public PurchaseItemsBuilder unitAmountInDecimal(String value) { - - formData.put("unit_amount_in_decimal", value); - - return this; - } - - public PurchaseItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public PurchaseItemsParams build() { - return new PurchaseItemsParams(this); - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder index(Integer value) { - - formData.put("index", value); - - return this; - } - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - } - - public static final class ShippingAddressesParams { - - private final Map formData; - - private ShippingAddressesParams(ShippingAddressesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressesBuilder builder() { - return new ShippingAddressesBuilder(); - } - - public static final class ShippingAddressesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressesBuilder() {} - - public ShippingAddressesBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressesBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressesBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressesBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressesBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressesBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressesBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressesBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressesBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressesBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressesBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressesBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressesBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressesBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressesParams build() { - return new ShippingAddressesParams(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; - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder index(Integer value) { - - formData.put("index", value); - - return this; - } - - public DiscountsBuilder couponId(String value) { - - formData.put("coupon_id", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - } - - public static final class SubscriptionInfoParams { - - private final Map formData; - - private SubscriptionInfoParams(SubscriptionInfoBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionInfoParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionInfoBuilder builder() { - return new SubscriptionInfoBuilder(); - } - - public static final class SubscriptionInfoBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionInfoBuilder() {} - - public SubscriptionInfoBuilder index(Integer value) { - - formData.put("index", value); - - return this; - } - - public SubscriptionInfoBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public SubscriptionInfoBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionInfoBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionInfoParams build() { - return new SubscriptionInfoParams(this); - } - } - } - - public static final class ContractTermsParams { - - private final Map formData; - - private ContractTermsParams(ContractTermsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermsBuilder builder() { - return new ContractTermsBuilder(); - } - - public static final class ContractTermsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermsBuilder() {} - - public ContractTermsBuilder index(Integer value) { - - formData.put("index", value); - - return this; - } - - public ContractTermsBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermsBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermsParams build() { - return new ContractTermsParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - RENEW_ONCE("renew_once"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteConvertParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteConvertParams.java deleted file mode 100644 index 35617a99..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteConvertParams.java +++ /dev/null @@ -1,169 +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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class QuoteConvertParams { - - private final Map formData; - - private QuoteConvertParams(QuoteConvertBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteConvertParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteConvertBuilder builder() { - return new QuoteConvertBuilder(); - } - - public static final class QuoteConvertBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteConvertBuilder() {} - - public QuoteConvertBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public QuoteConvertBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public QuoteConvertBuilder createPendingInvoices(Boolean value) { - - formData.put("create_pending_invoices", value); - - return this; - } - - public QuoteConvertBuilder firstInvoicePending(Boolean value) { - - formData.put("first_invoice_pending", value); - - return this; - } - - public QuoteConvertBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteConvertParams build() { - return new QuoteConvertParams(this); - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public SubscriptionBuilder autoCloseInvoices(Boolean value) { - - formData.put("auto_close_invoices", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteCreateForChargeItemsAndChargesParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteCreateForChargeItemsAndChargesParams.java deleted file mode 100644 index dc7d91f7..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteCreateForChargeItemsAndChargesParams.java +++ /dev/null @@ -1,975 +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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class QuoteCreateForChargeItemsAndChargesParams { - - private final Map formData; - - private QuoteCreateForChargeItemsAndChargesParams( - QuoteCreateForChargeItemsAndChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteCreateForChargeItemsAndChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteCreateForChargeItemsAndChargesBuilder builder() { - return new QuoteCreateForChargeItemsAndChargesBuilder(); - } - - public static final class QuoteCreateForChargeItemsAndChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteCreateForChargeItemsAndChargesBuilder() {} - - public QuoteCreateForChargeItemsAndChargesBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public QuoteCreateForChargeItemsAndChargesBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public QuoteCreateForChargeItemsAndChargesBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public QuoteCreateForChargeItemsAndChargesBuilder notes(String value) { - - formData.put("notes", value); - - return this; - } - - public QuoteCreateForChargeItemsAndChargesBuilder expiresAt(Timestamp value) { - - formData.put("expires_at", value); - - return this; - } - - public QuoteCreateForChargeItemsAndChargesBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public QuoteCreateForChargeItemsAndChargesBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public QuoteCreateForChargeItemsAndChargesBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public QuoteCreateForChargeItemsAndChargesBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteCreateForChargeItemsAndChargesBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteCreateForChargeItemsAndChargesBuilder itemPrices(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemPricesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_prices[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteCreateForChargeItemsAndChargesBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteCreateForChargeItemsAndChargesBuilder charges(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ChargesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteCreateForChargeItemsAndChargesBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteCreateForChargeItemsAndChargesBuilder taxProvidersFields( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteCreateForChargeItemsAndChargesParams build() { - return new QuoteCreateForChargeItemsAndChargesParams(this); - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class ItemPricesParams { - - private final Map formData; - - private ItemPricesParams(ItemPricesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemPricesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPricesBuilder builder() { - return new ItemPricesBuilder(); - } - - public static final class ItemPricesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemPricesBuilder() {} - - public ItemPricesBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemPricesBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public ItemPricesBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public ItemPricesBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public ItemPricesBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public ItemPricesBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public ItemPricesParams build() { - return new ItemPricesParams(this); - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ChargesParams { - - private final Map formData; - - private ChargesParams(ChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargesBuilder builder() { - return new ChargesBuilder(); - } - - public static final class ChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargesBuilder() {} - - public ChargesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public ChargesBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public ChargesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public ChargesBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public ChargesBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public ChargesBuilder servicePeriod(Integer value) { - - formData.put("service_period", value); - - return this; - } - - public ChargesParams build() { - return new ChargesParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteCreateForOnetimeChargesParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteCreateForOnetimeChargesParams.java deleted file mode 100644 index 6c6f2c3f..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteCreateForOnetimeChargesParams.java +++ /dev/null @@ -1,555 +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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class QuoteCreateForOnetimeChargesParams { - - private final Map formData; - - private QuoteCreateForOnetimeChargesParams(QuoteCreateForOnetimeChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteCreateForOnetimeChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteCreateForOnetimeChargesBuilder builder() { - return new QuoteCreateForOnetimeChargesBuilder(); - } - - public static final class QuoteCreateForOnetimeChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteCreateForOnetimeChargesBuilder() {} - - public QuoteCreateForOnetimeChargesBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public QuoteCreateForOnetimeChargesBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public QuoteCreateForOnetimeChargesBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public QuoteCreateForOnetimeChargesBuilder notes(String value) { - - formData.put("notes", value); - - return this; - } - - public QuoteCreateForOnetimeChargesBuilder expiresAt(Timestamp value) { - - formData.put("expires_at", value); - - return this; - } - - public QuoteCreateForOnetimeChargesBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public QuoteCreateForOnetimeChargesBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public QuoteCreateForOnetimeChargesBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public QuoteCreateForOnetimeChargesBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteCreateForOnetimeChargesBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteCreateForOnetimeChargesBuilder charges(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ChargesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteCreateForOnetimeChargesBuilder taxProvidersFields( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteCreateForOnetimeChargesParams build() { - return new QuoteCreateForOnetimeChargesParams(this); - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder servicePeriod(Integer value) { - - formData.put("service_period", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class ChargesParams { - - private final Map formData; - - private ChargesParams(ChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargesBuilder builder() { - return new ChargesBuilder(); - } - - public static final class ChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargesBuilder() {} - - public ChargesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public ChargesBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public ChargesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public ChargesBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public ChargesBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public ChargesBuilder servicePeriod(Integer value) { - - formData.put("service_period", value); - - return this; - } - - public ChargesParams build() { - return new ChargesParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteCreateSubForCustomerQuoteParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteCreateSubForCustomerQuoteParams.java deleted file mode 100644 index d4163fcb..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteCreateSubForCustomerQuoteParams.java +++ /dev/null @@ -1,831 +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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class QuoteCreateSubForCustomerQuoteParams { - - private final Map formData; - - private QuoteCreateSubForCustomerQuoteParams(QuoteCreateSubForCustomerQuoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteCreateSubForCustomerQuoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteCreateSubForCustomerQuoteBuilder builder() { - return new QuoteCreateSubForCustomerQuoteBuilder(); - } - - public static final class QuoteCreateSubForCustomerQuoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteCreateSubForCustomerQuoteBuilder() {} - - public QuoteCreateSubForCustomerQuoteBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public QuoteCreateSubForCustomerQuoteBuilder notes(String value) { - - formData.put("notes", value); - - return this; - } - - public QuoteCreateSubForCustomerQuoteBuilder expiresAt(Timestamp value) { - - formData.put("expires_at", value); - - return this; - } - - public QuoteCreateSubForCustomerQuoteBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public QuoteCreateSubForCustomerQuoteBuilder mandatoryAddonsToRemove(List value) { - - formData.put("mandatory_addons_to_remove", value); - - return this; - } - - public QuoteCreateSubForCustomerQuoteBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public QuoteCreateSubForCustomerQuoteBuilder billingAlignmentMode(BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public QuoteCreateSubForCustomerQuoteBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public QuoteCreateSubForCustomerQuoteBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteCreateSubForCustomerQuoteBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteCreateSubForCustomerQuoteBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteCreateSubForCustomerQuoteBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteCreateSubForCustomerQuoteBuilder eventBasedAddons( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteCreateSubForCustomerQuoteParams build() { - return new QuoteCreateSubForCustomerQuoteParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public SubscriptionBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - public SubscriptionBuilder planUnitPrice(Long value) { - - formData.put("plan_unit_price", value); - - return this; - } - - public SubscriptionBuilder planUnitPriceInDecimal(String value) { - - formData.put("plan_unit_price_in_decimal", value); - - return this; - } - - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AddonsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { - - formData.put("service_period_in_days", value); - - return this; - } - - public EventBasedAddonsBuilder onEvent(OnEvent value) { - - formData.put("on_event", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOn(ChargeOn value) { - - formData.put("charge_on", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - - public enum OnEvent { - SUBSCRIPTION_CREATION("subscription_creation"), - - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** An enum member indicating that OnEvent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OnEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OnEvent fromString(String value) { - if (value == null) return _UNKNOWN; - for (OnEvent enumValue : OnEvent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChargeOn { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOn(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOn fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOn enumValue : ChargeOn.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteCreateSubItemsForCustomerQuoteParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteCreateSubItemsForCustomerQuoteParams.java deleted file mode 100644 index 875024e6..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteCreateSubItemsForCustomerQuoteParams.java +++ /dev/null @@ -1,1452 +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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class QuoteCreateSubItemsForCustomerQuoteParams { - - private final Map formData; - - private QuoteCreateSubItemsForCustomerQuoteParams( - QuoteCreateSubItemsForCustomerQuoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteCreateSubItemsForCustomerQuoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteCreateSubItemsForCustomerQuoteBuilder builder() { - return new QuoteCreateSubItemsForCustomerQuoteBuilder(); - } - - public static final class QuoteCreateSubItemsForCustomerQuoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteCreateSubItemsForCustomerQuoteBuilder() {} - - public QuoteCreateSubItemsForCustomerQuoteBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder notes(String value) { - - formData.put("notes", value); - - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder expiresAt(Timestamp value) { - - formData.put("expires_at", value); - - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder mandatoryItemsToRemove(List value) { - - formData.put("mandatory_items_to_remove", value); - - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder billingAlignmentMode( - BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder billingStartOption(BillingStartOption value) { - - formData.put("billing_start_option", value); - - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder netTermDays(Integer value) { - - formData.put("net_term_days", value); - - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteBuilder coupons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 QuoteCreateSubItemsForCustomerQuoteBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 QuoteCreateSubItemsForCustomerQuoteBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteParams build() { - return new QuoteCreateSubItemsForCustomerQuoteParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum BillingStartOption { - IMMEDIATELY("immediately"), - - ON_SPECIFIC_DATE("on_specific_date"), - - /** An enum member indicating that BillingStartOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - BillingStartOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingStartOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingStartOption enumValue : BillingStartOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public SubscriptionItemsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionItemsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionItemsBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public SubscriptionItemsBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { - - formData.put("charge_on_option", value); - - return this; - } - - public SubscriptionItemsBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionItemsBuilder endDate(Timestamp value) { - - formData.put("end_date", value); - - return this; - } - - public SubscriptionItemsBuilder rampTierId(String value) { - - formData.put("ramp_tier_id", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - - 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"), - - /** 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; - } - } - - 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 enum ChargeOnOption { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOnOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOnOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOnOption enumValue : ChargeOnOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public DiscountsBuilder endDate(Timestamp value) { - - formData.put("end_date", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersBuilder rampTierId(String value) { - - formData.put("ramp_tier_id", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CouponsParams { - - private final Map formData; - - private CouponsParams(CouponsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponsBuilder builder() { - return new CouponsBuilder(); - } - - public static final class CouponsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponsBuilder() {} - - public CouponsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CouponsBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public CouponsBuilder endDate(Timestamp value) { - - formData.put("end_date", value); - - return this; - } - - public CouponsParams build() { - return new CouponsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteDeleteParams.java deleted file mode 100644 index f7285d28..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteDeleteParams.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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class QuoteDeleteParams { - - private final Map formData; - - private QuoteDeleteParams(QuoteDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteDeleteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteDeleteBuilder builder() { - return new QuoteDeleteBuilder(); - } - - public static final class QuoteDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteDeleteBuilder() {} - - public QuoteDeleteBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public QuoteDeleteParams build() { - return new QuoteDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditCreateSubCustomerQuoteForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditCreateSubCustomerQuoteForItemsParams.java deleted file mode 100644 index 2e2025a6..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditCreateSubCustomerQuoteForItemsParams.java +++ /dev/null @@ -1,1450 +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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class QuoteEditCreateSubCustomerQuoteForItemsParams { - - private final Map formData; - - private QuoteEditCreateSubCustomerQuoteForItemsParams( - QuoteEditCreateSubCustomerQuoteForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteEditCreateSubCustomerQuoteForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteEditCreateSubCustomerQuoteForItemsBuilder builder() { - return new QuoteEditCreateSubCustomerQuoteForItemsBuilder(); - } - - public static final class QuoteEditCreateSubCustomerQuoteForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteEditCreateSubCustomerQuoteForItemsBuilder() {} - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder notes(String value) { - - formData.put("notes", value); - - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder expiresAt(Timestamp value) { - - formData.put("expires_at", value); - - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder mandatoryItemsToRemove( - List value) { - - formData.put("mandatory_items_to_remove", value); - - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder billingAlignmentMode( - BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder billingStartOption( - BillingStartOption value) { - - formData.put("billing_start_option", value); - - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder netTermDays(Integer value) { - - formData.put("net_term_days", value); - - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder shippingAddress( - ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder billingAddress( - BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsBuilder coupons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 QuoteEditCreateSubCustomerQuoteForItemsBuilder customField( - String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 QuoteEditCreateSubCustomerQuoteForItemsBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsParams build() { - return new QuoteEditCreateSubCustomerQuoteForItemsParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum BillingStartOption { - IMMEDIATELY("immediately"), - - ON_SPECIFIC_DATE("on_specific_date"), - - /** An enum member indicating that BillingStartOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - BillingStartOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingStartOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingStartOption enumValue : BillingStartOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public SubscriptionItemsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionItemsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionItemsBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public SubscriptionItemsBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { - - formData.put("charge_on_option", value); - - return this; - } - - public SubscriptionItemsBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionItemsBuilder endDate(Timestamp value) { - - formData.put("end_date", value); - - return this; - } - - public SubscriptionItemsBuilder rampTierId(String value) { - - formData.put("ramp_tier_id", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - - 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"), - - /** 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; - } - } - - 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 enum ChargeOnOption { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOnOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOnOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOnOption enumValue : ChargeOnOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public DiscountsBuilder endDate(Timestamp value) { - - formData.put("end_date", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersBuilder rampTierId(String value) { - - formData.put("ramp_tier_id", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CouponsParams { - - private final Map formData; - - private CouponsParams(CouponsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponsBuilder builder() { - return new CouponsBuilder(); - } - - public static final class CouponsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponsBuilder() {} - - public CouponsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CouponsBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public CouponsBuilder endDate(Timestamp value) { - - formData.put("end_date", value); - - return this; - } - - public CouponsParams build() { - return new CouponsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditCreateSubForCustomerQuoteParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditCreateSubForCustomerQuoteParams.java deleted file mode 100644 index 73f17430..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditCreateSubForCustomerQuoteParams.java +++ /dev/null @@ -1,826 +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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class QuoteEditCreateSubForCustomerQuoteParams { - - private final Map formData; - - private QuoteEditCreateSubForCustomerQuoteParams( - QuoteEditCreateSubForCustomerQuoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteEditCreateSubForCustomerQuoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteEditCreateSubForCustomerQuoteBuilder builder() { - return new QuoteEditCreateSubForCustomerQuoteBuilder(); - } - - public static final class QuoteEditCreateSubForCustomerQuoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteEditCreateSubForCustomerQuoteBuilder() {} - - public QuoteEditCreateSubForCustomerQuoteBuilder notes(String value) { - - formData.put("notes", value); - - return this; - } - - public QuoteEditCreateSubForCustomerQuoteBuilder expiresAt(Timestamp value) { - - formData.put("expires_at", value); - - return this; - } - - public QuoteEditCreateSubForCustomerQuoteBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public QuoteEditCreateSubForCustomerQuoteBuilder mandatoryAddonsToRemove(List value) { - - formData.put("mandatory_addons_to_remove", value); - - return this; - } - - public QuoteEditCreateSubForCustomerQuoteBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public QuoteEditCreateSubForCustomerQuoteBuilder billingAlignmentMode( - BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public QuoteEditCreateSubForCustomerQuoteBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public QuoteEditCreateSubForCustomerQuoteBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditCreateSubForCustomerQuoteBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditCreateSubForCustomerQuoteBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditCreateSubForCustomerQuoteBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditCreateSubForCustomerQuoteBuilder eventBasedAddons( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditCreateSubForCustomerQuoteParams build() { - return new QuoteEditCreateSubForCustomerQuoteParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public SubscriptionBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - public SubscriptionBuilder planUnitPrice(Long value) { - - formData.put("plan_unit_price", value); - - return this; - } - - public SubscriptionBuilder planUnitPriceInDecimal(String value) { - - formData.put("plan_unit_price_in_decimal", value); - - return this; - } - - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AddonsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { - - formData.put("service_period_in_days", value); - - return this; - } - - public EventBasedAddonsBuilder onEvent(OnEvent value) { - - formData.put("on_event", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOn(ChargeOn value) { - - formData.put("charge_on", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - - public enum OnEvent { - SUBSCRIPTION_CREATION("subscription_creation"), - - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** An enum member indicating that OnEvent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OnEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OnEvent fromString(String value) { - if (value == null) return _UNKNOWN; - for (OnEvent enumValue : OnEvent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChargeOn { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOn(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOn fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOn enumValue : ChargeOn.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditForChargeItemsAndChargesParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditForChargeItemsAndChargesParams.java deleted file mode 100644 index f1e43f3b..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditForChargeItemsAndChargesParams.java +++ /dev/null @@ -1,961 +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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class QuoteEditForChargeItemsAndChargesParams { - - private final Map formData; - - private QuoteEditForChargeItemsAndChargesParams( - QuoteEditForChargeItemsAndChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteEditForChargeItemsAndChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteEditForChargeItemsAndChargesBuilder builder() { - return new QuoteEditForChargeItemsAndChargesBuilder(); - } - - public static final class QuoteEditForChargeItemsAndChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteEditForChargeItemsAndChargesBuilder() {} - - public QuoteEditForChargeItemsAndChargesBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public QuoteEditForChargeItemsAndChargesBuilder notes(String value) { - - formData.put("notes", value); - - return this; - } - - public QuoteEditForChargeItemsAndChargesBuilder expiresAt(Timestamp value) { - - formData.put("expires_at", value); - - return this; - } - - public QuoteEditForChargeItemsAndChargesBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public QuoteEditForChargeItemsAndChargesBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public QuoteEditForChargeItemsAndChargesBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public QuoteEditForChargeItemsAndChargesBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditForChargeItemsAndChargesBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditForChargeItemsAndChargesBuilder itemPrices(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemPricesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_prices[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditForChargeItemsAndChargesBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditForChargeItemsAndChargesBuilder charges(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ChargesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditForChargeItemsAndChargesBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditForChargeItemsAndChargesBuilder taxProvidersFields( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditForChargeItemsAndChargesParams build() { - return new QuoteEditForChargeItemsAndChargesParams(this); - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class ItemPricesParams { - - private final Map formData; - - private ItemPricesParams(ItemPricesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemPricesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPricesBuilder builder() { - return new ItemPricesBuilder(); - } - - public static final class ItemPricesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemPricesBuilder() {} - - public ItemPricesBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemPricesBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public ItemPricesBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public ItemPricesBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public ItemPricesBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public ItemPricesBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public ItemPricesParams build() { - return new ItemPricesParams(this); - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ChargesParams { - - private final Map formData; - - private ChargesParams(ChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargesBuilder builder() { - return new ChargesBuilder(); - } - - public static final class ChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargesBuilder() {} - - public ChargesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public ChargesBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public ChargesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public ChargesBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public ChargesBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public ChargesBuilder servicePeriod(Integer value) { - - formData.put("service_period", value); - - return this; - } - - public ChargesParams build() { - return new ChargesParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditOneTimeQuoteParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditOneTimeQuoteParams.java deleted file mode 100644 index 2b5b271b..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditOneTimeQuoteParams.java +++ /dev/null @@ -1,540 +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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class QuoteEditOneTimeQuoteParams { - - private final Map formData; - - private QuoteEditOneTimeQuoteParams(QuoteEditOneTimeQuoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteEditOneTimeQuoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteEditOneTimeQuoteBuilder builder() { - return new QuoteEditOneTimeQuoteBuilder(); - } - - public static final class QuoteEditOneTimeQuoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteEditOneTimeQuoteBuilder() {} - - public QuoteEditOneTimeQuoteBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public QuoteEditOneTimeQuoteBuilder notes(String value) { - - formData.put("notes", value); - - return this; - } - - public QuoteEditOneTimeQuoteBuilder expiresAt(Timestamp value) { - - formData.put("expires_at", value); - - return this; - } - - public QuoteEditOneTimeQuoteBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public QuoteEditOneTimeQuoteBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public QuoteEditOneTimeQuoteBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public QuoteEditOneTimeQuoteBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditOneTimeQuoteBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditOneTimeQuoteBuilder charges(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ChargesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditOneTimeQuoteBuilder taxProvidersFields(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditOneTimeQuoteParams build() { - return new QuoteEditOneTimeQuoteParams(this); - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder servicePeriod(Integer value) { - - formData.put("service_period", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class ChargesParams { - - private final Map formData; - - private ChargesParams(ChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargesBuilder builder() { - return new ChargesBuilder(); - } - - public static final class ChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargesBuilder() {} - - public ChargesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public ChargesBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public ChargesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public ChargesBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public ChargesBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public ChargesBuilder servicePeriod(Integer value) { - - formData.put("service_period", value); - - return this; - } - - public ChargesParams build() { - return new ChargesParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditUpdateSubscriptionQuoteForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditUpdateSubscriptionQuoteForItemsParams.java deleted file mode 100644 index d8369d82..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditUpdateSubscriptionQuoteForItemsParams.java +++ /dev/null @@ -1,1626 +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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class QuoteEditUpdateSubscriptionQuoteForItemsParams { - - private final Map formData; - - private QuoteEditUpdateSubscriptionQuoteForItemsParams( - QuoteEditUpdateSubscriptionQuoteForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteEditUpdateSubscriptionQuoteForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteEditUpdateSubscriptionQuoteForItemsBuilder builder() { - return new QuoteEditUpdateSubscriptionQuoteForItemsBuilder(); - } - - public static final class QuoteEditUpdateSubscriptionQuoteForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteEditUpdateSubscriptionQuoteForItemsBuilder() {} - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder notes(String value) { - - formData.put("notes", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder expiresAt(Timestamp value) { - - formData.put("expires_at", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder mandatoryItemsToRemove( - List value) { - - formData.put("mandatory_items_to_remove", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder replaceItemsList(Boolean value) { - - formData.put("replace_items_list", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder reactivateFrom(Timestamp value) { - - formData.put("reactivate_from", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder billingAlignmentMode( - BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder replaceCouponList(Boolean value) { - - formData.put("replace_coupon_list", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder changeOption(ChangeOption value) { - - formData.put("change_option", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder changesScheduledAt(Timestamp value) { - - formData.put("changes_scheduled_at", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder forceTermReset(Boolean value) { - - formData.put("force_term_reset", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder reactivate(Boolean value) { - - formData.put("reactivate", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder netTermDays(Integer value) { - - formData.put("net_term_days", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder billingAddress( - BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder shippingAddress( - ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsBuilder coupons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 QuoteEditUpdateSubscriptionQuoteForItemsBuilder customField( - String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 QuoteEditUpdateSubscriptionQuoteForItemsBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsParams build() { - return new QuoteEditUpdateSubscriptionQuoteForItemsParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChangeOption { - IMMEDIATELY("immediately"), - - SPECIFIC_DATE("specific_date"), - - /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChangeOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChangeOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChangeOption enumValue : ChangeOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - @Deprecated - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder registeredForGst(Boolean value) { - - formData.put("registered_for_gst", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - RENEW_ONCE("renew_once"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public SubscriptionItemsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionItemsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionItemsBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { - - formData.put("charge_on_option", value); - - return this; - } - - public SubscriptionItemsBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public SubscriptionItemsBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionItemsBuilder endDate(Timestamp value) { - - formData.put("end_date", value); - - return this; - } - - public SubscriptionItemsBuilder rampTierId(String value) { - - formData.put("ramp_tier_id", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - - 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"), - - /** 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; - } - } - - public enum ChargeOnOption { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOnOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOnOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOnOption enumValue : ChargeOnOption.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 DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder operationType(OperationType value) { - - formData.put("operation_type", value); - - return this; - } - - public DiscountsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public DiscountsBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public DiscountsBuilder endDate(Timestamp value) { - - formData.put("end_date", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 enum OperationType { - ADD("add"), - - REMOVE("remove"), - - /** An enum member indicating that OperationType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OperationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OperationType fromString(String value) { - if (value == null) return _UNKNOWN; - for (OperationType enumValue : OperationType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersBuilder rampTierId(String value) { - - formData.put("ramp_tier_id", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CouponsParams { - - private final Map formData; - - private CouponsParams(CouponsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponsBuilder builder() { - return new CouponsBuilder(); - } - - public static final class CouponsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponsBuilder() {} - - public CouponsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CouponsBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public CouponsBuilder endDate(Timestamp value) { - - formData.put("end_date", value); - - return this; - } - - public CouponsParams build() { - return new CouponsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditUpdateSubscriptionQuoteParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditUpdateSubscriptionQuoteParams.java deleted file mode 100644 index 6b9dd702..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteEditUpdateSubscriptionQuoteParams.java +++ /dev/null @@ -1,1166 +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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class QuoteEditUpdateSubscriptionQuoteParams { - - private final Map formData; - - private QuoteEditUpdateSubscriptionQuoteParams(QuoteEditUpdateSubscriptionQuoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteEditUpdateSubscriptionQuoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteEditUpdateSubscriptionQuoteBuilder builder() { - return new QuoteEditUpdateSubscriptionQuoteBuilder(); - } - - public static final class QuoteEditUpdateSubscriptionQuoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteEditUpdateSubscriptionQuoteBuilder() {} - - public QuoteEditUpdateSubscriptionQuoteBuilder notes(String value) { - - formData.put("notes", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder expiresAt(Timestamp value) { - - formData.put("expires_at", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder replaceAddonList(Boolean value) { - - formData.put("replace_addon_list", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder mandatoryAddonsToRemove(List value) { - - formData.put("mandatory_addons_to_remove", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder reactivateFrom(Timestamp value) { - - formData.put("reactivate_from", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder billingAlignmentMode( - BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder replaceCouponList(Boolean value) { - - formData.put("replace_coupon_list", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder changeOption(ChangeOption value) { - - formData.put("change_option", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder changesScheduledAt(Timestamp value) { - - formData.put("changes_scheduled_at", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder forceTermReset(Boolean value) { - - formData.put("force_term_reset", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder reactivate(Boolean value) { - - formData.put("reactivate", value); - - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteBuilder eventBasedAddons( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteEditUpdateSubscriptionQuoteParams build() { - return new QuoteEditUpdateSubscriptionQuoteParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChangeOption { - IMMEDIATELY("immediately"), - - SPECIFIC_DATE("specific_date"), - - /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChangeOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChangeOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChangeOption enumValue : ChangeOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionBuilder planUnitPrice(Long value) { - - formData.put("plan_unit_price", value); - - return this; - } - - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - public SubscriptionBuilder planUnitPriceInDecimal(String value) { - - formData.put("plan_unit_price_in_decimal", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder registeredForGst(Boolean value) { - - formData.put("registered_for_gst", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - RENEW_ONCE("renew_once"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { - - formData.put("service_period_in_days", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOn(ChargeOn value) { - - formData.put("charge_on", value); - - return this; - } - - public EventBasedAddonsBuilder onEvent(OnEvent value) { - - formData.put("on_event", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - - public enum ChargeOn { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOn(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOn fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOn enumValue : ChargeOn.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OnEvent { - SUBSCRIPTION_CREATION("subscription_creation"), - - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** An enum member indicating that OnEvent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OnEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OnEvent fromString(String value) { - if (value == null) return _UNKNOWN; - for (OnEvent enumValue : OnEvent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteExtendExpiryDateParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteExtendExpiryDateParams.java deleted file mode 100644 index 60dabf1d..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteExtendExpiryDateParams.java +++ /dev/null @@ -1,51 +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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class QuoteExtendExpiryDateParams { - - private final Map formData; - - private QuoteExtendExpiryDateParams(QuoteExtendExpiryDateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteExtendExpiryDateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteExtendExpiryDateBuilder builder() { - return new QuoteExtendExpiryDateBuilder(); - } - - public static final class QuoteExtendExpiryDateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteExtendExpiryDateBuilder() {} - - public QuoteExtendExpiryDateBuilder validTill(Timestamp value) { - - formData.put("valid_till", value); - - return this; - } - - public QuoteExtendExpiryDateParams build() { - return new QuoteExtendExpiryDateParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuotePdfParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuotePdfParams.java deleted file mode 100644 index 4a3d778f..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuotePdfParams.java +++ /dev/null @@ -1,85 +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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class QuotePdfParams { - - private final Map formData; - - private QuotePdfParams(QuotePdfBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuotePdfParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuotePdfBuilder builder() { - return new QuotePdfBuilder(); - } - - public static final class QuotePdfBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuotePdfBuilder() {} - - public QuotePdfBuilder consolidatedView(Boolean value) { - - formData.put("consolidated_view", value); - - return this; - } - - public QuotePdfBuilder dispositionType(DispositionType value) { - - formData.put("disposition_type", value); - - return this; - } - - public QuotePdfParams build() { - return new QuotePdfParams(this); - } - } - - public enum DispositionType { - ATTACHMENT("attachment"), - - INLINE("inline"), - - /** An enum member indicating that DispositionType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - DispositionType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static DispositionType fromString(String value) { - if (value == null) return _UNKNOWN; - for (DispositionType enumValue : DispositionType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteQuoteLineGroupsForQuoteParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteQuoteLineGroupsForQuoteParams.java deleted file mode 100644 index 5e9ba0cc..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteQuoteLineGroupsForQuoteParams.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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class QuoteQuoteLineGroupsForQuoteParams { - - private final Map queryParams; - - private QuoteQuoteLineGroupsForQuoteParams(QuoteQuoteLineGroupsForQuoteBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public QuoteQuoteLineGroupsForQuoteBuilder toBuilder() { - QuoteQuoteLineGroupsForQuoteBuilder builder = new QuoteQuoteLineGroupsForQuoteBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for QuoteQuoteLineGroupsForQuoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteQuoteLineGroupsForQuoteBuilder builder() { - return new QuoteQuoteLineGroupsForQuoteBuilder(); - } - - public static final class QuoteQuoteLineGroupsForQuoteBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private QuoteQuoteLineGroupsForQuoteBuilder() {} - - public QuoteQuoteLineGroupsForQuoteBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public QuoteQuoteLineGroupsForQuoteBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public QuoteQuoteLineGroupsForQuoteParams build() { - return new QuoteQuoteLineGroupsForQuoteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteUpdateSubscriptionQuoteForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteUpdateSubscriptionQuoteForItemsParams.java deleted file mode 100644 index 424db7ed..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteUpdateSubscriptionQuoteForItemsParams.java +++ /dev/null @@ -1,1637 +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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class QuoteUpdateSubscriptionQuoteForItemsParams { - - private final Map formData; - - private QuoteUpdateSubscriptionQuoteForItemsParams( - QuoteUpdateSubscriptionQuoteForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteUpdateSubscriptionQuoteForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteUpdateSubscriptionQuoteForItemsBuilder builder() { - return new QuoteUpdateSubscriptionQuoteForItemsBuilder(); - } - - public static final class QuoteUpdateSubscriptionQuoteForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteUpdateSubscriptionQuoteForItemsBuilder() {} - - public QuoteUpdateSubscriptionQuoteForItemsBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder notes(String value) { - - formData.put("notes", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder expiresAt(Timestamp value) { - - formData.put("expires_at", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder mandatoryItemsToRemove(List value) { - - formData.put("mandatory_items_to_remove", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder replaceItemsList(Boolean value) { - - formData.put("replace_items_list", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder reactivateFrom(Timestamp value) { - - formData.put("reactivate_from", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder billingAlignmentMode( - BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder replaceCouponList(Boolean value) { - - formData.put("replace_coupon_list", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder changeOption(ChangeOption value) { - - formData.put("change_option", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder changesScheduledAt(Timestamp value) { - - formData.put("changes_scheduled_at", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder forceTermReset(Boolean value) { - - formData.put("force_term_reset", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder reactivate(Boolean value) { - - formData.put("reactivate", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder netTermDays(Integer value) { - - formData.put("net_term_days", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder shippingAddress( - ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsBuilder coupons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 QuoteUpdateSubscriptionQuoteForItemsBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 QuoteUpdateSubscriptionQuoteForItemsBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsParams build() { - return new QuoteUpdateSubscriptionQuoteForItemsParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChangeOption { - IMMEDIATELY("immediately"), - - SPECIFIC_DATE("specific_date"), - - /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChangeOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChangeOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChangeOption enumValue : ChangeOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder registeredForGst(Boolean value) { - - formData.put("registered_for_gst", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - RENEW_ONCE("renew_once"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public SubscriptionItemsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionItemsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionItemsBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { - - formData.put("charge_on_option", value); - - return this; - } - - public SubscriptionItemsBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public SubscriptionItemsBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionItemsBuilder endDate(Timestamp value) { - - formData.put("end_date", value); - - return this; - } - - public SubscriptionItemsBuilder rampTierId(String value) { - - formData.put("ramp_tier_id", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - - 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"), - - /** 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; - } - } - - public enum ChargeOnOption { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOnOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOnOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOnOption enumValue : ChargeOnOption.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 DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder operationType(OperationType value) { - - formData.put("operation_type", value); - - return this; - } - - public DiscountsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public DiscountsBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public DiscountsBuilder endDate(Timestamp value) { - - formData.put("end_date", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 enum OperationType { - ADD("add"), - - REMOVE("remove"), - - /** An enum member indicating that OperationType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OperationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OperationType fromString(String value) { - if (value == null) return _UNKNOWN; - for (OperationType enumValue : OperationType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersBuilder rampTierId(String value) { - - formData.put("ramp_tier_id", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CouponsParams { - - private final Map formData; - - private CouponsParams(CouponsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponsBuilder builder() { - return new CouponsBuilder(); - } - - public static final class CouponsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponsBuilder() {} - - public CouponsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CouponsBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public CouponsBuilder endDate(Timestamp value) { - - formData.put("end_date", value); - - return this; - } - - public CouponsParams build() { - return new CouponsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteUpdateSubscriptionQuoteParams.java b/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteUpdateSubscriptionQuoteParams.java deleted file mode 100644 index df2a134e..00000000 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteUpdateSubscriptionQuoteParams.java +++ /dev/null @@ -1,1179 +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.core.models.quote.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class QuoteUpdateSubscriptionQuoteParams { - - private final Map formData; - - private QuoteUpdateSubscriptionQuoteParams(QuoteUpdateSubscriptionQuoteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for QuoteUpdateSubscriptionQuoteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static QuoteUpdateSubscriptionQuoteBuilder builder() { - return new QuoteUpdateSubscriptionQuoteBuilder(); - } - - public static final class QuoteUpdateSubscriptionQuoteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private QuoteUpdateSubscriptionQuoteBuilder() {} - - public QuoteUpdateSubscriptionQuoteBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder notes(String value) { - - formData.put("notes", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder expiresAt(Timestamp value) { - - formData.put("expires_at", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder replaceAddonList(Boolean value) { - - formData.put("replace_addon_list", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder mandatoryAddonsToRemove(List value) { - - formData.put("mandatory_addons_to_remove", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder reactivateFrom(Timestamp value) { - - formData.put("reactivate_from", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder billingAlignmentMode(BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder replaceCouponList(Boolean value) { - - formData.put("replace_coupon_list", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder changeOption(ChangeOption value) { - - formData.put("change_option", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder changesScheduledAt(Timestamp value) { - - formData.put("changes_scheduled_at", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder forceTermReset(Boolean value) { - - formData.put("force_term_reset", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder reactivate(Boolean value) { - - formData.put("reactivate", value); - - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder subscription(SubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteBuilder eventBasedAddons( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public QuoteUpdateSubscriptionQuoteParams build() { - return new QuoteUpdateSubscriptionQuoteParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChangeOption { - IMMEDIATELY("immediately"), - - SPECIFIC_DATE("specific_date"), - - /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChangeOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChangeOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChangeOption enumValue : ChangeOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionParams { - - private final Map formData; - - private SubscriptionParams(SubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionBuilder builder() { - return new SubscriptionBuilder(); - } - - public static final class SubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionBuilder() {} - - public SubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionBuilder planUnitPrice(Long value) { - - formData.put("plan_unit_price", value); - - return this; - } - - public SubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - public SubscriptionBuilder planUnitPriceInDecimal(String value) { - - formData.put("plan_unit_price_in_decimal", value); - - return this; - } - - public SubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - @Deprecated - public SubscriptionBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionParams build() { - return new SubscriptionParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder registeredForGst(Boolean value) { - - formData.put("registered_for_gst", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - RENEW_ONCE("renew_once"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { - - formData.put("service_period_in_days", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOn(ChargeOn value) { - - formData.put("charge_on", value); - - return this; - } - - public EventBasedAddonsBuilder onEvent(OnEvent value) { - - formData.put("on_event", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - - public enum ChargeOn { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOn(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOn fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOn enumValue : ChargeOn.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OnEvent { - SUBSCRIPTION_CREATION("subscription_creation"), - - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** An enum member indicating that OnEvent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OnEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OnEvent fromString(String value) { - if (value == null) return _UNKNOWN; - for (OnEvent enumValue : OnEvent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/ramp/params/RampCreateForSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/ramp/params/RampCreateForSubscriptionParams.java deleted file mode 100644 index 71644a9d..00000000 --- a/src/main/java/com/chargebee/v4/core/models/ramp/params/RampCreateForSubscriptionParams.java +++ /dev/null @@ -1,917 +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.core.models.ramp.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class RampCreateForSubscriptionParams { - - private final Map formData; - - private RampCreateForSubscriptionParams(RampCreateForSubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RampCreateForSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RampCreateForSubscriptionBuilder builder() { - return new RampCreateForSubscriptionBuilder(); - } - - public static final class RampCreateForSubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RampCreateForSubscriptionBuilder() {} - - public RampCreateForSubscriptionBuilder effectiveFrom(Timestamp value) { - - formData.put("effective_from", value); - - return this; - } - - public RampCreateForSubscriptionBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public RampCreateForSubscriptionBuilder couponsToRemove(List value) { - - formData.put("coupons_to_remove", value); - - return this; - } - - public RampCreateForSubscriptionBuilder discountsToRemove(List value) { - - formData.put("discounts_to_remove", value); - - return this; - } - - public RampCreateForSubscriptionBuilder itemsToRemove(List value) { - - formData.put("items_to_remove", value); - - return this; - } - - public RampCreateForSubscriptionBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public RampCreateForSubscriptionBuilder itemsToAdd(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemsToAddParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "items_to_add[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public RampCreateForSubscriptionBuilder itemsToUpdate(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemsToUpdateParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "items_to_update[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public RampCreateForSubscriptionBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public RampCreateForSubscriptionBuilder couponsToAdd(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponsToAddParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "coupons_to_add[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public RampCreateForSubscriptionBuilder discountsToAdd(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsToAddParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts_to_add[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public RampCreateForSubscriptionParams build() { - return new RampCreateForSubscriptionParams(this); - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermBuilder renewalBillingCycles(Integer value) { - - formData.put("renewal_billing_cycles", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - RENEW_ONCE("renew_once"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemsToAddParams { - - private final Map formData; - - private ItemsToAddParams(ItemsToAddBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemsToAddParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemsToAddBuilder builder() { - return new ItemsToAddBuilder(); - } - - public static final class ItemsToAddBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemsToAddBuilder() {} - - public ItemsToAddBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemsToAddBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public ItemsToAddBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public ItemsToAddBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public ItemsToAddBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public ItemsToAddBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public ItemsToAddBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public ItemsToAddBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public ItemsToAddBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public ItemsToAddBuilder chargeOnOption(ChargeOnOption value) { - - formData.put("charge_on_option", value); - - return this; - } - - public ItemsToAddParams build() { - return new ItemsToAddParams(this); - } - } - - public enum ChargeOnEvent { - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** 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; - } - } - - public enum ChargeOnOption { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOnOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOnOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOnOption enumValue : ChargeOnOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemsToUpdateParams { - - private final Map formData; - - private ItemsToUpdateParams(ItemsToUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemsToUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemsToUpdateBuilder builder() { - return new ItemsToUpdateBuilder(); - } - - public static final class ItemsToUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemsToUpdateBuilder() {} - - public ItemsToUpdateBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemsToUpdateBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public ItemsToUpdateBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public ItemsToUpdateBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public ItemsToUpdateBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public ItemsToUpdateBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public ItemsToUpdateBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public ItemsToUpdateBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public ItemsToUpdateBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public ItemsToUpdateBuilder chargeOnOption(ChargeOnOption value) { - - formData.put("charge_on_option", value); - - return this; - } - - public ItemsToUpdateParams build() { - return new ItemsToUpdateParams(this); - } - } - - public enum ChargeOnEvent { - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** 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; - } - } - - public enum ChargeOnOption { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOnOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOnOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOnOption enumValue : ChargeOnOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CouponsToAddParams { - - private final Map formData; - - private CouponsToAddParams(CouponsToAddBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponsToAddParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponsToAddBuilder builder() { - return new CouponsToAddBuilder(); - } - - public static final class CouponsToAddBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponsToAddBuilder() {} - - public CouponsToAddBuilder couponId(String value) { - - formData.put("coupon_id", value); - - return this; - } - - public CouponsToAddBuilder applyTill(Timestamp value) { - - formData.put("apply_till", value); - - return this; - } - - public CouponsToAddParams build() { - return new CouponsToAddParams(this); - } - } - } - - public static final class DiscountsToAddParams { - - private final Map formData; - - private DiscountsToAddParams(DiscountsToAddBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsToAddParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsToAddBuilder builder() { - return new DiscountsToAddBuilder(); - } - - public static final class DiscountsToAddBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsToAddBuilder() {} - - public DiscountsToAddBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsToAddBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsToAddBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsToAddBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsToAddBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsToAddBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsToAddBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsToAddBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsToAddParams build() { - return new DiscountsToAddParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/ramp/params/RampDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/ramp/params/RampDeleteParams.java deleted file mode 100644 index c4f6c757..00000000 --- a/src/main/java/com/chargebee/v4/core/models/ramp/params/RampDeleteParams.java +++ /dev/null @@ -1,43 +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.core.models.ramp.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class RampDeleteParams { - - private final Map formData; - - private RampDeleteParams(RampDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RampDeleteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RampDeleteBuilder builder() { - return new RampDeleteBuilder(); - } - - public static final class RampDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RampDeleteBuilder() {} - - public RampDeleteParams build() { - return new RampDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/ramp/params/RampUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/ramp/params/RampUpdateParams.java deleted file mode 100644 index 0cff6dd8..00000000 --- a/src/main/java/com/chargebee/v4/core/models/ramp/params/RampUpdateParams.java +++ /dev/null @@ -1,917 +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.core.models.ramp.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class RampUpdateParams { - - private final Map formData; - - private RampUpdateParams(RampUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RampUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RampUpdateBuilder builder() { - return new RampUpdateBuilder(); - } - - public static final class RampUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RampUpdateBuilder() {} - - public RampUpdateBuilder effectiveFrom(Timestamp value) { - - formData.put("effective_from", value); - - return this; - } - - public RampUpdateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public RampUpdateBuilder couponsToRemove(List value) { - - formData.put("coupons_to_remove", value); - - return this; - } - - public RampUpdateBuilder discountsToRemove(List value) { - - formData.put("discounts_to_remove", value); - - return this; - } - - public RampUpdateBuilder itemsToRemove(List value) { - - formData.put("items_to_remove", value); - - return this; - } - - public RampUpdateBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public RampUpdateBuilder itemsToAdd(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemsToAddParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "items_to_add[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public RampUpdateBuilder itemsToUpdate(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemsToUpdateParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "items_to_update[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public RampUpdateBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public RampUpdateBuilder couponsToAdd(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponsToAddParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "coupons_to_add[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public RampUpdateBuilder discountsToAdd(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsToAddParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts_to_add[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public RampUpdateParams build() { - return new RampUpdateParams(this); - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermBuilder renewalBillingCycles(Integer value) { - - formData.put("renewal_billing_cycles", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - RENEW_ONCE("renew_once"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemsToAddParams { - - private final Map formData; - - private ItemsToAddParams(ItemsToAddBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemsToAddParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemsToAddBuilder builder() { - return new ItemsToAddBuilder(); - } - - public static final class ItemsToAddBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemsToAddBuilder() {} - - public ItemsToAddBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemsToAddBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public ItemsToAddBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public ItemsToAddBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public ItemsToAddBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public ItemsToAddBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public ItemsToAddBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public ItemsToAddBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public ItemsToAddBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public ItemsToAddBuilder chargeOnOption(ChargeOnOption value) { - - formData.put("charge_on_option", value); - - return this; - } - - public ItemsToAddParams build() { - return new ItemsToAddParams(this); - } - } - - public enum ChargeOnEvent { - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** 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; - } - } - - public enum ChargeOnOption { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOnOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOnOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOnOption enumValue : ChargeOnOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemsToUpdateParams { - - private final Map formData; - - private ItemsToUpdateParams(ItemsToUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemsToUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemsToUpdateBuilder builder() { - return new ItemsToUpdateBuilder(); - } - - public static final class ItemsToUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemsToUpdateBuilder() {} - - public ItemsToUpdateBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemsToUpdateBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public ItemsToUpdateBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public ItemsToUpdateBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public ItemsToUpdateBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public ItemsToUpdateBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public ItemsToUpdateBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public ItemsToUpdateBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public ItemsToUpdateBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public ItemsToUpdateBuilder chargeOnOption(ChargeOnOption value) { - - formData.put("charge_on_option", value); - - return this; - } - - public ItemsToUpdateParams build() { - return new ItemsToUpdateParams(this); - } - } - - public enum ChargeOnEvent { - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** 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; - } - } - - public enum ChargeOnOption { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOnOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOnOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOnOption enumValue : ChargeOnOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CouponsToAddParams { - - private final Map formData; - - private CouponsToAddParams(CouponsToAddBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponsToAddParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponsToAddBuilder builder() { - return new CouponsToAddBuilder(); - } - - public static final class CouponsToAddBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponsToAddBuilder() {} - - public CouponsToAddBuilder couponId(String value) { - - formData.put("coupon_id", value); - - return this; - } - - public CouponsToAddBuilder applyTill(Timestamp value) { - - formData.put("apply_till", value); - - return this; - } - - public CouponsToAddParams build() { - return new CouponsToAddParams(this); - } - } - } - - public static final class DiscountsToAddParams { - - private final Map formData; - - private DiscountsToAddParams(DiscountsToAddBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsToAddParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsToAddBuilder builder() { - return new DiscountsToAddBuilder(); - } - - public static final class DiscountsToAddBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsToAddBuilder() {} - - public DiscountsToAddBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsToAddBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsToAddBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsToAddBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsToAddBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsToAddBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsToAddBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsToAddBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsToAddParams build() { - return new DiscountsToAddParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/recordedPurchase/params/RecordedPurchaseCreateParams.java b/src/main/java/com/chargebee/v4/core/models/recordedPurchase/params/RecordedPurchaseCreateParams.java deleted file mode 100644 index 9b70f3c5..00000000 --- a/src/main/java/com/chargebee/v4/core/models/recordedPurchase/params/RecordedPurchaseCreateParams.java +++ /dev/null @@ -1,271 +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.core.models.recordedPurchase.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class RecordedPurchaseCreateParams { - - private final Map formData; - - private RecordedPurchaseCreateParams(RecordedPurchaseCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for RecordedPurchaseCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static RecordedPurchaseCreateBuilder builder() { - return new RecordedPurchaseCreateBuilder(); - } - - public static final class RecordedPurchaseCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private RecordedPurchaseCreateBuilder() {} - - public RecordedPurchaseCreateBuilder appId(String value) { - - formData.put("app_id", value); - - return this; - } - - public RecordedPurchaseCreateBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public RecordedPurchaseCreateBuilder appleAppStore(AppleAppStoreParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "apple_app_store[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public RecordedPurchaseCreateBuilder googlePlayStore(GooglePlayStoreParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "google_play_store[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public RecordedPurchaseCreateBuilder omnichannelSubscription( - OmnichannelSubscriptionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "omnichannel_subscription[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public RecordedPurchaseCreateParams build() { - return new RecordedPurchaseCreateParams(this); - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - } - - public static final class AppleAppStoreParams { - - private final Map formData; - - private AppleAppStoreParams(AppleAppStoreBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AppleAppStoreParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AppleAppStoreBuilder builder() { - return new AppleAppStoreBuilder(); - } - - public static final class AppleAppStoreBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AppleAppStoreBuilder() {} - - public AppleAppStoreBuilder transactionId(String value) { - - formData.put("transaction_id", value); - - return this; - } - - public AppleAppStoreBuilder receipt(String value) { - - formData.put("receipt", value); - - return this; - } - - public AppleAppStoreBuilder productId(String value) { - - formData.put("product_id", value); - - return this; - } - - public AppleAppStoreParams build() { - return new AppleAppStoreParams(this); - } - } - } - - public static final class GooglePlayStoreParams { - - private final Map formData; - - private GooglePlayStoreParams(GooglePlayStoreBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for GooglePlayStoreParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static GooglePlayStoreBuilder builder() { - return new GooglePlayStoreBuilder(); - } - - public static final class GooglePlayStoreBuilder { - private final Map formData = new LinkedHashMap<>(); - - private GooglePlayStoreBuilder() {} - - public GooglePlayStoreBuilder purchaseToken(String value) { - - formData.put("purchase_token", value); - - return this; - } - - public GooglePlayStoreBuilder productId(String value) { - - formData.put("product_id", value); - - return this; - } - - public GooglePlayStoreBuilder orderId(String value) { - - formData.put("order_id", value); - - return this; - } - - public GooglePlayStoreParams build() { - return new GooglePlayStoreParams(this); - } - } - } - - public static final class OmnichannelSubscriptionParams { - - private final Map formData; - - private OmnichannelSubscriptionParams(OmnichannelSubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OmnichannelSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OmnichannelSubscriptionBuilder builder() { - return new OmnichannelSubscriptionBuilder(); - } - - public static final class OmnichannelSubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OmnichannelSubscriptionBuilder() {} - - public OmnichannelSubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public OmnichannelSubscriptionParams build() { - return new OmnichannelSubscriptionParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionAddChargeAtTermEndParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionAddChargeAtTermEndParams.java deleted file mode 100644 index ef47bca9..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionAddChargeAtTermEndParams.java +++ /dev/null @@ -1,132 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class SubscriptionAddChargeAtTermEndParams { - - private final Map formData; - - private SubscriptionAddChargeAtTermEndParams(SubscriptionAddChargeAtTermEndBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionAddChargeAtTermEndParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionAddChargeAtTermEndBuilder builder() { - return new SubscriptionAddChargeAtTermEndBuilder(); - } - - public static final class SubscriptionAddChargeAtTermEndBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionAddChargeAtTermEndBuilder() {} - - public SubscriptionAddChargeAtTermEndBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public SubscriptionAddChargeAtTermEndBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public SubscriptionAddChargeAtTermEndBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public SubscriptionAddChargeAtTermEndBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public SubscriptionAddChargeAtTermEndBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public SubscriptionAddChargeAtTermEndBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public SubscriptionAddChargeAtTermEndBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public SubscriptionAddChargeAtTermEndBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public SubscriptionAddChargeAtTermEndParams build() { - return new SubscriptionAddChargeAtTermEndParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionCancelForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionCancelForItemsParams.java deleted file mode 100644 index bada6b1e..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionCancelForItemsParams.java +++ /dev/null @@ -1,403 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class SubscriptionCancelForItemsParams { - - private final Map formData; - - private SubscriptionCancelForItemsParams(SubscriptionCancelForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionCancelForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionCancelForItemsBuilder builder() { - return new SubscriptionCancelForItemsBuilder(); - } - - public static final class SubscriptionCancelForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionCancelForItemsBuilder() {} - - public SubscriptionCancelForItemsBuilder cancelOption(CancelOption value) { - - formData.put("cancel_option", value); - - return this; - } - - public SubscriptionCancelForItemsBuilder endOfTerm(Boolean value) { - - formData.put("end_of_term", value); - - return this; - } - - public SubscriptionCancelForItemsBuilder cancelAt(Timestamp value) { - - formData.put("cancel_at", value); - - return this; - } - - public SubscriptionCancelForItemsBuilder creditOptionForCurrentTermCharges( - CreditOptionForCurrentTermCharges value) { - - formData.put("credit_option_for_current_term_charges", value); - - return this; - } - - public SubscriptionCancelForItemsBuilder unbilledChargesOption(UnbilledChargesOption value) { - - formData.put("unbilled_charges_option", value); - - return this; - } - - public SubscriptionCancelForItemsBuilder accountReceivablesHandling( - AccountReceivablesHandling value) { - - formData.put("account_receivables_handling", value); - - return this; - } - - public SubscriptionCancelForItemsBuilder refundableCreditsHandling( - RefundableCreditsHandling value) { - - formData.put("refundable_credits_handling", value); - - return this; - } - - public SubscriptionCancelForItemsBuilder contractTermCancelOption( - ContractTermCancelOption value) { - - formData.put("contract_term_cancel_option", value); - - return this; - } - - public SubscriptionCancelForItemsBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public SubscriptionCancelForItemsBuilder cancelReasonCode(String value) { - - formData.put("cancel_reason_code", value); - - return this; - } - - public SubscriptionCancelForItemsBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionCancelForItemsParams build() { - return new SubscriptionCancelForItemsParams(this); - } - } - - public enum CancelOption { - IMMEDIATELY("immediately"), - - END_OF_TERM("end_of_term"), - - SPECIFIC_DATE("specific_date"), - - END_OF_BILLING_TERM("end_of_billing_term"), - - /** An enum member indicating that CancelOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CancelOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CancelOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (CancelOption enumValue : CancelOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum CreditOptionForCurrentTermCharges { - NONE("none"), - - PRORATE("prorate"), - - FULL("full"), - - /** - * An enum member indicating that CreditOptionForCurrentTermCharges was instantiated with an - * unknown value. - */ - _UNKNOWN(null); - private final String value; - - CreditOptionForCurrentTermCharges(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CreditOptionForCurrentTermCharges fromString(String value) { - if (value == null) return _UNKNOWN; - for (CreditOptionForCurrentTermCharges enumValue : - CreditOptionForCurrentTermCharges.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum UnbilledChargesOption { - INVOICE("invoice"), - - DELETE("delete"), - - /** - * An enum member indicating that UnbilledChargesOption was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - UnbilledChargesOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static UnbilledChargesOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (UnbilledChargesOption enumValue : UnbilledChargesOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AccountReceivablesHandling { - NO_ACTION("no_action"), - - SCHEDULE_PAYMENT_COLLECTION("schedule_payment_collection"), - - WRITE_OFF("write_off"), - - /** - * An enum member indicating that AccountReceivablesHandling was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - AccountReceivablesHandling(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AccountReceivablesHandling fromString(String value) { - if (value == null) return _UNKNOWN; - for (AccountReceivablesHandling enumValue : AccountReceivablesHandling.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum RefundableCreditsHandling { - NO_ACTION("no_action"), - - SCHEDULE_REFUND("schedule_refund"), - - /** - * An enum member indicating that RefundableCreditsHandling was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - RefundableCreditsHandling(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static RefundableCreditsHandling fromString(String value) { - if (value == null) return _UNKNOWN; - for (RefundableCreditsHandling enumValue : RefundableCreditsHandling.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ContractTermCancelOption { - TERMINATE_IMMEDIATELY("terminate_immediately"), - - END_OF_CONTRACT_TERM("end_of_contract_term"), - - SPECIFIC_DATE("specific_date"), - - END_OF_SUBSCRIPTION_BILLING_TERM("end_of_subscription_billing_term"), - - /** - * An enum member indicating that ContractTermCancelOption was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - ContractTermCancelOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ContractTermCancelOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ContractTermCancelOption enumValue : ContractTermCancelOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public SubscriptionItemsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionCancelParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionCancelParams.java deleted file mode 100644 index 5793d079..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionCancelParams.java +++ /dev/null @@ -1,385 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class SubscriptionCancelParams { - - private final Map formData; - - private SubscriptionCancelParams(SubscriptionCancelBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionCancelParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionCancelBuilder builder() { - return new SubscriptionCancelBuilder(); - } - - public static final class SubscriptionCancelBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionCancelBuilder() {} - - public SubscriptionCancelBuilder cancelOption(CancelOption value) { - - formData.put("cancel_option", value); - - return this; - } - - public SubscriptionCancelBuilder endOfTerm(Boolean value) { - - formData.put("end_of_term", value); - - return this; - } - - public SubscriptionCancelBuilder cancelAt(Timestamp value) { - - formData.put("cancel_at", value); - - return this; - } - - public SubscriptionCancelBuilder creditOptionForCurrentTermCharges( - CreditOptionForCurrentTermCharges value) { - - formData.put("credit_option_for_current_term_charges", value); - - return this; - } - - public SubscriptionCancelBuilder unbilledChargesOption(UnbilledChargesOption value) { - - formData.put("unbilled_charges_option", value); - - return this; - } - - public SubscriptionCancelBuilder accountReceivablesHandling(AccountReceivablesHandling value) { - - formData.put("account_receivables_handling", value); - - return this; - } - - public SubscriptionCancelBuilder refundableCreditsHandling(RefundableCreditsHandling value) { - - formData.put("refundable_credits_handling", value); - - return this; - } - - public SubscriptionCancelBuilder contractTermCancelOption(ContractTermCancelOption value) { - - formData.put("contract_term_cancel_option", value); - - return this; - } - - public SubscriptionCancelBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public SubscriptionCancelBuilder cancelReasonCode(String value) { - - formData.put("cancel_reason_code", value); - - return this; - } - - public SubscriptionCancelBuilder eventBasedAddons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionCancelParams build() { - return new SubscriptionCancelParams(this); - } - } - - public enum CancelOption { - IMMEDIATELY("immediately"), - - END_OF_TERM("end_of_term"), - - SPECIFIC_DATE("specific_date"), - - END_OF_BILLING_TERM("end_of_billing_term"), - - /** An enum member indicating that CancelOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CancelOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CancelOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (CancelOption enumValue : CancelOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum CreditOptionForCurrentTermCharges { - NONE("none"), - - PRORATE("prorate"), - - FULL("full"), - - /** - * An enum member indicating that CreditOptionForCurrentTermCharges was instantiated with an - * unknown value. - */ - _UNKNOWN(null); - private final String value; - - CreditOptionForCurrentTermCharges(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CreditOptionForCurrentTermCharges fromString(String value) { - if (value == null) return _UNKNOWN; - for (CreditOptionForCurrentTermCharges enumValue : - CreditOptionForCurrentTermCharges.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum UnbilledChargesOption { - INVOICE("invoice"), - - DELETE("delete"), - - /** - * An enum member indicating that UnbilledChargesOption was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - UnbilledChargesOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static UnbilledChargesOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (UnbilledChargesOption enumValue : UnbilledChargesOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AccountReceivablesHandling { - NO_ACTION("no_action"), - - SCHEDULE_PAYMENT_COLLECTION("schedule_payment_collection"), - - WRITE_OFF("write_off"), - - /** - * An enum member indicating that AccountReceivablesHandling was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - AccountReceivablesHandling(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AccountReceivablesHandling fromString(String value) { - if (value == null) return _UNKNOWN; - for (AccountReceivablesHandling enumValue : AccountReceivablesHandling.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum RefundableCreditsHandling { - NO_ACTION("no_action"), - - SCHEDULE_REFUND("schedule_refund"), - - /** - * An enum member indicating that RefundableCreditsHandling was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - RefundableCreditsHandling(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static RefundableCreditsHandling fromString(String value) { - if (value == null) return _UNKNOWN; - for (RefundableCreditsHandling enumValue : RefundableCreditsHandling.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ContractTermCancelOption { - TERMINATE_IMMEDIATELY("terminate_immediately"), - - END_OF_CONTRACT_TERM("end_of_contract_term"), - - SPECIFIC_DATE("specific_date"), - - END_OF_SUBSCRIPTION_BILLING_TERM("end_of_subscription_billing_term"), - - /** - * An enum member indicating that ContractTermCancelOption was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - ContractTermCancelOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ContractTermCancelOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ContractTermCancelOption enumValue : ContractTermCancelOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { - - formData.put("service_period_in_days", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionChangeTermEndParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionChangeTermEndParams.java deleted file mode 100644 index e0b06428..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionChangeTermEndParams.java +++ /dev/null @@ -1,65 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class SubscriptionChangeTermEndParams { - - private final Map formData; - - private SubscriptionChangeTermEndParams(SubscriptionChangeTermEndBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionChangeTermEndParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionChangeTermEndBuilder builder() { - return new SubscriptionChangeTermEndBuilder(); - } - - public static final class SubscriptionChangeTermEndBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionChangeTermEndBuilder() {} - - public SubscriptionChangeTermEndBuilder termEndsAt(Timestamp value) { - - formData.put("term_ends_at", value); - - return this; - } - - public SubscriptionChangeTermEndBuilder prorate(Boolean value) { - - formData.put("prorate", value); - - return this; - } - - public SubscriptionChangeTermEndBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public SubscriptionChangeTermEndParams build() { - return new SubscriptionChangeTermEndParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionChargeAddonAtTermEndParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionChargeAddonAtTermEndParams.java deleted file mode 100644 index f95ef9dc..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionChargeAddonAtTermEndParams.java +++ /dev/null @@ -1,93 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class SubscriptionChargeAddonAtTermEndParams { - - private final Map formData; - - private SubscriptionChargeAddonAtTermEndParams(SubscriptionChargeAddonAtTermEndBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionChargeAddonAtTermEndParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionChargeAddonAtTermEndBuilder builder() { - return new SubscriptionChargeAddonAtTermEndBuilder(); - } - - public static final class SubscriptionChargeAddonAtTermEndBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionChargeAddonAtTermEndBuilder() {} - - public SubscriptionChargeAddonAtTermEndBuilder addonId(String value) { - - formData.put("addon_id", value); - - return this; - } - - public SubscriptionChargeAddonAtTermEndBuilder addonQuantity(Integer value) { - - formData.put("addon_quantity", value); - - return this; - } - - public SubscriptionChargeAddonAtTermEndBuilder addonUnitPrice(Long value) { - - formData.put("addon_unit_price", value); - - return this; - } - - public SubscriptionChargeAddonAtTermEndBuilder addonQuantityInDecimal(String value) { - - formData.put("addon_quantity_in_decimal", value); - - return this; - } - - public SubscriptionChargeAddonAtTermEndBuilder addonUnitPriceInDecimal(String value) { - - formData.put("addon_unit_price_in_decimal", value); - - return this; - } - - public SubscriptionChargeAddonAtTermEndBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public SubscriptionChargeAddonAtTermEndBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public SubscriptionChargeAddonAtTermEndParams build() { - return new SubscriptionChargeAddonAtTermEndParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionChargeFutureRenewalsParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionChargeFutureRenewalsParams.java deleted file mode 100644 index 83a70f75..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionChargeFutureRenewalsParams.java +++ /dev/null @@ -1,257 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class SubscriptionChargeFutureRenewalsParams { - - private final Map formData; - - private SubscriptionChargeFutureRenewalsParams(SubscriptionChargeFutureRenewalsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionChargeFutureRenewalsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionChargeFutureRenewalsBuilder builder() { - return new SubscriptionChargeFutureRenewalsBuilder(); - } - - public static final class SubscriptionChargeFutureRenewalsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionChargeFutureRenewalsBuilder() {} - - public SubscriptionChargeFutureRenewalsBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public SubscriptionChargeFutureRenewalsBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public SubscriptionChargeFutureRenewalsBuilder scheduleType(ScheduleType value) { - - formData.put("schedule_type", value); - - return this; - } - - public SubscriptionChargeFutureRenewalsBuilder fixedIntervalSchedule( - FixedIntervalScheduleParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "fixed_interval_schedule[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionChargeFutureRenewalsBuilder specificDatesSchedule( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SpecificDatesScheduleParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "specific_dates_schedule[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionChargeFutureRenewalsParams build() { - return new SubscriptionChargeFutureRenewalsParams(this); - } - } - - public enum ScheduleType { - IMMEDIATE("immediate"), - - SPECIFIC_DATES("specific_dates"), - - FIXED_INTERVALS("fixed_intervals"), - - /** An enum member indicating that ScheduleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ScheduleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ScheduleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ScheduleType enumValue : ScheduleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class FixedIntervalScheduleParams { - - private final Map formData; - - private FixedIntervalScheduleParams(FixedIntervalScheduleBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for FixedIntervalScheduleParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static FixedIntervalScheduleBuilder builder() { - return new FixedIntervalScheduleBuilder(); - } - - public static final class FixedIntervalScheduleBuilder { - private final Map formData = new LinkedHashMap<>(); - - private FixedIntervalScheduleBuilder() {} - - public FixedIntervalScheduleBuilder numberOfOccurrences(Integer value) { - - formData.put("number_of_occurrences", value); - - return this; - } - - public FixedIntervalScheduleBuilder daysBeforeRenewal(Integer value) { - - formData.put("days_before_renewal", value); - - return this; - } - - public FixedIntervalScheduleBuilder endScheduleOn(EndScheduleOn value) { - - formData.put("end_schedule_on", value); - - return this; - } - - public FixedIntervalScheduleBuilder endDate(Timestamp value) { - - formData.put("end_date", value); - - return this; - } - - public FixedIntervalScheduleParams build() { - return new FixedIntervalScheduleParams(this); - } - } - - public enum EndScheduleOn { - AFTER_NUMBER_OF_INTERVALS("after_number_of_intervals"), - - SPECIFIC_DATE("specific_date"), - - SUBSCRIPTION_END("subscription_end"), - - /** An enum member indicating that EndScheduleOn was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EndScheduleOn(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EndScheduleOn fromString(String value) { - if (value == null) return _UNKNOWN; - for (EndScheduleOn enumValue : EndScheduleOn.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class SpecificDatesScheduleParams { - - private final Map formData; - - private SpecificDatesScheduleParams(SpecificDatesScheduleBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SpecificDatesScheduleParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SpecificDatesScheduleBuilder builder() { - return new SpecificDatesScheduleBuilder(); - } - - public static final class SpecificDatesScheduleBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SpecificDatesScheduleBuilder() {} - - public SpecificDatesScheduleBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public SpecificDatesScheduleBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public SpecificDatesScheduleParams build() { - return new SpecificDatesScheduleParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionContractTermsForSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionContractTermsForSubscriptionParams.java deleted file mode 100644 index 2e914f50..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionContractTermsForSubscriptionParams.java +++ /dev/null @@ -1,157 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class SubscriptionContractTermsForSubscriptionParams { - - private final Map queryParams; - - private SubscriptionContractTermsForSubscriptionParams( - SubscriptionContractTermsForSubscriptionBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public SubscriptionContractTermsForSubscriptionBuilder toBuilder() { - SubscriptionContractTermsForSubscriptionBuilder builder = - new SubscriptionContractTermsForSubscriptionBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for SubscriptionContractTermsForSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionContractTermsForSubscriptionBuilder builder() { - return new SubscriptionContractTermsForSubscriptionBuilder(); - } - - public static final class SubscriptionContractTermsForSubscriptionBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private SubscriptionContractTermsForSubscriptionBuilder() {} - - public SubscriptionContractTermsForSubscriptionBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public SubscriptionContractTermsForSubscriptionBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public SortBySortBuilder sortBy() { - return new SortBySortBuilder("sort_by", this); - } - - public SubscriptionContractTermsForSubscriptionParams build() { - return new SubscriptionContractTermsForSubscriptionParams(this); - } - - public static final class SortBySortBuilder { - private final String fieldName; - private final SubscriptionContractTermsForSubscriptionBuilder builder; - - SortBySortBuilder(String fieldName, SubscriptionContractTermsForSubscriptionBuilder 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 SubscriptionContractTermsForSubscriptionBuilder builder; - - SortDirection( - String fieldName, - String selectedField, - SubscriptionContractTermsForSubscriptionBuilder builder) { - this.fieldName = fieldName; - this.selectedField = selectedField; - this.builder = builder; - } - - public SubscriptionContractTermsForSubscriptionBuilder asc() { - builder.queryParams.put(fieldName + "[asc]", selectedField); - return builder; - } - - public SubscriptionContractTermsForSubscriptionBuilder 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/core/models/subscription/params/SubscriptionCreateForCustomerParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionCreateForCustomerParams.java deleted file mode 100644 index d2cabcf5..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionCreateForCustomerParams.java +++ /dev/null @@ -1,1287 +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.core.models.subscription.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 SubscriptionCreateForCustomerParams { - - private final Map formData; - - private SubscriptionCreateForCustomerParams(SubscriptionCreateForCustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionCreateForCustomerParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionCreateForCustomerBuilder builder() { - return new SubscriptionCreateForCustomerBuilder(); - } - - public static final class SubscriptionCreateForCustomerBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionCreateForCustomerBuilder() {} - - public SubscriptionCreateForCustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder planUnitPrice(Long value) { - - formData.put("plan_unit_price", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder planUnitPriceInDecimal(String value) { - - formData.put("plan_unit_price_in_decimal", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder mandatoryAddonsToRemove(List value) { - - formData.put("mandatory_addons_to_remove", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - @Deprecated - public SubscriptionCreateForCustomerBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder billingAlignmentMode(BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder overrideRelationship(Boolean value) { - - formData.put("override_relationship", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public SubscriptionCreateForCustomerBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder replacePrimaryPaymentSource(Boolean value) { - - formData.put("replace_primary_payment_source", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder freePeriod(Integer value) { - - formData.put("free_period", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder freePeriodUnit(FreePeriodUnit value) { - - formData.put("free_period_unit", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder trialEndAction(TrialEndAction value) { - - formData.put("trial_end_action", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder paymentInitiator(PaymentInitiator value) { - - formData.put("payment_initiator", value); - - return this; - } - - public SubscriptionCreateForCustomerBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateForCustomerBuilder statementDescriptor( - StatementDescriptorParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateForCustomerBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateForCustomerBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateForCustomerBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionCreateForCustomerBuilder eventBasedAddons( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - @Deprecated - public SubscriptionCreateForCustomerBuilder coupons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 SubscriptionCreateForCustomerBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 SubscriptionCreateForCustomerBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateForCustomerParams build() { - return new SubscriptionCreateForCustomerParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum FreePeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - FreePeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static FreePeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TrialEndAction { - SITE_DEFAULT("site_default"), - - PLAN_DEFAULT("plan_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialEndAction enumValue : TrialEndAction.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PaymentInitiator { - CUSTOMER("customer"), - - MERCHANT("merchant"), - - /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentInitiator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentInitiator fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentInitiator enumValue : PaymentInitiator.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class StatementDescriptorParams { - - private final Map formData; - - private StatementDescriptorParams(StatementDescriptorBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatementDescriptorParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatementDescriptorBuilder builder() { - return new StatementDescriptorBuilder(); - } - - public static final class StatementDescriptorBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatementDescriptorBuilder() {} - - public StatementDescriptorBuilder descriptor(String value) { - - formData.put("descriptor", value); - - return this; - } - - public StatementDescriptorParams build() { - return new StatementDescriptorParams(this); - } - } - } - - public static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AddonsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { - - formData.put("service_period_in_days", value); - - return this; - } - - public EventBasedAddonsBuilder onEvent(OnEvent value) { - - formData.put("on_event", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOn(ChargeOn value) { - - formData.put("charge_on", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - - public enum OnEvent { - SUBSCRIPTION_CREATION("subscription_creation"), - - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** An enum member indicating that OnEvent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OnEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OnEvent fromString(String value) { - if (value == null) return _UNKNOWN; - for (OnEvent enumValue : OnEvent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChargeOn { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOn(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOn fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOn enumValue : ChargeOn.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CouponsParams { - - private final Map formData; - - private CouponsParams(CouponsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponsBuilder builder() { - return new CouponsBuilder(); - } - - public static final class CouponsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponsBuilder() {} - - public CouponsBuilder couponId(String value) { - - formData.put("coupon_id", value); - - return this; - } - - public CouponsBuilder applyTill(Timestamp value) { - - formData.put("apply_till", value); - - return this; - } - - public CouponsParams build() { - return new CouponsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionCreateParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionCreateParams.java deleted file mode 100644 index aab0c407..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionCreateParams.java +++ /dev/null @@ -1,2981 +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.core.models.subscription.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 SubscriptionCreateParams { - - private final Map formData; - - private SubscriptionCreateParams(SubscriptionCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionCreateBuilder builder() { - return new SubscriptionCreateBuilder(); - } - - public static final class SubscriptionCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionCreateBuilder() {} - - public SubscriptionCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionCreateBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionCreateBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionCreateBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - public SubscriptionCreateBuilder planUnitPrice(Long value) { - - formData.put("plan_unit_price", value); - - return this; - } - - public SubscriptionCreateBuilder planUnitPriceInDecimal(String value) { - - formData.put("plan_unit_price_in_decimal", value); - - return this; - } - - public SubscriptionCreateBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionCreateBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionCreateBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionCreateBuilder mandatoryAddonsToRemove(List value) { - - formData.put("mandatory_addons_to_remove", value); - - return this; - } - - public SubscriptionCreateBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - @Deprecated - public SubscriptionCreateBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionCreateBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionCreateBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public SubscriptionCreateBuilder billingAlignmentMode(BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public SubscriptionCreateBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionCreateBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public SubscriptionCreateBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public SubscriptionCreateBuilder tokenId(String value) { - - formData.put("token_id", value); - - return this; - } - - public SubscriptionCreateBuilder affiliateToken(String value) { - - formData.put("affiliate_token", value); - - return this; - } - - @Deprecated - public SubscriptionCreateBuilder createdFromIp(String value) { - - formData.put("created_from_ip", value); - - return this; - } - - public SubscriptionCreateBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public SubscriptionCreateBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public SubscriptionCreateBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public SubscriptionCreateBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public SubscriptionCreateBuilder freePeriod(Integer value) { - - formData.put("free_period", value); - - return this; - } - - public SubscriptionCreateBuilder freePeriodUnit(FreePeriodUnit value) { - - formData.put("free_period_unit", value); - - return this; - } - - public SubscriptionCreateBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionCreateBuilder trialEndAction(TrialEndAction value) { - - formData.put("trial_end_action", value); - - return this; - } - - public SubscriptionCreateBuilder clientProfileId(String value) { - - formData.put("client_profile_id", value); - - return this; - } - - public SubscriptionCreateBuilder paymentInitiator(PaymentInitiator value) { - - formData.put("payment_initiator", value); - - return this; - } - - public SubscriptionCreateBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateBuilder bankAccount(BankAccountParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "bank_account[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateBuilder paymentMethod(PaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateBuilder statementDescriptor(StatementDescriptorParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateBuilder entityIdentifiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EntityIdentifiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "entity_identifiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionCreateBuilder taxProvidersFields(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionCreateBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionCreateBuilder eventBasedAddons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - @Deprecated - public SubscriptionCreateBuilder coupons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 SubscriptionCreateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 SubscriptionCreateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateParams build() { - return new SubscriptionCreateParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum FreePeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - FreePeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static FreePeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TrialEndAction { - SITE_DEFAULT("site_default"), - - PLAN_DEFAULT("plan_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialEndAction enumValue : TrialEndAction.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PaymentInitiator { - CUSTOMER("customer"), - - MERCHANT("merchant"), - - /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentInitiator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentInitiator fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentInitiator enumValue : PaymentInitiator.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public CustomerBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CustomerBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CustomerBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public CustomerBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public CustomerBuilder locale(String value) { - - formData.put("locale", value); - - return this; - } - - public CustomerBuilder taxability(Taxability value) { - - formData.put("taxability", value); - - return this; - } - - public CustomerBuilder entityCode(EntityCode value) { - - formData.put("entity_code", value); - - return this; - } - - public CustomerBuilder exemptNumber(String value) { - - formData.put("exempt_number", value); - - return this; - } - - public CustomerBuilder netTermDays(Integer value) { - - formData.put("net_term_days", value); - - return this; - } - - public CustomerBuilder taxjarExemptionCategory(TaxjarExemptionCategory value) { - - formData.put("taxjar_exemption_category", value); - - return this; - } - - public CustomerBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public CustomerBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public CustomerBuilder allowDirectDebit(Boolean value) { - - formData.put("allow_direct_debit", value); - - return this; - } - - public CustomerBuilder consolidatedInvoicing(Boolean value) { - - formData.put("consolidated_invoicing", value); - - return this; - } - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder entityIdentifierScheme(String value) { - - formData.put("entity_identifier_scheme", value); - - return this; - } - - public CustomerBuilder entityIdentifierStandard(String value) { - - formData.put("entity_identifier_standard", value); - - return this; - } - - public CustomerBuilder isEinvoiceEnabled(Boolean value) { - - formData.put("is_einvoice_enabled", value); - - return this; - } - - public CustomerBuilder einvoicingMethod(EinvoicingMethod value) { - - formData.put("einvoicing_method", value); - - return this; - } - - public CustomerBuilder registeredForGst(Boolean value) { - - formData.put("registered_for_gst", value); - - return this; - } - - public CustomerBuilder businessCustomerWithoutVatNumber(Boolean value) { - - formData.put("business_customer_without_vat_number", value); - - return this; - } - - public CustomerBuilder exemptionDetails(List value) { - - formData.put("exemption_details", JsonUtil.toJson(value)); - - return this; - } - - public CustomerBuilder customerType(CustomerType value) { - - formData.put("customer_type", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - - public enum Taxability { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Taxability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Taxability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Taxability fromString(String value) { - if (value == null) return _UNKNOWN; - for (Taxability enumValue : Taxability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EntityCode { - A("a"), - - B("b"), - - C("c"), - - D("d"), - - E("e"), - - F("f"), - - G("g"), - - H("h"), - - I("i"), - - J("j"), - - K("k"), - - L("l"), - - M("m"), - - N("n"), - - P("p"), - - Q("q"), - - R("r"), - - MED_1("med1"), - - MED_2("med2"), - - /** An enum member indicating that EntityCode was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EntityCode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EntityCode fromString(String value) { - if (value == null) return _UNKNOWN; - for (EntityCode enumValue : EntityCode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TaxjarExemptionCategory { - WHOLESALE("wholesale"), - - GOVERNMENT("government"), - - OTHER("other"), - - /** - * An enum member indicating that TaxjarExemptionCategory was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - TaxjarExemptionCategory(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TaxjarExemptionCategory fromString(String value) { - if (value == null) return _UNKNOWN; - for (TaxjarExemptionCategory enumValue : TaxjarExemptionCategory.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EinvoicingMethod { - AUTOMATIC("automatic"), - - MANUAL("manual"), - - SITE_DEFAULT("site_default"), - - /** An enum member indicating that EinvoicingMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EinvoicingMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EinvoicingMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (EinvoicingMethod enumValue : EinvoicingMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum CustomerType { - RESIDENTIAL("residential"), - - BUSINESS("business"), - - SENIOR_CITIZEN("senior_citizen"), - - INDUSTRIAL("industrial"), - - /** An enum member indicating that CustomerType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CustomerType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CustomerType fromString(String value) { - if (value == null) return _UNKNOWN; - for (CustomerType enumValue : CustomerType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - @Deprecated - public CardBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public CardBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CardBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CardBuilder number(String value) { - - formData.put("number", value); - - return this; - } - - public CardBuilder expiryMonth(Integer value) { - - formData.put("expiry_month", value); - - return this; - } - - public CardBuilder expiryYear(Integer value) { - - formData.put("expiry_year", value); - - return this; - } - - public CardBuilder cvv(String value) { - - formData.put("cvv", value); - - return this; - } - - public CardBuilder preferredScheme(PreferredScheme value) { - - formData.put("preferred_scheme", value); - - return this; - } - - public CardBuilder billingAddr1(String value) { - - formData.put("billing_addr1", value); - - return this; - } - - public CardBuilder billingAddr2(String value) { - - formData.put("billing_addr2", value); - - return this; - } - - public CardBuilder billingCity(String value) { - - formData.put("billing_city", value); - - return this; - } - - public CardBuilder billingStateCode(String value) { - - formData.put("billing_state_code", value); - - return this; - } - - public CardBuilder billingState(String value) { - - formData.put("billing_state", value); - - return this; - } - - public CardBuilder billingZip(String value) { - - formData.put("billing_zip", value); - - return this; - } - - public CardBuilder billingCountry(String value) { - - formData.put("billing_country", value); - - return this; - } - - @Deprecated - public CardBuilder ipAddress(String value) { - - formData.put("ip_address", value); - - return this; - } - - public CardBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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 BankAccountParams { - - private final Map formData; - - private BankAccountParams(BankAccountBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BankAccountParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BankAccountBuilder builder() { - return new BankAccountBuilder(); - } - - public static final class BankAccountBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BankAccountBuilder() {} - - public BankAccountBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public BankAccountBuilder iban(String value) { - - formData.put("iban", value); - - return this; - } - - public BankAccountBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BankAccountBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BankAccountBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BankAccountBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BankAccountBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BankAccountBuilder bankName(String value) { - - formData.put("bank_name", value); - - return this; - } - - public BankAccountBuilder accountNumber(String value) { - - formData.put("account_number", value); - - return this; - } - - public BankAccountBuilder routingNumber(String value) { - - formData.put("routing_number", value); - - return this; - } - - public BankAccountBuilder bankCode(String value) { - - formData.put("bank_code", value); - - return this; - } - - public BankAccountBuilder accountType(AccountType value) { - - formData.put("account_type", value); - - return this; - } - - public BankAccountBuilder accountHolderType(AccountHolderType value) { - - formData.put("account_holder_type", value); - - return this; - } - - public BankAccountBuilder echeckType(EcheckType value) { - - formData.put("echeck_type", value); - - return this; - } - - public BankAccountBuilder issuingCountry(String value) { - - formData.put("issuing_country", value); - - return this; - } - - public BankAccountBuilder swedishIdentityNumber(String value) { - - formData.put("swedish_identity_number", value); - - return this; - } - - public BankAccountBuilder billingAddress(java.util.Map value) { - - formData.put("billing_address", JsonUtil.toJson(value)); - - return this; - } - - public BankAccountParams build() { - return new BankAccountParams(this); - } - } - - public enum AccountType { - CHECKING("checking"), - - SAVINGS("savings"), - - BUSINESS_CHECKING("business_checking"), - - CURRENT("current"), - - /** An enum member indicating that AccountType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AccountType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AccountType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AccountType enumValue : AccountType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AccountHolderType { - INDIVIDUAL("individual"), - - COMPANY("company"), - - /** - * An enum member indicating that AccountHolderType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - AccountHolderType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AccountHolderType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AccountHolderType enumValue : AccountHolderType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EcheckType { - WEB("web"), - - PPD("ppd"), - - CCD("ccd"), - - /** An enum member indicating that EcheckType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EcheckType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EcheckType fromString(String value) { - if (value == null) return _UNKNOWN; - for (EcheckType enumValue : EcheckType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class PaymentMethodParams { - - private final Map formData; - - private PaymentMethodParams(PaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentMethodBuilder builder() { - return new PaymentMethodBuilder(); - } - - public static final class PaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentMethodBuilder() {} - - public PaymentMethodBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - @Deprecated - public PaymentMethodBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public PaymentMethodBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentMethodBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public PaymentMethodBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public PaymentMethodBuilder issuingCountry(String value) { - - formData.put("issuing_country", value); - - return this; - } - - public PaymentMethodBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentMethodParams build() { - return new PaymentMethodParams(this); - } - } - - public enum Type { - CARD("card"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - AMAZON_PAYMENTS("amazon_payments"), - - DIRECT_DEBIT("direct_debit"), - - GENERIC("generic"), - - ALIPAY("alipay"), - - UNIONPAY("unionpay"), - - APPLE_PAY("apple_pay"), - - WECHAT_PAY("wechat_pay"), - - IDEAL("ideal"), - - GOOGLE_PAY("google_pay"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GIROPAY("giropay"), - - DOTPAY("dotpay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - VENMO("venmo"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** 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 Gateway { - 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"), - - GOCARDLESS("gocardless"), - - 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"), - - /** 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 static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class StatementDescriptorParams { - - private final Map formData; - - private StatementDescriptorParams(StatementDescriptorBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatementDescriptorParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatementDescriptorBuilder builder() { - return new StatementDescriptorBuilder(); - } - - public static final class StatementDescriptorBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatementDescriptorBuilder() {} - - public StatementDescriptorBuilder descriptor(String value) { - - formData.put("descriptor", value); - - return this; - } - - public StatementDescriptorParams build() { - return new StatementDescriptorParams(this); - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class EntityIdentifiersParams { - - private final Map formData; - - private EntityIdentifiersParams(EntityIdentifiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EntityIdentifiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EntityIdentifiersBuilder builder() { - return new EntityIdentifiersBuilder(); - } - - public static final class EntityIdentifiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EntityIdentifiersBuilder() {} - - public EntityIdentifiersBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EntityIdentifiersBuilder scheme(String value) { - - formData.put("scheme", value); - - return this; - } - - public EntityIdentifiersBuilder value(String value) { - - formData.put("value", value); - - return this; - } - - public EntityIdentifiersBuilder standard(String value) { - - formData.put("standard", value); - - return this; - } - - public EntityIdentifiersParams build() { - return new EntityIdentifiersParams(this); - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AddonsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { - - formData.put("service_period_in_days", value); - - return this; - } - - public EventBasedAddonsBuilder onEvent(OnEvent value) { - - formData.put("on_event", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOn(ChargeOn value) { - - formData.put("charge_on", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - - public enum OnEvent { - SUBSCRIPTION_CREATION("subscription_creation"), - - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** An enum member indicating that OnEvent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OnEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OnEvent fromString(String value) { - if (value == null) return _UNKNOWN; - for (OnEvent enumValue : OnEvent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChargeOn { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOn(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOn fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOn enumValue : ChargeOn.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CouponsParams { - - private final Map formData; - - private CouponsParams(CouponsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponsBuilder builder() { - return new CouponsBuilder(); - } - - public static final class CouponsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponsBuilder() {} - - public CouponsBuilder couponId(String value) { - - formData.put("coupon_id", value); - - return this; - } - - public CouponsBuilder applyTill(Timestamp value) { - - formData.put("apply_till", value); - - return this; - } - - public CouponsParams build() { - return new CouponsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionCreateWithItemsParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionCreateWithItemsParams.java deleted file mode 100644 index 881fb0b0..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionCreateWithItemsParams.java +++ /dev/null @@ -1,1683 +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.core.models.subscription.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 SubscriptionCreateWithItemsParams { - - private final Map formData; - - private SubscriptionCreateWithItemsParams(SubscriptionCreateWithItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionCreateWithItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionCreateWithItemsBuilder builder() { - return new SubscriptionCreateWithItemsBuilder(); - } - - public static final class SubscriptionCreateWithItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionCreateWithItemsBuilder() {} - - public SubscriptionCreateWithItemsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder businessEntityId(String value) { - - formData.put("business_entity_id", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - @Deprecated - public SubscriptionCreateWithItemsBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder mandatoryItemsToRemove(List value) { - - formData.put("mandatory_items_to_remove", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder netTermDays(Integer value) { - - formData.put("net_term_days", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - @Deprecated - public SubscriptionCreateWithItemsBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder billingAlignmentMode(BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder overrideRelationship(Boolean value) { - - formData.put("override_relationship", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public SubscriptionCreateWithItemsBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder replacePrimaryPaymentSource(Boolean value) { - - formData.put("replace_primary_payment_source", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder freePeriod(Integer value) { - - formData.put("free_period", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder freePeriodUnit(FreePeriodUnit value) { - - formData.put("free_period_unit", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder createPendingInvoices(Boolean value) { - - formData.put("create_pending_invoices", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder autoCloseInvoices(Boolean value) { - - formData.put("auto_close_invoices", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder firstInvoicePending(Boolean value) { - - formData.put("first_invoice_pending", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder trialEndAction(TrialEndAction value) { - - formData.put("trial_end_action", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder paymentInitiator(PaymentInitiator value) { - - formData.put("payment_initiator", value); - - return this; - } - - public SubscriptionCreateWithItemsBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateWithItemsBuilder statementDescriptor(StatementDescriptorParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateWithItemsBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateWithItemsBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateWithItemsBuilder billingOverride(BillingOverrideParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_override[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateWithItemsBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionCreateWithItemsBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionCreateWithItemsBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - @Deprecated - public SubscriptionCreateWithItemsBuilder coupons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 SubscriptionCreateWithItemsBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 SubscriptionCreateWithItemsBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public SubscriptionCreateWithItemsParams build() { - return new SubscriptionCreateWithItemsParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum FreePeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - FreePeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static FreePeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TrialEndAction { - SITE_DEFAULT("site_default"), - - PLAN_DEFAULT("plan_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialEndAction enumValue : TrialEndAction.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PaymentInitiator { - CUSTOMER("customer"), - - MERCHANT("merchant"), - - /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentInitiator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentInitiator fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentInitiator enumValue : PaymentInitiator.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class StatementDescriptorParams { - - private final Map formData; - - private StatementDescriptorParams(StatementDescriptorBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatementDescriptorParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatementDescriptorBuilder builder() { - return new StatementDescriptorBuilder(); - } - - public static final class StatementDescriptorBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatementDescriptorBuilder() {} - - public StatementDescriptorBuilder descriptor(String value) { - - formData.put("descriptor", value); - - return this; - } - - public StatementDescriptorParams build() { - return new StatementDescriptorParams(this); - } - } - } - - public static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - @Deprecated - public ContractTermBuilder contractStart(Timestamp value) { - - formData.put("contract_start", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingOverrideParams { - - private final Map formData; - - private BillingOverrideParams(BillingOverrideBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingOverrideParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingOverrideBuilder builder() { - return new BillingOverrideBuilder(); - } - - public static final class BillingOverrideBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingOverrideBuilder() {} - - public BillingOverrideBuilder maxExcessPaymentUsage(Long value) { - - formData.put("max_excess_payment_usage", value); - - return this; - } - - public BillingOverrideBuilder maxRefundableCreditsUsage(Long value) { - - formData.put("max_refundable_credits_usage", value); - - return this; - } - - public BillingOverrideParams build() { - return new BillingOverrideParams(this); - } - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public SubscriptionItemsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionItemsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionItemsBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public SubscriptionItemsBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { - - formData.put("charge_on_option", value); - - return this; - } - - public SubscriptionItemsBuilder usageAccumulationResetFrequency( - UsageAccumulationResetFrequency value) { - - formData.put("usage_accumulation_reset_frequency", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - - 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"), - - /** 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; - } - } - - 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 enum ChargeOnOption { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOnOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOnOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOnOption enumValue : ChargeOnOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum UsageAccumulationResetFrequency { - NEVER("never"), - - SUBSCRIPTION_BILLING_FREQUENCY("subscription_billing_frequency"), - - /** - * An enum member indicating that UsageAccumulationResetFrequency was instantiated with an - * unknown value. - */ - _UNKNOWN(null); - private final String value; - - UsageAccumulationResetFrequency(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static UsageAccumulationResetFrequency fromString(String value) { - if (value == null) return _UNKNOWN; - for (UsageAccumulationResetFrequency enumValue : UsageAccumulationResetFrequency.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CouponsParams { - - private final Map formData; - - private CouponsParams(CouponsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponsBuilder builder() { - return new CouponsBuilder(); - } - - public static final class CouponsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponsBuilder() {} - - public CouponsBuilder couponId(String value) { - - formData.put("coupon_id", value); - - return this; - } - - public CouponsBuilder applyTill(Timestamp value) { - - formData.put("apply_till", value); - - return this; - } - - public CouponsParams build() { - return new CouponsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionEditAdvanceInvoiceScheduleParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionEditAdvanceInvoiceScheduleParams.java deleted file mode 100644 index 246d7903..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionEditAdvanceInvoiceScheduleParams.java +++ /dev/null @@ -1,256 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class SubscriptionEditAdvanceInvoiceScheduleParams { - - private final Map formData; - - private SubscriptionEditAdvanceInvoiceScheduleParams( - SubscriptionEditAdvanceInvoiceScheduleBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionEditAdvanceInvoiceScheduleParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionEditAdvanceInvoiceScheduleBuilder builder() { - return new SubscriptionEditAdvanceInvoiceScheduleBuilder(); - } - - public static final class SubscriptionEditAdvanceInvoiceScheduleBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionEditAdvanceInvoiceScheduleBuilder() {} - - public SubscriptionEditAdvanceInvoiceScheduleBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public SubscriptionEditAdvanceInvoiceScheduleBuilder scheduleType(ScheduleType value) { - - formData.put("schedule_type", value); - - return this; - } - - public SubscriptionEditAdvanceInvoiceScheduleBuilder fixedIntervalSchedule( - FixedIntervalScheduleParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "fixed_interval_schedule[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionEditAdvanceInvoiceScheduleBuilder specificDatesSchedule( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SpecificDatesScheduleParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "specific_dates_schedule[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionEditAdvanceInvoiceScheduleParams build() { - return new SubscriptionEditAdvanceInvoiceScheduleParams(this); - } - } - - public enum ScheduleType { - SPECIFIC_DATES("specific_dates"), - - FIXED_INTERVALS("fixed_intervals"), - - /** An enum member indicating that ScheduleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ScheduleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ScheduleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ScheduleType enumValue : ScheduleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class FixedIntervalScheduleParams { - - private final Map formData; - - private FixedIntervalScheduleParams(FixedIntervalScheduleBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for FixedIntervalScheduleParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static FixedIntervalScheduleBuilder builder() { - return new FixedIntervalScheduleBuilder(); - } - - public static final class FixedIntervalScheduleBuilder { - private final Map formData = new LinkedHashMap<>(); - - private FixedIntervalScheduleBuilder() {} - - public FixedIntervalScheduleBuilder numberOfOccurrences(Integer value) { - - formData.put("number_of_occurrences", value); - - return this; - } - - public FixedIntervalScheduleBuilder daysBeforeRenewal(Integer value) { - - formData.put("days_before_renewal", value); - - return this; - } - - public FixedIntervalScheduleBuilder endScheduleOn(EndScheduleOn value) { - - formData.put("end_schedule_on", value); - - return this; - } - - public FixedIntervalScheduleBuilder endDate(Timestamp value) { - - formData.put("end_date", value); - - return this; - } - - public FixedIntervalScheduleParams build() { - return new FixedIntervalScheduleParams(this); - } - } - - public enum EndScheduleOn { - AFTER_NUMBER_OF_INTERVALS("after_number_of_intervals"), - - SPECIFIC_DATE("specific_date"), - - SUBSCRIPTION_END("subscription_end"), - - /** An enum member indicating that EndScheduleOn was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EndScheduleOn(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EndScheduleOn fromString(String value) { - if (value == null) return _UNKNOWN; - for (EndScheduleOn enumValue : EndScheduleOn.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class SpecificDatesScheduleParams { - - private final Map formData; - - private SpecificDatesScheduleParams(SpecificDatesScheduleBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SpecificDatesScheduleParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SpecificDatesScheduleBuilder builder() { - return new SpecificDatesScheduleBuilder(); - } - - public static final class SpecificDatesScheduleBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SpecificDatesScheduleBuilder() {} - - public SpecificDatesScheduleBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SpecificDatesScheduleBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public SpecificDatesScheduleBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public SpecificDatesScheduleParams build() { - return new SpecificDatesScheduleParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionImportContractTermParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionImportContractTermParams.java deleted file mode 100644 index a3adbbfb..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionImportContractTermParams.java +++ /dev/null @@ -1,240 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class SubscriptionImportContractTermParams { - - private final Map formData; - - private SubscriptionImportContractTermParams(SubscriptionImportContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionImportContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionImportContractTermBuilder builder() { - return new SubscriptionImportContractTermBuilder(); - } - - public static final class SubscriptionImportContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionImportContractTermBuilder() {} - - public SubscriptionImportContractTermBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionImportContractTermBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionImportContractTermParams build() { - return new SubscriptionImportContractTermParams(this); - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ContractTermBuilder createdAt(Timestamp value) { - - formData.put("created_at", value); - - return this; - } - - public ContractTermBuilder contractStart(Timestamp value) { - - formData.put("contract_start", value); - - return this; - } - - public ContractTermBuilder contractEnd(Timestamp value) { - - formData.put("contract_end", value); - - return this; - } - - public ContractTermBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public ContractTermBuilder totalAmountRaised(Long value) { - - formData.put("total_amount_raised", value); - - return this; - } - - public ContractTermBuilder totalAmountRaisedBeforeTax(Long value) { - - formData.put("total_amount_raised_before_tax", value); - - return this; - } - - public ContractTermBuilder totalContractValue(Long value) { - - formData.put("total_contract_value", value); - - return this; - } - - public ContractTermBuilder totalContractValueBeforeTax(Long value) { - - formData.put("total_contract_value_before_tax", value); - - return this; - } - - public ContractTermBuilder billingCycle(Integer value) { - - formData.put("billing_cycle", value); - - return this; - } - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum Status { - ACTIVE("active"), - - COMPLETED("completed"), - - CANCELLED("cancelled"), - - TERMINATED("terminated"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - RENEW_ONCE("renew_once"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionImportForCustomerParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionImportForCustomerParams.java deleted file mode 100644 index e2a96186..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionImportForCustomerParams.java +++ /dev/null @@ -1,1091 +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.core.models.subscription.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 SubscriptionImportForCustomerParams { - - private final Map formData; - - private SubscriptionImportForCustomerParams(SubscriptionImportForCustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionImportForCustomerParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionImportForCustomerBuilder builder() { - return new SubscriptionImportForCustomerBuilder(); - } - - public static final class SubscriptionImportForCustomerBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionImportForCustomerBuilder() {} - - public SubscriptionImportForCustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder planUnitPrice(Long value) { - - formData.put("plan_unit_price", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder planUnitPriceInDecimal(String value) { - - formData.put("plan_unit_price_in_decimal", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder currentTermEnd(Timestamp value) { - - formData.put("current_term_end", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder currentTermStart(Timestamp value) { - - formData.put("current_term_start", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder trialStart(Timestamp value) { - - formData.put("trial_start", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder cancelledAt(Timestamp value) { - - formData.put("cancelled_at", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder startedAt(Timestamp value) { - - formData.put("started_at", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder activatedAt(Timestamp value) { - - formData.put("activated_at", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder pauseDate(Timestamp value) { - - formData.put("pause_date", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder resumeDate(Timestamp value) { - - formData.put("resume_date", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder createCurrentTermInvoice(Boolean value) { - - formData.put("create_current_term_invoice", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public SubscriptionImportForCustomerBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public SubscriptionImportForCustomerBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionImportForCustomerBuilder transaction(TransactionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "transaction[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionImportForCustomerBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionImportForCustomerBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionImportForCustomerBuilder eventBasedAddons( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionImportForCustomerBuilder chargedEventBasedAddons( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ChargedEventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "charged_event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - @Deprecated - public SubscriptionImportForCustomerBuilder coupons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 SubscriptionImportForCustomerBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 SubscriptionImportForCustomerBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public SubscriptionImportForCustomerParams build() { - return new SubscriptionImportForCustomerParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Status { - FUTURE("future"), - - IN_TRIAL("in_trial"), - - ACTIVE("active"), - - NON_RENEWING("non_renewing"), - - PAUSED("paused"), - - CANCELLED("cancelled"), - - TRANSFERRED("transferred"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ContractTermBuilder createdAt(Timestamp value) { - - formData.put("created_at", value); - - return this; - } - - public ContractTermBuilder contractStart(Timestamp value) { - - formData.put("contract_start", value); - - return this; - } - - public ContractTermBuilder billingCycle(Integer value) { - - formData.put("billing_cycle", value); - - return this; - } - - public ContractTermBuilder totalAmountRaised(Long value) { - - formData.put("total_amount_raised", value); - - return this; - } - - public ContractTermBuilder totalAmountRaisedBeforeTax(Long value) { - - formData.put("total_amount_raised_before_tax", value); - - return this; - } - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - RENEW_ONCE("renew_once"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TransactionParams { - - private final Map formData; - - private TransactionParams(TransactionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionBuilder builder() { - return new TransactionBuilder(); - } - - public static final class TransactionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionBuilder() {} - - public TransactionBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public TransactionBuilder paymentMethod(PaymentMethod value) { - - formData.put("payment_method", value); - - return this; - } - - public TransactionBuilder referenceNumber(String value) { - - formData.put("reference_number", value); - - return this; - } - - public TransactionBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public TransactionParams build() { - return new TransactionParams(this); - } - } - - public enum PaymentMethod { - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - OTHER("other"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - CUSTOM("custom"), - - /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethod enumValue : PaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { - - formData.put("service_period_in_days", value); - - return this; - } - - public EventBasedAddonsBuilder onEvent(OnEvent value) { - - formData.put("on_event", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - - public enum OnEvent { - SUBSCRIPTION_CREATION("subscription_creation"), - - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** An enum member indicating that OnEvent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OnEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OnEvent fromString(String value) { - if (value == null) return _UNKNOWN; - for (OnEvent enumValue : OnEvent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ChargedEventBasedAddonsParams { - - private final Map formData; - - private ChargedEventBasedAddonsParams(ChargedEventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargedEventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargedEventBasedAddonsBuilder builder() { - return new ChargedEventBasedAddonsBuilder(); - } - - public static final class ChargedEventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargedEventBasedAddonsBuilder() {} - - public ChargedEventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ChargedEventBasedAddonsBuilder lastChargedAt(Timestamp value) { - - formData.put("last_charged_at", value); - - return this; - } - - public ChargedEventBasedAddonsParams build() { - return new ChargedEventBasedAddonsParams(this); - } - } - } - - public static final class CouponsParams { - - private final Map formData; - - private CouponsParams(CouponsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponsBuilder builder() { - return new CouponsBuilder(); - } - - public static final class CouponsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponsBuilder() {} - - public CouponsBuilder couponId(String value) { - - formData.put("coupon_id", value); - - return this; - } - - public CouponsBuilder applyTill(Timestamp value) { - - formData.put("apply_till", value); - - return this; - } - - public CouponsParams build() { - return new CouponsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionImportForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionImportForItemsParams.java deleted file mode 100644 index b0471490..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionImportForItemsParams.java +++ /dev/null @@ -1,1392 +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.core.models.subscription.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 SubscriptionImportForItemsParams { - - private final Map formData; - - private SubscriptionImportForItemsParams(SubscriptionImportForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionImportForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionImportForItemsBuilder builder() { - return new SubscriptionImportForItemsBuilder(); - } - - public static final class SubscriptionImportForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionImportForItemsBuilder() {} - - public SubscriptionImportForItemsBuilder exhaustedCouponIds(List value) { - - formData.put("exhausted_coupon_ids", value); - - return this; - } - - public SubscriptionImportForItemsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionImportForItemsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionImportForItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - @Deprecated - public SubscriptionImportForItemsBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionImportForItemsBuilder netTermDays(Integer value) { - - formData.put("net_term_days", value); - - return this; - } - - public SubscriptionImportForItemsBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionImportForItemsBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionImportForItemsBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public SubscriptionImportForItemsBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public SubscriptionImportForItemsBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public SubscriptionImportForItemsBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public SubscriptionImportForItemsBuilder currentTermEnd(Timestamp value) { - - formData.put("current_term_end", value); - - return this; - } - - public SubscriptionImportForItemsBuilder currentTermStart(Timestamp value) { - - formData.put("current_term_start", value); - - return this; - } - - public SubscriptionImportForItemsBuilder trialStart(Timestamp value) { - - formData.put("trial_start", value); - - return this; - } - - public SubscriptionImportForItemsBuilder cancelledAt(Timestamp value) { - - formData.put("cancelled_at", value); - - return this; - } - - public SubscriptionImportForItemsBuilder startedAt(Timestamp value) { - - formData.put("started_at", value); - - return this; - } - - public SubscriptionImportForItemsBuilder activatedAt(Timestamp value) { - - formData.put("activated_at", value); - - return this; - } - - public SubscriptionImportForItemsBuilder pauseDate(Timestamp value) { - - formData.put("pause_date", value); - - return this; - } - - public SubscriptionImportForItemsBuilder resumeDate(Timestamp value) { - - formData.put("resume_date", value); - - return this; - } - - public SubscriptionImportForItemsBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionImportForItemsBuilder createCurrentTermInvoice(Boolean value) { - - formData.put("create_current_term_invoice", value); - - return this; - } - - public SubscriptionImportForItemsBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public SubscriptionImportForItemsBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public SubscriptionImportForItemsBuilder cancelReasonCode(String value) { - - formData.put("cancel_reason_code", value); - - return this; - } - - public SubscriptionImportForItemsBuilder createPendingInvoices(Boolean value) { - - formData.put("create_pending_invoices", value); - - return this; - } - - public SubscriptionImportForItemsBuilder autoCloseInvoices(Boolean value) { - - formData.put("auto_close_invoices", value); - - return this; - } - - public SubscriptionImportForItemsBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionImportForItemsBuilder transaction(TransactionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "transaction[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionImportForItemsBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionImportForItemsBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionImportForItemsBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionImportForItemsBuilder chargedItems(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ChargedItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "charged_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionImportForItemsBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - @Deprecated - public SubscriptionImportForItemsBuilder coupons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 SubscriptionImportForItemsBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 SubscriptionImportForItemsBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public SubscriptionImportForItemsParams build() { - return new SubscriptionImportForItemsParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Status { - FUTURE("future"), - - IN_TRIAL("in_trial"), - - ACTIVE("active"), - - NON_RENEWING("non_renewing"), - - PAUSED("paused"), - - CANCELLED("cancelled"), - - TRANSFERRED("transferred"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ContractTermBuilder createdAt(Timestamp value) { - - formData.put("created_at", value); - - return this; - } - - public ContractTermBuilder contractStart(Timestamp value) { - - formData.put("contract_start", value); - - return this; - } - - public ContractTermBuilder billingCycle(Integer value) { - - formData.put("billing_cycle", value); - - return this; - } - - public ContractTermBuilder totalAmountRaised(Long value) { - - formData.put("total_amount_raised", value); - - return this; - } - - public ContractTermBuilder totalAmountRaisedBeforeTax(Long value) { - - formData.put("total_amount_raised_before_tax", value); - - return this; - } - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - RENEW_ONCE("renew_once"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TransactionParams { - - private final Map formData; - - private TransactionParams(TransactionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionBuilder builder() { - return new TransactionBuilder(); - } - - public static final class TransactionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionBuilder() {} - - public TransactionBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public TransactionBuilder paymentMethod(PaymentMethod value) { - - formData.put("payment_method", value); - - return this; - } - - public TransactionBuilder referenceNumber(String value) { - - formData.put("reference_number", value); - - return this; - } - - public TransactionBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public TransactionParams build() { - return new TransactionParams(this); - } - } - - public enum PaymentMethod { - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - OTHER("other"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - CUSTOM("custom"), - - /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethod enumValue : PaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public SubscriptionItemsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionItemsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionItemsBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public SubscriptionItemsBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - - 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"), - - /** 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; - } - } - - 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 DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 ChargedItemsParams { - - private final Map formData; - - private ChargedItemsParams(ChargedItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargedItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargedItemsBuilder builder() { - return new ChargedItemsBuilder(); - } - - public static final class ChargedItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargedItemsBuilder() {} - - public ChargedItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ChargedItemsBuilder lastChargedAt(Timestamp value) { - - formData.put("last_charged_at", value); - - return this; - } - - public ChargedItemsParams build() { - return new ChargedItemsParams(this); - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CouponsParams { - - private final Map formData; - - private CouponsParams(CouponsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponsBuilder builder() { - return new CouponsBuilder(); - } - - public static final class CouponsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponsBuilder() {} - - public CouponsBuilder couponId(String value) { - - formData.put("coupon_id", value); - - return this; - } - - public CouponsBuilder applyTill(Timestamp value) { - - formData.put("apply_till", value); - - return this; - } - - public CouponsParams build() { - return new CouponsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionImportSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionImportSubscriptionParams.java deleted file mode 100644 index 87328db0..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionImportSubscriptionParams.java +++ /dev/null @@ -1,2233 +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.core.models.subscription.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 SubscriptionImportSubscriptionParams { - - private final Map formData; - - private SubscriptionImportSubscriptionParams(SubscriptionImportSubscriptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionImportSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionImportSubscriptionBuilder builder() { - return new SubscriptionImportSubscriptionBuilder(); - } - - public static final class SubscriptionImportSubscriptionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionImportSubscriptionBuilder() {} - - public SubscriptionImportSubscriptionBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder clientProfileId(String value) { - - formData.put("client_profile_id", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder planUnitPrice(Long value) { - - formData.put("plan_unit_price", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder planUnitPriceInDecimal(String value) { - - formData.put("plan_unit_price_in_decimal", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder currentTermEnd(Timestamp value) { - - formData.put("current_term_end", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder currentTermStart(Timestamp value) { - - formData.put("current_term_start", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder trialStart(Timestamp value) { - - formData.put("trial_start", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder cancelledAt(Timestamp value) { - - formData.put("cancelled_at", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder startedAt(Timestamp value) { - - formData.put("started_at", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder activatedAt(Timestamp value) { - - formData.put("activated_at", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder pauseDate(Timestamp value) { - - formData.put("pause_date", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder resumeDate(Timestamp value) { - - formData.put("resume_date", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder createCurrentTermInvoice(Boolean value) { - - formData.put("create_current_term_invoice", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder affiliateToken(String value) { - - formData.put("affiliate_token", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public SubscriptionImportSubscriptionBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public SubscriptionImportSubscriptionBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionImportSubscriptionBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionImportSubscriptionBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionImportSubscriptionBuilder paymentMethod(PaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionImportSubscriptionBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionImportSubscriptionBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionImportSubscriptionBuilder transaction(TransactionParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "transaction[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionImportSubscriptionBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionImportSubscriptionBuilder eventBasedAddons( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionImportSubscriptionBuilder chargedEventBasedAddons( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ChargedEventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "charged_event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - @Deprecated - public SubscriptionImportSubscriptionBuilder coupons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 SubscriptionImportSubscriptionBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 SubscriptionImportSubscriptionBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public SubscriptionImportSubscriptionParams build() { - return new SubscriptionImportSubscriptionParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Status { - FUTURE("future"), - - IN_TRIAL("in_trial"), - - ACTIVE("active"), - - NON_RENEWING("non_renewing"), - - PAUSED("paused"), - - CANCELLED("cancelled"), - - TRANSFERRED("transferred"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public CustomerBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public CustomerBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CustomerBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CustomerBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public CustomerBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public CustomerBuilder locale(String value) { - - formData.put("locale", value); - - return this; - } - - public CustomerBuilder taxability(Taxability value) { - - formData.put("taxability", value); - - return this; - } - - public CustomerBuilder entityCode(EntityCode value) { - - formData.put("entity_code", value); - - return this; - } - - public CustomerBuilder exemptNumber(String value) { - - formData.put("exempt_number", value); - - return this; - } - - public CustomerBuilder netTermDays(Integer value) { - - formData.put("net_term_days", value); - - return this; - } - - public CustomerBuilder taxjarExemptionCategory(TaxjarExemptionCategory value) { - - formData.put("taxjar_exemption_category", value); - - return this; - } - - public CustomerBuilder customerType(CustomerType value) { - - formData.put("customer_type", value); - - return this; - } - - public CustomerBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public CustomerBuilder allowDirectDebit(Boolean value) { - - formData.put("allow_direct_debit", value); - - return this; - } - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - - public enum Taxability { - TAXABLE("taxable"), - - EXEMPT("exempt"), - - /** An enum member indicating that Taxability was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Taxability(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Taxability fromString(String value) { - if (value == null) return _UNKNOWN; - for (Taxability enumValue : Taxability.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EntityCode { - A("a"), - - B("b"), - - C("c"), - - D("d"), - - E("e"), - - F("f"), - - G("g"), - - H("h"), - - I("i"), - - J("j"), - - K("k"), - - L("l"), - - M("m"), - - N("n"), - - P("p"), - - Q("q"), - - R("r"), - - MED_1("med1"), - - MED_2("med2"), - - /** An enum member indicating that EntityCode was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EntityCode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EntityCode fromString(String value) { - if (value == null) return _UNKNOWN; - for (EntityCode enumValue : EntityCode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TaxjarExemptionCategory { - WHOLESALE("wholesale"), - - GOVERNMENT("government"), - - OTHER("other"), - - /** - * An enum member indicating that TaxjarExemptionCategory was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - TaxjarExemptionCategory(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TaxjarExemptionCategory fromString(String value) { - if (value == null) return _UNKNOWN; - for (TaxjarExemptionCategory enumValue : TaxjarExemptionCategory.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum CustomerType { - RESIDENTIAL("residential"), - - BUSINESS("business"), - - SENIOR_CITIZEN("senior_citizen"), - - INDUSTRIAL("industrial"), - - /** An enum member indicating that CustomerType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - CustomerType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CustomerType fromString(String value) { - if (value == null) return _UNKNOWN; - for (CustomerType enumValue : CustomerType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ContractTermBuilder createdAt(Timestamp value) { - - formData.put("created_at", value); - - return this; - } - - public ContractTermBuilder contractStart(Timestamp value) { - - formData.put("contract_start", value); - - return this; - } - - public ContractTermBuilder billingCycle(Integer value) { - - formData.put("billing_cycle", value); - - return this; - } - - public ContractTermBuilder totalAmountRaised(Long value) { - - formData.put("total_amount_raised", value); - - return this; - } - - public ContractTermBuilder totalAmountRaisedBeforeTax(Long value) { - - formData.put("total_amount_raised_before_tax", value); - - return this; - } - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - RENEW_ONCE("renew_once"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - @Deprecated - public CardBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public CardBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CardBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CardBuilder number(String value) { - - formData.put("number", value); - - return this; - } - - public CardBuilder expiryMonth(Integer value) { - - formData.put("expiry_month", value); - - return this; - } - - public CardBuilder expiryYear(Integer value) { - - formData.put("expiry_year", value); - - return this; - } - - public CardBuilder cvv(String value) { - - formData.put("cvv", value); - - return this; - } - - public CardBuilder preferredScheme(PreferredScheme value) { - - formData.put("preferred_scheme", value); - - return this; - } - - public CardBuilder billingAddr1(String value) { - - formData.put("billing_addr1", value); - - return this; - } - - public CardBuilder billingAddr2(String value) { - - formData.put("billing_addr2", value); - - return this; - } - - public CardBuilder billingCity(String value) { - - formData.put("billing_city", value); - - return this; - } - - public CardBuilder billingStateCode(String value) { - - formData.put("billing_state_code", value); - - return this; - } - - public CardBuilder billingState(String value) { - - formData.put("billing_state", value); - - return this; - } - - public CardBuilder billingZip(String value) { - - formData.put("billing_zip", value); - - return this; - } - - public CardBuilder billingCountry(String value) { - - formData.put("billing_country", value); - - return this; - } - - public CardBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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 PaymentMethodParams { - - private final Map formData; - - private PaymentMethodParams(PaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentMethodBuilder builder() { - return new PaymentMethodBuilder(); - } - - public static final class PaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentMethodBuilder() {} - - public PaymentMethodBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - @Deprecated - public PaymentMethodBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public PaymentMethodBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentMethodBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public PaymentMethodBuilder issuingCountry(String value) { - - formData.put("issuing_country", value); - - return this; - } - - public PaymentMethodBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentMethodParams build() { - return new PaymentMethodParams(this); - } - } - - public enum Type { - CARD("card"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - AMAZON_PAYMENTS("amazon_payments"), - - DIRECT_DEBIT("direct_debit"), - - GENERIC("generic"), - - ALIPAY("alipay"), - - UNIONPAY("unionpay"), - - APPLE_PAY("apple_pay"), - - WECHAT_PAY("wechat_pay"), - - IDEAL("ideal"), - - GOOGLE_PAY("google_pay"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GIROPAY("giropay"), - - DOTPAY("dotpay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - VENMO("venmo"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** 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 Gateway { - 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"), - - GOCARDLESS("gocardless"), - - 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"), - - /** 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 static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class TransactionParams { - - private final Map formData; - - private TransactionParams(TransactionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionBuilder builder() { - return new TransactionBuilder(); - } - - public static final class TransactionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionBuilder() {} - - public TransactionBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public TransactionBuilder paymentMethod(PaymentMethod value) { - - formData.put("payment_method", value); - - return this; - } - - public TransactionBuilder referenceNumber(String value) { - - formData.put("reference_number", value); - - return this; - } - - public TransactionBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public TransactionParams build() { - return new TransactionParams(this); - } - } - - public enum PaymentMethod { - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - OTHER("other"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - CUSTOM("custom"), - - /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethod enumValue : PaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { - - formData.put("service_period_in_days", value); - - return this; - } - - public EventBasedAddonsBuilder onEvent(OnEvent value) { - - formData.put("on_event", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - - public enum OnEvent { - SUBSCRIPTION_CREATION("subscription_creation"), - - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** An enum member indicating that OnEvent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OnEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OnEvent fromString(String value) { - if (value == null) return _UNKNOWN; - for (OnEvent enumValue : OnEvent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ChargedEventBasedAddonsParams { - - private final Map formData; - - private ChargedEventBasedAddonsParams(ChargedEventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargedEventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargedEventBasedAddonsBuilder builder() { - return new ChargedEventBasedAddonsBuilder(); - } - - public static final class ChargedEventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargedEventBasedAddonsBuilder() {} - - public ChargedEventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public ChargedEventBasedAddonsBuilder lastChargedAt(Timestamp value) { - - formData.put("last_charged_at", value); - - return this; - } - - public ChargedEventBasedAddonsParams build() { - return new ChargedEventBasedAddonsParams(this); - } - } - } - - public static final class CouponsParams { - - private final Map formData; - - private CouponsParams(CouponsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponsBuilder builder() { - return new CouponsBuilder(); - } - - public static final class CouponsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponsBuilder() {} - - public CouponsBuilder couponId(String value) { - - formData.put("coupon_id", value); - - return this; - } - - public CouponsBuilder applyTill(Timestamp value) { - - formData.put("apply_till", value); - - return this; - } - - public CouponsParams build() { - return new CouponsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionImportUnbilledChargesParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionImportUnbilledChargesParams.java deleted file mode 100644 index 5b255a40..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionImportUnbilledChargesParams.java +++ /dev/null @@ -1,458 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class SubscriptionImportUnbilledChargesParams { - - private final Map formData; - - private SubscriptionImportUnbilledChargesParams( - SubscriptionImportUnbilledChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionImportUnbilledChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionImportUnbilledChargesBuilder builder() { - return new SubscriptionImportUnbilledChargesBuilder(); - } - - public static final class SubscriptionImportUnbilledChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionImportUnbilledChargesBuilder() {} - - public SubscriptionImportUnbilledChargesBuilder unbilledCharges( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - UnbilledChargesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "unbilled_charges[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionImportUnbilledChargesBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionImportUnbilledChargesBuilder tiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionImportUnbilledChargesParams build() { - return new SubscriptionImportUnbilledChargesParams(this); - } - } - - public static final class UnbilledChargesParams { - - private final Map formData; - - private UnbilledChargesParams(UnbilledChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UnbilledChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UnbilledChargesBuilder builder() { - return new UnbilledChargesBuilder(); - } - - public static final class UnbilledChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UnbilledChargesBuilder() {} - - public UnbilledChargesBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public UnbilledChargesBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public UnbilledChargesBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public UnbilledChargesBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public UnbilledChargesBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public UnbilledChargesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public UnbilledChargesBuilder unitAmount(Long value) { - - formData.put("unit_amount", value); - - return this; - } - - public UnbilledChargesBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public UnbilledChargesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public UnbilledChargesBuilder unitAmountInDecimal(String value) { - - formData.put("unit_amount_in_decimal", value); - - return this; - } - - public UnbilledChargesBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public UnbilledChargesBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public UnbilledChargesBuilder discountAmount(Long value) { - - formData.put("discount_amount", value); - - return this; - } - - public UnbilledChargesBuilder useForProration(Boolean value) { - - formData.put("use_for_proration", value); - - return this; - } - - public UnbilledChargesBuilder isAdvanceCharge(Boolean value) { - - formData.put("is_advance_charge", value); - - return this; - } - - public UnbilledChargesParams build() { - return new UnbilledChargesParams(this); - } - } - - public enum EntityType { - ADHOC("adhoc"), - - PLAN_ITEM_PRICE("plan_item_price"), - - ADDON_ITEM_PRICE("addon_item_price"), - - CHARGE_ITEM_PRICE("charge_item_price"), - - PLAN_SETUP("plan_setup"), - - PLAN("plan"), - - ADDON("addon"), - - /** 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 static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder unbilledChargeId(String value) { - - formData.put("unbilled_charge_id", value); - - return this; - } - - public DiscountsBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public DiscountsBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public DiscountsBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum EntityType { - ITEM_LEVEL_COUPON("item_level_coupon"), - - DOCUMENT_LEVEL_COUPON("document_level_coupon"), - - ITEM_LEVEL_DISCOUNT("item_level_discount"), - - DOCUMENT_LEVEL_DISCOUNT("document_level_discount"), - - /** 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 static final class TiersParams { - - private final Map formData; - - private TiersParams(TiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TiersBuilder builder() { - return new TiersBuilder(); - } - - public static final class TiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TiersBuilder() {} - - public TiersBuilder unbilledChargeId(String value) { - - formData.put("unbilled_charge_id", value); - - return this; - } - - public TiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public TiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public TiersBuilder quantityUsed(Integer value) { - - formData.put("quantity_used", value); - - return this; - } - - public TiersBuilder unitAmount(Long value) { - - formData.put("unit_amount", value); - - return this; - } - - public TiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public TiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public TiersBuilder quantityUsedInDecimal(String value) { - - formData.put("quantity_used_in_decimal", value); - - return this; - } - - public TiersBuilder unitAmountInDecimal(String value) { - - formData.put("unit_amount_in_decimal", value); - - return this; - } - - public TiersParams build() { - return new TiersParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionMoveParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionMoveParams.java deleted file mode 100644 index 920cc41f..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionMoveParams.java +++ /dev/null @@ -1,57 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class SubscriptionMoveParams { - - private final Map formData; - - private SubscriptionMoveParams(SubscriptionMoveBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionMoveParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionMoveBuilder builder() { - return new SubscriptionMoveBuilder(); - } - - public static final class SubscriptionMoveBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionMoveBuilder() {} - - public SubscriptionMoveBuilder toCustomerId(String value) { - - formData.put("to_customer_id", value); - - return this; - } - - public SubscriptionMoveBuilder copyPaymentSource(Boolean value) { - - formData.put("copy_payment_source", value); - - return this; - } - - public SubscriptionMoveParams build() { - return new SubscriptionMoveParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionOverrideBillingProfileParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionOverrideBillingProfileParams.java deleted file mode 100644 index 0208c81a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionOverrideBillingProfileParams.java +++ /dev/null @@ -1,86 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class SubscriptionOverrideBillingProfileParams { - - private final Map formData; - - private SubscriptionOverrideBillingProfileParams( - SubscriptionOverrideBillingProfileBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionOverrideBillingProfileParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionOverrideBillingProfileBuilder builder() { - return new SubscriptionOverrideBillingProfileBuilder(); - } - - public static final class SubscriptionOverrideBillingProfileBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionOverrideBillingProfileBuilder() {} - - public SubscriptionOverrideBillingProfileBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public SubscriptionOverrideBillingProfileBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionOverrideBillingProfileParams build() { - return new SubscriptionOverrideBillingProfileParams(this); - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionPauseParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionPauseParams.java deleted file mode 100644 index 95675e92..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionPauseParams.java +++ /dev/null @@ -1,179 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class SubscriptionPauseParams { - - private final Map formData; - - private SubscriptionPauseParams(SubscriptionPauseBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionPauseParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionPauseBuilder builder() { - return new SubscriptionPauseBuilder(); - } - - public static final class SubscriptionPauseBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionPauseBuilder() {} - - public SubscriptionPauseBuilder pauseOption(PauseOption value) { - - formData.put("pause_option", value); - - return this; - } - - public SubscriptionPauseBuilder pauseDate(Timestamp value) { - - formData.put("pause_date", value); - - return this; - } - - public SubscriptionPauseBuilder unbilledChargesHandling(UnbilledChargesHandling value) { - - formData.put("unbilled_charges_handling", value); - - return this; - } - - public SubscriptionPauseBuilder invoiceDunningHandling(InvoiceDunningHandling value) { - - formData.put("invoice_dunning_handling", value); - - return this; - } - - public SubscriptionPauseBuilder skipBillingCycles(Integer value) { - - formData.put("skip_billing_cycles", value); - - return this; - } - - public SubscriptionPauseBuilder resumeDate(Timestamp value) { - - formData.put("resume_date", value); - - return this; - } - - public SubscriptionPauseParams build() { - return new SubscriptionPauseParams(this); - } - } - - public enum PauseOption { - IMMEDIATELY("immediately"), - - END_OF_TERM("end_of_term"), - - SPECIFIC_DATE("specific_date"), - - BILLING_CYCLES("billing_cycles"), - - /** An enum member indicating that PauseOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PauseOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PauseOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (PauseOption enumValue : PauseOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum UnbilledChargesHandling { - NO_ACTION("no_action"), - - INVOICE("invoice"), - - /** - * An enum member indicating that UnbilledChargesHandling was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - UnbilledChargesHandling(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static UnbilledChargesHandling fromString(String value) { - if (value == null) return _UNKNOWN; - for (UnbilledChargesHandling enumValue : UnbilledChargesHandling.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum InvoiceDunningHandling { - CONTINUE("continue"), - - STOP("stop"), - - /** - * An enum member indicating that InvoiceDunningHandling was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - InvoiceDunningHandling(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static InvoiceDunningHandling fromString(String value) { - if (value == null) return _UNKNOWN; - for (InvoiceDunningHandling enumValue : InvoiceDunningHandling.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionReactivateParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionReactivateParams.java deleted file mode 100644 index 3c70417e..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionReactivateParams.java +++ /dev/null @@ -1,466 +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.core.models.subscription.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.sql.Timestamp; - -public final class SubscriptionReactivateParams { - - private final Map formData; - - private SubscriptionReactivateParams(SubscriptionReactivateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionReactivateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionReactivateBuilder builder() { - return new SubscriptionReactivateBuilder(); - } - - public static final class SubscriptionReactivateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionReactivateBuilder() {} - - public SubscriptionReactivateBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionReactivateBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - @Deprecated - public SubscriptionReactivateBuilder trialPeriodDays(Integer value) { - - formData.put("trial_period_days", value); - - return this; - } - - public SubscriptionReactivateBuilder reactivateFrom(Timestamp value) { - - formData.put("reactivate_from", value); - - return this; - } - - public SubscriptionReactivateBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public SubscriptionReactivateBuilder billingAlignmentMode(BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public SubscriptionReactivateBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public SubscriptionReactivateBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public SubscriptionReactivateBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionReactivateBuilder paymentInitiator(PaymentInitiator value) { - - formData.put("payment_initiator", value); - - return this; - } - - public SubscriptionReactivateBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionReactivateBuilder statementDescriptor(StatementDescriptorParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionReactivateBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionReactivateParams build() { - return new SubscriptionReactivateParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PaymentInitiator { - CUSTOMER("customer"), - - MERCHANT("merchant"), - - /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentInitiator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentInitiator fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentInitiator enumValue : PaymentInitiator.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class StatementDescriptorParams { - - private final Map formData; - - private StatementDescriptorParams(StatementDescriptorBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatementDescriptorParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatementDescriptorBuilder builder() { - return new StatementDescriptorBuilder(); - } - - public static final class StatementDescriptorBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatementDescriptorBuilder() {} - - public StatementDescriptorBuilder descriptor(String value) { - - formData.put("descriptor", value); - - return this; - } - - public StatementDescriptorParams build() { - return new StatementDescriptorParams(this); - } - } - } - - public static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRegenerateInvoiceParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRegenerateInvoiceParams.java deleted file mode 100644 index 98b707f3..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRegenerateInvoiceParams.java +++ /dev/null @@ -1,72 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class SubscriptionRegenerateInvoiceParams { - - private final Map formData; - - private SubscriptionRegenerateInvoiceParams(SubscriptionRegenerateInvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionRegenerateInvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionRegenerateInvoiceBuilder builder() { - return new SubscriptionRegenerateInvoiceBuilder(); - } - - public static final class SubscriptionRegenerateInvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionRegenerateInvoiceBuilder() {} - - public SubscriptionRegenerateInvoiceBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public SubscriptionRegenerateInvoiceBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public SubscriptionRegenerateInvoiceBuilder prorate(Boolean value) { - - formData.put("prorate", value); - - return this; - } - - public SubscriptionRegenerateInvoiceBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public SubscriptionRegenerateInvoiceParams build() { - return new SubscriptionRegenerateInvoiceParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveAdvanceInvoiceScheduleParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveAdvanceInvoiceScheduleParams.java deleted file mode 100644 index fd6739b8..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveAdvanceInvoiceScheduleParams.java +++ /dev/null @@ -1,99 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class SubscriptionRemoveAdvanceInvoiceScheduleParams { - - private final Map formData; - - private SubscriptionRemoveAdvanceInvoiceScheduleParams( - SubscriptionRemoveAdvanceInvoiceScheduleBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionRemoveAdvanceInvoiceScheduleParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionRemoveAdvanceInvoiceScheduleBuilder builder() { - return new SubscriptionRemoveAdvanceInvoiceScheduleBuilder(); - } - - public static final class SubscriptionRemoveAdvanceInvoiceScheduleBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionRemoveAdvanceInvoiceScheduleBuilder() {} - - public SubscriptionRemoveAdvanceInvoiceScheduleBuilder specificDatesSchedule( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SpecificDatesScheduleParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "specific_dates_schedule[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionRemoveAdvanceInvoiceScheduleParams build() { - return new SubscriptionRemoveAdvanceInvoiceScheduleParams(this); - } - } - - public static final class SpecificDatesScheduleParams { - - private final Map formData; - - private SpecificDatesScheduleParams(SpecificDatesScheduleBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SpecificDatesScheduleParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SpecificDatesScheduleBuilder builder() { - return new SpecificDatesScheduleBuilder(); - } - - public static final class SpecificDatesScheduleBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SpecificDatesScheduleBuilder() {} - - public SpecificDatesScheduleBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public SpecificDatesScheduleParams build() { - return new SpecificDatesScheduleParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveCouponsParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveCouponsParams.java deleted file mode 100644 index 3459da5f..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveCouponsParams.java +++ /dev/null @@ -1,51 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class SubscriptionRemoveCouponsParams { - - private final Map formData; - - private SubscriptionRemoveCouponsParams(SubscriptionRemoveCouponsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionRemoveCouponsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionRemoveCouponsBuilder builder() { - return new SubscriptionRemoveCouponsBuilder(); - } - - public static final class SubscriptionRemoveCouponsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionRemoveCouponsBuilder() {} - - public SubscriptionRemoveCouponsBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public SubscriptionRemoveCouponsParams build() { - return new SubscriptionRemoveCouponsParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveScheduledCancellationParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveScheduledCancellationParams.java deleted file mode 100644 index a7cb98b0..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveScheduledCancellationParams.java +++ /dev/null @@ -1,144 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class SubscriptionRemoveScheduledCancellationParams { - - private final Map formData; - - private SubscriptionRemoveScheduledCancellationParams( - SubscriptionRemoveScheduledCancellationBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionRemoveScheduledCancellationParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionRemoveScheduledCancellationBuilder builder() { - return new SubscriptionRemoveScheduledCancellationBuilder(); - } - - public static final class SubscriptionRemoveScheduledCancellationBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionRemoveScheduledCancellationBuilder() {} - - public SubscriptionRemoveScheduledCancellationBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionRemoveScheduledCancellationBuilder contractTermBillingCycleOnRenewal( - Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionRemoveScheduledCancellationBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionRemoveScheduledCancellationParams build() { - return new SubscriptionRemoveScheduledCancellationParams(this); - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionResumeParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionResumeParams.java deleted file mode 100644 index d6f74168..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionResumeParams.java +++ /dev/null @@ -1,353 +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.core.models.subscription.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.sql.Timestamp; - -public final class SubscriptionResumeParams { - - private final Map formData; - - private SubscriptionResumeParams(SubscriptionResumeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionResumeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionResumeBuilder builder() { - return new SubscriptionResumeBuilder(); - } - - public static final class SubscriptionResumeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionResumeBuilder() {} - - public SubscriptionResumeBuilder resumeOption(ResumeOption value) { - - formData.put("resume_option", value); - - return this; - } - - public SubscriptionResumeBuilder resumeDate(Timestamp value) { - - formData.put("resume_date", value); - - return this; - } - - public SubscriptionResumeBuilder chargesHandling(ChargesHandling value) { - - formData.put("charges_handling", value); - - return this; - } - - public SubscriptionResumeBuilder unpaidInvoicesHandling(UnpaidInvoicesHandling value) { - - formData.put("unpaid_invoices_handling", value); - - return this; - } - - public SubscriptionResumeBuilder paymentInitiator(PaymentInitiator value) { - - formData.put("payment_initiator", value); - - return this; - } - - public SubscriptionResumeBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionResumeParams build() { - return new SubscriptionResumeParams(this); - } - } - - public enum ResumeOption { - IMMEDIATELY("immediately"), - - SPECIFIC_DATE("specific_date"), - - /** An enum member indicating that ResumeOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ResumeOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ResumeOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ResumeOption enumValue : ResumeOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChargesHandling { - INVOICE_IMMEDIATELY("invoice_immediately"), - - ADD_TO_UNBILLED_CHARGES("add_to_unbilled_charges"), - - /** An enum member indicating that ChargesHandling was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargesHandling(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargesHandling fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargesHandling enumValue : ChargesHandling.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum UnpaidInvoicesHandling { - NO_ACTION("no_action"), - - SCHEDULE_PAYMENT_COLLECTION("schedule_payment_collection"), - - /** - * An enum member indicating that UnpaidInvoicesHandling was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - UnpaidInvoicesHandling(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static UnpaidInvoicesHandling fromString(String value) { - if (value == null) return _UNKNOWN; - for (UnpaidInvoicesHandling enumValue : UnpaidInvoicesHandling.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PaymentInitiator { - CUSTOMER("customer"), - - MERCHANT("merchant"), - - /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentInitiator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentInitiator fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentInitiator enumValue : PaymentInitiator.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionSubscriptionsForCustomerParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionSubscriptionsForCustomerParams.java deleted file mode 100644 index 6d4879b7..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionSubscriptionsForCustomerParams.java +++ /dev/null @@ -1,62 +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.core.models.subscription.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class SubscriptionSubscriptionsForCustomerParams { - - private final Map queryParams; - - private SubscriptionSubscriptionsForCustomerParams( - SubscriptionSubscriptionsForCustomerBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public SubscriptionSubscriptionsForCustomerBuilder toBuilder() { - SubscriptionSubscriptionsForCustomerBuilder builder = - new SubscriptionSubscriptionsForCustomerBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for SubscriptionSubscriptionsForCustomerParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionSubscriptionsForCustomerBuilder builder() { - return new SubscriptionSubscriptionsForCustomerBuilder(); - } - - public static final class SubscriptionSubscriptionsForCustomerBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private SubscriptionSubscriptionsForCustomerBuilder() {} - - public SubscriptionSubscriptionsForCustomerBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public SubscriptionSubscriptionsForCustomerBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public SubscriptionSubscriptionsForCustomerParams build() { - return new SubscriptionSubscriptionsForCustomerParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionUpdateForItemsParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionUpdateForItemsParams.java deleted file mode 100644 index 7ac23abd..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionUpdateForItemsParams.java +++ /dev/null @@ -1,2770 +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.core.models.subscription.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 SubscriptionUpdateForItemsParams { - - private final Map formData; - - private SubscriptionUpdateForItemsParams(SubscriptionUpdateForItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionUpdateForItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionUpdateForItemsBuilder builder() { - return new SubscriptionUpdateForItemsBuilder(); - } - - public static final class SubscriptionUpdateForItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionUpdateForItemsBuilder() {} - - public SubscriptionUpdateForItemsBuilder mandatoryItemsToRemove(List value) { - - formData.put("mandatory_items_to_remove", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder replaceItemsList(Boolean value) { - - formData.put("replace_items_list", value); - - return this; - } - - @Deprecated - public SubscriptionUpdateForItemsBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder netTermDays(Integer value) { - - formData.put("net_term_days", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - @Deprecated - public SubscriptionUpdateForItemsBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder reactivateFrom(Timestamp value) { - - formData.put("reactivate_from", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder billingAlignmentMode(BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder replaceCouponList(Boolean value) { - - formData.put("replace_coupon_list", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder prorate(Boolean value) { - - formData.put("prorate", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder endOfTerm(Boolean value) { - - formData.put("end_of_term", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder forceTermReset(Boolean value) { - - formData.put("force_term_reset", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder reactivate(Boolean value) { - - formData.put("reactivate", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder tokenId(String value) { - - formData.put("token_id", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public SubscriptionUpdateForItemsBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder overrideRelationship(Boolean value) { - - formData.put("override_relationship", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder changesScheduledAt(Timestamp value) { - - formData.put("changes_scheduled_at", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder changeOption(ChangeOption value) { - - formData.put("change_option", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder freePeriod(Integer value) { - - formData.put("free_period", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder freePeriodUnit(FreePeriodUnit value) { - - formData.put("free_period_unit", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder createPendingInvoices(Boolean value) { - - formData.put("create_pending_invoices", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder autoCloseInvoices(Boolean value) { - - formData.put("auto_close_invoices", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder trialEndAction(TrialEndAction value) { - - formData.put("trial_end_action", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder paymentInitiator(PaymentInitiator value) { - - formData.put("payment_initiator", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder invoiceUsages(Boolean value) { - - formData.put("invoice_usages", value); - - return this; - } - - public SubscriptionUpdateForItemsBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateForItemsBuilder paymentMethod(PaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateForItemsBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateForItemsBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateForItemsBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateForItemsBuilder statementDescriptor(StatementDescriptorParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateForItemsBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateForItemsBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateForItemsBuilder billingOverride(BillingOverrideParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_override[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateForItemsBuilder subscriptionItems( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionItemsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionUpdateForItemsBuilder discounts(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - DiscountsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionUpdateForItemsBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - @Deprecated - public SubscriptionUpdateForItemsBuilder coupons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 SubscriptionUpdateForItemsBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 SubscriptionUpdateForItemsBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateForItemsParams build() { - return new SubscriptionUpdateForItemsParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChangeOption { - IMMEDIATELY("immediately"), - - END_OF_TERM("end_of_term"), - - SPECIFIC_DATE("specific_date"), - - /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChangeOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChangeOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChangeOption enumValue : ChangeOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum FreePeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - FreePeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static FreePeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TrialEndAction { - SITE_DEFAULT("site_default"), - - PLAN_DEFAULT("plan_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialEndAction enumValue : TrialEndAction.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum PaymentInitiator { - CUSTOMER("customer"), - - MERCHANT("merchant"), - - /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentInitiator(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentInitiator fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentInitiator enumValue : PaymentInitiator.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - @Deprecated - public CardBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public CardBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CardBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CardBuilder number(String value) { - - formData.put("number", value); - - return this; - } - - public CardBuilder expiryMonth(Integer value) { - - formData.put("expiry_month", value); - - return this; - } - - public CardBuilder expiryYear(Integer value) { - - formData.put("expiry_year", value); - - return this; - } - - public CardBuilder cvv(String value) { - - formData.put("cvv", value); - - return this; - } - - public CardBuilder preferredScheme(PreferredScheme value) { - - formData.put("preferred_scheme", value); - - return this; - } - - public CardBuilder billingAddr1(String value) { - - formData.put("billing_addr1", value); - - return this; - } - - public CardBuilder billingAddr2(String value) { - - formData.put("billing_addr2", value); - - return this; - } - - public CardBuilder billingCity(String value) { - - formData.put("billing_city", value); - - return this; - } - - public CardBuilder billingStateCode(String value) { - - formData.put("billing_state_code", value); - - return this; - } - - public CardBuilder billingState(String value) { - - formData.put("billing_state", value); - - return this; - } - - public CardBuilder billingZip(String value) { - - formData.put("billing_zip", value); - - return this; - } - - public CardBuilder billingCountry(String value) { - - formData.put("billing_country", value); - - return this; - } - - @Deprecated - public CardBuilder ipAddress(String value) { - - formData.put("ip_address", value); - - return this; - } - - public CardBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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 PaymentMethodParams { - - private final Map formData; - - private PaymentMethodParams(PaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentMethodBuilder builder() { - return new PaymentMethodBuilder(); - } - - public static final class PaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentMethodBuilder() {} - - public PaymentMethodBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - @Deprecated - public PaymentMethodBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public PaymentMethodBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentMethodBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public PaymentMethodBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public PaymentMethodBuilder issuingCountry(String value) { - - formData.put("issuing_country", value); - - return this; - } - - public PaymentMethodBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentMethodParams build() { - return new PaymentMethodParams(this); - } - } - - public enum Type { - CARD("card"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - AMAZON_PAYMENTS("amazon_payments"), - - DIRECT_DEBIT("direct_debit"), - - GENERIC("generic"), - - ALIPAY("alipay"), - - UNIONPAY("unionpay"), - - APPLE_PAY("apple_pay"), - - WECHAT_PAY("wechat_pay"), - - IDEAL("ideal"), - - GOOGLE_PAY("google_pay"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GIROPAY("giropay"), - - DOTPAY("dotpay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - VENMO("venmo"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** 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 Gateway { - 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"), - - GOCARDLESS("gocardless"), - - 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"), - - /** 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 static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class StatementDescriptorParams { - - private final Map formData; - - private StatementDescriptorParams(StatementDescriptorBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatementDescriptorParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatementDescriptorBuilder builder() { - return new StatementDescriptorBuilder(); - } - - public static final class StatementDescriptorBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatementDescriptorBuilder() {} - - public StatementDescriptorBuilder descriptor(String value) { - - formData.put("descriptor", value); - - return this; - } - - public StatementDescriptorParams build() { - return new StatementDescriptorParams(this); - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder entityIdentifierScheme(String value) { - - formData.put("entity_identifier_scheme", value); - - return this; - } - - public CustomerBuilder isEinvoiceEnabled(Boolean value) { - - formData.put("is_einvoice_enabled", value); - - return this; - } - - public CustomerBuilder einvoicingMethod(EinvoicingMethod value) { - - formData.put("einvoicing_method", value); - - return this; - } - - public CustomerBuilder entityIdentifierStandard(String value) { - - formData.put("entity_identifier_standard", value); - - return this; - } - - public CustomerBuilder businessCustomerWithoutVatNumber(Boolean value) { - - formData.put("business_customer_without_vat_number", value); - - return this; - } - - public CustomerBuilder registeredForGst(Boolean value) { - - formData.put("registered_for_gst", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - - public enum EinvoicingMethod { - AUTOMATIC("automatic"), - - MANUAL("manual"), - - SITE_DEFAULT("site_default"), - - /** An enum member indicating that EinvoicingMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EinvoicingMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EinvoicingMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (EinvoicingMethod enumValue : EinvoicingMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - @Deprecated - public ContractTermBuilder contractStart(Timestamp value) { - - formData.put("contract_start", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - RENEW_ONCE("renew_once"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingOverrideParams { - - private final Map formData; - - private BillingOverrideParams(BillingOverrideBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingOverrideParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingOverrideBuilder builder() { - return new BillingOverrideBuilder(); - } - - public static final class BillingOverrideBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingOverrideBuilder() {} - - public BillingOverrideBuilder maxExcessPaymentUsage(Long value) { - - formData.put("max_excess_payment_usage", value); - - return this; - } - - public BillingOverrideBuilder maxRefundableCreditsUsage(Long value) { - - formData.put("max_refundable_credits_usage", value); - - return this; - } - - public BillingOverrideParams build() { - return new BillingOverrideParams(this); - } - } - } - - public static final class SubscriptionItemsParams { - - private final Map formData; - - private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionItemsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionItemsBuilder builder() { - return new SubscriptionItemsBuilder(); - } - - public static final class SubscriptionItemsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionItemsBuilder() {} - - public SubscriptionItemsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public SubscriptionItemsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public SubscriptionItemsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public SubscriptionItemsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public SubscriptionItemsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public SubscriptionItemsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionItemsBuilder servicePeriodDays(Integer value) { - - formData.put("service_period_days", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { - - formData.put("charge_on_event", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { - - formData.put("charge_on_option", value); - - return this; - } - - public SubscriptionItemsBuilder itemType(ItemType value) { - - formData.put("item_type", value); - - return this; - } - - public SubscriptionItemsBuilder prorationType(ProrationType value) { - - formData.put("proration_type", value); - - return this; - } - - public SubscriptionItemsBuilder usageAccumulationResetFrequency( - UsageAccumulationResetFrequency value) { - - formData.put("usage_accumulation_reset_frequency", value); - - return this; - } - - public SubscriptionItemsParams build() { - return new SubscriptionItemsParams(this); - } - } - - 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"), - - /** 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; - } - } - - public enum ChargeOnOption { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOnOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOnOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOnOption enumValue : ChargeOnOption.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 enum ProrationType { - FULL_TERM("full_term"), - - PARTIAL_TERM("partial_term"), - - NONE("none"), - - /** An enum member indicating that ProrationType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ProrationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ProrationType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ProrationType enumValue : ProrationType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum UsageAccumulationResetFrequency { - NEVER("never"), - - SUBSCRIPTION_BILLING_FREQUENCY("subscription_billing_frequency"), - - /** - * An enum member indicating that UsageAccumulationResetFrequency was instantiated with an - * unknown value. - */ - _UNKNOWN(null); - private final String value; - - UsageAccumulationResetFrequency(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static UsageAccumulationResetFrequency fromString(String value) { - if (value == null) return _UNKNOWN; - for (UsageAccumulationResetFrequency enumValue : UsageAccumulationResetFrequency.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class DiscountsParams { - - private final Map formData; - - private DiscountsParams(DiscountsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for DiscountsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static DiscountsBuilder builder() { - return new DiscountsBuilder(); - } - - public static final class DiscountsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private DiscountsBuilder() {} - - public DiscountsBuilder applyOn(ApplyOn value) { - - formData.put("apply_on", value); - - return this; - } - - public DiscountsBuilder durationType(DurationType value) { - - formData.put("duration_type", value); - - return this; - } - - public DiscountsBuilder percentage(Number value) { - - formData.put("percentage", value); - - return this; - } - - public DiscountsBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public DiscountsBuilder period(Integer value) { - - formData.put("period", value); - - return this; - } - - public DiscountsBuilder periodUnit(PeriodUnit value) { - - formData.put("period_unit", value); - - return this; - } - - public DiscountsBuilder includedInMrr(Boolean value) { - - formData.put("included_in_mrr", value); - - return this; - } - - public DiscountsBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public DiscountsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public DiscountsBuilder operationType(OperationType value) { - - formData.put("operation_type", value); - - return this; - } - - public DiscountsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public DiscountsParams build() { - return new DiscountsParams(this); - } - } - - public enum ApplyOn { - INVOICE_AMOUNT("invoice_amount"), - - SPECIFIC_ITEM_PRICE("specific_item_price"), - - /** 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 enum OperationType { - ADD("add"), - - REMOVE("remove"), - - /** An enum member indicating that OperationType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OperationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OperationType fromString(String value) { - if (value == null) return _UNKNOWN; - for (OperationType enumValue : OperationType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CouponsParams { - - private final Map formData; - - private CouponsParams(CouponsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponsBuilder builder() { - return new CouponsBuilder(); - } - - public static final class CouponsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponsBuilder() {} - - public CouponsBuilder couponId(String value) { - - formData.put("coupon_id", value); - - return this; - } - - public CouponsBuilder applyTill(Timestamp value) { - - formData.put("apply_till", value); - - return this; - } - - public CouponsParams build() { - return new CouponsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionUpdateParams.java deleted file mode 100644 index 951302b2..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionUpdateParams.java +++ /dev/null @@ -1,2302 +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.core.models.subscription.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 SubscriptionUpdateParams { - - private final Map formData; - - private SubscriptionUpdateParams(SubscriptionUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionUpdateBuilder builder() { - return new SubscriptionUpdateBuilder(); - } - - public static final class SubscriptionUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionUpdateBuilder() {} - - public SubscriptionUpdateBuilder planId(String value) { - - formData.put("plan_id", value); - - return this; - } - - public SubscriptionUpdateBuilder planQuantity(Integer value) { - - formData.put("plan_quantity", value); - - return this; - } - - public SubscriptionUpdateBuilder planUnitPrice(Long value) { - - formData.put("plan_unit_price", value); - - return this; - } - - public SubscriptionUpdateBuilder setupFee(Long value) { - - formData.put("setup_fee", value); - - return this; - } - - public SubscriptionUpdateBuilder replaceAddonList(Boolean value) { - - formData.put("replace_addon_list", value); - - return this; - } - - public SubscriptionUpdateBuilder mandatoryAddonsToRemove(List value) { - - formData.put("mandatory_addons_to_remove", value); - - return this; - } - - public SubscriptionUpdateBuilder planQuantityInDecimal(String value) { - - formData.put("plan_quantity_in_decimal", value); - - return this; - } - - public SubscriptionUpdateBuilder planUnitPriceInDecimal(String value) { - - formData.put("plan_unit_price_in_decimal", value); - - return this; - } - - public SubscriptionUpdateBuilder invoiceDate(Timestamp value) { - - formData.put("invoice_date", value); - - return this; - } - - public SubscriptionUpdateBuilder startDate(Timestamp value) { - - formData.put("start_date", value); - - return this; - } - - public SubscriptionUpdateBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public SubscriptionUpdateBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - @Deprecated - public SubscriptionUpdateBuilder coupon(String value) { - - formData.put("coupon", value); - - return this; - } - - public SubscriptionUpdateBuilder termsToCharge(Integer value) { - - formData.put("terms_to_charge", value); - - return this; - } - - public SubscriptionUpdateBuilder reactivateFrom(Timestamp value) { - - formData.put("reactivate_from", value); - - return this; - } - - public SubscriptionUpdateBuilder billingAlignmentMode(BillingAlignmentMode value) { - - formData.put("billing_alignment_mode", value); - - return this; - } - - public SubscriptionUpdateBuilder autoCollection(AutoCollection value) { - - formData.put("auto_collection", value); - - return this; - } - - public SubscriptionUpdateBuilder offlinePaymentMethod(OfflinePaymentMethod value) { - - formData.put("offline_payment_method", value); - - return this; - } - - public SubscriptionUpdateBuilder poNumber(String value) { - - formData.put("po_number", value); - - return this; - } - - public SubscriptionUpdateBuilder couponIds(List value) { - - formData.put("coupon_ids", value); - - return this; - } - - public SubscriptionUpdateBuilder replaceCouponList(Boolean value) { - - formData.put("replace_coupon_list", value); - - return this; - } - - public SubscriptionUpdateBuilder prorate(Boolean value) { - - formData.put("prorate", value); - - return this; - } - - public SubscriptionUpdateBuilder endOfTerm(Boolean value) { - - formData.put("end_of_term", value); - - return this; - } - - public SubscriptionUpdateBuilder forceTermReset(Boolean value) { - - formData.put("force_term_reset", value); - - return this; - } - - public SubscriptionUpdateBuilder reactivate(Boolean value) { - - formData.put("reactivate", value); - - return this; - } - - public SubscriptionUpdateBuilder tokenId(String value) { - - formData.put("token_id", value); - - return this; - } - - public SubscriptionUpdateBuilder invoiceNotes(String value) { - - formData.put("invoice_notes", value); - - return this; - } - - public SubscriptionUpdateBuilder metaData(java.util.Map value) { - - formData.put("meta_data", JsonUtil.toJson(value)); - - return this; - } - - public SubscriptionUpdateBuilder invoiceImmediately(Boolean value) { - - formData.put("invoice_immediately", value); - - return this; - } - - public SubscriptionUpdateBuilder overrideRelationship(Boolean value) { - - formData.put("override_relationship", value); - - return this; - } - - public SubscriptionUpdateBuilder changesScheduledAt(Timestamp value) { - - formData.put("changes_scheduled_at", value); - - return this; - } - - public SubscriptionUpdateBuilder changeOption(ChangeOption value) { - - formData.put("change_option", value); - - return this; - } - - public SubscriptionUpdateBuilder contractTermBillingCycleOnRenewal(Integer value) { - - formData.put("contract_term_billing_cycle_on_renewal", value); - - return this; - } - - public SubscriptionUpdateBuilder freePeriod(Integer value) { - - formData.put("free_period", value); - - return this; - } - - public SubscriptionUpdateBuilder freePeriodUnit(FreePeriodUnit value) { - - formData.put("free_period_unit", value); - - return this; - } - - public SubscriptionUpdateBuilder trialEndAction(TrialEndAction value) { - - formData.put("trial_end_action", value); - - return this; - } - - public SubscriptionUpdateBuilder card(CardParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "card[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateBuilder paymentMethod(PaymentMethodParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_method[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateBuilder paymentIntent(PaymentIntentParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "payment_intent[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateBuilder billingAddress(BillingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "billing_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateBuilder shippingAddress(ShippingAddressParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "shipping_address[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateBuilder statementDescriptor(StatementDescriptorParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateBuilder customer(CustomerParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateBuilder contractTerm(ContractTermParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "contract_term[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionUpdateBuilder eventBasedAddons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventBasedAddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - @Deprecated - public SubscriptionUpdateBuilder coupons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - CouponsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - 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 SubscriptionUpdateBuilder customField(String fieldName, Object value) { - if (fieldName == null || !fieldName.startsWith("cf_")) { - throw new IllegalArgumentException("Custom field name must start with 'cf_'"); - } - formData.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 SubscriptionUpdateBuilder 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()); - } - formData.put(entry.getKey(), entry.getValue()); - } - } - return this; - } - - public SubscriptionUpdateParams build() { - return new SubscriptionUpdateParams(this); - } - } - - public enum BillingAlignmentMode { - IMMEDIATE("immediate"), - - DELAYED("delayed"), - - /** - * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - BillingAlignmentMode(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static BillingAlignmentMode fromString(String value) { - if (value == null) return _UNKNOWN; - for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum AutoCollection { - ON("on"), - - OFF("off"), - - /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AutoCollection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCollection fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCollection enumValue : AutoCollection.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OfflinePaymentMethod { - NO_PREFERENCE("no_preference"), - - CASH("cash"), - - CHECK("check"), - - BANK_TRANSFER("bank_transfer"), - - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - BOLETO("boleto"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - CUSTOM("custom"), - - /** - * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - OfflinePaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OfflinePaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChangeOption { - IMMEDIATELY("immediately"), - - END_OF_TERM("end_of_term"), - - SPECIFIC_DATE("specific_date"), - - /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChangeOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChangeOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChangeOption enumValue : ChangeOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum FreePeriodUnit { - DAY("day"), - - WEEK("week"), - - MONTH("month"), - - YEAR("year"), - - /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - FreePeriodUnit(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static FreePeriodUnit fromString(String value) { - if (value == null) return _UNKNOWN; - for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum TrialEndAction { - SITE_DEFAULT("site_default"), - - PLAN_DEFAULT("plan_default"), - - ACTIVATE_SUBSCRIPTION("activate_subscription"), - - CANCEL_SUBSCRIPTION("cancel_subscription"), - - /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - TrialEndAction(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static TrialEndAction fromString(String value) { - if (value == null) return _UNKNOWN; - for (TrialEndAction enumValue : TrialEndAction.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class CardParams { - - private final Map formData; - - private CardParams(CardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CardBuilder builder() { - return new CardBuilder(); - } - - public static final class CardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CardBuilder() {} - - @Deprecated - public CardBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public CardBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - @Deprecated - public CardBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public CardBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public CardBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public CardBuilder number(String value) { - - formData.put("number", value); - - return this; - } - - public CardBuilder expiryMonth(Integer value) { - - formData.put("expiry_month", value); - - return this; - } - - public CardBuilder expiryYear(Integer value) { - - formData.put("expiry_year", value); - - return this; - } - - public CardBuilder cvv(String value) { - - formData.put("cvv", value); - - return this; - } - - public CardBuilder preferredScheme(PreferredScheme value) { - - formData.put("preferred_scheme", value); - - return this; - } - - public CardBuilder billingAddr1(String value) { - - formData.put("billing_addr1", value); - - return this; - } - - public CardBuilder billingAddr2(String value) { - - formData.put("billing_addr2", value); - - return this; - } - - public CardBuilder billingCity(String value) { - - formData.put("billing_city", value); - - return this; - } - - public CardBuilder billingStateCode(String value) { - - formData.put("billing_state_code", value); - - return this; - } - - public CardBuilder billingState(String value) { - - formData.put("billing_state", value); - - return this; - } - - public CardBuilder billingZip(String value) { - - formData.put("billing_zip", value); - - return this; - } - - public CardBuilder billingCountry(String value) { - - formData.put("billing_country", value); - - return this; - } - - @Deprecated - public CardBuilder ipAddress(String value) { - - formData.put("ip_address", value); - - return this; - } - - public CardBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public CardParams build() { - return new CardParams(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"), - - /** 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 PaymentMethodParams { - - private final Map formData; - - private PaymentMethodParams(PaymentMethodBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentMethodParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentMethodBuilder builder() { - return new PaymentMethodBuilder(); - } - - public static final class PaymentMethodBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentMethodBuilder() {} - - public PaymentMethodBuilder type(Type value) { - - formData.put("type", value); - - return this; - } - - @Deprecated - public PaymentMethodBuilder gateway(Gateway value) { - - formData.put("gateway", value); - - return this; - } - - public PaymentMethodBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentMethodBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public PaymentMethodBuilder tmpToken(String value) { - - formData.put("tmp_token", value); - - return this; - } - - public PaymentMethodBuilder issuingCountry(String value) { - - formData.put("issuing_country", value); - - return this; - } - - public PaymentMethodBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentMethodParams build() { - return new PaymentMethodParams(this); - } - } - - public enum Type { - CARD("card"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - AMAZON_PAYMENTS("amazon_payments"), - - DIRECT_DEBIT("direct_debit"), - - GENERIC("generic"), - - ALIPAY("alipay"), - - UNIONPAY("unionpay"), - - APPLE_PAY("apple_pay"), - - WECHAT_PAY("wechat_pay"), - - IDEAL("ideal"), - - GOOGLE_PAY("google_pay"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GIROPAY("giropay"), - - DOTPAY("dotpay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - VENMO("venmo"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** 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 Gateway { - 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"), - - GOCARDLESS("gocardless"), - - 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"), - - /** 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 static final class PaymentIntentParams { - - private final Map formData; - - private PaymentIntentParams(PaymentIntentBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for PaymentIntentParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static PaymentIntentBuilder builder() { - return new PaymentIntentBuilder(); - } - - public static final class PaymentIntentBuilder { - private final Map formData = new LinkedHashMap<>(); - - private PaymentIntentBuilder() {} - - public PaymentIntentBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public PaymentIntentBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - - return this; - } - - public PaymentIntentBuilder gwToken(String value) { - - formData.put("gw_token", value); - - return this; - } - - public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { - - formData.put("payment_method_type", value); - - return this; - } - - public PaymentIntentBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - @Deprecated - public PaymentIntentBuilder gwPaymentMethodId(String value) { - - formData.put("gw_payment_method_id", value); - - return this; - } - - public PaymentIntentBuilder additionalInformation(java.util.Map value) { - - formData.put("additional_information", JsonUtil.toJson(value)); - - return this; - } - - public PaymentIntentParams build() { - return new PaymentIntentParams(this); - } - } - - public enum PaymentMethodType { - CARD("card"), - - IDEAL("ideal"), - - SOFORT("sofort"), - - BANCONTACT("bancontact"), - - GOOGLE_PAY("google_pay"), - - DOTPAY("dotpay"), - - GIROPAY("giropay"), - - APPLE_PAY("apple_pay"), - - UPI("upi"), - - NETBANKING_EMANDATES("netbanking_emandates"), - - PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), - - DIRECT_DEBIT("direct_debit"), - - BOLETO("boleto"), - - VENMO("venmo"), - - AMAZON_PAYMENTS("amazon_payments"), - - PAY_TO("pay_to"), - - FASTER_PAYMENTS("faster_payments"), - - SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), - - KLARNA_PAY_NOW("klarna_pay_now"), - - ONLINE_BANKING_POLAND("online_banking_poland"), - - PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), - - /** - * An enum member indicating that PaymentMethodType was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - PaymentMethodType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethodType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethodType enumValue : PaymentMethodType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class BillingAddressParams { - - private final Map formData; - - private BillingAddressParams(BillingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for BillingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static BillingAddressBuilder builder() { - return new BillingAddressBuilder(); - } - - public static final class BillingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private BillingAddressBuilder() {} - - public BillingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public BillingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public BillingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public BillingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public BillingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public BillingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public BillingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public BillingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public BillingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public BillingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public BillingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public BillingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public BillingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public BillingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public BillingAddressParams build() { - return new BillingAddressParams(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; - } - } - } - - public static final class ShippingAddressParams { - - private final Map formData; - - private ShippingAddressParams(ShippingAddressBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ShippingAddressParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ShippingAddressBuilder builder() { - return new ShippingAddressBuilder(); - } - - public static final class ShippingAddressBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ShippingAddressBuilder() {} - - public ShippingAddressBuilder firstName(String value) { - - formData.put("first_name", value); - - return this; - } - - public ShippingAddressBuilder lastName(String value) { - - formData.put("last_name", value); - - return this; - } - - public ShippingAddressBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public ShippingAddressBuilder company(String value) { - - formData.put("company", value); - - return this; - } - - public ShippingAddressBuilder phone(String value) { - - formData.put("phone", value); - - return this; - } - - public ShippingAddressBuilder line1(String value) { - - formData.put("line1", value); - - return this; - } - - public ShippingAddressBuilder line2(String value) { - - formData.put("line2", value); - - return this; - } - - public ShippingAddressBuilder line3(String value) { - - formData.put("line3", value); - - return this; - } - - public ShippingAddressBuilder city(String value) { - - formData.put("city", value); - - return this; - } - - public ShippingAddressBuilder stateCode(String value) { - - formData.put("state_code", value); - - return this; - } - - public ShippingAddressBuilder state(String value) { - - formData.put("state", value); - - return this; - } - - public ShippingAddressBuilder zip(String value) { - - formData.put("zip", value); - - return this; - } - - public ShippingAddressBuilder country(String value) { - - formData.put("country", value); - - return this; - } - - public ShippingAddressBuilder validationStatus(ValidationStatus value) { - - formData.put("validation_status", value); - - return this; - } - - public ShippingAddressParams build() { - return new ShippingAddressParams(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; - } - } - } - - public static final class StatementDescriptorParams { - - private final Map formData; - - private StatementDescriptorParams(StatementDescriptorBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for StatementDescriptorParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static StatementDescriptorBuilder builder() { - return new StatementDescriptorBuilder(); - } - - public static final class StatementDescriptorBuilder { - private final Map formData = new LinkedHashMap<>(); - - private StatementDescriptorBuilder() {} - - public StatementDescriptorBuilder descriptor(String value) { - - formData.put("descriptor", value); - - return this; - } - - public StatementDescriptorParams build() { - return new StatementDescriptorParams(this); - } - } - } - - public static final class CustomerParams { - - private final Map formData; - - private CustomerParams(CustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - 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 final Map formData = new LinkedHashMap<>(); - - private CustomerBuilder() {} - - public CustomerBuilder vatNumber(String value) { - - formData.put("vat_number", value); - - return this; - } - - public CustomerBuilder vatNumberPrefix(String value) { - - formData.put("vat_number_prefix", value); - - return this; - } - - public CustomerBuilder entityIdentifierScheme(String value) { - - formData.put("entity_identifier_scheme", value); - - return this; - } - - public CustomerBuilder isEinvoiceEnabled(Boolean value) { - - formData.put("is_einvoice_enabled", value); - - return this; - } - - public CustomerBuilder einvoicingMethod(EinvoicingMethod value) { - - formData.put("einvoicing_method", value); - - return this; - } - - public CustomerBuilder entityIdentifierStandard(String value) { - - formData.put("entity_identifier_standard", value); - - return this; - } - - public CustomerBuilder businessCustomerWithoutVatNumber(Boolean value) { - - formData.put("business_customer_without_vat_number", value); - - return this; - } - - public CustomerBuilder registeredForGst(Boolean value) { - - formData.put("registered_for_gst", value); - - return this; - } - - public CustomerParams build() { - return new CustomerParams(this); - } - } - - public enum EinvoicingMethod { - AUTOMATIC("automatic"), - - MANUAL("manual"), - - SITE_DEFAULT("site_default"), - - /** An enum member indicating that EinvoicingMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EinvoicingMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EinvoicingMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (EinvoicingMethod enumValue : EinvoicingMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ContractTermParams { - - private final Map formData; - - private ContractTermParams(ContractTermBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ContractTermParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ContractTermBuilder builder() { - return new ContractTermBuilder(); - } - - public static final class ContractTermBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ContractTermBuilder() {} - - public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { - - formData.put("action_at_term_end", value); - - return this; - } - - public ContractTermBuilder cancellationCutoffPeriod(Integer value) { - - formData.put("cancellation_cutoff_period", value); - - return this; - } - - public ContractTermParams build() { - return new ContractTermParams(this); - } - } - - public enum ActionAtTermEnd { - RENEW("renew"), - - EVERGREEN("evergreen"), - - CANCEL("cancel"), - - RENEW_ONCE("renew_once"), - - /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ActionAtTermEnd(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ActionAtTermEnd fromString(String value) { - if (value == null) return _UNKNOWN; - for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder billingCycles(Integer value) { - - formData.put("billing_cycles", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder trialEnd(Timestamp value) { - - formData.put("trial_end", value); - - return this; - } - - public AddonsBuilder prorationType(ProrationType value) { - - formData.put("proration_type", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - - public enum ProrationType { - FULL_TERM("full_term"), - - PARTIAL_TERM("partial_term"), - - NONE("none"), - - /** An enum member indicating that ProrationType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ProrationType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ProrationType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ProrationType enumValue : ProrationType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class EventBasedAddonsParams { - - private final Map formData; - - private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventBasedAddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventBasedAddonsBuilder builder() { - return new EventBasedAddonsBuilder(); - } - - public static final class EventBasedAddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventBasedAddonsBuilder() {} - - public EventBasedAddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public EventBasedAddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public EventBasedAddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { - - formData.put("service_period_in_days", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOn(ChargeOn value) { - - formData.put("charge_on", value); - - return this; - } - - public EventBasedAddonsBuilder onEvent(OnEvent value) { - - formData.put("on_event", value); - - return this; - } - - public EventBasedAddonsBuilder chargeOnce(Boolean value) { - - formData.put("charge_once", value); - - return this; - } - - public EventBasedAddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public EventBasedAddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public EventBasedAddonsParams build() { - return new EventBasedAddonsParams(this); - } - } - - public enum ChargeOn { - IMMEDIATELY("immediately"), - - ON_EVENT("on_event"), - - /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ChargeOn(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargeOn fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargeOn enumValue : ChargeOn.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum OnEvent { - SUBSCRIPTION_CREATION("subscription_creation"), - - SUBSCRIPTION_TRIAL_START("subscription_trial_start"), - - PLAN_ACTIVATION("plan_activation"), - - SUBSCRIPTION_ACTIVATION("subscription_activation"), - - CONTRACT_TERMINATION("contract_termination"), - - /** An enum member indicating that OnEvent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - OnEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static OnEvent fromString(String value) { - if (value == null) return _UNKNOWN; - for (OnEvent enumValue : OnEvent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class CouponsParams { - - private final Map formData; - - private CouponsParams(CouponsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for CouponsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static CouponsBuilder builder() { - return new CouponsBuilder(); - } - - public static final class CouponsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private CouponsBuilder() {} - - public CouponsBuilder couponId(String value) { - - formData.put("coupon_id", value); - - return this; - } - - public CouponsBuilder applyTill(Timestamp value) { - - formData.put("apply_till", value); - - return this; - } - - public CouponsParams build() { - return new CouponsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlement/params/SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityParams.java b/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlement/params/SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityParams.java deleted file mode 100644 index bb0c864b..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlement/params/SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityParams.java +++ /dev/null @@ -1,109 +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.core.models.subscriptionEntitlement.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityParams { - - private final Map formData; - - private SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityParams( - SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** - * Create a new builder for SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityParams. - */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityBuilder builder() { - return new SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityBuilder(); - } - - public static final class SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityBuilder() {} - - public SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityBuilder isEnabled( - Boolean value) { - - formData.put("is_enabled", value); - - return this; - } - - public SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityBuilder - subscriptionEntitlements(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - SubscriptionEntitlementsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "subscription_entitlements[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityParams build() { - return new SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityParams(this); - } - } - - public static final class SubscriptionEntitlementsParams { - - private final Map formData; - - private SubscriptionEntitlementsParams(SubscriptionEntitlementsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for SubscriptionEntitlementsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionEntitlementsBuilder builder() { - return new SubscriptionEntitlementsBuilder(); - } - - public static final class SubscriptionEntitlementsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private SubscriptionEntitlementsBuilder() {} - - public SubscriptionEntitlementsBuilder featureId(String value) { - - formData.put("feature_id", value); - - return this; - } - - public SubscriptionEntitlementsParams build() { - return new SubscriptionEntitlementsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlement/params/SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlement/params/SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams.java deleted file mode 100644 index 69ecdf3a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlement/params/SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams.java +++ /dev/null @@ -1,87 +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.core.models.subscriptionEntitlement.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams { - - private final Map queryParams; - - private SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams( - SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionBuilder toBuilder() { - SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionBuilder builder = - new SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** - * Create a new builder for SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams. - */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionBuilder builder() { - return new SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionBuilder(); - } - - public static final class SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionBuilder() {} - - public SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionBuilder limit( - Integer value) { - queryParams.put("limit", value); - return this; - } - - public SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionBuilder offset( - String value) { - queryParams.put("offset", value); - return this; - } - - @Deprecated - public SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionBuilder includeDrafts( - Boolean value) { - queryParams.put("include_drafts", value); - return this; - } - - @Deprecated - public SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionBuilder embed( - String value) { - queryParams.put("embed", value); - return this; - } - - @Deprecated - public SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionBuilder - includeScheduledOverrides(Boolean value) { - queryParams.put("include_scheduled_overrides", value); - return this; - } - - public SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams build() { - return new SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/thirdPartyConfiguration/params/ThirdPartyConfigurationUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/thirdPartyConfiguration/params/ThirdPartyConfigurationUpdateParams.java deleted file mode 100644 index 8784afce..00000000 --- a/src/main/java/com/chargebee/v4/core/models/thirdPartyConfiguration/params/ThirdPartyConfigurationUpdateParams.java +++ /dev/null @@ -1,73 +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.core.models.thirdPartyConfiguration.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.sql.Timestamp; - -public final class ThirdPartyConfigurationUpdateParams { - - private final Map formData; - - private ThirdPartyConfigurationUpdateParams(ThirdPartyConfigurationUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ThirdPartyConfigurationUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ThirdPartyConfigurationUpdateBuilder builder() { - return new ThirdPartyConfigurationUpdateBuilder(); - } - - public static final class ThirdPartyConfigurationUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ThirdPartyConfigurationUpdateBuilder() {} - - public ThirdPartyConfigurationUpdateBuilder integrationName(String value) { - - formData.put("integration_name", value); - - return this; - } - - public ThirdPartyConfigurationUpdateBuilder configJson(java.util.Map value) { - - formData.put("config_json", JsonUtil.toJson(value)); - - return this; - } - - public ThirdPartyConfigurationUpdateBuilder authJson(java.util.Map value) { - - formData.put("auth_json", JsonUtil.toJson(value)); - - return this; - } - - public ThirdPartyConfigurationUpdateBuilder lastSyncAt(Timestamp value) { - - formData.put("last_sync_at", value); - - return this; - } - - public ThirdPartyConfigurationUpdateParams build() { - return new ThirdPartyConfigurationUpdateParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingUpdateEntityParams.java b/src/main/java/com/chargebee/v4/core/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingUpdateEntityParams.java deleted file mode 100644 index 58d8fa2d..00000000 --- a/src/main/java/com/chargebee/v4/core/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingUpdateEntityParams.java +++ /dev/null @@ -1,286 +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.core.models.thirdPartyEntityMapping.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; - -public final class ThirdPartyEntityMappingUpdateEntityParams { - - private final Map formData; - - private ThirdPartyEntityMappingUpdateEntityParams( - ThirdPartyEntityMappingUpdateEntityBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ThirdPartyEntityMappingUpdateEntityParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ThirdPartyEntityMappingUpdateEntityBuilder builder() { - return new ThirdPartyEntityMappingUpdateEntityBuilder(); - } - - public static final class ThirdPartyEntityMappingUpdateEntityBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ThirdPartyEntityMappingUpdateEntityBuilder() {} - - public ThirdPartyEntityMappingUpdateEntityBuilder entityType(EntityType value) { - - formData.put("entity_type", value); - - return this; - } - - public ThirdPartyEntityMappingUpdateEntityBuilder entityId(String value) { - - formData.put("entity_id", value); - - return this; - } - - public ThirdPartyEntityMappingUpdateEntityBuilder thirdPartyEntityId(String value) { - - formData.put("third_party_entity_id", value); - - return this; - } - - public ThirdPartyEntityMappingUpdateEntityBuilder integrationName(String value) { - - formData.put("integration_name", value); - - return this; - } - - public ThirdPartyEntityMappingUpdateEntityBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public ThirdPartyEntityMappingUpdateEntityBuilder oldResource( - java.util.Map value) { - - formData.put("old_resource", JsonUtil.toJson(value)); - - return this; - } - - public ThirdPartyEntityMappingUpdateEntityBuilder mappingMeta( - java.util.Map value) { - - formData.put("mapping_meta", JsonUtil.toJson(value)); - - return this; - } - - public ThirdPartyEntityMappingUpdateEntityBuilder failedDependentEntityId(String value) { - - formData.put("failed_dependent_entity_id", value); - - return this; - } - - public ThirdPartyEntityMappingUpdateEntityBuilder failedDependentEntityType( - FailedDependentEntityType value) { - - formData.put("failed_dependent_entity_type", value); - - return this; - } - - public ThirdPartyEntityMappingUpdateEntityBuilder errorMessage(String value) { - - formData.put("error_message", value); - - return this; - } - - public ThirdPartyEntityMappingUpdateEntityBuilder url(String value) { - - formData.put("url", value); - - return this; - } - - public ThirdPartyEntityMappingUpdateEntityParams build() { - return new ThirdPartyEntityMappingUpdateEntityParams(this); - } - } - - public enum EntityType { - CUSTOMER("customer"), - - INVOICE("invoice"), - - CREDIT_NOTE("credit_note"), - - TRANSACTION("transaction"), - - PLAN("plan"), - - ADDON("addon"), - - COUPON("coupon"), - - SUBSCRIPTION("subscription"), - - ORDER("order"), - - QUOTE("quote"), - - ITEM_FAMILY("item_family"), - - ITEM("item"), - - ITEM_PRICE("item_price"), - - TAX_RATE("tax_rate"), - - TAX_GROUP("tax_group"), - - /** 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 Status { - SYNCED("synced"), - - PARTIALLY_SYNCED("partially_synced"), - - CREATE_FAILED("create_failed"), - - UPDATE_FAILED("update_failed"), - - STOPPED("stopped"), - - IGNORED("ignored"), - - TO_BE_PICKED("to_be_picked"), - - FORCE_SYNC("force_sync"), - - MISMATCH("mismatch"), - - DELETED("deleted"), - - QUEUED("queued"), - - DELETE_FAILED("delete_failed"), - - DELETE_SUCCESS("delete_success"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum FailedDependentEntityType { - CUSTOMER("customer"), - - INVOICE("invoice"), - - CREDIT_NOTE("credit_note"), - - TRANSACTION("transaction"), - - PLAN("plan"), - - ADDON("addon"), - - COUPON("coupon"), - - SUBSCRIPTION("subscription"), - - ORDER("order"), - - QUOTE("quote"), - - ITEM_FAMILY("item_family"), - - ITEM("item"), - - ITEM_PRICE("item_price"), - - TAX_RATE("tax_rate"), - - TAX_GROUP("tax_group"), - - /** - * An enum member indicating that FailedDependentEntityType was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - FailedDependentEntityType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static FailedDependentEntityType fromString(String value) { - if (value == null) return _UNKNOWN; - for (FailedDependentEntityType enumValue : FailedDependentEntityType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/thirdPartySyncDetail/params/ThirdPartySyncDetailCreateParams.java b/src/main/java/com/chargebee/v4/core/models/thirdPartySyncDetail/params/ThirdPartySyncDetailCreateParams.java deleted file mode 100644 index f494e447..00000000 --- a/src/main/java/com/chargebee/v4/core/models/thirdPartySyncDetail/params/ThirdPartySyncDetailCreateParams.java +++ /dev/null @@ -1,100 +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.core.models.thirdPartySyncDetail.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; - -public final class ThirdPartySyncDetailCreateParams { - - private final Map formData; - - private ThirdPartySyncDetailCreateParams(ThirdPartySyncDetailCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ThirdPartySyncDetailCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ThirdPartySyncDetailCreateBuilder builder() { - return new ThirdPartySyncDetailCreateBuilder(); - } - - public static final class ThirdPartySyncDetailCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ThirdPartySyncDetailCreateBuilder() {} - - public ThirdPartySyncDetailCreateBuilder context(java.util.Map value) { - - formData.put("context", JsonUtil.toJson(value)); - - return this; - } - - public ThirdPartySyncDetailCreateBuilder thirdPartyConfiguration( - ThirdPartyConfigurationParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "third_party_configuration[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public ThirdPartySyncDetailCreateParams build() { - return new ThirdPartySyncDetailCreateParams(this); - } - } - - public static final class ThirdPartyConfigurationParams { - - private final Map formData; - - private ThirdPartyConfigurationParams(ThirdPartyConfigurationBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ThirdPartyConfigurationParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ThirdPartyConfigurationBuilder builder() { - return new ThirdPartyConfigurationBuilder(); - } - - public static final class ThirdPartyConfigurationBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ThirdPartyConfigurationBuilder() {} - - public ThirdPartyConfigurationBuilder integrationName(String value) { - - formData.put("integration_name", value); - - return this; - } - - public ThirdPartyConfigurationParams build() { - return new ThirdPartyConfigurationParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/thirdPartySyncDetail/params/ThirdPartySyncDetailUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/thirdPartySyncDetail/params/ThirdPartySyncDetailUpdateParams.java deleted file mode 100644 index 5aa0d026..00000000 --- a/src/main/java/com/chargebee/v4/core/models/thirdPartySyncDetail/params/ThirdPartySyncDetailUpdateParams.java +++ /dev/null @@ -1,92 +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.core.models.thirdPartySyncDetail.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; - -public final class ThirdPartySyncDetailUpdateParams { - - private final Map formData; - - private ThirdPartySyncDetailUpdateParams(ThirdPartySyncDetailUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ThirdPartySyncDetailUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ThirdPartySyncDetailUpdateBuilder builder() { - return new ThirdPartySyncDetailUpdateBuilder(); - } - - public static final class ThirdPartySyncDetailUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ThirdPartySyncDetailUpdateBuilder() {} - - public ThirdPartySyncDetailUpdateBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public ThirdPartySyncDetailUpdateBuilder context(java.util.Map value) { - - formData.put("context", JsonUtil.toJson(value)); - - return this; - } - - public ThirdPartySyncDetailUpdateParams build() { - return new ThirdPartySyncDetailUpdateParams(this); - } - } - - public enum Status { - SUCCEEDED("succeeded"), - - FAILED("failed"), - - STARTED("started"), - - RUNNING("running"), - - ABORTED("aborted"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/timeMachine/params/TimeMachineStartAfreshParams.java b/src/main/java/com/chargebee/v4/core/models/timeMachine/params/TimeMachineStartAfreshParams.java deleted file mode 100644 index 0d45c9f1..00000000 --- a/src/main/java/com/chargebee/v4/core/models/timeMachine/params/TimeMachineStartAfreshParams.java +++ /dev/null @@ -1,51 +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.core.models.timeMachine.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class TimeMachineStartAfreshParams { - - private final Map formData; - - private TimeMachineStartAfreshParams(TimeMachineStartAfreshBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TimeMachineStartAfreshParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TimeMachineStartAfreshBuilder builder() { - return new TimeMachineStartAfreshBuilder(); - } - - public static final class TimeMachineStartAfreshBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TimeMachineStartAfreshBuilder() {} - - public TimeMachineStartAfreshBuilder genesisTime(Timestamp value) { - - formData.put("genesis_time", value); - - return this; - } - - public TimeMachineStartAfreshParams build() { - return new TimeMachineStartAfreshParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/timeMachine/params/TimeMachineTravelForwardParams.java b/src/main/java/com/chargebee/v4/core/models/timeMachine/params/TimeMachineTravelForwardParams.java deleted file mode 100644 index 7ec5c261..00000000 --- a/src/main/java/com/chargebee/v4/core/models/timeMachine/params/TimeMachineTravelForwardParams.java +++ /dev/null @@ -1,51 +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.core.models.timeMachine.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class TimeMachineTravelForwardParams { - - private final Map formData; - - private TimeMachineTravelForwardParams(TimeMachineTravelForwardBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TimeMachineTravelForwardParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TimeMachineTravelForwardBuilder builder() { - return new TimeMachineTravelForwardBuilder(); - } - - public static final class TimeMachineTravelForwardBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TimeMachineTravelForwardBuilder() {} - - public TimeMachineTravelForwardBuilder destinationTime(Timestamp value) { - - formData.put("destination_time", value); - - return this; - } - - public TimeMachineTravelForwardParams build() { - return new TimeMachineTravelForwardParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/tpSiteUser/params/TpSiteUserGuestsForTpSiteUserParams.java b/src/main/java/com/chargebee/v4/core/models/tpSiteUser/params/TpSiteUserGuestsForTpSiteUserParams.java deleted file mode 100644 index 05224beb..00000000 --- a/src/main/java/com/chargebee/v4/core/models/tpSiteUser/params/TpSiteUserGuestsForTpSiteUserParams.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.core.models.tpSiteUser.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class TpSiteUserGuestsForTpSiteUserParams { - - private final Map queryParams; - - private TpSiteUserGuestsForTpSiteUserParams(TpSiteUserGuestsForTpSiteUserBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public TpSiteUserGuestsForTpSiteUserBuilder toBuilder() { - TpSiteUserGuestsForTpSiteUserBuilder builder = new TpSiteUserGuestsForTpSiteUserBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for TpSiteUserGuestsForTpSiteUserParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TpSiteUserGuestsForTpSiteUserBuilder builder() { - return new TpSiteUserGuestsForTpSiteUserBuilder(); - } - - public static final class TpSiteUserGuestsForTpSiteUserBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private TpSiteUserGuestsForTpSiteUserBuilder() {} - - public TpSiteUserGuestsForTpSiteUserBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public TpSiteUserGuestsForTpSiteUserBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public TpSiteUserGuestsForTpSiteUserParams build() { - return new TpSiteUserGuestsForTpSiteUserParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/tpSiteUser/params/TpSiteUserPayNowEnableLiveParams.java b/src/main/java/com/chargebee/v4/core/models/tpSiteUser/params/TpSiteUserPayNowEnableLiveParams.java deleted file mode 100644 index 1a61798d..00000000 --- a/src/main/java/com/chargebee/v4/core/models/tpSiteUser/params/TpSiteUserPayNowEnableLiveParams.java +++ /dev/null @@ -1,57 +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.core.models.tpSiteUser.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class TpSiteUserPayNowEnableLiveParams { - - private final Map formData; - - private TpSiteUserPayNowEnableLiveParams(TpSiteUserPayNowEnableLiveBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TpSiteUserPayNowEnableLiveParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TpSiteUserPayNowEnableLiveBuilder builder() { - return new TpSiteUserPayNowEnableLiveBuilder(); - } - - public static final class TpSiteUserPayNowEnableLiveBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TpSiteUserPayNowEnableLiveBuilder() {} - - public TpSiteUserPayNowEnableLiveBuilder domain(String value) { - - formData.put("domain", value); - - return this; - } - - public TpSiteUserPayNowEnableLiveBuilder hostedPageToken(String value) { - - formData.put("hosted_page_token", value); - - return this; - } - - public TpSiteUserPayNowEnableLiveParams build() { - return new TpSiteUserPayNowEnableLiveParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/tpSiteUser/params/TpSiteUserUsersForTpSiteUserParams.java b/src/main/java/com/chargebee/v4/core/models/tpSiteUser/params/TpSiteUserUsersForTpSiteUserParams.java deleted file mode 100644 index c9b9ca0e..00000000 --- a/src/main/java/com/chargebee/v4/core/models/tpSiteUser/params/TpSiteUserUsersForTpSiteUserParams.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.core.models.tpSiteUser.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class TpSiteUserUsersForTpSiteUserParams { - - private final Map queryParams; - - private TpSiteUserUsersForTpSiteUserParams(TpSiteUserUsersForTpSiteUserBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public TpSiteUserUsersForTpSiteUserBuilder toBuilder() { - TpSiteUserUsersForTpSiteUserBuilder builder = new TpSiteUserUsersForTpSiteUserBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for TpSiteUserUsersForTpSiteUserParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TpSiteUserUsersForTpSiteUserBuilder builder() { - return new TpSiteUserUsersForTpSiteUserBuilder(); - } - - public static final class TpSiteUserUsersForTpSiteUserBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private TpSiteUserUsersForTpSiteUserBuilder() {} - - public TpSiteUserUsersForTpSiteUserBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public TpSiteUserUsersForTpSiteUserBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public TpSiteUserUsersForTpSiteUserParams build() { - return new TpSiteUserUsersForTpSiteUserParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionCreateAuthorizationParams.java b/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionCreateAuthorizationParams.java deleted file mode 100644 index 27d4838e..00000000 --- a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionCreateAuthorizationParams.java +++ /dev/null @@ -1,71 +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.core.models.transaction.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class TransactionCreateAuthorizationParams { - - private final Map formData; - - private TransactionCreateAuthorizationParams(TransactionCreateAuthorizationBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionCreateAuthorizationParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionCreateAuthorizationBuilder builder() { - return new TransactionCreateAuthorizationBuilder(); - } - - public static final class TransactionCreateAuthorizationBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionCreateAuthorizationBuilder() {} - - public TransactionCreateAuthorizationBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public TransactionCreateAuthorizationBuilder paymentSourceId(String value) { - - formData.put("payment_source_id", value); - - return this; - } - - public TransactionCreateAuthorizationBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public TransactionCreateAuthorizationBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public TransactionCreateAuthorizationParams build() { - return new TransactionCreateAuthorizationParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionDeleteOfflineTransactionParams.java b/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionDeleteOfflineTransactionParams.java deleted file mode 100644 index decbec71..00000000 --- a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionDeleteOfflineTransactionParams.java +++ /dev/null @@ -1,51 +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.core.models.transaction.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class TransactionDeleteOfflineTransactionParams { - - private final Map formData; - - private TransactionDeleteOfflineTransactionParams( - TransactionDeleteOfflineTransactionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionDeleteOfflineTransactionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionDeleteOfflineTransactionBuilder builder() { - return new TransactionDeleteOfflineTransactionBuilder(); - } - - public static final class TransactionDeleteOfflineTransactionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionDeleteOfflineTransactionBuilder() {} - - public TransactionDeleteOfflineTransactionBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public TransactionDeleteOfflineTransactionParams build() { - return new TransactionDeleteOfflineTransactionParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionReconcileParams.java b/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionReconcileParams.java deleted file mode 100644 index d6fdb5b2..00000000 --- a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionReconcileParams.java +++ /dev/null @@ -1,92 +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.core.models.transaction.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class TransactionReconcileParams { - - private final Map formData; - - private TransactionReconcileParams(TransactionReconcileBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionReconcileParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionReconcileBuilder builder() { - return new TransactionReconcileBuilder(); - } - - public static final class TransactionReconcileBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionReconcileBuilder() {} - - public TransactionReconcileBuilder idAtGateway(String value) { - - formData.put("id_at_gateway", value); - - return this; - } - - public TransactionReconcileBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public TransactionReconcileBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public TransactionReconcileParams build() { - return new TransactionReconcileParams(this); - } - } - - public enum Status { - SUCCESS("success"), - - FAILURE("failure"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionRecordRefundParams.java b/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionRecordRefundParams.java deleted file mode 100644 index 33097bd0..00000000 --- a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionRecordRefundParams.java +++ /dev/null @@ -1,126 +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.core.models.transaction.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class TransactionRecordRefundParams { - - private final Map formData; - - private TransactionRecordRefundParams(TransactionRecordRefundBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionRecordRefundParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionRecordRefundBuilder builder() { - return new TransactionRecordRefundBuilder(); - } - - public static final class TransactionRecordRefundBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionRecordRefundBuilder() {} - - public TransactionRecordRefundBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public TransactionRecordRefundBuilder paymentMethod(PaymentMethod value) { - - formData.put("payment_method", value); - - return this; - } - - public TransactionRecordRefundBuilder date(Timestamp value) { - - formData.put("date", value); - - return this; - } - - public TransactionRecordRefundBuilder referenceNumber(String value) { - - formData.put("reference_number", value); - - return this; - } - - public TransactionRecordRefundBuilder customPaymentMethodId(String value) { - - formData.put("custom_payment_method_id", value); - - return this; - } - - public TransactionRecordRefundBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public TransactionRecordRefundParams build() { - return new TransactionRecordRefundParams(this); - } - } - - public enum PaymentMethod { - CASH("cash"), - - CHECK("check"), - - CHARGEBACK("chargeback"), - - BANK_TRANSFER("bank_transfer"), - - OTHER("other"), - - APP_STORE("app_store"), - - PLAY_STORE("play_store"), - - CUSTOM("custom"), - - /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PaymentMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PaymentMethod fromString(String value) { - if (value == null) return _UNKNOWN; - for (PaymentMethod enumValue : PaymentMethod.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionRefundParams.java b/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionRefundParams.java deleted file mode 100644 index 93c633bc..00000000 --- a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionRefundParams.java +++ /dev/null @@ -1,57 +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.core.models.transaction.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class TransactionRefundParams { - - private final Map formData; - - private TransactionRefundParams(TransactionRefundBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionRefundParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionRefundBuilder builder() { - return new TransactionRefundBuilder(); - } - - public static final class TransactionRefundBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionRefundBuilder() {} - - public TransactionRefundBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public TransactionRefundBuilder comment(String value) { - - formData.put("comment", value); - - return this; - } - - public TransactionRefundParams build() { - return new TransactionRefundParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionSyncTransactionParams.java b/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionSyncTransactionParams.java deleted file mode 100644 index 437ad43f..00000000 --- a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionSyncTransactionParams.java +++ /dev/null @@ -1,43 +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.core.models.transaction.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class TransactionSyncTransactionParams { - - private final Map formData; - - private TransactionSyncTransactionParams(TransactionSyncTransactionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionSyncTransactionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionSyncTransactionBuilder builder() { - return new TransactionSyncTransactionBuilder(); - } - - public static final class TransactionSyncTransactionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionSyncTransactionBuilder() {} - - public TransactionSyncTransactionParams build() { - return new TransactionSyncTransactionParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionTransactionsForCustomerParams.java b/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionTransactionsForCustomerParams.java deleted file mode 100644 index f86caf5f..00000000 --- a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionTransactionsForCustomerParams.java +++ /dev/null @@ -1,62 +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.core.models.transaction.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class TransactionTransactionsForCustomerParams { - - private final Map queryParams; - - private TransactionTransactionsForCustomerParams( - TransactionTransactionsForCustomerBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public TransactionTransactionsForCustomerBuilder toBuilder() { - TransactionTransactionsForCustomerBuilder builder = - new TransactionTransactionsForCustomerBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for TransactionTransactionsForCustomerParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionTransactionsForCustomerBuilder builder() { - return new TransactionTransactionsForCustomerBuilder(); - } - - public static final class TransactionTransactionsForCustomerBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private TransactionTransactionsForCustomerBuilder() {} - - public TransactionTransactionsForCustomerBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public TransactionTransactionsForCustomerBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public TransactionTransactionsForCustomerParams build() { - return new TransactionTransactionsForCustomerParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionTransactionsForSubscriptionParams.java b/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionTransactionsForSubscriptionParams.java deleted file mode 100644 index e0956456..00000000 --- a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionTransactionsForSubscriptionParams.java +++ /dev/null @@ -1,62 +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.core.models.transaction.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class TransactionTransactionsForSubscriptionParams { - - private final Map queryParams; - - private TransactionTransactionsForSubscriptionParams( - TransactionTransactionsForSubscriptionBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public TransactionTransactionsForSubscriptionBuilder toBuilder() { - TransactionTransactionsForSubscriptionBuilder builder = - new TransactionTransactionsForSubscriptionBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for TransactionTransactionsForSubscriptionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionTransactionsForSubscriptionBuilder builder() { - return new TransactionTransactionsForSubscriptionBuilder(); - } - - public static final class TransactionTransactionsForSubscriptionBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private TransactionTransactionsForSubscriptionBuilder() {} - - public TransactionTransactionsForSubscriptionBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public TransactionTransactionsForSubscriptionBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public TransactionTransactionsForSubscriptionParams build() { - return new TransactionTransactionsForSubscriptionParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionVoidTransactionParams.java b/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionVoidTransactionParams.java deleted file mode 100644 index a2f5523a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionVoidTransactionParams.java +++ /dev/null @@ -1,43 +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.core.models.transaction.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class TransactionVoidTransactionParams { - - private final Map formData; - - private TransactionVoidTransactionParams(TransactionVoidTransactionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TransactionVoidTransactionParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TransactionVoidTransactionBuilder builder() { - return new TransactionVoidTransactionBuilder(); - } - - public static final class TransactionVoidTransactionBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TransactionVoidTransactionBuilder() {} - - public TransactionVoidTransactionParams build() { - return new TransactionVoidTransactionParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeCreateParams.java b/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeCreateParams.java deleted file mode 100644 index 291f00ab..00000000 --- a/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeCreateParams.java +++ /dev/null @@ -1,529 +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.core.models.unbilledCharge.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class UnbilledChargeCreateParams { - - private final Map formData; - - private UnbilledChargeCreateParams(UnbilledChargeCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UnbilledChargeCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UnbilledChargeCreateBuilder builder() { - return new UnbilledChargeCreateBuilder(); - } - - public static final class UnbilledChargeCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UnbilledChargeCreateBuilder() {} - - public UnbilledChargeCreateBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public UnbilledChargeCreateBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public UnbilledChargeCreateBuilder itemPrices(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemPricesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_prices[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public UnbilledChargeCreateBuilder itemTiers(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ItemTiersParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public UnbilledChargeCreateBuilder charges(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ChargesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public UnbilledChargeCreateBuilder taxProvidersFields(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public UnbilledChargeCreateParams build() { - return new UnbilledChargeCreateParams(this); - } - } - - public static final class ItemPricesParams { - - private final Map formData; - - private ItemPricesParams(ItemPricesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemPricesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemPricesBuilder builder() { - return new ItemPricesBuilder(); - } - - public static final class ItemPricesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemPricesBuilder() {} - - public ItemPricesBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemPricesBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public ItemPricesBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public ItemPricesBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public ItemPricesBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public ItemPricesBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public ItemPricesBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public ItemPricesParams build() { - return new ItemPricesParams(this); - } - } - } - - public static final class ItemTiersParams { - - private final Map formData; - - private ItemTiersParams(ItemTiersBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ItemTiersParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ItemTiersBuilder builder() { - return new ItemTiersBuilder(); - } - - public static final class ItemTiersBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ItemTiersBuilder() {} - - public ItemTiersBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public ItemTiersBuilder startingUnit(Integer value) { - - formData.put("starting_unit", value); - - return this; - } - - public ItemTiersBuilder endingUnit(Integer value) { - - formData.put("ending_unit", value); - - return this; - } - - public ItemTiersBuilder price(Long value) { - - formData.put("price", value); - - return this; - } - - public ItemTiersBuilder startingUnitInDecimal(String value) { - - formData.put("starting_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder endingUnitInDecimal(String value) { - - formData.put("ending_unit_in_decimal", value); - - return this; - } - - public ItemTiersBuilder priceInDecimal(String value) { - - formData.put("price_in_decimal", value); - - return this; - } - - public ItemTiersBuilder pricingType(PricingType value) { - - formData.put("pricing_type", value); - - return this; - } - - public ItemTiersBuilder packageSize(Integer value) { - - formData.put("package_size", value); - - return this; - } - - public ItemTiersParams build() { - return new ItemTiersParams(this); - } - } - - public enum PricingType { - PER_UNIT("per_unit"), - - FLAT_FEE("flat_fee"), - - PACKAGE("package"), - - /** An enum member indicating that PricingType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - PricingType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static PricingType fromString(String value) { - if (value == null) return _UNKNOWN; - for (PricingType enumValue : PricingType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class ChargesParams { - - private final Map formData; - - private ChargesParams(ChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargesBuilder builder() { - return new ChargesBuilder(); - } - - public static final class ChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargesBuilder() {} - - public ChargesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public ChargesBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public ChargesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ChargesBuilder taxable(Boolean value) { - - formData.put("taxable", value); - - return this; - } - - public ChargesBuilder taxProfileId(String value) { - - formData.put("tax_profile_id", value); - - return this; - } - - public ChargesBuilder avalaraTaxCode(String value) { - - formData.put("avalara_tax_code", value); - - return this; - } - - public ChargesBuilder hsnCode(String value) { - - formData.put("hsn_code", value); - - return this; - } - - public ChargesBuilder taxjarProductCode(String value) { - - formData.put("taxjar_product_code", value); - - return this; - } - - public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public ChargesBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public ChargesBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public ChargesBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public ChargesBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public ChargesParams build() { - return new ChargesParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeCreateUnbilledChargeParams.java b/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeCreateUnbilledChargeParams.java deleted file mode 100644 index 1a612e3e..00000000 --- a/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeCreateUnbilledChargeParams.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.core.models.unbilledCharge.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -public final class UnbilledChargeCreateUnbilledChargeParams { - - private final Map formData; - - private UnbilledChargeCreateUnbilledChargeParams( - UnbilledChargeCreateUnbilledChargeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UnbilledChargeCreateUnbilledChargeParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UnbilledChargeCreateUnbilledChargeBuilder builder() { - return new UnbilledChargeCreateUnbilledChargeBuilder(); - } - - public static final class UnbilledChargeCreateUnbilledChargeBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UnbilledChargeCreateUnbilledChargeBuilder() {} - - public UnbilledChargeCreateUnbilledChargeBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public UnbilledChargeCreateUnbilledChargeBuilder currencyCode(String value) { - - formData.put("currency_code", value); - - return this; - } - - public UnbilledChargeCreateUnbilledChargeBuilder addons(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - AddonsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public UnbilledChargeCreateUnbilledChargeBuilder charges(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - ChargesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public UnbilledChargeCreateUnbilledChargeBuilder taxProvidersFields( - List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - TaxProvidersFieldsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public UnbilledChargeCreateUnbilledChargeParams build() { - return new UnbilledChargeCreateUnbilledChargeParams(this); - } - } - - public static final class AddonsParams { - - private final Map formData; - - private AddonsParams(AddonsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for AddonsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static AddonsBuilder builder() { - return new AddonsBuilder(); - } - - public static final class AddonsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private AddonsBuilder() {} - - public AddonsBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public AddonsBuilder quantity(Integer value) { - - formData.put("quantity", value); - - return this; - } - - public AddonsBuilder unitPrice(Long value) { - - formData.put("unit_price", value); - - return this; - } - - public AddonsBuilder quantityInDecimal(String value) { - - formData.put("quantity_in_decimal", value); - - return this; - } - - public AddonsBuilder unitPriceInDecimal(String value) { - - formData.put("unit_price_in_decimal", value); - - return this; - } - - public AddonsBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public AddonsBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public AddonsParams build() { - return new AddonsParams(this); - } - } - } - - public static final class ChargesParams { - - private final Map formData; - - private ChargesParams(ChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for ChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static ChargesBuilder builder() { - return new ChargesBuilder(); - } - - public static final class ChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private ChargesBuilder() {} - - public ChargesBuilder amount(Long value) { - - formData.put("amount", value); - - return this; - } - - public ChargesBuilder amountInDecimal(String value) { - - formData.put("amount_in_decimal", value); - - return this; - } - - public ChargesBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public ChargesBuilder taxable(Boolean value) { - - formData.put("taxable", value); - - return this; - } - - public ChargesBuilder taxProfileId(String value) { - - formData.put("tax_profile_id", value); - - return this; - } - - public ChargesBuilder avalaraTaxCode(String value) { - - formData.put("avalara_tax_code", value); - - return this; - } - - public ChargesBuilder hsnCode(String value) { - - formData.put("hsn_code", value); - - return this; - } - - public ChargesBuilder taxjarProductCode(String value) { - - formData.put("taxjar_product_code", value); - - return this; - } - - public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { - - formData.put("avalara_sale_type", value); - - return this; - } - - public ChargesBuilder avalaraTransactionType(Integer value) { - - formData.put("avalara_transaction_type", value); - - return this; - } - - public ChargesBuilder avalaraServiceType(Integer value) { - - formData.put("avalara_service_type", value); - - return this; - } - - public ChargesBuilder dateFrom(Timestamp value) { - - formData.put("date_from", value); - - return this; - } - - public ChargesBuilder dateTo(Timestamp value) { - - formData.put("date_to", value); - - return this; - } - - public ChargesParams build() { - return new ChargesParams(this); - } - } - - public enum AvalaraSaleType { - WHOLESALE("wholesale"), - - RETAIL("retail"), - - CONSUMED("consumed"), - - VENDOR_USE("vendor_use"), - - /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - AvalaraSaleType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AvalaraSaleType fromString(String value) { - if (value == null) return _UNKNOWN; - for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - } - - public static final class TaxProvidersFieldsParams { - - private final Map formData; - - private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for TaxProvidersFieldsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static TaxProvidersFieldsBuilder builder() { - return new TaxProvidersFieldsBuilder(); - } - - public static final class TaxProvidersFieldsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private TaxProvidersFieldsBuilder() {} - - public TaxProvidersFieldsBuilder providerName(String value) { - - formData.put("provider_name", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldId(String value) { - - formData.put("field_id", value); - - return this; - } - - public TaxProvidersFieldsBuilder fieldValue(String value) { - - formData.put("field_value", value); - - return this; - } - - public TaxProvidersFieldsParams build() { - return new TaxProvidersFieldsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeInvoiceNowEstimateParams.java b/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeInvoiceNowEstimateParams.java deleted file mode 100644 index 18d96c86..00000000 --- a/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeInvoiceNowEstimateParams.java +++ /dev/null @@ -1,57 +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.core.models.unbilledCharge.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class UnbilledChargeInvoiceNowEstimateParams { - - private final Map formData; - - private UnbilledChargeInvoiceNowEstimateParams(UnbilledChargeInvoiceNowEstimateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UnbilledChargeInvoiceNowEstimateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UnbilledChargeInvoiceNowEstimateBuilder builder() { - return new UnbilledChargeInvoiceNowEstimateBuilder(); - } - - public static final class UnbilledChargeInvoiceNowEstimateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UnbilledChargeInvoiceNowEstimateBuilder() {} - - public UnbilledChargeInvoiceNowEstimateBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public UnbilledChargeInvoiceNowEstimateBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public UnbilledChargeInvoiceNowEstimateParams build() { - return new UnbilledChargeInvoiceNowEstimateParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeInvoiceUnbilledChargesParams.java b/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeInvoiceUnbilledChargesParams.java deleted file mode 100644 index a837616c..00000000 --- a/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeInvoiceUnbilledChargesParams.java +++ /dev/null @@ -1,58 +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.core.models.unbilledCharge.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class UnbilledChargeInvoiceUnbilledChargesParams { - - private final Map formData; - - private UnbilledChargeInvoiceUnbilledChargesParams( - UnbilledChargeInvoiceUnbilledChargesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UnbilledChargeInvoiceUnbilledChargesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UnbilledChargeInvoiceUnbilledChargesBuilder builder() { - return new UnbilledChargeInvoiceUnbilledChargesBuilder(); - } - - public static final class UnbilledChargeInvoiceUnbilledChargesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UnbilledChargeInvoiceUnbilledChargesBuilder() {} - - public UnbilledChargeInvoiceUnbilledChargesBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public UnbilledChargeInvoiceUnbilledChargesBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public UnbilledChargeInvoiceUnbilledChargesParams build() { - return new UnbilledChargeInvoiceUnbilledChargesParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/usage/params/UsageCreateParams.java b/src/main/java/com/chargebee/v4/core/models/usage/params/UsageCreateParams.java deleted file mode 100644 index 9a92edff..00000000 --- a/src/main/java/com/chargebee/v4/core/models/usage/params/UsageCreateParams.java +++ /dev/null @@ -1,115 +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.core.models.usage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.sql.Timestamp; - -public final class UsageCreateParams { - - private final Map formData; - - private UsageCreateParams(UsageCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UsageCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UsageCreateBuilder builder() { - return new UsageCreateBuilder(); - } - - public static final class UsageCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UsageCreateBuilder() {} - - public UsageCreateBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public UsageCreateBuilder itemPriceId(String value) { - - formData.put("item_price_id", value); - - return this; - } - - public UsageCreateBuilder quantity(String value) { - - formData.put("quantity", value); - - return this; - } - - public UsageCreateBuilder usageDate(Timestamp value) { - - formData.put("usage_date", value); - - return this; - } - - @Deprecated - public UsageCreateBuilder dedupeOption(DedupeOption value) { - - formData.put("dedupe_option", value); - - return this; - } - - public UsageCreateBuilder note(String value) { - - formData.put("note", value); - - return this; - } - - public UsageCreateParams build() { - return new UsageCreateParams(this); - } - } - - public enum DedupeOption { - SKIP("skip"), - - UPDATE_EXISTING("update_existing"), - - /** An enum member indicating that DedupeOption was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - DedupeOption(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static DedupeOption fromString(String value) { - if (value == null) return _UNKNOWN; - for (DedupeOption enumValue : DedupeOption.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/usage/params/UsagePdfParams.java b/src/main/java/com/chargebee/v4/core/models/usage/params/UsagePdfParams.java deleted file mode 100644 index 779a7907..00000000 --- a/src/main/java/com/chargebee/v4/core/models/usage/params/UsagePdfParams.java +++ /dev/null @@ -1,126 +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.core.models.usage.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class UsagePdfParams { - - private final Map formData; - - private UsagePdfParams(UsagePdfBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UsagePdfParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UsagePdfBuilder builder() { - return new UsagePdfBuilder(); - } - - public static final class UsagePdfBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UsagePdfBuilder() {} - - public UsagePdfBuilder dispositionType(DispositionType value) { - - formData.put("disposition_type", value); - - return this; - } - - public UsagePdfBuilder invoice(InvoiceParams value) { - if (value != null) { - Map nestedData = value.toFormData(); - for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "invoice[" + entry.getKey() + "]"; - formData.put(nestedKey, entry.getValue()); - } - } - return this; - } - - public UsagePdfParams build() { - return new UsagePdfParams(this); - } - } - - public enum DispositionType { - ATTACHMENT("attachment"), - - INLINE("inline"), - - /** An enum member indicating that DispositionType was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - DispositionType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static DispositionType fromString(String value) { - if (value == null) return _UNKNOWN; - for (DispositionType enumValue : DispositionType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class InvoiceParams { - - private final Map formData; - - private InvoiceParams(InvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for InvoiceParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static InvoiceBuilder builder() { - return new InvoiceBuilder(); - } - - public static final class InvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); - - private InvoiceBuilder() {} - - public InvoiceBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public InvoiceParams build() { - return new InvoiceParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/usageEvent/params/UsageEventBatchIngestParams.java b/src/main/java/com/chargebee/v4/core/models/usageEvent/params/UsageEventBatchIngestParams.java deleted file mode 100644 index 3a7a6ffb..00000000 --- a/src/main/java/com/chargebee/v4/core/models/usageEvent/params/UsageEventBatchIngestParams.java +++ /dev/null @@ -1,120 +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.core.models.usageEvent.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 UsageEventBatchIngestParams { - - private final Map formData; - - private UsageEventBatchIngestParams(UsageEventBatchIngestBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UsageEventBatchIngestParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UsageEventBatchIngestBuilder builder() { - return new UsageEventBatchIngestBuilder(); - } - - public static final class UsageEventBatchIngestBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UsageEventBatchIngestBuilder() {} - - public UsageEventBatchIngestBuilder events(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - EventsParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "events[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public UsageEventBatchIngestParams build() { - return new UsageEventBatchIngestParams(this); - } - } - - public static final class EventsParams { - - private final Map formData; - - private EventsParams(EventsBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for EventsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static EventsBuilder builder() { - return new EventsBuilder(); - } - - public static final class EventsBuilder { - private final Map formData = new LinkedHashMap<>(); - - private EventsBuilder() {} - - public EventsBuilder deduplicationId(String value) { - - formData.put("deduplication_id", value); - - return this; - } - - public EventsBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public EventsBuilder usageTimestamp(Timestamp value) { - - formData.put("usage_timestamp", value); - - return this; - } - - public EventsBuilder properties(java.util.Map value) { - - formData.put("properties", JsonUtil.toJson(value)); - - return this; - } - - public EventsParams build() { - return new EventsParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/usageEvent/params/UsageEventCreateParams.java b/src/main/java/com/chargebee/v4/core/models/usageEvent/params/UsageEventCreateParams.java deleted file mode 100644 index 9f6e2c34..00000000 --- a/src/main/java/com/chargebee/v4/core/models/usageEvent/params/UsageEventCreateParams.java +++ /dev/null @@ -1,72 +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.core.models.usageEvent.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; - -public final class UsageEventCreateParams { - - private final Map formData; - - private UsageEventCreateParams(UsageEventCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UsageEventCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UsageEventCreateBuilder builder() { - return new UsageEventCreateBuilder(); - } - - public static final class UsageEventCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UsageEventCreateBuilder() {} - - public UsageEventCreateBuilder deduplicationId(String value) { - - formData.put("deduplication_id", value); - - return this; - } - - public UsageEventCreateBuilder subscriptionId(String value) { - - formData.put("subscription_id", value); - - return this; - } - - public UsageEventCreateBuilder usageTimestamp(Long value) { - - formData.put("usage_timestamp", value); - - return this; - } - - public UsageEventCreateBuilder properties(java.util.Map value) { - - formData.put("properties", JsonUtil.toJson(value)); - - return this; - } - - public UsageEventCreateParams build() { - return new UsageEventCreateParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/usageFile/params/UsageFileUploadUrlParams.java b/src/main/java/com/chargebee/v4/core/models/usageFile/params/UsageFileUploadUrlParams.java deleted file mode 100644 index 3d4fe0b6..00000000 --- a/src/main/java/com/chargebee/v4/core/models/usageFile/params/UsageFileUploadUrlParams.java +++ /dev/null @@ -1,57 +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.core.models.usageFile.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class UsageFileUploadUrlParams { - - private final Map formData; - - private UsageFileUploadUrlParams(UsageFileUploadUrlBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for UsageFileUploadUrlParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static UsageFileUploadUrlBuilder builder() { - return new UsageFileUploadUrlBuilder(); - } - - public static final class UsageFileUploadUrlBuilder { - private final Map formData = new LinkedHashMap<>(); - - private UsageFileUploadUrlBuilder() {} - - public UsageFileUploadUrlBuilder fileName(String value) { - - formData.put("file_name", value); - - return this; - } - - public UsageFileUploadUrlBuilder mimeType(String value) { - - formData.put("mime_type", value); - - return this; - } - - public UsageFileUploadUrlParams build() { - return new UsageFileUploadUrlParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/variant/params/VariantCreateProductVariantParams.java b/src/main/java/com/chargebee/v4/core/models/variant/params/VariantCreateProductVariantParams.java deleted file mode 100644 index a6180205..00000000 --- a/src/main/java/com/chargebee/v4/core/models/variant/params/VariantCreateProductVariantParams.java +++ /dev/null @@ -1,182 +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.core.models.variant.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; - -public final class VariantCreateProductVariantParams { - - private final Map formData; - - private VariantCreateProductVariantParams(VariantCreateProductVariantBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for VariantCreateProductVariantParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static VariantCreateProductVariantBuilder builder() { - return new VariantCreateProductVariantBuilder(); - } - - public static final class VariantCreateProductVariantBuilder { - private final Map formData = new LinkedHashMap<>(); - - private VariantCreateProductVariantBuilder() {} - - public VariantCreateProductVariantBuilder id(String value) { - - formData.put("id", value); - - return this; - } - - public VariantCreateProductVariantBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public VariantCreateProductVariantBuilder externalName(String value) { - - formData.put("external_name", value); - - return this; - } - - public VariantCreateProductVariantBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public VariantCreateProductVariantBuilder sku(String value) { - - formData.put("sku", value); - - return this; - } - - public VariantCreateProductVariantBuilder metadata(java.util.Map value) { - - formData.put("metadata", JsonUtil.toJson(value)); - - return this; - } - - public VariantCreateProductVariantBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public VariantCreateProductVariantBuilder optionValues(List value) { - if (value != null && !value.isEmpty()) { - for (int i = 0; i < value.size(); i++) { - OptionValuesParams item = value.get(i); - if (item != null) { - Map itemData = item.toFormData(); - for (Map.Entry entry : itemData.entrySet()) { - String indexedKey = "option_values[" + entry.getKey() + "][" + i + "]"; - formData.put(indexedKey, entry.getValue()); - } - } - } - } - return this; - } - - public VariantCreateProductVariantParams build() { - return new VariantCreateProductVariantParams(this); - } - } - - public enum Status { - ACTIVE("active"), - - INACTIVE("inactive"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public static final class OptionValuesParams { - - private final Map formData; - - private OptionValuesParams(OptionValuesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for OptionValuesParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static OptionValuesBuilder builder() { - return new OptionValuesBuilder(); - } - - public static final class OptionValuesBuilder { - private final Map formData = new LinkedHashMap<>(); - - private OptionValuesBuilder() {} - - public OptionValuesBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public OptionValuesBuilder value(String value) { - - formData.put("value", value); - - return this; - } - - public OptionValuesParams build() { - return new OptionValuesParams(this); - } - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/variant/params/VariantDeleteParams.java b/src/main/java/com/chargebee/v4/core/models/variant/params/VariantDeleteParams.java deleted file mode 100644 index bc06174e..00000000 --- a/src/main/java/com/chargebee/v4/core/models/variant/params/VariantDeleteParams.java +++ /dev/null @@ -1,43 +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.core.models.variant.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class VariantDeleteParams { - - private final Map formData; - - private VariantDeleteParams(VariantDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for VariantDeleteParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static VariantDeleteBuilder builder() { - return new VariantDeleteBuilder(); - } - - public static final class VariantDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); - - private VariantDeleteBuilder() {} - - public VariantDeleteParams build() { - return new VariantDeleteParams(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/variant/params/VariantListProductVariantsParams.java b/src/main/java/com/chargebee/v4/core/models/variant/params/VariantListProductVariantsParams.java deleted file mode 100644 index 055920c3..00000000 --- a/src/main/java/com/chargebee/v4/core/models/variant/params/VariantListProductVariantsParams.java +++ /dev/null @@ -1,470 +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.core.models.variant.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 VariantListProductVariantsParams { - - private final Map queryParams; - - private VariantListProductVariantsParams(VariantListProductVariantsBuilder builder) { - this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); - } - - /** Get the query parameters for this request. */ - public Map toQueryParams() { - return queryParams; - } - - public VariantListProductVariantsBuilder toBuilder() { - VariantListProductVariantsBuilder builder = new VariantListProductVariantsBuilder(); - builder.queryParams.putAll(queryParams); - return builder; - } - - /** Create a new builder for VariantListProductVariantsParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static VariantListProductVariantsBuilder builder() { - return new VariantListProductVariantsBuilder(); - } - - public static final class VariantListProductVariantsBuilder { - private final Map queryParams = new LinkedHashMap<>(); - - private VariantListProductVariantsBuilder() {} - - public VariantListProductVariantsBuilder limit(Integer value) { - queryParams.put("limit", value); - return this; - } - - public VariantListProductVariantsBuilder offset(String value) { - queryParams.put("offset", value); - return this; - } - - public VariantListProductVariantsBuilder includeDeleted(Boolean value) { - queryParams.put("include_deleted", value); - return this; - } - - public IdFilter id() { - return new IdFilter("id", this); - } - - public NameFilter name() { - return new NameFilter("name", this); - } - - public SkuFilter sku() { - return new SkuFilter("sku", this); - } - - public StatusFilter status() { - return new StatusFilter("status", this); - } - - public UpdatedAtFilter updatedAt() { - return new UpdatedAtFilter("updated_at", this); - } - - public CreatedAtFilter createdAt() { - return new CreatedAtFilter("created_at", this); - } - - public SortBySortBuilder sortBy() { - return new SortBySortBuilder("sort_by", this); - } - - public VariantListProductVariantsParams build() { - return new VariantListProductVariantsParams(this); - } - - public static final class IdFilter { - private final String fieldName; - private final VariantListProductVariantsBuilder builder; - - IdFilter(String fieldName, VariantListProductVariantsBuilder builder) { - this.fieldName = fieldName; - this.builder = builder; - } - - public VariantListProductVariantsBuilder is(String value) { - builder.queryParams.put(fieldName + "[is]", value); - return builder; - } - - public VariantListProductVariantsBuilder isNot(String value) { - builder.queryParams.put(fieldName + "[is_not]", value); - return builder; - } - - public VariantListProductVariantsBuilder startsWith(String value) { - builder.queryParams.put(fieldName + "[starts_with]", value); - return builder; - } - - public VariantListProductVariantsBuilder in(String... values) { - builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); - return builder; - } - - public VariantListProductVariantsBuilder notIn(String... values) { - builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); - return builder; - } - } - - public static final class NameFilter { - private final String fieldName; - private final VariantListProductVariantsBuilder builder; - - NameFilter(String fieldName, VariantListProductVariantsBuilder builder) { - this.fieldName = fieldName; - this.builder = builder; - } - - public VariantListProductVariantsBuilder is(String value) { - builder.queryParams.put(fieldName + "[is]", value); - return builder; - } - - public VariantListProductVariantsBuilder isNot(String value) { - builder.queryParams.put(fieldName + "[is_not]", value); - return builder; - } - - public VariantListProductVariantsBuilder startsWith(String value) { - builder.queryParams.put(fieldName + "[starts_with]", value); - return builder; - } - - public VariantListProductVariantsBuilder in(String... values) { - builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); - return builder; - } - - public VariantListProductVariantsBuilder notIn(String... values) { - builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); - return builder; - } - } - - public static final class SkuFilter { - private final String fieldName; - private final VariantListProductVariantsBuilder builder; - - SkuFilter(String fieldName, VariantListProductVariantsBuilder builder) { - this.fieldName = fieldName; - this.builder = builder; - } - - public VariantListProductVariantsBuilder is(String value) { - builder.queryParams.put(fieldName + "[is]", value); - return builder; - } - - public VariantListProductVariantsBuilder isNot(String value) { - builder.queryParams.put(fieldName + "[is_not]", value); - return builder; - } - - public VariantListProductVariantsBuilder startsWith(String value) { - builder.queryParams.put(fieldName + "[starts_with]", value); - return builder; - } - - public VariantListProductVariantsBuilder in(String... values) { - builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); - return builder; - } - - public VariantListProductVariantsBuilder notIn(String... values) { - builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); - return builder; - } - } - - public static final class StatusFilter { - private final String fieldName; - private final VariantListProductVariantsBuilder builder; - - StatusFilter(String fieldName, VariantListProductVariantsBuilder builder) { - this.fieldName = fieldName; - this.builder = builder; - } - - public VariantListProductVariantsBuilder is(String value) { - builder.queryParams.put(fieldName + "[is]", value); - return builder; - } - - public VariantListProductVariantsBuilder isNot(String value) { - builder.queryParams.put(fieldName + "[is_not]", value); - return builder; - } - - public VariantListProductVariantsBuilder in(String... values) { - builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); - return builder; - } - - public VariantListProductVariantsBuilder 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 VariantListProductVariantsBuilder builder; - - UpdatedAtFilter(String fieldName, VariantListProductVariantsBuilder builder) { - this.fieldName = fieldName; - this.builder = builder; - } - - public VariantListProductVariantsBuilder after(Timestamp timestamp) { - builder.queryParams.put(fieldName + "[after]", timestamp.getTime() / 1000); - return builder; - } - - public VariantListProductVariantsBuilder before(Timestamp timestamp) { - builder.queryParams.put(fieldName + "[before]", timestamp.getTime() / 1000); - return builder; - } - - public VariantListProductVariantsBuilder on(Timestamp timestamp) { - builder.queryParams.put(fieldName + "[on]", timestamp.getTime() / 1000); - return builder; - } - - public VariantListProductVariantsBuilder between(Timestamp start, Timestamp end) { - builder.queryParams.put( - fieldName + "[between]", - "[" + (start.getTime() / 1000) + "," + (end.getTime() / 1000) + "]"); - return builder; - } - } - - public static final class CreatedAtFilter { - private final String fieldName; - private final VariantListProductVariantsBuilder builder; - - CreatedAtFilter(String fieldName, VariantListProductVariantsBuilder builder) { - this.fieldName = fieldName; - this.builder = builder; - } - - public VariantListProductVariantsBuilder after(Timestamp timestamp) { - builder.queryParams.put(fieldName + "[after]", timestamp.getTime() / 1000); - return builder; - } - - public VariantListProductVariantsBuilder before(Timestamp timestamp) { - builder.queryParams.put(fieldName + "[before]", timestamp.getTime() / 1000); - return builder; - } - - public VariantListProductVariantsBuilder on(Timestamp timestamp) { - builder.queryParams.put(fieldName + "[on]", timestamp.getTime() / 1000); - return builder; - } - - public VariantListProductVariantsBuilder 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 VariantListProductVariantsBuilder builder; - - SortBySortBuilder(String fieldName, VariantListProductVariantsBuilder builder) { - this.fieldName = fieldName; - this.builder = builder; - } - - public SortDirection name() { - return new SortDirection(fieldName, "name", builder); - } - - public SortDirection id() { - return new SortDirection(fieldName, "id", builder); - } - - public SortDirection status() { - return new SortDirection(fieldName, "status", builder); - } - - public SortDirection created_at() { - return new SortDirection(fieldName, "created_at", builder); - } - - public SortDirection updated_at() { - return new SortDirection(fieldName, "updated_at", builder); - } - } - - public static final class SortDirection { - private final String fieldName; - private final String selectedField; - private final VariantListProductVariantsBuilder builder; - - SortDirection( - String fieldName, String selectedField, VariantListProductVariantsBuilder builder) { - this.fieldName = fieldName; - this.selectedField = selectedField; - this.builder = builder; - } - - public VariantListProductVariantsBuilder asc() { - builder.queryParams.put(fieldName + "[asc]", selectedField); - return builder; - } - - public VariantListProductVariantsBuilder desc() { - builder.queryParams.put(fieldName + "[desc]", selectedField); - return builder; - } - } - } - - public enum StatusIs { - ACTIVE("active"), - - INACTIVE("inactive"), - - /** An enum member indicating that StatusIs was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - StatusIs(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static StatusIs fromString(String value) { - if (value == null) return _UNKNOWN; - for (StatusIs enumValue : StatusIs.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum StatusIsNot { - ACTIVE("active"), - - INACTIVE("inactive"), - - /** An enum member indicating that StatusIsNot was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - StatusIsNot(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static StatusIsNot fromString(String value) { - if (value == null) return _UNKNOWN; - for (StatusIsNot enumValue : StatusIsNot.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum SortByAsc { - NAME("name"), - - ID("id"), - - STATUS("status"), - - CREATED_AT("created_at"), - - UPDATED_AT("updated_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 { - NAME("name"), - - ID("id"), - - STATUS("status"), - - CREATED_AT("created_at"), - - UPDATED_AT("updated_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/core/models/variant/params/VariantUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/variant/params/VariantUpdateParams.java deleted file mode 100644 index 6d2227e5..00000000 --- a/src/main/java/com/chargebee/v4/core/models/variant/params/VariantUpdateParams.java +++ /dev/null @@ -1,114 +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.core.models.variant.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; - -public final class VariantUpdateParams { - - private final Map formData; - - private VariantUpdateParams(VariantUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for VariantUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static VariantUpdateBuilder builder() { - return new VariantUpdateBuilder(); - } - - public static final class VariantUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private VariantUpdateBuilder() {} - - public VariantUpdateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public VariantUpdateBuilder description(String value) { - - formData.put("description", value); - - return this; - } - - public VariantUpdateBuilder status(Status value) { - - formData.put("status", value); - - return this; - } - - public VariantUpdateBuilder externalName(String value) { - - formData.put("external_name", value); - - return this; - } - - public VariantUpdateBuilder sku(String value) { - - formData.put("sku", value); - - return this; - } - - public VariantUpdateBuilder metadata(java.util.Map value) { - - formData.put("metadata", JsonUtil.toJson(value)); - - return this; - } - - public VariantUpdateParams build() { - return new VariantUpdateParams(this); - } - } - - public enum Status { - ACTIVE("active"), - - INACTIVE("inactive"), - - /** An enum member indicating that Status was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Status fromString(String value) { - if (value == null) return _UNKNOWN; - for (Status enumValue : Status.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountCreateParams.java b/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountCreateParams.java deleted file mode 100644 index a9769295..00000000 --- a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountCreateParams.java +++ /dev/null @@ -1,102 +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.core.models.virtualBankAccount.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class VirtualBankAccountCreateParams { - - private final Map formData; - - private VirtualBankAccountCreateParams(VirtualBankAccountCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for VirtualBankAccountCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static VirtualBankAccountCreateBuilder builder() { - return new VirtualBankAccountCreateBuilder(); - } - - public static final class VirtualBankAccountCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private VirtualBankAccountCreateBuilder() {} - - public VirtualBankAccountCreateBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public VirtualBankAccountCreateBuilder email(String value) { - - formData.put("email", value); - - return this; - } - - public VirtualBankAccountCreateBuilder scheme(Scheme value) { - - formData.put("scheme", value); - - return this; - } - - public VirtualBankAccountCreateParams build() { - return new VirtualBankAccountCreateParams(this); - } - } - - public enum Scheme { - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - GB_AUTOMATED_BANK_TRANSFER("gb_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - /** An enum member indicating that Scheme was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Scheme(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Scheme fromString(String value) { - if (value == null) return _UNKNOWN; - for (Scheme enumValue : Scheme.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountCreateUsingPermanentTokenParams.java b/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountCreateUsingPermanentTokenParams.java deleted file mode 100644 index af68ad0a..00000000 --- a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountCreateUsingPermanentTokenParams.java +++ /dev/null @@ -1,103 +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.core.models.virtualBankAccount.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -public final class VirtualBankAccountCreateUsingPermanentTokenParams { - - private final Map formData; - - private VirtualBankAccountCreateUsingPermanentTokenParams( - VirtualBankAccountCreateUsingPermanentTokenBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for VirtualBankAccountCreateUsingPermanentTokenParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static VirtualBankAccountCreateUsingPermanentTokenBuilder builder() { - return new VirtualBankAccountCreateUsingPermanentTokenBuilder(); - } - - public static final class VirtualBankAccountCreateUsingPermanentTokenBuilder { - private final Map formData = new LinkedHashMap<>(); - - private VirtualBankAccountCreateUsingPermanentTokenBuilder() {} - - public VirtualBankAccountCreateUsingPermanentTokenBuilder customerId(String value) { - - formData.put("customer_id", value); - - return this; - } - - public VirtualBankAccountCreateUsingPermanentTokenBuilder referenceId(String value) { - - formData.put("reference_id", value); - - return this; - } - - public VirtualBankAccountCreateUsingPermanentTokenBuilder scheme(Scheme value) { - - formData.put("scheme", value); - - return this; - } - - public VirtualBankAccountCreateUsingPermanentTokenParams build() { - return new VirtualBankAccountCreateUsingPermanentTokenParams(this); - } - } - - public enum Scheme { - ACH_CREDIT("ach_credit"), - - SEPA_CREDIT("sepa_credit"), - - US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), - - GB_AUTOMATED_BANK_TRANSFER("gb_automated_bank_transfer"), - - EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), - - JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), - - MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), - - /** An enum member indicating that Scheme was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Scheme(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Scheme fromString(String value) { - if (value == null) return _UNKNOWN; - for (Scheme enumValue : Scheme.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/webhookEndpoint/params/WebhookEndpointCreateParams.java b/src/main/java/com/chargebee/v4/core/models/webhookEndpoint/params/WebhookEndpointCreateParams.java deleted file mode 100644 index 01e03834..00000000 --- a/src/main/java/com/chargebee/v4/core/models/webhookEndpoint/params/WebhookEndpointCreateParams.java +++ /dev/null @@ -1,176 +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.core.models.webhookEndpoint.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class WebhookEndpointCreateParams { - - private final Map formData; - - private WebhookEndpointCreateParams(WebhookEndpointCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for WebhookEndpointCreateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static WebhookEndpointCreateBuilder builder() { - return new WebhookEndpointCreateBuilder(); - } - - public static final class WebhookEndpointCreateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private WebhookEndpointCreateBuilder() {} - - public WebhookEndpointCreateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public WebhookEndpointCreateBuilder apiVersion(ApiVersion value) { - - formData.put("api_version", value); - - return this; - } - - public WebhookEndpointCreateBuilder url(String value) { - - formData.put("url", value); - - return this; - } - - public WebhookEndpointCreateBuilder primaryUrl(Boolean value) { - - formData.put("primary_url", value); - - return this; - } - - public WebhookEndpointCreateBuilder disabled(Boolean value) { - - formData.put("disabled", value); - - return this; - } - - public WebhookEndpointCreateBuilder basicAuthPassword(String value) { - - formData.put("basic_auth_password", value); - - return this; - } - - public WebhookEndpointCreateBuilder basicAuthUsername(String value) { - - formData.put("basic_auth_username", value); - - return this; - } - - public WebhookEndpointCreateBuilder sendCardResource(Boolean value) { - - formData.put("send_card_resource", value); - - return this; - } - - public WebhookEndpointCreateBuilder chargebeeResponseSchemaType( - ChargebeeResponseSchemaType value) { - - formData.put("chargebee_response_schema_type", value); - - return this; - } - - public WebhookEndpointCreateBuilder enabledEvents(List value) { - - formData.put("enabled_events", value); - - return this; - } - - public WebhookEndpointCreateParams build() { - return new WebhookEndpointCreateParams(this); - } - } - - public enum ApiVersion { - V1("v1"), - - V2("v2"), - - /** An enum member indicating that ApiVersion was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ApiVersion(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ApiVersion fromString(String value) { - if (value == null) return _UNKNOWN; - for (ApiVersion enumValue : ApiVersion.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum ChargebeeResponseSchemaType { - PLANS_ADDONS("plans_addons"), - - ITEMS("items"), - - COMPAT("compat"), - - /** - * An enum member indicating that ChargebeeResponseSchemaType was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - ChargebeeResponseSchemaType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ChargebeeResponseSchemaType fromString(String value) { - if (value == null) return _UNKNOWN; - for (ChargebeeResponseSchemaType enumValue : ChargebeeResponseSchemaType.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/models/webhookEndpoint/params/WebhookEndpointUpdateParams.java b/src/main/java/com/chargebee/v4/core/models/webhookEndpoint/params/WebhookEndpointUpdateParams.java deleted file mode 100644 index 79aa4ba4..00000000 --- a/src/main/java/com/chargebee/v4/core/models/webhookEndpoint/params/WebhookEndpointUpdateParams.java +++ /dev/null @@ -1,135 +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.core.models.webhookEndpoint.params; - -import com.chargebee.v4.internal.Recommended; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.List; - -public final class WebhookEndpointUpdateParams { - - private final Map formData; - - private WebhookEndpointUpdateParams(WebhookEndpointUpdateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } - - /** Get the form data for this request. */ - public Map toFormData() { - return formData; - } - - /** Create a new builder for WebhookEndpointUpdateParams. */ - @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") - public static WebhookEndpointUpdateBuilder builder() { - return new WebhookEndpointUpdateBuilder(); - } - - public static final class WebhookEndpointUpdateBuilder { - private final Map formData = new LinkedHashMap<>(); - - private WebhookEndpointUpdateBuilder() {} - - public WebhookEndpointUpdateBuilder name(String value) { - - formData.put("name", value); - - return this; - } - - public WebhookEndpointUpdateBuilder apiVersion(ApiVersion value) { - - formData.put("api_version", value); - - return this; - } - - public WebhookEndpointUpdateBuilder url(String value) { - - formData.put("url", value); - - return this; - } - - public WebhookEndpointUpdateBuilder primaryUrl(Boolean value) { - - formData.put("primary_url", value); - - return this; - } - - public WebhookEndpointUpdateBuilder sendCardResource(Boolean value) { - - formData.put("send_card_resource", value); - - return this; - } - - public WebhookEndpointUpdateBuilder basicAuthPassword(String value) { - - formData.put("basic_auth_password", value); - - return this; - } - - public WebhookEndpointUpdateBuilder basicAuthUsername(String value) { - - formData.put("basic_auth_username", value); - - return this; - } - - public WebhookEndpointUpdateBuilder disabled(Boolean value) { - - formData.put("disabled", value); - - return this; - } - - public WebhookEndpointUpdateBuilder enabledEvents(List value) { - - formData.put("enabled_events", value); - - return this; - } - - public WebhookEndpointUpdateParams build() { - return new WebhookEndpointUpdateParams(this); - } - } - - public enum ApiVersion { - V1("v1"), - - V2("v2"), - - /** An enum member indicating that ApiVersion was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - ApiVersion(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static ApiVersion fromString(String value) { - if (value == null) return _UNKNOWN; - for (ApiVersion enumValue : ApiVersion.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/additionalBillingLogiq/AdditionalBillingLogiqRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/additionalBillingLogiq/AdditionalBillingLogiqRetrieveResponse.java deleted file mode 100644 index 3dbaa8dd..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/additionalBillingLogiq/AdditionalBillingLogiqRetrieveResponse.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.chargebee.v4.core.responses.additionalBillingLogiq; - -import com.chargebee.v4.core.responses.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( - Object additionalBillingLogiq, Response httpResponse) { - super(httpResponse); - - this.additionalBillingLogiq = 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 { - - Object additionalBillingLogiq = JsonUtil.getObject(json, "additional_billing_logiq"); - - return new AdditionalBillingLogiqRetrieveResponse(additionalBillingLogiq, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse AdditionalBillingLogiqRetrieveResponse from JSON", e); - } - } - - /** Get the additionalBillingLogiq from the response. */ - public Object getAdditionalBillingLogiq() { - return additionalBillingLogiq; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/addon/AddonRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/addon/AddonRetrieveResponse.java deleted file mode 100644 index 958e768c..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/addon/AddonRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.addon; - -import com.chargebee.v4.core.models.addon.Addon; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for AddonRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class AddonRetrieveResponse extends BaseResponse { - private final Addon addon; - - private AddonRetrieveResponse(Addon addon, Response httpResponse) { - super(httpResponse); - - this.addon = addon; - } - - /** Parse JSON response into AddonRetrieveResponse object. */ - public static AddonRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into AddonRetrieveResponse object with HTTP response. */ - public static AddonRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Addon addon = Addon.fromJson(JsonUtil.getObject(json, "addon")); - - return new AddonRetrieveResponse(addon, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse AddonRetrieveResponse from JSON", e); - } - } - - /** Get the addon from the response. */ - public Addon getAddon() { - return addon; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/address/AddressRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/address/AddressRetrieveResponse.java deleted file mode 100644 index 766adaed..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/address/AddressRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.address; - -import com.chargebee.v4.core.models.address.Address; - -import com.chargebee.v4.core.responses.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(Address address, Response httpResponse) { - super(httpResponse); - - this.address = 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 { - - Address address = Address.fromJson(JsonUtil.getObject(json, "address")); - - return new AddressRetrieveResponse(address, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse AddressRetrieveResponse from JSON", e); - } - } - - /** Get the address from the response. */ - public Address getAddress() { - return address; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/attachedItem/AttachedItemRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/attachedItem/AttachedItemRetrieveResponse.java deleted file mode 100644 index 4da187fa..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/attachedItem/AttachedItemRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.attachedItem; - -import com.chargebee.v4.core.models.attachedItem.AttachedItem; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for AttachedItemRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class AttachedItemRetrieveResponse extends BaseResponse { - private final AttachedItem attachedItem; - - private AttachedItemRetrieveResponse(AttachedItem attachedItem, Response httpResponse) { - super(httpResponse); - - this.attachedItem = attachedItem; - } - - /** Parse JSON response into AttachedItemRetrieveResponse object. */ - public static AttachedItemRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into AttachedItemRetrieveResponse object with HTTP response. */ - public static AttachedItemRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - AttachedItem attachedItem = AttachedItem.fromJson(JsonUtil.getObject(json, "attached_item")); - - return new AttachedItemRetrieveResponse(attachedItem, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse AttachedItemRetrieveResponse from JSON", e); - } - } - - /** Get the attachedItem from the response. */ - public AttachedItem getAttachedItem() { - return attachedItem; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/brandConfiguration/BrandConfigurationRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/brandConfiguration/BrandConfigurationRetrieveResponse.java deleted file mode 100644 index b675f75a..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/brandConfiguration/BrandConfigurationRetrieveResponse.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.chargebee.v4.core.responses.brandConfiguration; - -import com.chargebee.v4.core.responses.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(Object brandConfiguration, Response httpResponse) { - super(httpResponse); - - this.brandConfiguration = 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 { - - Object brandConfiguration = JsonUtil.getObject(json, "brand_configuration"); - - return new BrandConfigurationRetrieveResponse(brandConfiguration, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse BrandConfigurationRetrieveResponse from JSON", e); - } - } - - /** Get the brandConfiguration from the response. */ - public Object getBrandConfiguration() { - return brandConfiguration; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/businessProfile/BusinessProfileRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/businessProfile/BusinessProfileRetrieveResponse.java deleted file mode 100644 index f5499dd1..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/businessProfile/BusinessProfileRetrieveResponse.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.chargebee.v4.core.responses.businessProfile; - -import com.chargebee.v4.core.responses.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(Object businessProfile, Response httpResponse) { - super(httpResponse); - - this.businessProfile = 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 { - - Object businessProfile = JsonUtil.getObject(json, "business_profile"); - - return new BusinessProfileRetrieveResponse(businessProfile, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse BusinessProfileRetrieveResponse from JSON", e); - } - } - - /** Get the businessProfile from the response. */ - public Object getBusinessProfile() { - return businessProfile; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/card/CardCopyCardForCustomerResponse.java b/src/main/java/com/chargebee/v4/core/responses/card/CardCopyCardForCustomerResponse.java deleted file mode 100644 index 9381a840..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/card/CardCopyCardForCustomerResponse.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.chargebee.v4.core.responses.card; - -import com.chargebee.v4.core.models.thirdPartyPaymentMethod.ThirdPartyPaymentMethod; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for CardCopyCardForCustomer operation. Contains the response data from - * the API. - */ -public final class CardCopyCardForCustomerResponse extends BaseResponse { - private final ThirdPartyPaymentMethod thirdPartyPaymentMethod; - - private CardCopyCardForCustomerResponse(Builder builder) { - super(builder.httpResponse); - - this.thirdPartyPaymentMethod = builder.thirdPartyPaymentMethod; - } - - /** Parse JSON response into CardCopyCardForCustomerResponse object. */ - public static CardCopyCardForCustomerResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into CardCopyCardForCustomerResponse object with HTTP response. */ - public static CardCopyCardForCustomerResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __thirdPartyPaymentMethodJson = JsonUtil.getObject(json, "third_party_payment_method"); - if (__thirdPartyPaymentMethodJson != null) { - builder.thirdPartyPaymentMethod( - ThirdPartyPaymentMethod.fromJson(__thirdPartyPaymentMethodJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException("Failed to parse CardCopyCardForCustomerResponse from JSON", e); - } - } - - /** Create a new builder for CardCopyCardForCustomerResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for CardCopyCardForCustomerResponse. */ - public static class Builder { - - private ThirdPartyPaymentMethod thirdPartyPaymentMethod; - - private Response httpResponse; - - private Builder() {} - - public Builder thirdPartyPaymentMethod(ThirdPartyPaymentMethod thirdPartyPaymentMethod) { - this.thirdPartyPaymentMethod = thirdPartyPaymentMethod; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public CardCopyCardForCustomerResponse build() { - return new CardCopyCardForCustomerResponse(this); - } - } - - /** Get the thirdPartyPaymentMethod from the response. */ - public ThirdPartyPaymentMethod getThirdPartyPaymentMethod() { - return thirdPartyPaymentMethod; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/card/CardDeleteCardForCustomerResponse.java b/src/main/java/com/chargebee/v4/core/responses/card/CardDeleteCardForCustomerResponse.java deleted file mode 100644 index 2b402be5..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/card/CardDeleteCardForCustomerResponse.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.chargebee.v4.core.responses.card; - -import com.chargebee.v4.core.models.customer.Customer; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for CardDeleteCardForCustomer operation. Contains the response data - * from the API. - */ -public final class CardDeleteCardForCustomerResponse extends BaseResponse { - private final Customer customer; - - private CardDeleteCardForCustomerResponse(Builder builder) { - super(builder.httpResponse); - - this.customer = builder.customer; - } - - /** Parse JSON response into CardDeleteCardForCustomerResponse object. */ - public static CardDeleteCardForCustomerResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into CardDeleteCardForCustomerResponse object with HTTP response. */ - public static CardDeleteCardForCustomerResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __customerJson = JsonUtil.getObject(json, "customer"); - if (__customerJson != null) { - builder.customer(Customer.fromJson(__customerJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException("Failed to parse CardDeleteCardForCustomerResponse from JSON", e); - } - } - - /** Create a new builder for CardDeleteCardForCustomerResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for CardDeleteCardForCustomerResponse. */ - public static class Builder { - - private Customer customer; - - private Response httpResponse; - - private Builder() {} - - public Builder customer(Customer customer) { - this.customer = customer; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public CardDeleteCardForCustomerResponse build() { - return new CardDeleteCardForCustomerResponse(this); - } - } - - /** Get the customer from the response. */ - public Customer getCustomer() { - return customer; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/card/CardRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/card/CardRetrieveResponse.java deleted file mode 100644 index e355d2dc..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/card/CardRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.card; - -import com.chargebee.v4.core.models.card.Card; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for CardRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class CardRetrieveResponse extends BaseResponse { - private final Card card; - - private CardRetrieveResponse(Card card, Response httpResponse) { - super(httpResponse); - - this.card = card; - } - - /** Parse JSON response into CardRetrieveResponse object. */ - public static CardRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into CardRetrieveResponse object with HTTP response. */ - public static CardRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Card card = Card.fromJson(JsonUtil.getObject(json, "card")); - - return new CardRetrieveResponse(card, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse CardRetrieveResponse from JSON", e); - } - } - - /** Get the card from the response. */ - public Card getCard() { - return card; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/card/CardUpdateCardForCustomerResponse.java b/src/main/java/com/chargebee/v4/core/responses/card/CardUpdateCardForCustomerResponse.java deleted file mode 100644 index 7ebfd1db..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/card/CardUpdateCardForCustomerResponse.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.chargebee.v4.core.responses.card; - -import com.chargebee.v4.core.models.customer.Customer; - -import com.chargebee.v4.core.models.card.Card; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for CardUpdateCardForCustomer operation. Contains the response data - * from the API. - */ -public final class CardUpdateCardForCustomerResponse extends BaseResponse { - private final Customer customer; - - private final Card card; - - private CardUpdateCardForCustomerResponse(Builder builder) { - super(builder.httpResponse); - - this.customer = builder.customer; - - this.card = builder.card; - } - - /** Parse JSON response into CardUpdateCardForCustomerResponse object. */ - public static CardUpdateCardForCustomerResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into CardUpdateCardForCustomerResponse object with HTTP response. */ - public static CardUpdateCardForCustomerResponse 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 CardUpdateCardForCustomerResponse from JSON", e); - } - } - - /** Create a new builder for CardUpdateCardForCustomerResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for CardUpdateCardForCustomerResponse. */ - 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 CardUpdateCardForCustomerResponse build() { - return new CardUpdateCardForCustomerResponse(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/core/responses/comment/CommentRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/comment/CommentRetrieveResponse.java deleted file mode 100644 index 141bc584..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/comment/CommentRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.comment; - -import com.chargebee.v4.core.models.comment.Comment; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for CommentRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class CommentRetrieveResponse extends BaseResponse { - private final Comment comment; - - private CommentRetrieveResponse(Comment comment, Response httpResponse) { - super(httpResponse); - - this.comment = comment; - } - - /** Parse JSON response into CommentRetrieveResponse object. */ - public static CommentRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into CommentRetrieveResponse object with HTTP response. */ - public static CommentRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Comment comment = Comment.fromJson(JsonUtil.getObject(json, "comment")); - - return new CommentRetrieveResponse(comment, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse CommentRetrieveResponse from JSON", e); - } - } - - /** Get the comment from the response. */ - public Comment getComment() { - return comment; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/configuration/ConfigurationListResponse.java b/src/main/java/com/chargebee/v4/core/responses/configuration/ConfigurationListResponse.java deleted file mode 100644 index 848dc1cb..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/configuration/ConfigurationListResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.chargebee.v4.core.responses.configuration; - -import com.chargebee.v4.core.models.configuration.Configuration; - -import com.chargebee.v4.core.responses.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(List configurations, Response httpResponse) { - super(httpResponse); - - this.configurations = 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 { - - List configurations = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "configurations")).stream() - .map(Configuration::fromJson) - .collect(java.util.stream.Collectors.toList()); - - return new ConfigurationListResponse(configurations, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse ConfigurationListResponse from JSON", e); - } - } - - /** Get the configurations from the response. */ - public List getConfigurations() { - return configurations; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/coupon/CouponRetrieveResponse.java deleted file mode 100644 index 0edbb534..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.coupon; - -import com.chargebee.v4.core.models.coupon.Coupon; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for CouponRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class CouponRetrieveResponse extends BaseResponse { - private final Coupon coupon; - - private CouponRetrieveResponse(Coupon coupon, Response httpResponse) { - super(httpResponse); - - this.coupon = coupon; - } - - /** Parse JSON response into CouponRetrieveResponse object. */ - public static CouponRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into CouponRetrieveResponse object with HTTP response. */ - public static CouponRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Coupon coupon = Coupon.fromJson(JsonUtil.getObject(json, "coupon")); - - return new CouponRetrieveResponse(coupon, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse CouponRetrieveResponse from JSON", e); - } - } - - /** Get the coupon from the response. */ - public Coupon getCoupon() { - return coupon; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/couponCode/CouponCodeRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/couponCode/CouponCodeRetrieveResponse.java deleted file mode 100644 index 45081f51..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/couponCode/CouponCodeRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.couponCode; - -import com.chargebee.v4.core.models.couponCode.CouponCode; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for CouponCodeRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class CouponCodeRetrieveResponse extends BaseResponse { - private final CouponCode couponCode; - - private CouponCodeRetrieveResponse(CouponCode couponCode, Response httpResponse) { - super(httpResponse); - - this.couponCode = couponCode; - } - - /** Parse JSON response into CouponCodeRetrieveResponse object. */ - public static CouponCodeRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into CouponCodeRetrieveResponse object with HTTP response. */ - public static CouponCodeRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - CouponCode couponCode = CouponCode.fromJson(JsonUtil.getObject(json, "coupon_code")); - - return new CouponCodeRetrieveResponse(couponCode, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse CouponCodeRetrieveResponse from JSON", e); - } - } - - /** Get the couponCode from the response. */ - public CouponCode getCouponCode() { - return couponCode; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetRetrieveResponse.java deleted file mode 100644 index f55480ba..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.couponSet; - -import com.chargebee.v4.core.models.couponSet.CouponSet; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for CouponSetRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class CouponSetRetrieveResponse extends BaseResponse { - private final CouponSet couponSet; - - private CouponSetRetrieveResponse(CouponSet couponSet, Response httpResponse) { - super(httpResponse); - - this.couponSet = couponSet; - } - - /** Parse JSON response into CouponSetRetrieveResponse object. */ - public static CouponSetRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into CouponSetRetrieveResponse object with HTTP response. */ - public static CouponSetRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - CouponSet couponSet = CouponSet.fromJson(JsonUtil.getObject(json, "coupon_set")); - - return new CouponSetRetrieveResponse(couponSet, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse CouponSetRetrieveResponse from JSON", e); - } - } - - /** Get the couponSet from the response. */ - public CouponSet getCouponSet() { - return couponSet; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteCreditNotesForCustomerResponse.java b/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteCreditNotesForCustomerResponse.java deleted file mode 100644 index fbdc9ac7..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteCreditNotesForCustomerResponse.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.chargebee.v4.core.responses.creditNote; - -import java.util.List; - -import com.chargebee.v4.core.models.creditNote.CreditNote; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.CreditNoteService; -import com.chargebee.v4.core.models.creditNote.params.CreditNoteCreditNotesForCustomerParams; - -/** - * Immutable response object for CreditNoteCreditNotesForCustomer operation. Contains paginated list - * data. - */ -public final class CreditNoteCreditNotesForCustomerResponse { - - private final List list; - - private final String nextOffset; - - private final String customerId; - - private final CreditNoteService service; - private final CreditNoteCreditNotesForCustomerParams originalParams; - private final Response httpResponse; - - private CreditNoteCreditNotesForCustomerResponse( - List list, - String nextOffset, - String customerId, - CreditNoteService service, - CreditNoteCreditNotesForCustomerParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.customerId = customerId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into CreditNoteCreditNotesForCustomerResponse object (no service context). - * Use this when you only need to read a single page (no nextPage()). - */ - public static CreditNoteCreditNotesForCustomerResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(CreditNoteCreditNotesForCustomerItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new CreditNoteCreditNotesForCustomerResponse(list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse CreditNoteCreditNotesForCustomerResponse from JSON", e); - } - } - - /** - * Parse JSON response into CreditNoteCreditNotesForCustomerResponse object with service context - * for pagination (enables nextPage()). - */ - public static CreditNoteCreditNotesForCustomerResponse fromJson( - String json, - CreditNoteService service, - CreditNoteCreditNotesForCustomerParams originalParams, - String customerId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(CreditNoteCreditNotesForCustomerItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new CreditNoteCreditNotesForCustomerResponse( - list, nextOffset, customerId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse CreditNoteCreditNotesForCustomerResponse 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 CreditNoteCreditNotesForCustomerResponse 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)."); - } - - CreditNoteCreditNotesForCustomerParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : CreditNoteCreditNotesForCustomerParams.builder()) - .offset(nextOffset) - .build(); - - return service.creditNotesForCustomer(customerId, 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 CreditNoteCreditNotesForCustomerItem { - - private CreditNote creditNote; - - public CreditNote getCreditNote() { - return creditNote; - } - - public static CreditNoteCreditNotesForCustomerItem fromJson(String json) { - CreditNoteCreditNotesForCustomerItem item = new CreditNoteCreditNotesForCustomerItem(); - - String __creditNoteJson = JsonUtil.getObject(json, "credit_note"); - if (__creditNoteJson != null) { - item.creditNote = CreditNote.fromJson(__creditNoteJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteDownloadEinvoiceResponse.java b/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteDownloadEinvoiceResponse.java deleted file mode 100644 index ad5f0999..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteDownloadEinvoiceResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.chargebee.v4.core.responses.creditNote; - -import com.chargebee.v4.core.models.download.Download; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import java.util.List; - -/** - * Immutable response object for CreditNoteDownloadEinvoice operation. Contains the response data - * from a single resource get operation. - */ -public final class CreditNoteDownloadEinvoiceResponse extends BaseResponse { - private final List downloads; - - private CreditNoteDownloadEinvoiceResponse(List downloads, Response httpResponse) { - super(httpResponse); - - this.downloads = downloads; - } - - /** Parse JSON response into CreditNoteDownloadEinvoiceResponse object. */ - public static CreditNoteDownloadEinvoiceResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into CreditNoteDownloadEinvoiceResponse object with HTTP response. */ - public static CreditNoteDownloadEinvoiceResponse fromJson(String json, Response httpResponse) { - try { - - List downloads = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "downloads")).stream() - .map(Download::fromJson) - .collect(java.util.stream.Collectors.toList()); - - return new CreditNoteDownloadEinvoiceResponse(downloads, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse CreditNoteDownloadEinvoiceResponse from JSON", e); - } - } - - /** Get the downloads from the response. */ - public List getDownloads() { - return downloads; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteImportCreditNoteResponse.java b/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteImportCreditNoteResponse.java deleted file mode 100644 index 3331025a..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteImportCreditNoteResponse.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.chargebee.v4.core.responses.creditNote; - -import com.chargebee.v4.core.models.creditNote.CreditNote; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for CreditNoteImportCreditNote operation. Contains the response data - * from the API. - */ -public final class CreditNoteImportCreditNoteResponse extends BaseResponse { - private final CreditNote creditNote; - - private CreditNoteImportCreditNoteResponse(Builder builder) { - super(builder.httpResponse); - - this.creditNote = builder.creditNote; - } - - /** Parse JSON response into CreditNoteImportCreditNoteResponse object. */ - public static CreditNoteImportCreditNoteResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into CreditNoteImportCreditNoteResponse object with HTTP response. */ - public static CreditNoteImportCreditNoteResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __creditNoteJson = JsonUtil.getObject(json, "credit_note"); - if (__creditNoteJson != null) { - builder.creditNote(CreditNote.fromJson(__creditNoteJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException("Failed to parse CreditNoteImportCreditNoteResponse from JSON", e); - } - } - - /** Create a new builder for CreditNoteImportCreditNoteResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for CreditNoteImportCreditNoteResponse. */ - public static class Builder { - - private CreditNote creditNote; - - private Response httpResponse; - - private Builder() {} - - public Builder creditNote(CreditNote creditNote) { - this.creditNote = creditNote; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public CreditNoteImportCreditNoteResponse build() { - return new CreditNoteImportCreditNoteResponse(this); - } - } - - /** Get the creditNote from the response. */ - public CreditNote getCreditNote() { - return creditNote; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteRetrieveResponse.java deleted file mode 100644 index 7ac5d79a..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.creditNote; - -import com.chargebee.v4.core.models.creditNote.CreditNote; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for CreditNoteRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class CreditNoteRetrieveResponse extends BaseResponse { - private final CreditNote creditNote; - - private CreditNoteRetrieveResponse(CreditNote creditNote, Response httpResponse) { - super(httpResponse); - - this.creditNote = creditNote; - } - - /** Parse JSON response into CreditNoteRetrieveResponse object. */ - public static CreditNoteRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into CreditNoteRetrieveResponse object with HTTP response. */ - public static CreditNoteRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - CreditNote creditNote = CreditNote.fromJson(JsonUtil.getObject(json, "credit_note")); - - return new CreditNoteRetrieveResponse(creditNote, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse CreditNoteRetrieveResponse from JSON", e); - } - } - - /** Get the creditNote from the response. */ - public CreditNote getCreditNote() { - return creditNote; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteVoidCreditNoteResponse.java b/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteVoidCreditNoteResponse.java deleted file mode 100644 index b6b15706..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteVoidCreditNoteResponse.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.chargebee.v4.core.responses.creditNote; - -import com.chargebee.v4.core.models.creditNote.CreditNote; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for CreditNoteVoidCreditNote operation. Contains the response data from - * the API. - */ -public final class CreditNoteVoidCreditNoteResponse extends BaseResponse { - private final CreditNote creditNote; - - private CreditNoteVoidCreditNoteResponse(Builder builder) { - super(builder.httpResponse); - - this.creditNote = builder.creditNote; - } - - /** Parse JSON response into CreditNoteVoidCreditNoteResponse object. */ - public static CreditNoteVoidCreditNoteResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into CreditNoteVoidCreditNoteResponse object with HTTP response. */ - public static CreditNoteVoidCreditNoteResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __creditNoteJson = JsonUtil.getObject(json, "credit_note"); - if (__creditNoteJson != null) { - builder.creditNote(CreditNote.fromJson(__creditNoteJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException("Failed to parse CreditNoteVoidCreditNoteResponse from JSON", e); - } - } - - /** Create a new builder for CreditNoteVoidCreditNoteResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for CreditNoteVoidCreditNoteResponse. */ - public static class Builder { - - private CreditNote creditNote; - - private Response httpResponse; - - private Builder() {} - - public Builder creditNote(CreditNote creditNote) { - this.creditNote = creditNote; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public CreditNoteVoidCreditNoteResponse build() { - return new CreditNoteVoidCreditNoteResponse(this); - } - } - - /** Get the creditNote from the response. */ - public CreditNote getCreditNote() { - return creditNote; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/currency/CurrencyRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/currency/CurrencyRetrieveResponse.java deleted file mode 100644 index 00040440..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/currency/CurrencyRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.currency; - -import com.chargebee.v4.core.models.currency.Currency; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for CurrencyRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class CurrencyRetrieveResponse extends BaseResponse { - private final Currency currency; - - private CurrencyRetrieveResponse(Currency currency, Response httpResponse) { - super(httpResponse); - - this.currency = currency; - } - - /** Parse JSON response into CurrencyRetrieveResponse object. */ - public static CurrencyRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into CurrencyRetrieveResponse object with HTTP response. */ - public static CurrencyRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Currency currency = Currency.fromJson(JsonUtil.getObject(json, "currency")); - - return new CurrencyRetrieveResponse(currency, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse CurrencyRetrieveResponse from JSON", e); - } - } - - /** Get the currency from the response. */ - public Currency getCurrency() { - return currency; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerContactsForCustomerResponse.java b/src/main/java/com/chargebee/v4/core/responses/customer/CustomerContactsForCustomerResponse.java deleted file mode 100644 index e062b283..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerContactsForCustomerResponse.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.chargebee.v4.core.responses.customer; - -import java.util.List; - -import com.chargebee.v4.core.models.contact.Contact; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.CustomerService; -import com.chargebee.v4.core.models.customer.params.CustomerContactsForCustomerParams; - -/** - * Immutable response object for CustomerContactsForCustomer operation. Contains paginated list - * data. - */ -public final class CustomerContactsForCustomerResponse { - - private final List list; - - private final String nextOffset; - - private final String customerId; - - private final CustomerService service; - private final CustomerContactsForCustomerParams originalParams; - private final Response httpResponse; - - private CustomerContactsForCustomerResponse( - List list, - String nextOffset, - String customerId, - CustomerService service, - CustomerContactsForCustomerParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.customerId = customerId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into CustomerContactsForCustomerResponse object (no service context). Use - * this when you only need to read a single page (no nextPage()). - */ - public static CustomerContactsForCustomerResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(CustomerContactsForCustomerItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new CustomerContactsForCustomerResponse(list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse CustomerContactsForCustomerResponse from JSON", e); - } - } - - /** - * Parse JSON response into CustomerContactsForCustomerResponse object with service context for - * pagination (enables nextPage()). - */ - public static CustomerContactsForCustomerResponse fromJson( - String json, - CustomerService service, - CustomerContactsForCustomerParams originalParams, - String customerId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(CustomerContactsForCustomerItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new CustomerContactsForCustomerResponse( - list, nextOffset, customerId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse CustomerContactsForCustomerResponse 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 CustomerContactsForCustomerResponse 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)."); - } - - CustomerContactsForCustomerParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : CustomerContactsForCustomerParams.builder()) - .offset(nextOffset) - .build(); - - return service.contactsForCustomer(customerId, 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 CustomerContactsForCustomerItem { - - private Contact contact; - - public Contact getContact() { - return contact; - } - - public static CustomerContactsForCustomerItem fromJson(String json) { - CustomerContactsForCustomerItem item = new CustomerContactsForCustomerItem(); - - String __contactJson = JsonUtil.getObject(json, "contact"); - if (__contactJson != null) { - item.contact = Contact.fromJson(__contactJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerHierarchyResponse.java b/src/main/java/com/chargebee/v4/core/responses/customer/CustomerHierarchyResponse.java deleted file mode 100644 index 9ae73e15..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerHierarchyResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.chargebee.v4.core.responses.customer; - -import com.chargebee.v4.core.models.hierarchy.Hierarchy; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import java.util.List; - -/** - * Immutable response object for CustomerHierarchy operation. Contains the response data from a - * single resource get operation. - */ -public final class CustomerHierarchyResponse extends BaseResponse { - private final List hierarchies; - - private CustomerHierarchyResponse(List hierarchies, Response httpResponse) { - super(httpResponse); - - this.hierarchies = hierarchies; - } - - /** Parse JSON response into CustomerHierarchyResponse object. */ - public static CustomerHierarchyResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into CustomerHierarchyResponse object with HTTP response. */ - public static CustomerHierarchyResponse fromJson(String json, Response httpResponse) { - try { - - List hierarchies = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "hierarchies")).stream() - .map(Hierarchy::fromJson) - .collect(java.util.stream.Collectors.toList()); - - return new CustomerHierarchyResponse(hierarchies, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse CustomerHierarchyResponse from JSON", e); - } - } - - /** Get the hierarchies from the response. */ - public List getHierarchies() { - return hierarchies; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/customer/CustomerRetrieveResponse.java deleted file mode 100644 index 8468ef3b..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerRetrieveResponse.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.chargebee.v4.core.responses.customer; - -import com.chargebee.v4.core.models.customer.Customer; - -import com.chargebee.v4.core.models.card.Card; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for CustomerRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class CustomerRetrieveResponse extends BaseResponse { - private final Customer customer; - - private final Card card; - - private CustomerRetrieveResponse(Customer customer, Card card, Response httpResponse) { - super(httpResponse); - - this.customer = customer; - - this.card = card; - } - - /** Parse JSON response into CustomerRetrieveResponse object. */ - public static CustomerRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into CustomerRetrieveResponse object with HTTP response. */ - public static CustomerRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Customer customer = Customer.fromJson(JsonUtil.getObject(json, "customer")); - - Card card = Card.fromJson(JsonUtil.getObject(json, "card")); - - return new CustomerRetrieveResponse(customer, card, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse CustomerRetrieveResponse from JSON", e); - } - } - - /** 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/core/responses/differentialPrice/DifferentialPriceRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/differentialPrice/DifferentialPriceRetrieveResponse.java deleted file mode 100644 index a96f2362..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/differentialPrice/DifferentialPriceRetrieveResponse.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.chargebee.v4.core.responses.differentialPrice; - -import com.chargebee.v4.core.models.differentialPrice.DifferentialPrice; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for DifferentialPriceRetrieve operation. Contains the response data - * from a single resource get operation. - */ -public final class DifferentialPriceRetrieveResponse extends BaseResponse { - private final DifferentialPrice differentialPrice; - - private DifferentialPriceRetrieveResponse( - DifferentialPrice differentialPrice, Response httpResponse) { - super(httpResponse); - - this.differentialPrice = differentialPrice; - } - - /** Parse JSON response into DifferentialPriceRetrieveResponse object. */ - public static DifferentialPriceRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into DifferentialPriceRetrieveResponse object with HTTP response. */ - public static DifferentialPriceRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - DifferentialPrice differentialPrice = - DifferentialPrice.fromJson(JsonUtil.getObject(json, "differential_price")); - - return new DifferentialPriceRetrieveResponse(differentialPrice, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse DifferentialPriceRetrieveResponse from JSON", e); - } - } - - /** Get the differentialPrice from the response. */ - public DifferentialPrice getDifferentialPrice() { - return differentialPrice; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/entitlementOverride/EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse.java b/src/main/java/com/chargebee/v4/core/responses/entitlementOverride/EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse.java deleted file mode 100644 index 50ec19fe..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/entitlementOverride/EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.chargebee.v4.core.responses.entitlementOverride; - -import java.util.List; - -import com.chargebee.v4.core.models.entitlementOverride.EntitlementOverride; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for EntitlementOverrideAddEntitlementOverrideForSubscription operation. - * Contains the response data from the API. - */ -public final class EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse - extends BaseResponse { - private final List list; - - private EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse(Builder builder) { - super(builder.httpResponse); - - this.list = builder.list; - } - - /** - * Parse JSON response into EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse - * object. - */ - public static EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse fromJson( - String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse - * object with HTTP response. - */ - public static EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - builder.list( - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(EntitlementOverride::fromJson) - .collect(java.util.stream.Collectors.toList())); - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse from JSON", - e); - } - } - - /** Create a new builder for EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse. */ - public static class Builder { - - private List list; - - private Response httpResponse; - - private Builder() {} - - public Builder list(List list) { - this.list = list; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse build() { - return new EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse(this); - } - } - - /** Get the list from the response. */ - public List getList() { - return list; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/entitlementOverride/EntitlementOverrideListEntitlementOverrideForSubscriptionResponse.java b/src/main/java/com/chargebee/v4/core/responses/entitlementOverride/EntitlementOverrideListEntitlementOverrideForSubscriptionResponse.java deleted file mode 100644 index e6865275..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/entitlementOverride/EntitlementOverrideListEntitlementOverrideForSubscriptionResponse.java +++ /dev/null @@ -1,185 +0,0 @@ -package com.chargebee.v4.core.responses.entitlementOverride; - -import java.util.List; - -import com.chargebee.v4.core.models.entitlementOverride.EntitlementOverride; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.EntitlementOverrideService; -import com.chargebee.v4.core.models.entitlementOverride.params.EntitlementOverrideListEntitlementOverrideForSubscriptionParams; - -/** - * Immutable response object for EntitlementOverrideListEntitlementOverrideForSubscription - * operation. Contains paginated list data. - */ -public final class EntitlementOverrideListEntitlementOverrideForSubscriptionResponse { - - private final List list; - - private final String nextOffset; - - private final String subscriptionId; - - private final EntitlementOverrideService service; - private final EntitlementOverrideListEntitlementOverrideForSubscriptionParams originalParams; - private final Response httpResponse; - - private EntitlementOverrideListEntitlementOverrideForSubscriptionResponse( - List list, - String nextOffset, - String subscriptionId, - EntitlementOverrideService service, - EntitlementOverrideListEntitlementOverrideForSubscriptionParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.subscriptionId = subscriptionId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into EntitlementOverrideListEntitlementOverrideForSubscriptionResponse - * object (no service context). Use this when you only need to read a single page (no nextPage()). - */ - public static EntitlementOverrideListEntitlementOverrideForSubscriptionResponse fromJson( - String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(EntitlementOverrideListEntitlementOverrideForSubscriptionItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new EntitlementOverrideListEntitlementOverrideForSubscriptionResponse( - list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse EntitlementOverrideListEntitlementOverrideForSubscriptionResponse from JSON", - e); - } - } - - /** - * Parse JSON response into EntitlementOverrideListEntitlementOverrideForSubscriptionResponse - * object with service context for pagination (enables nextPage()). - */ - public static EntitlementOverrideListEntitlementOverrideForSubscriptionResponse fromJson( - String json, - EntitlementOverrideService service, - EntitlementOverrideListEntitlementOverrideForSubscriptionParams originalParams, - String subscriptionId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(EntitlementOverrideListEntitlementOverrideForSubscriptionItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new EntitlementOverrideListEntitlementOverrideForSubscriptionResponse( - list, nextOffset, subscriptionId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse EntitlementOverrideListEntitlementOverrideForSubscriptionResponse 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 EntitlementOverrideListEntitlementOverrideForSubscriptionResponse 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)."); - } - - EntitlementOverrideListEntitlementOverrideForSubscriptionParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : EntitlementOverrideListEntitlementOverrideForSubscriptionParams.builder()) - .offset(nextOffset) - .build(); - - return service.listEntitlementOverrideForSubscription(subscriptionId, 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 EntitlementOverrideListEntitlementOverrideForSubscriptionItem { - - private EntitlementOverride entitlementOverride; - - public EntitlementOverride getEntitlementOverride() { - return entitlementOverride; - } - - public static EntitlementOverrideListEntitlementOverrideForSubscriptionItem fromJson( - String json) { - EntitlementOverrideListEntitlementOverrideForSubscriptionItem item = - new EntitlementOverrideListEntitlementOverrideForSubscriptionItem(); - - String __entitlementOverrideJson = JsonUtil.getObject(json, "entitlement_override"); - if (__entitlementOverrideJson != null) { - item.entitlementOverride = EntitlementOverride.fromJson(__entitlementOverrideJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateAdvanceInvoiceEstimateResponse.java b/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateAdvanceInvoiceEstimateResponse.java deleted file mode 100644 index 8dace56f..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateAdvanceInvoiceEstimateResponse.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.chargebee.v4.core.responses.estimate; - -import com.chargebee.v4.core.models.estimate.Estimate; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for EstimateAdvanceInvoiceEstimate operation. Contains the response - * data from the API. - */ -public final class EstimateAdvanceInvoiceEstimateResponse extends BaseResponse { - private final Estimate estimate; - - private EstimateAdvanceInvoiceEstimateResponse(Builder builder) { - super(builder.httpResponse); - - this.estimate = builder.estimate; - } - - /** Parse JSON response into EstimateAdvanceInvoiceEstimateResponse object. */ - public static EstimateAdvanceInvoiceEstimateResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into EstimateAdvanceInvoiceEstimateResponse object with HTTP response. */ - public static EstimateAdvanceInvoiceEstimateResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __estimateJson = JsonUtil.getObject(json, "estimate"); - if (__estimateJson != null) { - builder.estimate(Estimate.fromJson(__estimateJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse EstimateAdvanceInvoiceEstimateResponse from JSON", e); - } - } - - /** Create a new builder for EstimateAdvanceInvoiceEstimateResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for EstimateAdvanceInvoiceEstimateResponse. */ - public static class Builder { - - private Estimate estimate; - - private Response httpResponse; - - private Builder() {} - - public Builder estimate(Estimate estimate) { - this.estimate = estimate; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public EstimateAdvanceInvoiceEstimateResponse build() { - return new EstimateAdvanceInvoiceEstimateResponse(this); - } - } - - /** Get the estimate from the response. */ - public Estimate getEstimate() { - return estimate; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateSubForCustomerEstimateResponse.java b/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateSubForCustomerEstimateResponse.java deleted file mode 100644 index 47bdc908..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateSubForCustomerEstimateResponse.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.chargebee.v4.core.responses.estimate; - -import com.chargebee.v4.core.models.estimate.Estimate; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for EstimateCreateSubForCustomerEstimate operation. Contains the - * response data from a single resource get operation. - */ -public final class EstimateCreateSubForCustomerEstimateResponse extends BaseResponse { - private final Estimate estimate; - - private EstimateCreateSubForCustomerEstimateResponse(Estimate estimate, Response httpResponse) { - super(httpResponse); - - this.estimate = estimate; - } - - /** Parse JSON response into EstimateCreateSubForCustomerEstimateResponse object. */ - public static EstimateCreateSubForCustomerEstimateResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into EstimateCreateSubForCustomerEstimateResponse object with HTTP - * response. - */ - public static EstimateCreateSubForCustomerEstimateResponse fromJson( - String json, Response httpResponse) { - try { - - Estimate estimate = Estimate.fromJson(JsonUtil.getObject(json, "estimate")); - - return new EstimateCreateSubForCustomerEstimateResponse(estimate, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse EstimateCreateSubForCustomerEstimateResponse from JSON", e); - } - } - - /** Get the estimate from the response. */ - public Estimate getEstimate() { - return estimate; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateSubItemEstimateResponse.java b/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateSubItemEstimateResponse.java deleted file mode 100644 index 986308f4..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateSubItemEstimateResponse.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.chargebee.v4.core.responses.estimate; - -import com.chargebee.v4.core.models.estimate.Estimate; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for EstimateCreateSubItemEstimate operation. Contains the response data - * from the API. - */ -public final class EstimateCreateSubItemEstimateResponse extends BaseResponse { - private final Estimate estimate; - - private EstimateCreateSubItemEstimateResponse(Builder builder) { - super(builder.httpResponse); - - this.estimate = builder.estimate; - } - - /** Parse JSON response into EstimateCreateSubItemEstimateResponse object. */ - public static EstimateCreateSubItemEstimateResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into EstimateCreateSubItemEstimateResponse object with HTTP response. */ - public static EstimateCreateSubItemEstimateResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __estimateJson = JsonUtil.getObject(json, "estimate"); - if (__estimateJson != null) { - builder.estimate(Estimate.fromJson(__estimateJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse EstimateCreateSubItemEstimateResponse from JSON", e); - } - } - - /** Create a new builder for EstimateCreateSubItemEstimateResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for EstimateCreateSubItemEstimateResponse. */ - public static class Builder { - - private Estimate estimate; - - private Response httpResponse; - - private Builder() {} - - public Builder estimate(Estimate estimate) { - this.estimate = estimate; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public EstimateCreateSubItemEstimateResponse build() { - return new EstimateCreateSubItemEstimateResponse(this); - } - } - - /** Get the estimate from the response. */ - public Estimate getEstimate() { - return estimate; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateSubItemForCustomerEstimateResponse.java b/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateSubItemForCustomerEstimateResponse.java deleted file mode 100644 index afc06da7..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateSubItemForCustomerEstimateResponse.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.chargebee.v4.core.responses.estimate; - -import com.chargebee.v4.core.models.estimate.Estimate; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for EstimateCreateSubItemForCustomerEstimate operation. Contains the - * response data from the API. - */ -public final class EstimateCreateSubItemForCustomerEstimateResponse extends BaseResponse { - private final Estimate estimate; - - private EstimateCreateSubItemForCustomerEstimateResponse(Builder builder) { - super(builder.httpResponse); - - this.estimate = builder.estimate; - } - - /** Parse JSON response into EstimateCreateSubItemForCustomerEstimateResponse object. */ - public static EstimateCreateSubItemForCustomerEstimateResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into EstimateCreateSubItemForCustomerEstimateResponse object with HTTP - * response. - */ - public static EstimateCreateSubItemForCustomerEstimateResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __estimateJson = JsonUtil.getObject(json, "estimate"); - if (__estimateJson != null) { - builder.estimate(Estimate.fromJson(__estimateJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse EstimateCreateSubItemForCustomerEstimateResponse from JSON", e); - } - } - - /** Create a new builder for EstimateCreateSubItemForCustomerEstimateResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for EstimateCreateSubItemForCustomerEstimateResponse. */ - public static class Builder { - - private Estimate estimate; - - private Response httpResponse; - - private Builder() {} - - public Builder estimate(Estimate estimate) { - this.estimate = estimate; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public EstimateCreateSubItemForCustomerEstimateResponse build() { - return new EstimateCreateSubItemForCustomerEstimateResponse(this); - } - } - - /** Get the estimate from the response. */ - public Estimate getEstimate() { - return estimate; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateRegenerateInvoiceEstimateResponse.java b/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateRegenerateInvoiceEstimateResponse.java deleted file mode 100644 index ee934c2b..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateRegenerateInvoiceEstimateResponse.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.chargebee.v4.core.responses.estimate; - -import com.chargebee.v4.core.models.estimate.Estimate; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for EstimateRegenerateInvoiceEstimate operation. Contains the response - * data from the API. - */ -public final class EstimateRegenerateInvoiceEstimateResponse extends BaseResponse { - private final Estimate estimate; - - private EstimateRegenerateInvoiceEstimateResponse(Builder builder) { - super(builder.httpResponse); - - this.estimate = builder.estimate; - } - - /** Parse JSON response into EstimateRegenerateInvoiceEstimateResponse object. */ - public static EstimateRegenerateInvoiceEstimateResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into EstimateRegenerateInvoiceEstimateResponse object with HTTP response. - */ - public static EstimateRegenerateInvoiceEstimateResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __estimateJson = JsonUtil.getObject(json, "estimate"); - if (__estimateJson != null) { - builder.estimate(Estimate.fromJson(__estimateJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse EstimateRegenerateInvoiceEstimateResponse from JSON", e); - } - } - - /** Create a new builder for EstimateRegenerateInvoiceEstimateResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for EstimateRegenerateInvoiceEstimateResponse. */ - public static class Builder { - - private Estimate estimate; - - private Response httpResponse; - - private Builder() {} - - public Builder estimate(Estimate estimate) { - this.estimate = estimate; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public EstimateRegenerateInvoiceEstimateResponse build() { - return new EstimateRegenerateInvoiceEstimateResponse(this); - } - } - - /** Get the estimate from the response. */ - public Estimate getEstimate() { - return estimate; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateRenewalEstimateResponse.java b/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateRenewalEstimateResponse.java deleted file mode 100644 index 22802b60..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateRenewalEstimateResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.estimate; - -import com.chargebee.v4.core.models.estimate.Estimate; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for EstimateRenewalEstimate operation. Contains the response data from - * a single resource get operation. - */ -public final class EstimateRenewalEstimateResponse extends BaseResponse { - private final Estimate estimate; - - private EstimateRenewalEstimateResponse(Estimate estimate, Response httpResponse) { - super(httpResponse); - - this.estimate = estimate; - } - - /** Parse JSON response into EstimateRenewalEstimateResponse object. */ - public static EstimateRenewalEstimateResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into EstimateRenewalEstimateResponse object with HTTP response. */ - public static EstimateRenewalEstimateResponse fromJson(String json, Response httpResponse) { - try { - - Estimate estimate = Estimate.fromJson(JsonUtil.getObject(json, "estimate")); - - return new EstimateRenewalEstimateResponse(estimate, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse EstimateRenewalEstimateResponse from JSON", e); - } - } - - /** Get the estimate from the response. */ - public Estimate getEstimate() { - return estimate; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateUpcomingInvoicesEstimateResponse.java b/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateUpcomingInvoicesEstimateResponse.java deleted file mode 100644 index 9fb7ddd0..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateUpcomingInvoicesEstimateResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.chargebee.v4.core.responses.estimate; - -import com.chargebee.v4.core.models.estimate.Estimate; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for EstimateUpcomingInvoicesEstimate operation. Contains the response - * data from a single resource get operation. - */ -public final class EstimateUpcomingInvoicesEstimateResponse extends BaseResponse { - private final Estimate estimate; - - private EstimateUpcomingInvoicesEstimateResponse(Estimate estimate, Response httpResponse) { - super(httpResponse); - - this.estimate = estimate; - } - - /** Parse JSON response into EstimateUpcomingInvoicesEstimateResponse object. */ - public static EstimateUpcomingInvoicesEstimateResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into EstimateUpcomingInvoicesEstimateResponse object with HTTP response. - */ - public static EstimateUpcomingInvoicesEstimateResponse fromJson( - String json, Response httpResponse) { - try { - - Estimate estimate = Estimate.fromJson(JsonUtil.getObject(json, "estimate")); - - return new EstimateUpcomingInvoicesEstimateResponse(estimate, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse EstimateUpcomingInvoicesEstimateResponse from JSON", e); - } - } - - /** Get the estimate from the response. */ - public Estimate getEstimate() { - return estimate; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/event/EventRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/event/EventRetrieveResponse.java deleted file mode 100644 index c8f868ef..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/event/EventRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.event; - -import com.chargebee.v4.core.models.event.Event; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for EventRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class EventRetrieveResponse extends BaseResponse { - private final Event event; - - private EventRetrieveResponse(Event event, Response httpResponse) { - super(httpResponse); - - this.event = event; - } - - /** Parse JSON response into EventRetrieveResponse object. */ - public static EventRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into EventRetrieveResponse object with HTTP response. */ - public static EventRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Event event = Event.fromJson(JsonUtil.getObject(json, "event")); - - return new EventRetrieveResponse(event, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse EventRetrieveResponse from JSON", e); - } - } - - /** Get the event from the response. */ - public Event getEvent() { - return event; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/export/ExportRetrieveResponse.java deleted file mode 100644 index 3cf4015f..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.export; - -import com.chargebee.v4.core.models.export.Export; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for ExportRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class ExportRetrieveResponse extends BaseResponse { - private final Export export; - - private ExportRetrieveResponse(Export export, Response httpResponse) { - super(httpResponse); - - this.export = export; - } - - /** Parse JSON response into ExportRetrieveResponse object. */ - public static ExportRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into ExportRetrieveResponse object with HTTP response. */ - public static ExportRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Export export = Export.fromJson(JsonUtil.getObject(json, "export")); - - return new ExportRetrieveResponse(export, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse ExportRetrieveResponse from JSON", e); - } - } - - /** Get the export from the response. */ - public Export getExport() { - return export; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/feature/FeatureRetrieveResponse.java deleted file mode 100644 index 95de3af7..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.feature; - -import com.chargebee.v4.core.models.feature.Feature; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for FeatureRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class FeatureRetrieveResponse extends BaseResponse { - private final Feature feature; - - private FeatureRetrieveResponse(Feature feature, Response httpResponse) { - super(httpResponse); - - this.feature = feature; - } - - /** Parse JSON response into FeatureRetrieveResponse object. */ - public static FeatureRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into FeatureRetrieveResponse object with HTTP response. */ - public static FeatureRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Feature feature = Feature.fromJson(JsonUtil.getObject(json, "feature")); - - return new FeatureRetrieveResponse(feature, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse FeatureRetrieveResponse from JSON", e); - } - } - - /** Get the feature from the response. */ - public Feature getFeature() { - return feature; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/fullExport/FullExportStatusResponse.java b/src/main/java/com/chargebee/v4/core/responses/fullExport/FullExportStatusResponse.java deleted file mode 100644 index be84c0ab..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/fullExport/FullExportStatusResponse.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.chargebee.v4.core.responses.fullExport; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for FullExportStatus operation. Contains the response data from a - * single resource get operation. - */ -public final class FullExportStatusResponse extends BaseResponse { - private final Object fullExport; - - private FullExportStatusResponse(Object fullExport, Response httpResponse) { - super(httpResponse); - - this.fullExport = fullExport; - } - - /** Parse JSON response into FullExportStatusResponse object. */ - public static FullExportStatusResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into FullExportStatusResponse object with HTTP response. */ - public static FullExportStatusResponse fromJson(String json, Response httpResponse) { - try { - - Object fullExport = JsonUtil.getObject(json, "full_export"); - - return new FullExportStatusResponse(fullExport, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse FullExportStatusResponse from JSON", e); - } - } - - /** Get the fullExport from the response. */ - public Object getFullExport() { - return fullExport; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/gift/GiftRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/gift/GiftRetrieveResponse.java deleted file mode 100644 index b427ec75..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/gift/GiftRetrieveResponse.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.chargebee.v4.core.responses.gift; - -import com.chargebee.v4.core.models.gift.Gift; - -import com.chargebee.v4.core.models.subscription.Subscription; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for GiftRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class GiftRetrieveResponse extends BaseResponse { - private final Gift gift; - - private final Subscription subscription; - - private GiftRetrieveResponse(Gift gift, Subscription subscription, Response httpResponse) { - super(httpResponse); - - this.gift = gift; - - this.subscription = subscription; - } - - /** Parse JSON response into GiftRetrieveResponse object. */ - public static GiftRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into GiftRetrieveResponse object with HTTP response. */ - public static GiftRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Gift gift = Gift.fromJson(JsonUtil.getObject(json, "gift")); - - Subscription subscription = Subscription.fromJson(JsonUtil.getObject(json, "subscription")); - - return new GiftRetrieveResponse(gift, subscription, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse GiftRetrieveResponse from JSON", e); - } - } - - /** Get the gift from the response. */ - public Gift getGift() { - return gift; - } - - /** Get the subscription from the response. */ - public Subscription getSubscription() { - return subscription; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/gift/GiftUpdateGiftResponse.java b/src/main/java/com/chargebee/v4/core/responses/gift/GiftUpdateGiftResponse.java deleted file mode 100644 index 7f25499e..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/gift/GiftUpdateGiftResponse.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.chargebee.v4.core.responses.gift; - -import com.chargebee.v4.core.models.gift.Gift; - -import com.chargebee.v4.core.models.subscription.Subscription; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for GiftUpdateGift operation. Contains the response data from the API. - */ -public final class GiftUpdateGiftResponse extends BaseResponse { - private final Gift gift; - - private final Subscription subscription; - - private GiftUpdateGiftResponse(Builder builder) { - super(builder.httpResponse); - - this.gift = builder.gift; - - this.subscription = builder.subscription; - } - - /** Parse JSON response into GiftUpdateGiftResponse object. */ - public static GiftUpdateGiftResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into GiftUpdateGiftResponse object with HTTP response. */ - public static GiftUpdateGiftResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __giftJson = JsonUtil.getObject(json, "gift"); - if (__giftJson != null) { - builder.gift(Gift.fromJson(__giftJson)); - } - - String __subscriptionJson = JsonUtil.getObject(json, "subscription"); - if (__subscriptionJson != null) { - builder.subscription(Subscription.fromJson(__subscriptionJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException("Failed to parse GiftUpdateGiftResponse from JSON", e); - } - } - - /** Create a new builder for GiftUpdateGiftResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for GiftUpdateGiftResponse. */ - public static class Builder { - - private Gift gift; - - private Subscription subscription; - - private Response httpResponse; - - private Builder() {} - - public Builder gift(Gift gift) { - this.gift = gift; - return this; - } - - public Builder subscription(Subscription subscription) { - this.subscription = subscription; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public GiftUpdateGiftResponse build() { - return new GiftUpdateGiftResponse(this); - } - } - - /** Get the gift from the response. */ - public Gift getGift() { - return gift; - } - - /** Get the subscription from the response. */ - public Subscription getSubscription() { - return subscription; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageRetrieveResponse.java deleted file mode 100644 index ca4ef1da..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.hostedPage; - -import com.chargebee.v4.core.models.hostedPage.HostedPage; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for HostedPageRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class HostedPageRetrieveResponse extends BaseResponse { - private final HostedPage hostedPage; - - private HostedPageRetrieveResponse(HostedPage hostedPage, Response httpResponse) { - super(httpResponse); - - this.hostedPage = hostedPage; - } - - /** Parse JSON response into HostedPageRetrieveResponse object. */ - public static HostedPageRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into HostedPageRetrieveResponse object with HTTP response. */ - public static HostedPageRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - HostedPage hostedPage = HostedPage.fromJson(JsonUtil.getObject(json, "hosted_page")); - - return new HostedPageRetrieveResponse(hostedPage, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse HostedPageRetrieveResponse from JSON", e); - } - } - - /** Get the hostedPage from the response. */ - public HostedPage getHostedPage() { - return hostedPage; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/inAppSubscription/InAppSubscriptionRetrieveStoreSubsResponse.java b/src/main/java/com/chargebee/v4/core/responses/inAppSubscription/InAppSubscriptionRetrieveStoreSubsResponse.java deleted file mode 100644 index de196eb3..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/inAppSubscription/InAppSubscriptionRetrieveStoreSubsResponse.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.chargebee.v4.core.responses.inAppSubscription; - -import java.util.List; - -import com.chargebee.v4.core.models.inAppSubscription.InAppSubscription; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for InAppSubscriptionRetrieveStoreSubs operation. Contains the response - * data from the API. - */ -public final class InAppSubscriptionRetrieveStoreSubsResponse extends BaseResponse { - private final List inAppSubscriptions; - - private InAppSubscriptionRetrieveStoreSubsResponse(Builder builder) { - super(builder.httpResponse); - - this.inAppSubscriptions = builder.inAppSubscriptions; - } - - /** Parse JSON response into InAppSubscriptionRetrieveStoreSubsResponse object. */ - public static InAppSubscriptionRetrieveStoreSubsResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into InAppSubscriptionRetrieveStoreSubsResponse object with HTTP response. - */ - public static InAppSubscriptionRetrieveStoreSubsResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - builder.inAppSubscriptions( - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "in_app_subscriptions")).stream() - .map(InAppSubscription::fromJson) - .collect(java.util.stream.Collectors.toList())); - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse InAppSubscriptionRetrieveStoreSubsResponse from JSON", e); - } - } - - /** Create a new builder for InAppSubscriptionRetrieveStoreSubsResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for InAppSubscriptionRetrieveStoreSubsResponse. */ - public static class Builder { - - private List inAppSubscriptions; - - private Response httpResponse; - - private Builder() {} - - public Builder inAppSubscriptions(List inAppSubscriptions) { - this.inAppSubscriptions = inAppSubscriptions; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public InAppSubscriptionRetrieveStoreSubsResponse build() { - return new InAppSubscriptionRetrieveStoreSubsResponse(this); - } - } - - /** Get the inAppSubscriptions from the response. */ - public List getInAppSubscriptions() { - return inAppSubscriptions; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceDownloadEinvoiceResponse.java b/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceDownloadEinvoiceResponse.java deleted file mode 100644 index 7ad9786d..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceDownloadEinvoiceResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.chargebee.v4.core.responses.invoice; - -import com.chargebee.v4.core.models.download.Download; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import java.util.List; - -/** - * Immutable response object for InvoiceDownloadEinvoice operation. Contains the response data from - * a single resource get operation. - */ -public final class InvoiceDownloadEinvoiceResponse extends BaseResponse { - private final List downloads; - - private InvoiceDownloadEinvoiceResponse(List downloads, Response httpResponse) { - super(httpResponse); - - this.downloads = downloads; - } - - /** Parse JSON response into InvoiceDownloadEinvoiceResponse object. */ - public static InvoiceDownloadEinvoiceResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into InvoiceDownloadEinvoiceResponse object with HTTP response. */ - public static InvoiceDownloadEinvoiceResponse fromJson(String json, Response httpResponse) { - try { - - List downloads = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "downloads")).stream() - .map(Download::fromJson) - .collect(java.util.stream.Collectors.toList()); - - return new InvoiceDownloadEinvoiceResponse(downloads, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse InvoiceDownloadEinvoiceResponse from JSON", e); - } - } - - /** Get the downloads from the response. */ - public List getDownloads() { - return downloads; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceImportInvoiceResponse.java b/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceImportInvoiceResponse.java deleted file mode 100644 index 46247173..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceImportInvoiceResponse.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.chargebee.v4.core.responses.invoice; - -import com.chargebee.v4.core.models.invoice.Invoice; - -import com.chargebee.v4.core.models.creditNote.CreditNote; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for InvoiceImportInvoice operation. Contains the response data from the - * API. - */ -public final class InvoiceImportInvoiceResponse extends BaseResponse { - private final Invoice invoice; - - private final CreditNote creditNote; - - private InvoiceImportInvoiceResponse(Builder builder) { - super(builder.httpResponse); - - this.invoice = builder.invoice; - - this.creditNote = builder.creditNote; - } - - /** Parse JSON response into InvoiceImportInvoiceResponse object. */ - public static InvoiceImportInvoiceResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into InvoiceImportInvoiceResponse object with HTTP response. */ - public static InvoiceImportInvoiceResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __invoiceJson = JsonUtil.getObject(json, "invoice"); - if (__invoiceJson != null) { - builder.invoice(Invoice.fromJson(__invoiceJson)); - } - - String __creditNoteJson = JsonUtil.getObject(json, "credit_note"); - if (__creditNoteJson != null) { - builder.creditNote(CreditNote.fromJson(__creditNoteJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException("Failed to parse InvoiceImportInvoiceResponse from JSON", e); - } - } - - /** Create a new builder for InvoiceImportInvoiceResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for InvoiceImportInvoiceResponse. */ - public static class Builder { - - private Invoice invoice; - - private CreditNote creditNote; - - private Response httpResponse; - - private Builder() {} - - public Builder invoice(Invoice invoice) { - this.invoice = invoice; - return this; - } - - public Builder creditNote(CreditNote creditNote) { - this.creditNote = creditNote; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public InvoiceImportInvoiceResponse build() { - return new InvoiceImportInvoiceResponse(this); - } - } - - /** Get the invoice from the response. */ - public Invoice getInvoice() { - return invoice; - } - - /** Get the creditNote from the response. */ - public CreditNote getCreditNote() { - return creditNote; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceInvoicesForCustomerResponse.java b/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceInvoicesForCustomerResponse.java deleted file mode 100644 index 456ac389..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceInvoicesForCustomerResponse.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.chargebee.v4.core.responses.invoice; - -import java.util.List; - -import com.chargebee.v4.core.models.invoice.Invoice; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.InvoiceService; -import com.chargebee.v4.core.models.invoice.params.InvoiceInvoicesForCustomerParams; - -/** - * Immutable response object for InvoiceInvoicesForCustomer operation. Contains paginated list data. - */ -public final class InvoiceInvoicesForCustomerResponse { - - private final List list; - - private final String nextOffset; - - private final String customerId; - - private final InvoiceService service; - private final InvoiceInvoicesForCustomerParams originalParams; - private final Response httpResponse; - - private InvoiceInvoicesForCustomerResponse( - List list, - String nextOffset, - String customerId, - InvoiceService service, - InvoiceInvoicesForCustomerParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.customerId = customerId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into InvoiceInvoicesForCustomerResponse object (no service context). Use - * this when you only need to read a single page (no nextPage()). - */ - public static InvoiceInvoicesForCustomerResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(InvoiceInvoicesForCustomerItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new InvoiceInvoicesForCustomerResponse(list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException("Failed to parse InvoiceInvoicesForCustomerResponse from JSON", e); - } - } - - /** - * Parse JSON response into InvoiceInvoicesForCustomerResponse object with service context for - * pagination (enables nextPage()). - */ - public static InvoiceInvoicesForCustomerResponse fromJson( - String json, - InvoiceService service, - InvoiceInvoicesForCustomerParams originalParams, - String customerId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(InvoiceInvoicesForCustomerItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new InvoiceInvoicesForCustomerResponse( - list, nextOffset, customerId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse InvoiceInvoicesForCustomerResponse 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 InvoiceInvoicesForCustomerResponse 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)."); - } - - InvoiceInvoicesForCustomerParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : InvoiceInvoicesForCustomerParams.builder()) - .offset(nextOffset) - .build(); - - return service.invoicesForCustomer(customerId, 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 InvoiceInvoicesForCustomerItem { - - private Invoice invoice; - - public Invoice getInvoice() { - return invoice; - } - - public static InvoiceInvoicesForCustomerItem fromJson(String json) { - InvoiceInvoicesForCustomerItem item = new InvoiceInvoicesForCustomerItem(); - - String __invoiceJson = JsonUtil.getObject(json, "invoice"); - if (__invoiceJson != null) { - item.invoice = Invoice.fromJson(__invoiceJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceInvoicesForSubscriptionResponse.java b/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceInvoicesForSubscriptionResponse.java deleted file mode 100644 index 1409df1e..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceInvoicesForSubscriptionResponse.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.chargebee.v4.core.responses.invoice; - -import java.util.List; - -import com.chargebee.v4.core.models.invoice.Invoice; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.InvoiceService; -import com.chargebee.v4.core.models.invoice.params.InvoiceInvoicesForSubscriptionParams; - -/** - * Immutable response object for InvoiceInvoicesForSubscription operation. Contains paginated list - * data. - */ -public final class InvoiceInvoicesForSubscriptionResponse { - - private final List list; - - private final String nextOffset; - - private final String subscriptionId; - - private final InvoiceService service; - private final InvoiceInvoicesForSubscriptionParams originalParams; - private final Response httpResponse; - - private InvoiceInvoicesForSubscriptionResponse( - List list, - String nextOffset, - String subscriptionId, - InvoiceService service, - InvoiceInvoicesForSubscriptionParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.subscriptionId = subscriptionId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into InvoiceInvoicesForSubscriptionResponse object (no service context). - * Use this when you only need to read a single page (no nextPage()). - */ - public static InvoiceInvoicesForSubscriptionResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(InvoiceInvoicesForSubscriptionItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new InvoiceInvoicesForSubscriptionResponse(list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse InvoiceInvoicesForSubscriptionResponse from JSON", e); - } - } - - /** - * Parse JSON response into InvoiceInvoicesForSubscriptionResponse object with service context for - * pagination (enables nextPage()). - */ - public static InvoiceInvoicesForSubscriptionResponse fromJson( - String json, - InvoiceService service, - InvoiceInvoicesForSubscriptionParams originalParams, - String subscriptionId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(InvoiceInvoicesForSubscriptionItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new InvoiceInvoicesForSubscriptionResponse( - list, nextOffset, subscriptionId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse InvoiceInvoicesForSubscriptionResponse 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 InvoiceInvoicesForSubscriptionResponse 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)."); - } - - InvoiceInvoicesForSubscriptionParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : InvoiceInvoicesForSubscriptionParams.builder()) - .offset(nextOffset) - .build(); - - return service.invoicesForSubscription(subscriptionId, 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 InvoiceInvoicesForSubscriptionItem { - - private Invoice invoice; - - public Invoice getInvoice() { - return invoice; - } - - public static InvoiceInvoicesForSubscriptionItem fromJson(String json) { - InvoiceInvoicesForSubscriptionItem item = new InvoiceInvoicesForSubscriptionItem(); - - String __invoiceJson = JsonUtil.getObject(json, "invoice"); - if (__invoiceJson != null) { - item.invoice = Invoice.fromJson(__invoiceJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoicePaymentSchedulesResponse.java b/src/main/java/com/chargebee/v4/core/responses/invoice/InvoicePaymentSchedulesResponse.java deleted file mode 100644 index 1569e2f3..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoicePaymentSchedulesResponse.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.chargebee.v4.core.responses.invoice; - -import com.chargebee.v4.core.models.paymentSchedule.PaymentSchedule; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import java.util.List; - -/** - * Immutable response object for InvoicePaymentSchedules operation. Contains the response data from - * a single resource get operation. - */ -public final class InvoicePaymentSchedulesResponse extends BaseResponse { - private final List paymentSchedules; - - private InvoicePaymentSchedulesResponse( - List paymentSchedules, Response httpResponse) { - super(httpResponse); - - this.paymentSchedules = paymentSchedules; - } - - /** Parse JSON response into InvoicePaymentSchedulesResponse object. */ - public static InvoicePaymentSchedulesResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into InvoicePaymentSchedulesResponse object with HTTP response. */ - public static InvoicePaymentSchedulesResponse fromJson(String json, Response httpResponse) { - try { - - List paymentSchedules = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "payment_schedules")).stream() - .map(PaymentSchedule::fromJson) - .collect(java.util.stream.Collectors.toList()); - - return new InvoicePaymentSchedulesResponse(paymentSchedules, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse InvoicePaymentSchedulesResponse from JSON", e); - } - } - - /** Get the paymentSchedules from the response. */ - public List getPaymentSchedules() { - return paymentSchedules; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceResendEinvoiceResponse.java b/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceResendEinvoiceResponse.java deleted file mode 100644 index 598865ab..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceResendEinvoiceResponse.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.chargebee.v4.core.responses.invoice; - -import com.chargebee.v4.core.models.invoice.Invoice; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for InvoiceResendEinvoice operation. Contains the response data from - * the API. - */ -public final class InvoiceResendEinvoiceResponse extends BaseResponse { - private final Invoice invoice; - - private InvoiceResendEinvoiceResponse(Builder builder) { - super(builder.httpResponse); - - this.invoice = builder.invoice; - } - - /** Parse JSON response into InvoiceResendEinvoiceResponse object. */ - public static InvoiceResendEinvoiceResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into InvoiceResendEinvoiceResponse object with HTTP response. */ - public static InvoiceResendEinvoiceResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __invoiceJson = JsonUtil.getObject(json, "invoice"); - if (__invoiceJson != null) { - builder.invoice(Invoice.fromJson(__invoiceJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException("Failed to parse InvoiceResendEinvoiceResponse from JSON", e); - } - } - - /** Create a new builder for InvoiceResendEinvoiceResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for InvoiceResendEinvoiceResponse. */ - public static class Builder { - - private Invoice invoice; - - private Response httpResponse; - - private Builder() {} - - public Builder invoice(Invoice invoice) { - this.invoice = invoice; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public InvoiceResendEinvoiceResponse build() { - return new InvoiceResendEinvoiceResponse(this); - } - } - - /** Get the invoice from the response. */ - public Invoice getInvoice() { - return invoice; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRetrieveResponse.java deleted file mode 100644 index 5423d3e8..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.invoice; - -import com.chargebee.v4.core.models.invoice.Invoice; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for InvoiceRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class InvoiceRetrieveResponse extends BaseResponse { - private final Invoice invoice; - - private InvoiceRetrieveResponse(Invoice invoice, Response httpResponse) { - super(httpResponse); - - this.invoice = invoice; - } - - /** Parse JSON response into InvoiceRetrieveResponse object. */ - public static InvoiceRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into InvoiceRetrieveResponse object with HTTP response. */ - public static InvoiceRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Invoice invoice = Invoice.fromJson(JsonUtil.getObject(json, "invoice")); - - return new InvoiceRetrieveResponse(invoice, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse InvoiceRetrieveResponse from JSON", e); - } - } - - /** Get the invoice from the response. */ - public Invoice getInvoice() { - return invoice; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceSendEinvoiceResponse.java b/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceSendEinvoiceResponse.java deleted file mode 100644 index 94ede9e3..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceSendEinvoiceResponse.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.chargebee.v4.core.responses.invoice; - -import com.chargebee.v4.core.models.invoice.Invoice; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for InvoiceSendEinvoice operation. Contains the response data from the - * API. - */ -public final class InvoiceSendEinvoiceResponse extends BaseResponse { - private final Invoice invoice; - - private InvoiceSendEinvoiceResponse(Builder builder) { - super(builder.httpResponse); - - this.invoice = builder.invoice; - } - - /** Parse JSON response into InvoiceSendEinvoiceResponse object. */ - public static InvoiceSendEinvoiceResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into InvoiceSendEinvoiceResponse object with HTTP response. */ - public static InvoiceSendEinvoiceResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __invoiceJson = JsonUtil.getObject(json, "invoice"); - if (__invoiceJson != null) { - builder.invoice(Invoice.fromJson(__invoiceJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException("Failed to parse InvoiceSendEinvoiceResponse from JSON", e); - } - } - - /** Create a new builder for InvoiceSendEinvoiceResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for InvoiceSendEinvoiceResponse. */ - public static class Builder { - - private Invoice invoice; - - private Response httpResponse; - - private Builder() {} - - public Builder invoice(Invoice invoice) { - this.invoice = invoice; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public InvoiceSendEinvoiceResponse build() { - return new InvoiceSendEinvoiceResponse(this); - } - } - - /** Get the invoice from the response. */ - public Invoice getInvoice() { - return invoice; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceVoidInvoiceResponse.java b/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceVoidInvoiceResponse.java deleted file mode 100644 index 6ebd1dd4..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceVoidInvoiceResponse.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.chargebee.v4.core.responses.invoice; - -import com.chargebee.v4.core.models.invoice.Invoice; - -import com.chargebee.v4.core.models.creditNote.CreditNote; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for InvoiceVoidInvoice operation. Contains the response data from the - * API. - */ -public final class InvoiceVoidInvoiceResponse extends BaseResponse { - private final Invoice invoice; - - private final CreditNote creditNote; - - private InvoiceVoidInvoiceResponse(Builder builder) { - super(builder.httpResponse); - - this.invoice = builder.invoice; - - this.creditNote = builder.creditNote; - } - - /** Parse JSON response into InvoiceVoidInvoiceResponse object. */ - public static InvoiceVoidInvoiceResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into InvoiceVoidInvoiceResponse object with HTTP response. */ - public static InvoiceVoidInvoiceResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __invoiceJson = JsonUtil.getObject(json, "invoice"); - if (__invoiceJson != null) { - builder.invoice(Invoice.fromJson(__invoiceJson)); - } - - String __creditNoteJson = JsonUtil.getObject(json, "credit_note"); - if (__creditNoteJson != null) { - builder.creditNote(CreditNote.fromJson(__creditNoteJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException("Failed to parse InvoiceVoidInvoiceResponse from JSON", e); - } - } - - /** Create a new builder for InvoiceVoidInvoiceResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for InvoiceVoidInvoiceResponse. */ - public static class Builder { - - private Invoice invoice; - - private CreditNote creditNote; - - private Response httpResponse; - - private Builder() {} - - public Builder invoice(Invoice invoice) { - this.invoice = invoice; - return this; - } - - public Builder creditNote(CreditNote creditNote) { - this.creditNote = creditNote; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public InvoiceVoidInvoiceResponse build() { - return new InvoiceVoidInvoiceResponse(this); - } - } - - /** Get the invoice from the response. */ - public Invoice getInvoice() { - return invoice; - } - - /** Get the creditNote from the response. */ - public CreditNote getCreditNote() { - return creditNote; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/item/ItemRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/item/ItemRetrieveResponse.java deleted file mode 100644 index 624e9406..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/item/ItemRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.item; - -import com.chargebee.v4.core.models.item.Item; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for ItemRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class ItemRetrieveResponse extends BaseResponse { - private final Item item; - - private ItemRetrieveResponse(Item item, Response httpResponse) { - super(httpResponse); - - this.item = item; - } - - /** Parse JSON response into ItemRetrieveResponse object. */ - public static ItemRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into ItemRetrieveResponse object with HTTP response. */ - public static ItemRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Item item = Item.fromJson(JsonUtil.getObject(json, "item")); - - return new ItemRetrieveResponse(item, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse ItemRetrieveResponse from JSON", e); - } - } - - /** Get the item from the response. */ - public Item getItem() { - return item; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/itemEntitlement/ItemEntitlementAddItemEntitlementsResponse.java b/src/main/java/com/chargebee/v4/core/responses/itemEntitlement/ItemEntitlementAddItemEntitlementsResponse.java deleted file mode 100644 index d58fa35e..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/itemEntitlement/ItemEntitlementAddItemEntitlementsResponse.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.chargebee.v4.core.responses.itemEntitlement; - -import com.chargebee.v4.core.models.itemEntitlement.ItemEntitlement; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for ItemEntitlementAddItemEntitlements operation. Contains the response - * data from the API. - */ -public final class ItemEntitlementAddItemEntitlementsResponse extends BaseResponse { - private final ItemEntitlement itemEntitlement; - - private ItemEntitlementAddItemEntitlementsResponse(Builder builder) { - super(builder.httpResponse); - - this.itemEntitlement = builder.itemEntitlement; - } - - /** Parse JSON response into ItemEntitlementAddItemEntitlementsResponse object. */ - public static ItemEntitlementAddItemEntitlementsResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into ItemEntitlementAddItemEntitlementsResponse object with HTTP response. - */ - public static ItemEntitlementAddItemEntitlementsResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __itemEntitlementJson = JsonUtil.getObject(json, "item_entitlement"); - if (__itemEntitlementJson != null) { - builder.itemEntitlement(ItemEntitlement.fromJson(__itemEntitlementJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse ItemEntitlementAddItemEntitlementsResponse from JSON", e); - } - } - - /** Create a new builder for ItemEntitlementAddItemEntitlementsResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for ItemEntitlementAddItemEntitlementsResponse. */ - public static class Builder { - - private ItemEntitlement itemEntitlement; - - private Response httpResponse; - - private Builder() {} - - public Builder itemEntitlement(ItemEntitlement itemEntitlement) { - this.itemEntitlement = itemEntitlement; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public ItemEntitlementAddItemEntitlementsResponse build() { - return new ItemEntitlementAddItemEntitlementsResponse(this); - } - } - - /** Get the itemEntitlement from the response. */ - public ItemEntitlement getItemEntitlement() { - return itemEntitlement; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/itemEntitlement/ItemEntitlementItemEntitlementsForFeatureResponse.java b/src/main/java/com/chargebee/v4/core/responses/itemEntitlement/ItemEntitlementItemEntitlementsForFeatureResponse.java deleted file mode 100644 index f0c8c3bd..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/itemEntitlement/ItemEntitlementItemEntitlementsForFeatureResponse.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.chargebee.v4.core.responses.itemEntitlement; - -import java.util.List; - -import com.chargebee.v4.core.models.itemEntitlement.ItemEntitlement; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.ItemEntitlementService; -import com.chargebee.v4.core.models.itemEntitlement.params.ItemEntitlementItemEntitlementsForFeatureParams; - -/** - * Immutable response object for ItemEntitlementItemEntitlementsForFeature operation. Contains - * paginated list data. - */ -public final class ItemEntitlementItemEntitlementsForFeatureResponse { - - private final List list; - - private final String nextOffset; - - private final String featureId; - - private final ItemEntitlementService service; - private final ItemEntitlementItemEntitlementsForFeatureParams originalParams; - private final Response httpResponse; - - private ItemEntitlementItemEntitlementsForFeatureResponse( - List list, - String nextOffset, - String featureId, - ItemEntitlementService service, - ItemEntitlementItemEntitlementsForFeatureParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.featureId = featureId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into ItemEntitlementItemEntitlementsForFeatureResponse object (no service - * context). Use this when you only need to read a single page (no nextPage()). - */ - public static ItemEntitlementItemEntitlementsForFeatureResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(ItemEntitlementItemEntitlementsForFeatureItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new ItemEntitlementItemEntitlementsForFeatureResponse( - list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse ItemEntitlementItemEntitlementsForFeatureResponse from JSON", e); - } - } - - /** - * Parse JSON response into ItemEntitlementItemEntitlementsForFeatureResponse object with service - * context for pagination (enables nextPage()). - */ - public static ItemEntitlementItemEntitlementsForFeatureResponse fromJson( - String json, - ItemEntitlementService service, - ItemEntitlementItemEntitlementsForFeatureParams originalParams, - String featureId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(ItemEntitlementItemEntitlementsForFeatureItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new ItemEntitlementItemEntitlementsForFeatureResponse( - list, nextOffset, featureId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse ItemEntitlementItemEntitlementsForFeatureResponse 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 ItemEntitlementItemEntitlementsForFeatureResponse 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)."); - } - - ItemEntitlementItemEntitlementsForFeatureParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : ItemEntitlementItemEntitlementsForFeatureParams.builder()) - .offset(nextOffset) - .build(); - - return service.itemEntitlementsForFeature(featureId, 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 ItemEntitlementItemEntitlementsForFeatureItem { - - private ItemEntitlement itemEntitlement; - - public ItemEntitlement getItemEntitlement() { - return itemEntitlement; - } - - public static ItemEntitlementItemEntitlementsForFeatureItem fromJson(String json) { - ItemEntitlementItemEntitlementsForFeatureItem item = - new ItemEntitlementItemEntitlementsForFeatureItem(); - - String __itemEntitlementJson = JsonUtil.getObject(json, "item_entitlement"); - if (__itemEntitlementJson != null) { - item.itemEntitlement = ItemEntitlement.fromJson(__itemEntitlementJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/itemEntitlement/ItemEntitlementItemEntitlementsForItemResponse.java b/src/main/java/com/chargebee/v4/core/responses/itemEntitlement/ItemEntitlementItemEntitlementsForItemResponse.java deleted file mode 100644 index 2fa743ae..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/itemEntitlement/ItemEntitlementItemEntitlementsForItemResponse.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.chargebee.v4.core.responses.itemEntitlement; - -import java.util.List; - -import com.chargebee.v4.core.models.itemEntitlement.ItemEntitlement; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.ItemEntitlementService; -import com.chargebee.v4.core.models.itemEntitlement.params.ItemEntitlementItemEntitlementsForItemParams; - -/** - * Immutable response object for ItemEntitlementItemEntitlementsForItem operation. Contains - * paginated list data. - */ -public final class ItemEntitlementItemEntitlementsForItemResponse { - - private final List list; - - private final String nextOffset; - - private final String itemId; - - private final ItemEntitlementService service; - private final ItemEntitlementItemEntitlementsForItemParams originalParams; - private final Response httpResponse; - - private ItemEntitlementItemEntitlementsForItemResponse( - List list, - String nextOffset, - String itemId, - ItemEntitlementService service, - ItemEntitlementItemEntitlementsForItemParams 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 ItemEntitlementItemEntitlementsForItemResponse object (no service - * context). Use this when you only need to read a single page (no nextPage()). - */ - public static ItemEntitlementItemEntitlementsForItemResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(ItemEntitlementItemEntitlementsForItemItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new ItemEntitlementItemEntitlementsForItemResponse( - list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse ItemEntitlementItemEntitlementsForItemResponse from JSON", e); - } - } - - /** - * Parse JSON response into ItemEntitlementItemEntitlementsForItemResponse object with service - * context for pagination (enables nextPage()). - */ - public static ItemEntitlementItemEntitlementsForItemResponse fromJson( - String json, - ItemEntitlementService service, - ItemEntitlementItemEntitlementsForItemParams originalParams, - String itemId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(ItemEntitlementItemEntitlementsForItemItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new ItemEntitlementItemEntitlementsForItemResponse( - list, nextOffset, itemId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse ItemEntitlementItemEntitlementsForItemResponse 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 ItemEntitlementItemEntitlementsForItemResponse 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)."); - } - - ItemEntitlementItemEntitlementsForItemParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : ItemEntitlementItemEntitlementsForItemParams.builder()) - .offset(nextOffset) - .build(); - - return service.itemEntitlementsForItem(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 ItemEntitlementItemEntitlementsForItemItem { - - private ItemEntitlement itemEntitlement; - - public ItemEntitlement getItemEntitlement() { - return itemEntitlement; - } - - public static ItemEntitlementItemEntitlementsForItemItem fromJson(String json) { - ItemEntitlementItemEntitlementsForItemItem item = - new ItemEntitlementItemEntitlementsForItemItem(); - - String __itemEntitlementJson = JsonUtil.getObject(json, "item_entitlement"); - if (__itemEntitlementJson != null) { - item.itemEntitlement = ItemEntitlement.fromJson(__itemEntitlementJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/itemEntitlement/ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse.java b/src/main/java/com/chargebee/v4/core/responses/itemEntitlement/ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse.java deleted file mode 100644 index cf4e7a80..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/itemEntitlement/ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.chargebee.v4.core.responses.itemEntitlement; - -import com.chargebee.v4.core.models.itemEntitlement.ItemEntitlement; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for ItemEntitlementUpsertOrRemoveItemEntitlementsForItem operation. - * Contains the response data from the API. - */ -public final class ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse - extends BaseResponse { - private final ItemEntitlement itemEntitlement; - - private ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse(Builder builder) { - super(builder.httpResponse); - - this.itemEntitlement = builder.itemEntitlement; - } - - /** - * Parse JSON response into ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse object. - */ - public static ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse object - * with HTTP response. - */ - public static ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __itemEntitlementJson = JsonUtil.getObject(json, "item_entitlement"); - if (__itemEntitlementJson != null) { - builder.itemEntitlement(ItemEntitlement.fromJson(__itemEntitlementJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse from JSON", - e); - } - } - - /** Create a new builder for ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse. */ - public static class Builder { - - private ItemEntitlement itemEntitlement; - - private Response httpResponse; - - private Builder() {} - - public Builder itemEntitlement(ItemEntitlement itemEntitlement) { - this.itemEntitlement = itemEntitlement; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse build() { - return new ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse(this); - } - } - - /** Get the itemEntitlement from the response. */ - public ItemEntitlement getItemEntitlement() { - return itemEntitlement; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/itemFamily/ItemFamilyRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/itemFamily/ItemFamilyRetrieveResponse.java deleted file mode 100644 index f237c951..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/itemFamily/ItemFamilyRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.itemFamily; - -import com.chargebee.v4.core.models.itemFamily.ItemFamily; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for ItemFamilyRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class ItemFamilyRetrieveResponse extends BaseResponse { - private final ItemFamily itemFamily; - - private ItemFamilyRetrieveResponse(ItemFamily itemFamily, Response httpResponse) { - super(httpResponse); - - this.itemFamily = itemFamily; - } - - /** Parse JSON response into ItemFamilyRetrieveResponse object. */ - public static ItemFamilyRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into ItemFamilyRetrieveResponse object with HTTP response. */ - public static ItemFamilyRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - ItemFamily itemFamily = ItemFamily.fromJson(JsonUtil.getObject(json, "item_family")); - - return new ItemFamilyRetrieveResponse(itemFamily, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse ItemFamilyRetrieveResponse from JSON", e); - } - } - - /** Get the itemFamily from the response. */ - public ItemFamily getItemFamily() { - return itemFamily; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceFindApplicableItemPricesResponse.java b/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceFindApplicableItemPricesResponse.java deleted file mode 100644 index 02d955e2..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceFindApplicableItemPricesResponse.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.chargebee.v4.core.responses.itemPrice; - -import java.util.List; - -import com.chargebee.v4.core.models.itemPrice.ItemPrice; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.ItemPriceService; -import com.chargebee.v4.core.models.itemPrice.params.ItemPriceFindApplicableItemPricesParams; - -/** - * Immutable response object for ItemPriceFindApplicableItemPrices operation. Contains paginated - * list data. - */ -public final class ItemPriceFindApplicableItemPricesResponse { - - private final List list; - - private final String nextOffset; - - private final String itemPriceId; - - private final ItemPriceService service; - private final ItemPriceFindApplicableItemPricesParams originalParams; - private final Response httpResponse; - - private ItemPriceFindApplicableItemPricesResponse( - List list, - String nextOffset, - String itemPriceId, - ItemPriceService service, - ItemPriceFindApplicableItemPricesParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.itemPriceId = itemPriceId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into ItemPriceFindApplicableItemPricesResponse object (no service context). - * Use this when you only need to read a single page (no nextPage()). - */ - public static ItemPriceFindApplicableItemPricesResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(ItemPriceFindApplicableItemPricesItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new ItemPriceFindApplicableItemPricesResponse( - list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse ItemPriceFindApplicableItemPricesResponse from JSON", e); - } - } - - /** - * Parse JSON response into ItemPriceFindApplicableItemPricesResponse object with service context - * for pagination (enables nextPage()). - */ - public static ItemPriceFindApplicableItemPricesResponse fromJson( - String json, - ItemPriceService service, - ItemPriceFindApplicableItemPricesParams originalParams, - String itemPriceId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(ItemPriceFindApplicableItemPricesItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new ItemPriceFindApplicableItemPricesResponse( - list, nextOffset, itemPriceId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse ItemPriceFindApplicableItemPricesResponse 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 ItemPriceFindApplicableItemPricesResponse 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)."); - } - - ItemPriceFindApplicableItemPricesParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : ItemPriceFindApplicableItemPricesParams.builder()) - .offset(nextOffset) - .build(); - - return service.findApplicableItemPrices(itemPriceId, 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 ItemPriceFindApplicableItemPricesItem { - - private ItemPrice itemPrice; - - public ItemPrice getItemPrice() { - return itemPrice; - } - - public static ItemPriceFindApplicableItemPricesItem fromJson(String json) { - ItemPriceFindApplicableItemPricesItem item = new ItemPriceFindApplicableItemPricesItem(); - - String __itemPriceJson = JsonUtil.getObject(json, "item_price"); - if (__itemPriceJson != null) { - item.itemPrice = ItemPrice.fromJson(__itemPriceJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceRetrieveResponse.java deleted file mode 100644 index d27d2c1e..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.itemPrice; - -import com.chargebee.v4.core.models.itemPrice.ItemPrice; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for ItemPriceRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class ItemPriceRetrieveResponse extends BaseResponse { - private final ItemPrice itemPrice; - - private ItemPriceRetrieveResponse(ItemPrice itemPrice, Response httpResponse) { - super(httpResponse); - - this.itemPrice = itemPrice; - } - - /** Parse JSON response into ItemPriceRetrieveResponse object. */ - public static ItemPriceRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into ItemPriceRetrieveResponse object with HTTP response. */ - public static ItemPriceRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - ItemPrice itemPrice = ItemPrice.fromJson(JsonUtil.getObject(json, "item_price")); - - return new ItemPriceRetrieveResponse(itemPrice, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse ItemPriceRetrieveResponse from JSON", e); - } - } - - /** Get the itemPrice from the response. */ - public ItemPrice getItemPrice() { - return itemPrice; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/media/MediaCreateMediaAndAttachToItemResponse.java b/src/main/java/com/chargebee/v4/core/responses/media/MediaCreateMediaAndAttachToItemResponse.java deleted file mode 100644 index 9d84cd1e..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/media/MediaCreateMediaAndAttachToItemResponse.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.chargebee.v4.core.responses.media; - -import com.chargebee.v4.core.models.media.Media; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for MediaCreateMediaAndAttachToItem operation. Contains the response - * data from the API. - */ -public final class MediaCreateMediaAndAttachToItemResponse extends BaseResponse { - private final Media media; - - private MediaCreateMediaAndAttachToItemResponse(Builder builder) { - super(builder.httpResponse); - - this.media = builder.media; - } - - /** Parse JSON response into MediaCreateMediaAndAttachToItemResponse object. */ - public static MediaCreateMediaAndAttachToItemResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into MediaCreateMediaAndAttachToItemResponse object with HTTP response. */ - public static MediaCreateMediaAndAttachToItemResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __mediaJson = JsonUtil.getObject(json, "media"); - if (__mediaJson != null) { - builder.media(Media.fromJson(__mediaJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse MediaCreateMediaAndAttachToItemResponse from JSON", e); - } - } - - /** Create a new builder for MediaCreateMediaAndAttachToItemResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for MediaCreateMediaAndAttachToItemResponse. */ - public static class Builder { - - private Media media; - - private Response httpResponse; - - private Builder() {} - - public Builder media(Media media) { - this.media = media; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public MediaCreateMediaAndAttachToItemResponse build() { - return new MediaCreateMediaAndAttachToItemResponse(this); - } - } - - /** Get the media from the response. */ - public Media getMedia() { - return media; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/offerEvent/OfferEventOfferEventsResponse.java b/src/main/java/com/chargebee/v4/core/responses/offerEvent/OfferEventOfferEventsResponse.java deleted file mode 100644 index 3dd776d7..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/offerEvent/OfferEventOfferEventsResponse.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.chargebee.v4.core.responses.offerEvent; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for OfferEventOfferEvents operation. Contains the response data from - * the API. - */ -public final class OfferEventOfferEventsResponse extends BaseResponse { - - private OfferEventOfferEventsResponse(Builder builder) { - super(builder.httpResponse); - } - - /** Parse JSON response into OfferEventOfferEventsResponse object. */ - public static OfferEventOfferEventsResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into OfferEventOfferEventsResponse object with HTTP response. */ - public static OfferEventOfferEventsResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException("Failed to parse OfferEventOfferEventsResponse from JSON", e); - } - } - - /** Create a new builder for OfferEventOfferEventsResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for OfferEventOfferEventsResponse. */ - public static class Builder { - - private Response httpResponse; - - private Builder() {} - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public OfferEventOfferEventsResponse build() { - return new OfferEventOfferEventsResponse(this); - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/offerFulfillment/OfferFulfillmentOfferFulfillmentsGetResponse.java b/src/main/java/com/chargebee/v4/core/responses/offerFulfillment/OfferFulfillmentOfferFulfillmentsGetResponse.java deleted file mode 100644 index 4dd63b8d..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/offerFulfillment/OfferFulfillmentOfferFulfillmentsGetResponse.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.chargebee.v4.core.responses.offerFulfillment; - -import com.chargebee.v4.core.models.offerFulfillment.OfferFulfillment; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for OfferFulfillmentOfferFulfillmentsGet operation. Contains the - * response data from a single resource get operation. - */ -public final class OfferFulfillmentOfferFulfillmentsGetResponse extends BaseResponse { - private final OfferFulfillment offerFulfillment; - - private OfferFulfillmentOfferFulfillmentsGetResponse( - OfferFulfillment offerFulfillment, Response httpResponse) { - super(httpResponse); - - this.offerFulfillment = offerFulfillment; - } - - /** Parse JSON response into OfferFulfillmentOfferFulfillmentsGetResponse object. */ - public static OfferFulfillmentOfferFulfillmentsGetResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into OfferFulfillmentOfferFulfillmentsGetResponse object with HTTP - * response. - */ - public static OfferFulfillmentOfferFulfillmentsGetResponse fromJson( - String json, Response httpResponse) { - try { - - OfferFulfillment offerFulfillment = - OfferFulfillment.fromJson(JsonUtil.getObject(json, "offer_fulfillment")); - - return new OfferFulfillmentOfferFulfillmentsGetResponse(offerFulfillment, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse OfferFulfillmentOfferFulfillmentsGetResponse from JSON", e); - } - } - - /** Get the offerFulfillment from the response. */ - public OfferFulfillment getOfferFulfillment() { - return offerFulfillment; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/offerFulfillment/OfferFulfillmentOfferFulfillmentsResponse.java b/src/main/java/com/chargebee/v4/core/responses/offerFulfillment/OfferFulfillmentOfferFulfillmentsResponse.java deleted file mode 100644 index 98315838..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/offerFulfillment/OfferFulfillmentOfferFulfillmentsResponse.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.chargebee.v4.core.responses.offerFulfillment; - -import com.chargebee.v4.core.models.offerFulfillment.OfferFulfillment; - -import com.chargebee.v4.core.models.hostedPage.HostedPage; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for OfferFulfillmentOfferFulfillments operation. Contains the response - * data from the API. - */ -public final class OfferFulfillmentOfferFulfillmentsResponse extends BaseResponse { - private final OfferFulfillment offerFulfillment; - - private final HostedPage hostedPage; - - private OfferFulfillmentOfferFulfillmentsResponse(Builder builder) { - super(builder.httpResponse); - - this.offerFulfillment = builder.offerFulfillment; - - this.hostedPage = builder.hostedPage; - } - - /** Parse JSON response into OfferFulfillmentOfferFulfillmentsResponse object. */ - public static OfferFulfillmentOfferFulfillmentsResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into OfferFulfillmentOfferFulfillmentsResponse object with HTTP response. - */ - public static OfferFulfillmentOfferFulfillmentsResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __offerFulfillmentJson = JsonUtil.getObject(json, "offer_fulfillment"); - if (__offerFulfillmentJson != null) { - builder.offerFulfillment(OfferFulfillment.fromJson(__offerFulfillmentJson)); - } - - String __hostedPageJson = JsonUtil.getObject(json, "hosted_page"); - if (__hostedPageJson != null) { - builder.hostedPage(HostedPage.fromJson(__hostedPageJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse OfferFulfillmentOfferFulfillmentsResponse from JSON", e); - } - } - - /** Create a new builder for OfferFulfillmentOfferFulfillmentsResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for OfferFulfillmentOfferFulfillmentsResponse. */ - public static class Builder { - - private OfferFulfillment offerFulfillment; - - private HostedPage hostedPage; - - private Response httpResponse; - - private Builder() {} - - public Builder offerFulfillment(OfferFulfillment offerFulfillment) { - this.offerFulfillment = offerFulfillment; - return this; - } - - public Builder hostedPage(HostedPage hostedPage) { - this.hostedPage = hostedPage; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public OfferFulfillmentOfferFulfillmentsResponse build() { - return new OfferFulfillmentOfferFulfillmentsResponse(this); - } - } - - /** Get the offerFulfillment from the response. */ - public OfferFulfillment getOfferFulfillment() { - return offerFulfillment; - } - - /** Get the hostedPage from the response. */ - public HostedPage getHostedPage() { - return hostedPage; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/offerFulfillment/OfferFulfillmentOfferFulfillmentsUpdateResponse.java b/src/main/java/com/chargebee/v4/core/responses/offerFulfillment/OfferFulfillmentOfferFulfillmentsUpdateResponse.java deleted file mode 100644 index 65055af5..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/offerFulfillment/OfferFulfillmentOfferFulfillmentsUpdateResponse.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.chargebee.v4.core.responses.offerFulfillment; - -import com.chargebee.v4.core.models.offerFulfillment.OfferFulfillment; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for OfferFulfillmentOfferFulfillmentsUpdate operation. Contains the - * response data from the API. - */ -public final class OfferFulfillmentOfferFulfillmentsUpdateResponse extends BaseResponse { - private final OfferFulfillment offerFulfillment; - - private OfferFulfillmentOfferFulfillmentsUpdateResponse(Builder builder) { - super(builder.httpResponse); - - this.offerFulfillment = builder.offerFulfillment; - } - - /** Parse JSON response into OfferFulfillmentOfferFulfillmentsUpdateResponse object. */ - public static OfferFulfillmentOfferFulfillmentsUpdateResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into OfferFulfillmentOfferFulfillmentsUpdateResponse object with HTTP - * response. - */ - public static OfferFulfillmentOfferFulfillmentsUpdateResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __offerFulfillmentJson = JsonUtil.getObject(json, "offer_fulfillment"); - if (__offerFulfillmentJson != null) { - builder.offerFulfillment(OfferFulfillment.fromJson(__offerFulfillmentJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse OfferFulfillmentOfferFulfillmentsUpdateResponse from JSON", e); - } - } - - /** Create a new builder for OfferFulfillmentOfferFulfillmentsUpdateResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for OfferFulfillmentOfferFulfillmentsUpdateResponse. */ - public static class Builder { - - private OfferFulfillment offerFulfillment; - - private Response httpResponse; - - private Builder() {} - - public Builder offerFulfillment(OfferFulfillment offerFulfillment) { - this.offerFulfillment = offerFulfillment; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public OfferFulfillmentOfferFulfillmentsUpdateResponse build() { - return new OfferFulfillmentOfferFulfillmentsUpdateResponse(this); - } - } - - /** Get the offerFulfillment from the response. */ - public OfferFulfillment getOfferFulfillment() { - return offerFulfillment; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/omnichannelOneTimeOrder/OmnichannelOneTimeOrderRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/omnichannelOneTimeOrder/OmnichannelOneTimeOrderRetrieveResponse.java deleted file mode 100644 index ee0accff..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/omnichannelOneTimeOrder/OmnichannelOneTimeOrderRetrieveResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.chargebee.v4.core.responses.omnichannelOneTimeOrder; - -import com.chargebee.v4.core.models.omnichannelOneTimeOrder.OmnichannelOneTimeOrder; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for OmnichannelOneTimeOrderRetrieve operation. Contains the response - * data from a single resource get operation. - */ -public final class OmnichannelOneTimeOrderRetrieveResponse extends BaseResponse { - private final OmnichannelOneTimeOrder omnichannelOneTimeOrder; - - private OmnichannelOneTimeOrderRetrieveResponse( - OmnichannelOneTimeOrder omnichannelOneTimeOrder, Response httpResponse) { - super(httpResponse); - - this.omnichannelOneTimeOrder = omnichannelOneTimeOrder; - } - - /** Parse JSON response into OmnichannelOneTimeOrderRetrieveResponse object. */ - public static OmnichannelOneTimeOrderRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into OmnichannelOneTimeOrderRetrieveResponse object with HTTP response. */ - public static OmnichannelOneTimeOrderRetrieveResponse fromJson( - String json, Response httpResponse) { - try { - - OmnichannelOneTimeOrder omnichannelOneTimeOrder = - OmnichannelOneTimeOrder.fromJson(JsonUtil.getObject(json, "omnichannel_one_time_order")); - - return new OmnichannelOneTimeOrderRetrieveResponse(omnichannelOneTimeOrder, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse OmnichannelOneTimeOrderRetrieveResponse from JSON", e); - } - } - - /** Get the omnichannelOneTimeOrder from the response. */ - public OmnichannelOneTimeOrder getOmnichannelOneTimeOrder() { - return omnichannelOneTimeOrder; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/omnichannelSubscription/OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse.java b/src/main/java/com/chargebee/v4/core/responses/omnichannelSubscription/OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse.java deleted file mode 100644 index afefc47d..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/omnichannelSubscription/OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse.java +++ /dev/null @@ -1,200 +0,0 @@ -package com.chargebee.v4.core.responses.omnichannelSubscription; - -import java.util.List; - -import com.chargebee.v4.core.models.omnichannelTransaction.OmnichannelTransaction; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.OmnichannelSubscriptionService; -import com.chargebee.v4.core.models.omnichannelSubscription.params.OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams; - -/** - * Immutable response object for - * OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscription operation. Contains - * paginated list data. - */ -public final -class OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse { - - private final List - list; - - private final String nextOffset; - - private final String omnichannelSubscriptionId; - - private final OmnichannelSubscriptionService service; - private final OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams - originalParams; - private final Response httpResponse; - - private OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse( - List list, - String nextOffset, - String omnichannelSubscriptionId, - OmnichannelSubscriptionService service, - OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.omnichannelSubscriptionId = omnichannelSubscriptionId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into - * OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse object (no - * service context). Use this when you only need to read a single page (no nextPage()). - */ - public static OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse - fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map( - OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionItem - ::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse( - list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse from JSON", - e); - } - } - - /** - * Parse JSON response into - * OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse object with - * service context for pagination (enables nextPage()). - */ - public static OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse - fromJson( - String json, - OmnichannelSubscriptionService service, - OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams - originalParams, - String omnichannelSubscriptionId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map( - OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionItem - ::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse( - list, nextOffset, omnichannelSubscriptionId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse 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 OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse 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)."); - } - - OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams - .builder()) - .offset(nextOffset) - .build(); - - return service.omnichannelTransactionsForOmnichannelSubscription( - omnichannelSubscriptionId, 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 OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionItem { - - private OmnichannelTransaction omnichannelTransaction; - - public OmnichannelTransaction getOmnichannelTransaction() { - return omnichannelTransaction; - } - - public static OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionItem - fromJson(String json) { - OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionItem item = - new OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionItem(); - - String __omnichannelTransactionJson = JsonUtil.getObject(json, "omnichannel_transaction"); - if (__omnichannelTransactionJson != null) { - item.omnichannelTransaction = OmnichannelTransaction.fromJson(__omnichannelTransactionJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/omnichannelSubscription/OmnichannelSubscriptionRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/omnichannelSubscription/OmnichannelSubscriptionRetrieveResponse.java deleted file mode 100644 index ae169cd4..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/omnichannelSubscription/OmnichannelSubscriptionRetrieveResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.chargebee.v4.core.responses.omnichannelSubscription; - -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for OmnichannelSubscriptionRetrieve operation. Contains the response - * data from a single resource get operation. - */ -public final class OmnichannelSubscriptionRetrieveResponse extends BaseResponse { - private final OmnichannelSubscription omnichannelSubscription; - - private OmnichannelSubscriptionRetrieveResponse( - OmnichannelSubscription omnichannelSubscription, Response httpResponse) { - super(httpResponse); - - this.omnichannelSubscription = omnichannelSubscription; - } - - /** Parse JSON response into OmnichannelSubscriptionRetrieveResponse object. */ - public static OmnichannelSubscriptionRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into OmnichannelSubscriptionRetrieveResponse object with HTTP response. */ - public static OmnichannelSubscriptionRetrieveResponse fromJson( - String json, Response httpResponse) { - try { - - OmnichannelSubscription omnichannelSubscription = - OmnichannelSubscription.fromJson(JsonUtil.getObject(json, "omnichannel_subscription")); - - return new OmnichannelSubscriptionRetrieveResponse(omnichannelSubscription, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse OmnichannelSubscriptionRetrieveResponse from JSON", e); - } - } - - /** Get the omnichannelSubscription from the response. */ - public OmnichannelSubscription getOmnichannelSubscription() { - return omnichannelSubscription; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/omnichannelSubscriptionItem/OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse.java b/src/main/java/com/chargebee/v4/core/responses/omnichannelSubscriptionItem/OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse.java deleted file mode 100644 index f4e849f5..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/omnichannelSubscriptionItem/OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse.java +++ /dev/null @@ -1,189 +0,0 @@ -package com.chargebee.v4.core.responses.omnichannelSubscriptionItem; - -import java.util.List; - -import com.chargebee.v4.core.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.OmnichannelSubscriptionItemService; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.params.OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams; - -/** - * Immutable response object for OmnichannelSubscriptionItemListOmniSubItemScheduleChanges - * operation. Contains paginated list data. - */ -public final class OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse { - - private final List list; - - private final String nextOffset; - - private final String omnichannelSubscriptionItemId; - - private final OmnichannelSubscriptionItemService service; - private final OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams originalParams; - private final Response httpResponse; - - private OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse( - List list, - String nextOffset, - String omnichannelSubscriptionItemId, - OmnichannelSubscriptionItemService service, - OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.omnichannelSubscriptionItemId = omnichannelSubscriptionItemId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse - * object (no service context). Use this when you only need to read a single page (no nextPage()). - */ - public static OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse fromJson( - String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(OmnichannelSubscriptionItemListOmniSubItemScheduleChangesItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse( - list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse from JSON", - e); - } - } - - /** - * Parse JSON response into OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse - * object with service context for pagination (enables nextPage()). - */ - public static OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse fromJson( - String json, - OmnichannelSubscriptionItemService service, - OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams originalParams, - String omnichannelSubscriptionItemId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(OmnichannelSubscriptionItemListOmniSubItemScheduleChangesItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse( - list, nextOffset, omnichannelSubscriptionItemId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse 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 OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse 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)."); - } - - OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams.builder()) - .offset(nextOffset) - .build(); - - return service.listOmniSubItemScheduleChanges(omnichannelSubscriptionItemId, 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 OmnichannelSubscriptionItemListOmniSubItemScheduleChangesItem { - - private OmnichannelSubscriptionItemScheduledChange omnichannelSubscriptionItemScheduledChange; - - public OmnichannelSubscriptionItemScheduledChange - getOmnichannelSubscriptionItemScheduledChange() { - return omnichannelSubscriptionItemScheduledChange; - } - - public static OmnichannelSubscriptionItemListOmniSubItemScheduleChangesItem fromJson( - String json) { - OmnichannelSubscriptionItemListOmniSubItemScheduleChangesItem item = - new OmnichannelSubscriptionItemListOmniSubItemScheduleChangesItem(); - - String __omnichannelSubscriptionItemScheduledChangeJson = - JsonUtil.getObject(json, "omnichannel_subscription_item_scheduled_change"); - if (__omnichannelSubscriptionItemScheduledChangeJson != null) { - item.omnichannelSubscriptionItemScheduledChange = - OmnichannelSubscriptionItemScheduledChange.fromJson( - __omnichannelSubscriptionItemScheduledChangeJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/order/OrderAssignOrderNumberResponse.java b/src/main/java/com/chargebee/v4/core/responses/order/OrderAssignOrderNumberResponse.java deleted file mode 100644 index 722c86ea..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/order/OrderAssignOrderNumberResponse.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.chargebee.v4.core.responses.order; - -import com.chargebee.v4.core.models.order.Order; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for OrderAssignOrderNumber operation. Contains the response data from - * the API. - */ -public final class OrderAssignOrderNumberResponse extends BaseResponse { - private final Order order; - - private OrderAssignOrderNumberResponse(Builder builder) { - super(builder.httpResponse); - - this.order = builder.order; - } - - /** Parse JSON response into OrderAssignOrderNumberResponse object. */ - public static OrderAssignOrderNumberResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into OrderAssignOrderNumberResponse object with HTTP response. */ - public static OrderAssignOrderNumberResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __orderJson = JsonUtil.getObject(json, "order"); - if (__orderJson != null) { - builder.order(Order.fromJson(__orderJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException("Failed to parse OrderAssignOrderNumberResponse from JSON", e); - } - } - - /** Create a new builder for OrderAssignOrderNumberResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for OrderAssignOrderNumberResponse. */ - public static class Builder { - - private Order order; - - private Response httpResponse; - - private Builder() {} - - public Builder order(Order order) { - this.order = order; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public OrderAssignOrderNumberResponse build() { - return new OrderAssignOrderNumberResponse(this); - } - } - - /** Get the order from the response. */ - public Order getOrder() { - return order; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/order/OrderImportOrderResponse.java b/src/main/java/com/chargebee/v4/core/responses/order/OrderImportOrderResponse.java deleted file mode 100644 index 2d1196dd..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/order/OrderImportOrderResponse.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.chargebee.v4.core.responses.order; - -import com.chargebee.v4.core.models.order.Order; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for OrderImportOrder operation. Contains the response data from the - * API. - */ -public final class OrderImportOrderResponse extends BaseResponse { - private final Order order; - - private OrderImportOrderResponse(Builder builder) { - super(builder.httpResponse); - - this.order = builder.order; - } - - /** Parse JSON response into OrderImportOrderResponse object. */ - public static OrderImportOrderResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into OrderImportOrderResponse object with HTTP response. */ - public static OrderImportOrderResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __orderJson = JsonUtil.getObject(json, "order"); - if (__orderJson != null) { - builder.order(Order.fromJson(__orderJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException("Failed to parse OrderImportOrderResponse from JSON", e); - } - } - - /** Create a new builder for OrderImportOrderResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for OrderImportOrderResponse. */ - public static class Builder { - - private Order order; - - private Response httpResponse; - - private Builder() {} - - public Builder order(Order order) { - this.order = order; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public OrderImportOrderResponse build() { - return new OrderImportOrderResponse(this); - } - } - - /** Get the order from the response. */ - public Order getOrder() { - return order; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/order/OrderOrdersForInvoiceResponse.java b/src/main/java/com/chargebee/v4/core/responses/order/OrderOrdersForInvoiceResponse.java deleted file mode 100644 index bf5e147d..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/order/OrderOrdersForInvoiceResponse.java +++ /dev/null @@ -1,173 +0,0 @@ -package com.chargebee.v4.core.responses.order; - -import java.util.List; - -import com.chargebee.v4.core.models.order.Order; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.OrderService; -import com.chargebee.v4.core.models.order.params.OrderOrdersForInvoiceParams; - -/** Immutable response object for OrderOrdersForInvoice operation. Contains paginated list data. */ -public final class OrderOrdersForInvoiceResponse { - - private final List list; - - private final String nextOffset; - - private final String invoiceId; - - private final OrderService service; - private final OrderOrdersForInvoiceParams originalParams; - private final Response httpResponse; - - private OrderOrdersForInvoiceResponse( - List list, - String nextOffset, - String invoiceId, - OrderService service, - OrderOrdersForInvoiceParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.invoiceId = invoiceId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into OrderOrdersForInvoiceResponse object (no service context). Use this - * when you only need to read a single page (no nextPage()). - */ - public static OrderOrdersForInvoiceResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(OrderOrdersForInvoiceItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new OrderOrdersForInvoiceResponse(list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException("Failed to parse OrderOrdersForInvoiceResponse from JSON", e); - } - } - - /** - * Parse JSON response into OrderOrdersForInvoiceResponse object with service context for - * pagination (enables nextPage()). - */ - public static OrderOrdersForInvoiceResponse fromJson( - String json, - OrderService service, - OrderOrdersForInvoiceParams originalParams, - String invoiceId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(OrderOrdersForInvoiceItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new OrderOrdersForInvoiceResponse( - list, nextOffset, invoiceId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse OrderOrdersForInvoiceResponse 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 OrderOrdersForInvoiceResponse 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)."); - } - - OrderOrdersForInvoiceParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : OrderOrdersForInvoiceParams.builder()) - .offset(nextOffset) - .build(); - - return service.ordersForInvoice(invoiceId, 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 OrderOrdersForInvoiceItem { - - private Order order; - - public Order getOrder() { - return order; - } - - public static OrderOrdersForInvoiceItem fromJson(String json) { - OrderOrdersForInvoiceItem item = new OrderOrdersForInvoiceItem(); - - String __orderJson = JsonUtil.getObject(json, "order"); - if (__orderJson != null) { - item.order = Order.fromJson(__orderJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/order/OrderRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/order/OrderRetrieveResponse.java deleted file mode 100644 index 35e5f251..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/order/OrderRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.order; - -import com.chargebee.v4.core.models.order.Order; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for OrderRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class OrderRetrieveResponse extends BaseResponse { - private final Order order; - - private OrderRetrieveResponse(Order order, Response httpResponse) { - super(httpResponse); - - this.order = order; - } - - /** Parse JSON response into OrderRetrieveResponse object. */ - public static OrderRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into OrderRetrieveResponse object with HTTP response. */ - public static OrderRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Order order = Order.fromJson(JsonUtil.getObject(json, "order")); - - return new OrderRetrieveResponse(order, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse OrderRetrieveResponse from JSON", e); - } - } - - /** Get the order from the response. */ - public Order getOrder() { - return order; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentIntent/PaymentIntentRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/paymentIntent/PaymentIntentRetrieveResponse.java deleted file mode 100644 index d4623c3b..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/paymentIntent/PaymentIntentRetrieveResponse.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.chargebee.v4.core.responses.paymentIntent; - -import com.chargebee.v4.core.models.paymentIntent.PaymentIntent; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for PaymentIntentRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class PaymentIntentRetrieveResponse extends BaseResponse { - private final PaymentIntent paymentIntent; - - private PaymentIntentRetrieveResponse(PaymentIntent paymentIntent, Response httpResponse) { - super(httpResponse); - - this.paymentIntent = paymentIntent; - } - - /** Parse JSON response into PaymentIntentRetrieveResponse object. */ - public static PaymentIntentRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into PaymentIntentRetrieveResponse object with HTTP response. */ - public static PaymentIntentRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - PaymentIntent paymentIntent = - PaymentIntent.fromJson(JsonUtil.getObject(json, "payment_intent")); - - return new PaymentIntentRetrieveResponse(paymentIntent, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse PaymentIntentRetrieveResponse from JSON", e); - } - } - - /** Get the paymentIntent from the response. */ - public PaymentIntent getPaymentIntent() { - return paymentIntent; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentScheduleScheme/PaymentScheduleSchemeRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/paymentScheduleScheme/PaymentScheduleSchemeRetrieveResponse.java deleted file mode 100644 index 4391945b..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/paymentScheduleScheme/PaymentScheduleSchemeRetrieveResponse.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.chargebee.v4.core.responses.paymentScheduleScheme; - -import com.chargebee.v4.core.models.paymentScheduleScheme.PaymentScheduleScheme; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for PaymentScheduleSchemeRetrieve operation. Contains the response data - * from a single resource get operation. - */ -public final class PaymentScheduleSchemeRetrieveResponse extends BaseResponse { - private final PaymentScheduleScheme paymentScheduleScheme; - - private PaymentScheduleSchemeRetrieveResponse( - PaymentScheduleScheme paymentScheduleScheme, Response httpResponse) { - super(httpResponse); - - this.paymentScheduleScheme = paymentScheduleScheme; - } - - /** Parse JSON response into PaymentScheduleSchemeRetrieveResponse object. */ - public static PaymentScheduleSchemeRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into PaymentScheduleSchemeRetrieveResponse object with HTTP response. */ - public static PaymentScheduleSchemeRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - PaymentScheduleScheme paymentScheduleScheme = - PaymentScheduleScheme.fromJson(JsonUtil.getObject(json, "payment_schedule_scheme")); - - return new PaymentScheduleSchemeRetrieveResponse(paymentScheduleScheme, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse PaymentScheduleSchemeRetrieveResponse from JSON", e); - } - } - - /** Get the paymentScheduleScheme from the response. */ - public PaymentScheduleScheme getPaymentScheduleScheme() { - return paymentScheduleScheme; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateVoucherPaymentSourceResponse.java b/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateVoucherPaymentSourceResponse.java deleted file mode 100644 index e0904beb..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateVoucherPaymentSourceResponse.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.chargebee.v4.core.responses.paymentSource; - -import com.chargebee.v4.core.models.customer.Customer; - -import com.chargebee.v4.core.models.paymentSource.PaymentSource; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for PaymentSourceCreateVoucherPaymentSource operation. Contains the - * response data from the API. - */ -public final class PaymentSourceCreateVoucherPaymentSourceResponse extends BaseResponse { - private final Customer customer; - - private final PaymentSource paymentSource; - - private PaymentSourceCreateVoucherPaymentSourceResponse(Builder builder) { - super(builder.httpResponse); - - this.customer = builder.customer; - - this.paymentSource = builder.paymentSource; - } - - /** Parse JSON response into PaymentSourceCreateVoucherPaymentSourceResponse object. */ - public static PaymentSourceCreateVoucherPaymentSourceResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into PaymentSourceCreateVoucherPaymentSourceResponse object with HTTP - * response. - */ - public static PaymentSourceCreateVoucherPaymentSourceResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __customerJson = JsonUtil.getObject(json, "customer"); - if (__customerJson != null) { - builder.customer(Customer.fromJson(__customerJson)); - } - - String __paymentSourceJson = JsonUtil.getObject(json, "payment_source"); - if (__paymentSourceJson != null) { - builder.paymentSource(PaymentSource.fromJson(__paymentSourceJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse PaymentSourceCreateVoucherPaymentSourceResponse from JSON", e); - } - } - - /** Create a new builder for PaymentSourceCreateVoucherPaymentSourceResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for PaymentSourceCreateVoucherPaymentSourceResponse. */ - public static class Builder { - - private Customer customer; - - private PaymentSource paymentSource; - - private Response httpResponse; - - private Builder() {} - - public Builder customer(Customer customer) { - this.customer = customer; - return this; - } - - public Builder paymentSource(PaymentSource paymentSource) { - this.paymentSource = paymentSource; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public PaymentSourceCreateVoucherPaymentSourceResponse build() { - return new PaymentSourceCreateVoucherPaymentSourceResponse(this); - } - } - - /** Get the customer from the response. */ - public Customer getCustomer() { - return customer; - } - - /** Get the paymentSource from the response. */ - public PaymentSource getPaymentSource() { - return paymentSource; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceExportPaymentSourceResponse.java b/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceExportPaymentSourceResponse.java deleted file mode 100644 index d3c82724..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceExportPaymentSourceResponse.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.chargebee.v4.core.responses.paymentSource; - -import com.chargebee.v4.core.models.thirdPartyPaymentMethod.ThirdPartyPaymentMethod; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for PaymentSourceExportPaymentSource operation. Contains the response - * data from the API. - */ -public final class PaymentSourceExportPaymentSourceResponse extends BaseResponse { - private final ThirdPartyPaymentMethod thirdPartyPaymentMethod; - - private PaymentSourceExportPaymentSourceResponse(Builder builder) { - super(builder.httpResponse); - - this.thirdPartyPaymentMethod = builder.thirdPartyPaymentMethod; - } - - /** Parse JSON response into PaymentSourceExportPaymentSourceResponse object. */ - public static PaymentSourceExportPaymentSourceResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into PaymentSourceExportPaymentSourceResponse object with HTTP response. - */ - public static PaymentSourceExportPaymentSourceResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __thirdPartyPaymentMethodJson = JsonUtil.getObject(json, "third_party_payment_method"); - if (__thirdPartyPaymentMethodJson != null) { - builder.thirdPartyPaymentMethod( - ThirdPartyPaymentMethod.fromJson(__thirdPartyPaymentMethodJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse PaymentSourceExportPaymentSourceResponse from JSON", e); - } - } - - /** Create a new builder for PaymentSourceExportPaymentSourceResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for PaymentSourceExportPaymentSourceResponse. */ - public static class Builder { - - private ThirdPartyPaymentMethod thirdPartyPaymentMethod; - - private Response httpResponse; - - private Builder() {} - - public Builder thirdPartyPaymentMethod(ThirdPartyPaymentMethod thirdPartyPaymentMethod) { - this.thirdPartyPaymentMethod = thirdPartyPaymentMethod; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public PaymentSourceExportPaymentSourceResponse build() { - return new PaymentSourceExportPaymentSourceResponse(this); - } - } - - /** Get the thirdPartyPaymentMethod from the response. */ - public ThirdPartyPaymentMethod getThirdPartyPaymentMethod() { - return thirdPartyPaymentMethod; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceRetrieveResponse.java deleted file mode 100644 index 68de9af9..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceRetrieveResponse.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.chargebee.v4.core.responses.paymentSource; - -import com.chargebee.v4.core.models.paymentSource.PaymentSource; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for PaymentSourceRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class PaymentSourceRetrieveResponse extends BaseResponse { - private final PaymentSource paymentSource; - - private PaymentSourceRetrieveResponse(PaymentSource paymentSource, Response httpResponse) { - super(httpResponse); - - this.paymentSource = paymentSource; - } - - /** Parse JSON response into PaymentSourceRetrieveResponse object. */ - public static PaymentSourceRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into PaymentSourceRetrieveResponse object with HTTP response. */ - public static PaymentSourceRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - PaymentSource paymentSource = - PaymentSource.fromJson(JsonUtil.getObject(json, "payment_source")); - - return new PaymentSourceRetrieveResponse(paymentSource, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse PaymentSourceRetrieveResponse from JSON", e); - } - } - - /** Get the paymentSource from the response. */ - public PaymentSource getPaymentSource() { - return paymentSource; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentVoucher/PaymentVoucherPaymentVouchersForCustomerResponse.java b/src/main/java/com/chargebee/v4/core/responses/paymentVoucher/PaymentVoucherPaymentVouchersForCustomerResponse.java deleted file mode 100644 index 6f55c101..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/paymentVoucher/PaymentVoucherPaymentVouchersForCustomerResponse.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.chargebee.v4.core.responses.paymentVoucher; - -import java.util.List; - -import com.chargebee.v4.core.models.paymentVoucher.PaymentVoucher; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.PaymentVoucherService; -import com.chargebee.v4.core.models.paymentVoucher.params.PaymentVoucherPaymentVouchersForCustomerParams; - -/** - * Immutable response object for PaymentVoucherPaymentVouchersForCustomer operation. Contains - * paginated list data. - */ -public final class PaymentVoucherPaymentVouchersForCustomerResponse { - - private final List list; - - private final String nextOffset; - - private final String customerId; - - private final PaymentVoucherService service; - private final PaymentVoucherPaymentVouchersForCustomerParams originalParams; - private final Response httpResponse; - - private PaymentVoucherPaymentVouchersForCustomerResponse( - List list, - String nextOffset, - String customerId, - PaymentVoucherService service, - PaymentVoucherPaymentVouchersForCustomerParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.customerId = customerId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into PaymentVoucherPaymentVouchersForCustomerResponse object (no service - * context). Use this when you only need to read a single page (no nextPage()). - */ - public static PaymentVoucherPaymentVouchersForCustomerResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(PaymentVoucherPaymentVouchersForCustomerItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new PaymentVoucherPaymentVouchersForCustomerResponse( - list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse PaymentVoucherPaymentVouchersForCustomerResponse from JSON", e); - } - } - - /** - * Parse JSON response into PaymentVoucherPaymentVouchersForCustomerResponse object with service - * context for pagination (enables nextPage()). - */ - public static PaymentVoucherPaymentVouchersForCustomerResponse fromJson( - String json, - PaymentVoucherService service, - PaymentVoucherPaymentVouchersForCustomerParams originalParams, - String customerId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(PaymentVoucherPaymentVouchersForCustomerItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new PaymentVoucherPaymentVouchersForCustomerResponse( - list, nextOffset, customerId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse PaymentVoucherPaymentVouchersForCustomerResponse 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 PaymentVoucherPaymentVouchersForCustomerResponse 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)."); - } - - PaymentVoucherPaymentVouchersForCustomerParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : PaymentVoucherPaymentVouchersForCustomerParams.builder()) - .offset(nextOffset) - .build(); - - return service.paymentVouchersForCustomer(customerId, 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 PaymentVoucherPaymentVouchersForCustomerItem { - - private PaymentVoucher paymentVoucher; - - public PaymentVoucher getPaymentVoucher() { - return paymentVoucher; - } - - public static PaymentVoucherPaymentVouchersForCustomerItem fromJson(String json) { - PaymentVoucherPaymentVouchersForCustomerItem item = - new PaymentVoucherPaymentVouchersForCustomerItem(); - - String __paymentVoucherJson = JsonUtil.getObject(json, "payment_voucher"); - if (__paymentVoucherJson != null) { - item.paymentVoucher = PaymentVoucher.fromJson(__paymentVoucherJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentVoucher/PaymentVoucherPaymentVouchersForInvoiceResponse.java b/src/main/java/com/chargebee/v4/core/responses/paymentVoucher/PaymentVoucherPaymentVouchersForInvoiceResponse.java deleted file mode 100644 index b1b11f0a..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/paymentVoucher/PaymentVoucherPaymentVouchersForInvoiceResponse.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.chargebee.v4.core.responses.paymentVoucher; - -import java.util.List; - -import com.chargebee.v4.core.models.paymentVoucher.PaymentVoucher; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.PaymentVoucherService; -import com.chargebee.v4.core.models.paymentVoucher.params.PaymentVoucherPaymentVouchersForInvoiceParams; - -/** - * Immutable response object for PaymentVoucherPaymentVouchersForInvoice operation. Contains - * paginated list data. - */ -public final class PaymentVoucherPaymentVouchersForInvoiceResponse { - - private final List list; - - private final String nextOffset; - - private final String invoiceId; - - private final PaymentVoucherService service; - private final PaymentVoucherPaymentVouchersForInvoiceParams originalParams; - private final Response httpResponse; - - private PaymentVoucherPaymentVouchersForInvoiceResponse( - List list, - String nextOffset, - String invoiceId, - PaymentVoucherService service, - PaymentVoucherPaymentVouchersForInvoiceParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.invoiceId = invoiceId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into PaymentVoucherPaymentVouchersForInvoiceResponse object (no service - * context). Use this when you only need to read a single page (no nextPage()). - */ - public static PaymentVoucherPaymentVouchersForInvoiceResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(PaymentVoucherPaymentVouchersForInvoiceItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new PaymentVoucherPaymentVouchersForInvoiceResponse( - list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse PaymentVoucherPaymentVouchersForInvoiceResponse from JSON", e); - } - } - - /** - * Parse JSON response into PaymentVoucherPaymentVouchersForInvoiceResponse object with service - * context for pagination (enables nextPage()). - */ - public static PaymentVoucherPaymentVouchersForInvoiceResponse fromJson( - String json, - PaymentVoucherService service, - PaymentVoucherPaymentVouchersForInvoiceParams originalParams, - String invoiceId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(PaymentVoucherPaymentVouchersForInvoiceItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new PaymentVoucherPaymentVouchersForInvoiceResponse( - list, nextOffset, invoiceId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse PaymentVoucherPaymentVouchersForInvoiceResponse 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 PaymentVoucherPaymentVouchersForInvoiceResponse 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)."); - } - - PaymentVoucherPaymentVouchersForInvoiceParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : PaymentVoucherPaymentVouchersForInvoiceParams.builder()) - .offset(nextOffset) - .build(); - - return service.paymentVouchersForInvoice(invoiceId, 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 PaymentVoucherPaymentVouchersForInvoiceItem { - - private PaymentVoucher paymentVoucher; - - public PaymentVoucher getPaymentVoucher() { - return paymentVoucher; - } - - public static PaymentVoucherPaymentVouchersForInvoiceItem fromJson(String json) { - PaymentVoucherPaymentVouchersForInvoiceItem item = - new PaymentVoucherPaymentVouchersForInvoiceItem(); - - String __paymentVoucherJson = JsonUtil.getObject(json, "payment_voucher"); - if (__paymentVoucherJson != null) { - item.paymentVoucher = PaymentVoucher.fromJson(__paymentVoucherJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentVoucher/PaymentVoucherRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/paymentVoucher/PaymentVoucherRetrieveResponse.java deleted file mode 100644 index ae7ca757..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/paymentVoucher/PaymentVoucherRetrieveResponse.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.chargebee.v4.core.responses.paymentVoucher; - -import com.chargebee.v4.core.models.paymentVoucher.PaymentVoucher; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for PaymentVoucherRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class PaymentVoucherRetrieveResponse extends BaseResponse { - private final PaymentVoucher paymentVoucher; - - private PaymentVoucherRetrieveResponse(PaymentVoucher paymentVoucher, Response httpResponse) { - super(httpResponse); - - this.paymentVoucher = paymentVoucher; - } - - /** Parse JSON response into PaymentVoucherRetrieveResponse object. */ - public static PaymentVoucherRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into PaymentVoucherRetrieveResponse object with HTTP response. */ - public static PaymentVoucherRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - PaymentVoucher paymentVoucher = - PaymentVoucher.fromJson(JsonUtil.getObject(json, "payment_voucher")); - - return new PaymentVoucherRetrieveResponse(paymentVoucher, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse PaymentVoucherRetrieveResponse from JSON", e); - } - } - - /** Get the paymentVoucher from the response. */ - public PaymentVoucher getPaymentVoucher() { - return paymentVoucher; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2Migration/Pc2MigrationRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/pc2Migration/Pc2MigrationRetrieveResponse.java deleted file mode 100644 index 194af29c..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/pc2Migration/Pc2MigrationRetrieveResponse.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.chargebee.v4.core.responses.pc2Migration; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for Pc2MigrationRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class Pc2MigrationRetrieveResponse extends BaseResponse { - private final Object pc2Migration; - - private Pc2MigrationRetrieveResponse(Object pc2Migration, Response httpResponse) { - super(httpResponse); - - this.pc2Migration = pc2Migration; - } - - /** Parse JSON response into Pc2MigrationRetrieveResponse object. */ - public static Pc2MigrationRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into Pc2MigrationRetrieveResponse object with HTTP response. */ - public static Pc2MigrationRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Object pc2Migration = JsonUtil.getObject(json, "pc2_migration"); - - return new Pc2MigrationRetrieveResponse(pc2Migration, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse Pc2MigrationRetrieveResponse from JSON", e); - } - } - - /** Get the pc2Migration from the response. */ - public Object getPc2Migration() { - return pc2Migration; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemRetrieveResponse.java deleted file mode 100644 index c96a8a99..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemRetrieveResponse.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.chargebee.v4.core.responses.pc2MigrationItem; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for Pc2MigrationItemRetrieve operation. Contains the response data from - * a single resource get operation. - */ -public final class Pc2MigrationItemRetrieveResponse extends BaseResponse { - private final Object pc2MigrationItem; - - private Pc2MigrationItemRetrieveResponse(Object pc2MigrationItem, Response httpResponse) { - super(httpResponse); - - this.pc2MigrationItem = pc2MigrationItem; - } - - /** Parse JSON response into Pc2MigrationItemRetrieveResponse object. */ - public static Pc2MigrationItemRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into Pc2MigrationItemRetrieveResponse object with HTTP response. */ - public static Pc2MigrationItemRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Object pc2MigrationItem = JsonUtil.getObject(json, "pc2_migration_item"); - - return new Pc2MigrationItemRetrieveResponse(pc2MigrationItem, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse Pc2MigrationItemRetrieveResponse from JSON", e); - } - } - - /** Get the pc2MigrationItem from the response. */ - public Object getPc2MigrationItem() { - return pc2MigrationItem; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemFamily/Pc2MigrationItemFamilyRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemFamily/Pc2MigrationItemFamilyRetrieveResponse.java deleted file mode 100644 index 9f3a7229..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemFamily/Pc2MigrationItemFamilyRetrieveResponse.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.chargebee.v4.core.responses.pc2MigrationItemFamily; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for Pc2MigrationItemFamilyRetrieve operation. Contains the response - * data from a single resource get operation. - */ -public final class Pc2MigrationItemFamilyRetrieveResponse extends BaseResponse { - private final Object pc2MigrationItemFamily; - - private Pc2MigrationItemFamilyRetrieveResponse( - Object pc2MigrationItemFamily, Response httpResponse) { - super(httpResponse); - - this.pc2MigrationItemFamily = pc2MigrationItemFamily; - } - - /** Parse JSON response into Pc2MigrationItemFamilyRetrieveResponse object. */ - public static Pc2MigrationItemFamilyRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into Pc2MigrationItemFamilyRetrieveResponse object with HTTP response. */ - public static Pc2MigrationItemFamilyRetrieveResponse fromJson( - String json, Response httpResponse) { - try { - - Object pc2MigrationItemFamily = JsonUtil.getObject(json, "pc2_migration_item_family"); - - return new Pc2MigrationItemFamilyRetrieveResponse(pc2MigrationItemFamily, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse Pc2MigrationItemFamilyRetrieveResponse from JSON", e); - } - } - - /** Get the pc2MigrationItemFamily from the response. */ - public Object getPc2MigrationItemFamily() { - return pc2MigrationItemFamily; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemPrice/Pc2MigrationItemPriceRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemPrice/Pc2MigrationItemPriceRetrieveResponse.java deleted file mode 100644 index fcbcc4fc..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemPrice/Pc2MigrationItemPriceRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.pc2MigrationItemPrice; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for Pc2MigrationItemPriceRetrieve operation. Contains the response data - * from a single resource get operation. - */ -public final class Pc2MigrationItemPriceRetrieveResponse extends BaseResponse { - private final Object pc2MigrationItemPrice; - - private Pc2MigrationItemPriceRetrieveResponse( - Object pc2MigrationItemPrice, Response httpResponse) { - super(httpResponse); - - this.pc2MigrationItemPrice = pc2MigrationItemPrice; - } - - /** Parse JSON response into Pc2MigrationItemPriceRetrieveResponse object. */ - public static Pc2MigrationItemPriceRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into Pc2MigrationItemPriceRetrieveResponse object with HTTP response. */ - public static Pc2MigrationItemPriceRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Object pc2MigrationItemPrice = JsonUtil.getObject(json, "pc2_migration_item_price"); - - return new Pc2MigrationItemPriceRetrieveResponse(pc2MigrationItemPrice, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse Pc2MigrationItemPriceRetrieveResponse from JSON", e); - } - } - - /** Get the pc2MigrationItemPrice from the response. */ - public Object getPc2MigrationItemPrice() { - return pc2MigrationItemPrice; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/personalizedOffer/PersonalizedOfferPersonalizedOffersResponse.java b/src/main/java/com/chargebee/v4/core/responses/personalizedOffer/PersonalizedOfferPersonalizedOffersResponse.java deleted file mode 100644 index 09a00813..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/personalizedOffer/PersonalizedOfferPersonalizedOffersResponse.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.chargebee.v4.core.responses.personalizedOffer; - -import java.util.List; - -import com.chargebee.v4.core.models.brand.Brand; - -import com.chargebee.v4.core.models.personalizedOffer.PersonalizedOffer; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import java.sql.Timestamp; - -/** - * Immutable response object for PersonalizedOfferPersonalizedOffers operation. Contains the - * response data from the API. - */ -public final class PersonalizedOfferPersonalizedOffersResponse extends BaseResponse { - private final List personalizedOffers; - - private final Brand brand; - - private final Timestamp expiresAt; - - private PersonalizedOfferPersonalizedOffersResponse(Builder builder) { - super(builder.httpResponse); - - this.personalizedOffers = builder.personalizedOffers; - - this.brand = builder.brand; - - this.expiresAt = builder.expiresAt; - } - - /** Parse JSON response into PersonalizedOfferPersonalizedOffersResponse object. */ - public static PersonalizedOfferPersonalizedOffersResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into PersonalizedOfferPersonalizedOffersResponse object with HTTP response. - */ - public static PersonalizedOfferPersonalizedOffersResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - builder.personalizedOffers( - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "personalized_offers")).stream() - .map(PersonalizedOffer::fromJson) - .collect(java.util.stream.Collectors.toList())); - - String __brandJson = JsonUtil.getObject(json, "brand"); - if (__brandJson != null) { - builder.brand(Brand.fromJson(__brandJson)); - } - - builder.expiresAt(JsonUtil.getTimestamp(json, "expires_at")); - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse PersonalizedOfferPersonalizedOffersResponse from JSON", e); - } - } - - /** Create a new builder for PersonalizedOfferPersonalizedOffersResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for PersonalizedOfferPersonalizedOffersResponse. */ - public static class Builder { - - private List personalizedOffers; - - private Brand brand; - - private Timestamp expiresAt; - - private Response httpResponse; - - private Builder() {} - - public Builder personalizedOffers(List personalizedOffers) { - this.personalizedOffers = personalizedOffers; - return this; - } - - public Builder brand(Brand brand) { - this.brand = brand; - return this; - } - - public Builder expiresAt(Timestamp expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public PersonalizedOfferPersonalizedOffersResponse build() { - return new PersonalizedOfferPersonalizedOffersResponse(this); - } - } - - /** Get the personalizedOffers from the response. */ - public List getPersonalizedOffers() { - return personalizedOffers; - } - - /** Get the brand from the response. */ - public Brand getBrand() { - return brand; - } - - /** Get the expiresAt from the response. */ - public Timestamp getExpiresAt() { - return expiresAt; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/plan/PlanRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/plan/PlanRetrieveResponse.java deleted file mode 100644 index 3a488c92..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/plan/PlanRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.plan; - -import com.chargebee.v4.core.models.plan.Plan; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for PlanRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class PlanRetrieveResponse extends BaseResponse { - private final Plan plan; - - private PlanRetrieveResponse(Plan plan, Response httpResponse) { - super(httpResponse); - - this.plan = plan; - } - - /** Parse JSON response into PlanRetrieveResponse object. */ - public static PlanRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into PlanRetrieveResponse object with HTTP response. */ - public static PlanRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Plan plan = Plan.fromJson(JsonUtil.getObject(json, "plan")); - - return new PlanRetrieveResponse(plan, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse PlanRetrieveResponse from JSON", e); - } - } - - /** Get the plan from the response. */ - public Plan getPlan() { - return plan; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/portalSession/PortalSessionRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/portalSession/PortalSessionRetrieveResponse.java deleted file mode 100644 index 4b07382b..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/portalSession/PortalSessionRetrieveResponse.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.chargebee.v4.core.responses.portalSession; - -import com.chargebee.v4.core.models.portalSession.PortalSession; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for PortalSessionRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class PortalSessionRetrieveResponse extends BaseResponse { - private final PortalSession portalSession; - - private PortalSessionRetrieveResponse(PortalSession portalSession, Response httpResponse) { - super(httpResponse); - - this.portalSession = portalSession; - } - - /** Parse JSON response into PortalSessionRetrieveResponse object. */ - public static PortalSessionRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into PortalSessionRetrieveResponse object with HTTP response. */ - public static PortalSessionRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - PortalSession portalSession = - PortalSession.fromJson(JsonUtil.getObject(json, "portal_session")); - - return new PortalSessionRetrieveResponse(portalSession, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse PortalSessionRetrieveResponse from JSON", e); - } - } - - /** Get the portalSession from the response. */ - public PortalSession getPortalSession() { - return portalSession; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/priceVariant/PriceVariantRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/priceVariant/PriceVariantRetrieveResponse.java deleted file mode 100644 index b871a080..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/priceVariant/PriceVariantRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.priceVariant; - -import com.chargebee.v4.core.models.priceVariant.PriceVariant; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for PriceVariantRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class PriceVariantRetrieveResponse extends BaseResponse { - private final PriceVariant priceVariant; - - private PriceVariantRetrieveResponse(PriceVariant priceVariant, Response httpResponse) { - super(httpResponse); - - this.priceVariant = priceVariant; - } - - /** Parse JSON response into PriceVariantRetrieveResponse object. */ - public static PriceVariantRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into PriceVariantRetrieveResponse object with HTTP response. */ - public static PriceVariantRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - PriceVariant priceVariant = PriceVariant.fromJson(JsonUtil.getObject(json, "price_variant")); - - return new PriceVariantRetrieveResponse(priceVariant, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse PriceVariantRetrieveResponse from JSON", e); - } - } - - /** Get the priceVariant from the response. */ - public PriceVariant getPriceVariant() { - return priceVariant; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/product/ProductRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/product/ProductRetrieveResponse.java deleted file mode 100644 index 6febce41..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/product/ProductRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.product; - -import com.chargebee.v4.core.models.product.Product; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for ProductRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class ProductRetrieveResponse extends BaseResponse { - private final Product product; - - private ProductRetrieveResponse(Product product, Response httpResponse) { - super(httpResponse); - - this.product = product; - } - - /** Parse JSON response into ProductRetrieveResponse object. */ - public static ProductRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into ProductRetrieveResponse object with HTTP response. */ - public static ProductRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Product product = Product.fromJson(JsonUtil.getObject(json, "product")); - - return new ProductRetrieveResponse(product, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse ProductRetrieveResponse from JSON", e); - } - } - - /** Get the product from the response. */ - public Product getProduct() { - return product; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/promotionalCredit/PromotionalCreditRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/promotionalCredit/PromotionalCreditRetrieveResponse.java deleted file mode 100644 index ca4567ca..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/promotionalCredit/PromotionalCreditRetrieveResponse.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.chargebee.v4.core.responses.promotionalCredit; - -import com.chargebee.v4.core.models.promotionalCredit.PromotionalCredit; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for PromotionalCreditRetrieve operation. Contains the response data - * from a single resource get operation. - */ -public final class PromotionalCreditRetrieveResponse extends BaseResponse { - private final PromotionalCredit promotionalCredit; - - private PromotionalCreditRetrieveResponse( - PromotionalCredit promotionalCredit, Response httpResponse) { - super(httpResponse); - - this.promotionalCredit = promotionalCredit; - } - - /** Parse JSON response into PromotionalCreditRetrieveResponse object. */ - public static PromotionalCreditRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into PromotionalCreditRetrieveResponse object with HTTP response. */ - public static PromotionalCreditRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - PromotionalCredit promotionalCredit = - PromotionalCredit.fromJson(JsonUtil.getObject(json, "promotional_credit")); - - return new PromotionalCreditRetrieveResponse(promotionalCredit, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse PromotionalCreditRetrieveResponse from JSON", e); - } - } - - /** Get the promotionalCredit from the response. */ - public PromotionalCredit getPromotionalCredit() { - return promotionalCredit; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteCreateSubForCustomerQuoteResponse.java b/src/main/java/com/chargebee/v4/core/responses/quote/QuoteCreateSubForCustomerQuoteResponse.java deleted file mode 100644 index bc235d93..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteCreateSubForCustomerQuoteResponse.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.chargebee.v4.core.responses.quote; - -import com.chargebee.v4.core.models.quote.Quote; - -import com.chargebee.v4.core.models.quotedSubscription.QuotedSubscription; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for QuoteCreateSubForCustomerQuote operation. Contains the response - * data from the API. - */ -public final class QuoteCreateSubForCustomerQuoteResponse extends BaseResponse { - private final Quote quote; - - private final QuotedSubscription quotedSubscription; - - private QuoteCreateSubForCustomerQuoteResponse(Builder builder) { - super(builder.httpResponse); - - this.quote = builder.quote; - - this.quotedSubscription = builder.quotedSubscription; - } - - /** Parse JSON response into QuoteCreateSubForCustomerQuoteResponse object. */ - public static QuoteCreateSubForCustomerQuoteResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into QuoteCreateSubForCustomerQuoteResponse object with HTTP response. */ - public static QuoteCreateSubForCustomerQuoteResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __quoteJson = JsonUtil.getObject(json, "quote"); - if (__quoteJson != null) { - builder.quote(Quote.fromJson(__quoteJson)); - } - - String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); - if (__quotedSubscriptionJson != null) { - builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse QuoteCreateSubForCustomerQuoteResponse from JSON", e); - } - } - - /** Create a new builder for QuoteCreateSubForCustomerQuoteResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for QuoteCreateSubForCustomerQuoteResponse. */ - public static class Builder { - - private Quote quote; - - private QuotedSubscription quotedSubscription; - - private Response httpResponse; - - private Builder() {} - - public Builder quote(Quote quote) { - this.quote = quote; - return this; - } - - public Builder quotedSubscription(QuotedSubscription quotedSubscription) { - this.quotedSubscription = quotedSubscription; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public QuoteCreateSubForCustomerQuoteResponse build() { - return new QuoteCreateSubForCustomerQuoteResponse(this); - } - } - - /** Get the quote from the response. */ - public Quote getQuote() { - return quote; - } - - /** Get the quotedSubscription from the response. */ - public QuotedSubscription getQuotedSubscription() { - return quotedSubscription; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteCreateSubItemsForCustomerQuoteResponse.java b/src/main/java/com/chargebee/v4/core/responses/quote/QuoteCreateSubItemsForCustomerQuoteResponse.java deleted file mode 100644 index 3e9ec42d..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteCreateSubItemsForCustomerQuoteResponse.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.chargebee.v4.core.responses.quote; - -import com.chargebee.v4.core.models.quote.Quote; - -import com.chargebee.v4.core.models.quotedRamp.QuotedRamp; - -import com.chargebee.v4.core.models.quotedSubscription.QuotedSubscription; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for QuoteCreateSubItemsForCustomerQuote operation. Contains the - * response data from the API. - */ -public final class QuoteCreateSubItemsForCustomerQuoteResponse extends BaseResponse { - private final Quote quote; - - private final QuotedSubscription quotedSubscription; - - private final QuotedRamp quotedRamp; - - private QuoteCreateSubItemsForCustomerQuoteResponse(Builder builder) { - super(builder.httpResponse); - - this.quote = builder.quote; - - this.quotedSubscription = builder.quotedSubscription; - - this.quotedRamp = builder.quotedRamp; - } - - /** Parse JSON response into QuoteCreateSubItemsForCustomerQuoteResponse object. */ - public static QuoteCreateSubItemsForCustomerQuoteResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into QuoteCreateSubItemsForCustomerQuoteResponse object with HTTP response. - */ - public static QuoteCreateSubItemsForCustomerQuoteResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __quoteJson = JsonUtil.getObject(json, "quote"); - if (__quoteJson != null) { - builder.quote(Quote.fromJson(__quoteJson)); - } - - String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); - if (__quotedSubscriptionJson != null) { - builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); - } - - String __quotedRampJson = JsonUtil.getObject(json, "quoted_ramp"); - if (__quotedRampJson != null) { - builder.quotedRamp(QuotedRamp.fromJson(__quotedRampJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse QuoteCreateSubItemsForCustomerQuoteResponse from JSON", e); - } - } - - /** Create a new builder for QuoteCreateSubItemsForCustomerQuoteResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for QuoteCreateSubItemsForCustomerQuoteResponse. */ - public static class Builder { - - private Quote quote; - - private QuotedSubscription quotedSubscription; - - private QuotedRamp quotedRamp; - - private Response httpResponse; - - private Builder() {} - - public Builder quote(Quote quote) { - this.quote = quote; - return this; - } - - public Builder quotedSubscription(QuotedSubscription quotedSubscription) { - this.quotedSubscription = quotedSubscription; - return this; - } - - public Builder quotedRamp(QuotedRamp quotedRamp) { - this.quotedRamp = quotedRamp; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public QuoteCreateSubItemsForCustomerQuoteResponse build() { - return new QuoteCreateSubItemsForCustomerQuoteResponse(this); - } - } - - /** Get the quote from the response. */ - public Quote getQuote() { - return quote; - } - - /** Get the quotedSubscription from the response. */ - public QuotedSubscription getQuotedSubscription() { - return quotedSubscription; - } - - /** Get the quotedRamp from the response. */ - public QuotedRamp getQuotedRamp() { - return quotedRamp; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditCreateSubCustomerQuoteForItemsResponse.java b/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditCreateSubCustomerQuoteForItemsResponse.java deleted file mode 100644 index 09d0e912..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditCreateSubCustomerQuoteForItemsResponse.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.chargebee.v4.core.responses.quote; - -import com.chargebee.v4.core.models.quote.Quote; - -import com.chargebee.v4.core.models.quotedRamp.QuotedRamp; - -import com.chargebee.v4.core.models.quotedSubscription.QuotedSubscription; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for QuoteEditCreateSubCustomerQuoteForItems operation. Contains the - * response data from the API. - */ -public final class QuoteEditCreateSubCustomerQuoteForItemsResponse extends BaseResponse { - private final Quote quote; - - private final QuotedSubscription quotedSubscription; - - private final QuotedRamp quotedRamp; - - private QuoteEditCreateSubCustomerQuoteForItemsResponse(Builder builder) { - super(builder.httpResponse); - - this.quote = builder.quote; - - this.quotedSubscription = builder.quotedSubscription; - - this.quotedRamp = builder.quotedRamp; - } - - /** Parse JSON response into QuoteEditCreateSubCustomerQuoteForItemsResponse object. */ - public static QuoteEditCreateSubCustomerQuoteForItemsResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into QuoteEditCreateSubCustomerQuoteForItemsResponse object with HTTP - * response. - */ - public static QuoteEditCreateSubCustomerQuoteForItemsResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __quoteJson = JsonUtil.getObject(json, "quote"); - if (__quoteJson != null) { - builder.quote(Quote.fromJson(__quoteJson)); - } - - String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); - if (__quotedSubscriptionJson != null) { - builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); - } - - String __quotedRampJson = JsonUtil.getObject(json, "quoted_ramp"); - if (__quotedRampJson != null) { - builder.quotedRamp(QuotedRamp.fromJson(__quotedRampJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse QuoteEditCreateSubCustomerQuoteForItemsResponse from JSON", e); - } - } - - /** Create a new builder for QuoteEditCreateSubCustomerQuoteForItemsResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for QuoteEditCreateSubCustomerQuoteForItemsResponse. */ - public static class Builder { - - private Quote quote; - - private QuotedSubscription quotedSubscription; - - private QuotedRamp quotedRamp; - - private Response httpResponse; - - private Builder() {} - - public Builder quote(Quote quote) { - this.quote = quote; - return this; - } - - public Builder quotedSubscription(QuotedSubscription quotedSubscription) { - this.quotedSubscription = quotedSubscription; - return this; - } - - public Builder quotedRamp(QuotedRamp quotedRamp) { - this.quotedRamp = quotedRamp; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public QuoteEditCreateSubCustomerQuoteForItemsResponse build() { - return new QuoteEditCreateSubCustomerQuoteForItemsResponse(this); - } - } - - /** Get the quote from the response. */ - public Quote getQuote() { - return quote; - } - - /** Get the quotedSubscription from the response. */ - public QuotedSubscription getQuotedSubscription() { - return quotedSubscription; - } - - /** Get the quotedRamp from the response. */ - public QuotedRamp getQuotedRamp() { - return quotedRamp; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditCreateSubForCustomerQuoteResponse.java b/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditCreateSubForCustomerQuoteResponse.java deleted file mode 100644 index f3f6851b..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditCreateSubForCustomerQuoteResponse.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.chargebee.v4.core.responses.quote; - -import com.chargebee.v4.core.models.quote.Quote; - -import com.chargebee.v4.core.models.quotedSubscription.QuotedSubscription; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for QuoteEditCreateSubForCustomerQuote operation. Contains the response - * data from the API. - */ -public final class QuoteEditCreateSubForCustomerQuoteResponse extends BaseResponse { - private final Quote quote; - - private final QuotedSubscription quotedSubscription; - - private QuoteEditCreateSubForCustomerQuoteResponse(Builder builder) { - super(builder.httpResponse); - - this.quote = builder.quote; - - this.quotedSubscription = builder.quotedSubscription; - } - - /** Parse JSON response into QuoteEditCreateSubForCustomerQuoteResponse object. */ - public static QuoteEditCreateSubForCustomerQuoteResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into QuoteEditCreateSubForCustomerQuoteResponse object with HTTP response. - */ - public static QuoteEditCreateSubForCustomerQuoteResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __quoteJson = JsonUtil.getObject(json, "quote"); - if (__quoteJson != null) { - builder.quote(Quote.fromJson(__quoteJson)); - } - - String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); - if (__quotedSubscriptionJson != null) { - builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse QuoteEditCreateSubForCustomerQuoteResponse from JSON", e); - } - } - - /** Create a new builder for QuoteEditCreateSubForCustomerQuoteResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for QuoteEditCreateSubForCustomerQuoteResponse. */ - public static class Builder { - - private Quote quote; - - private QuotedSubscription quotedSubscription; - - private Response httpResponse; - - private Builder() {} - - public Builder quote(Quote quote) { - this.quote = quote; - return this; - } - - public Builder quotedSubscription(QuotedSubscription quotedSubscription) { - this.quotedSubscription = quotedSubscription; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public QuoteEditCreateSubForCustomerQuoteResponse build() { - return new QuoteEditCreateSubForCustomerQuoteResponse(this); - } - } - - /** Get the quote from the response. */ - public Quote getQuote() { - return quote; - } - - /** Get the quotedSubscription from the response. */ - public QuotedSubscription getQuotedSubscription() { - return quotedSubscription; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditOneTimeQuoteResponse.java b/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditOneTimeQuoteResponse.java deleted file mode 100644 index af3a3cfe..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditOneTimeQuoteResponse.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.chargebee.v4.core.responses.quote; - -import com.chargebee.v4.core.models.quote.Quote; - -import com.chargebee.v4.core.models.quotedCharge.QuotedCharge; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for QuoteEditOneTimeQuote operation. Contains the response data from - * the API. - */ -public final class QuoteEditOneTimeQuoteResponse extends BaseResponse { - private final Quote quote; - - private final QuotedCharge quotedCharge; - - private QuoteEditOneTimeQuoteResponse(Builder builder) { - super(builder.httpResponse); - - this.quote = builder.quote; - - this.quotedCharge = builder.quotedCharge; - } - - /** Parse JSON response into QuoteEditOneTimeQuoteResponse object. */ - public static QuoteEditOneTimeQuoteResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into QuoteEditOneTimeQuoteResponse object with HTTP response. */ - public static QuoteEditOneTimeQuoteResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __quoteJson = JsonUtil.getObject(json, "quote"); - if (__quoteJson != null) { - builder.quote(Quote.fromJson(__quoteJson)); - } - - String __quotedChargeJson = JsonUtil.getObject(json, "quoted_charge"); - if (__quotedChargeJson != null) { - builder.quotedCharge(QuotedCharge.fromJson(__quotedChargeJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException("Failed to parse QuoteEditOneTimeQuoteResponse from JSON", e); - } - } - - /** Create a new builder for QuoteEditOneTimeQuoteResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for QuoteEditOneTimeQuoteResponse. */ - public static class Builder { - - private Quote quote; - - private QuotedCharge quotedCharge; - - private Response httpResponse; - - private Builder() {} - - public Builder quote(Quote quote) { - this.quote = quote; - return this; - } - - public Builder quotedCharge(QuotedCharge quotedCharge) { - this.quotedCharge = quotedCharge; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public QuoteEditOneTimeQuoteResponse build() { - return new QuoteEditOneTimeQuoteResponse(this); - } - } - - /** Get the quote from the response. */ - public Quote getQuote() { - return quote; - } - - /** Get the quotedCharge from the response. */ - public QuotedCharge getQuotedCharge() { - return quotedCharge; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditUpdateSubscriptionQuoteForItemsResponse.java b/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditUpdateSubscriptionQuoteForItemsResponse.java deleted file mode 100644 index 0003ce08..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditUpdateSubscriptionQuoteForItemsResponse.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.chargebee.v4.core.responses.quote; - -import com.chargebee.v4.core.models.quote.Quote; - -import com.chargebee.v4.core.models.quotedRamp.QuotedRamp; - -import com.chargebee.v4.core.models.quotedSubscription.QuotedSubscription; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for QuoteEditUpdateSubscriptionQuoteForItems operation. Contains the - * response data from the API. - */ -public final class QuoteEditUpdateSubscriptionQuoteForItemsResponse extends BaseResponse { - private final Quote quote; - - private final QuotedSubscription quotedSubscription; - - private final QuotedRamp quotedRamp; - - private QuoteEditUpdateSubscriptionQuoteForItemsResponse(Builder builder) { - super(builder.httpResponse); - - this.quote = builder.quote; - - this.quotedSubscription = builder.quotedSubscription; - - this.quotedRamp = builder.quotedRamp; - } - - /** Parse JSON response into QuoteEditUpdateSubscriptionQuoteForItemsResponse object. */ - public static QuoteEditUpdateSubscriptionQuoteForItemsResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into QuoteEditUpdateSubscriptionQuoteForItemsResponse object with HTTP - * response. - */ - public static QuoteEditUpdateSubscriptionQuoteForItemsResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __quoteJson = JsonUtil.getObject(json, "quote"); - if (__quoteJson != null) { - builder.quote(Quote.fromJson(__quoteJson)); - } - - String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); - if (__quotedSubscriptionJson != null) { - builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); - } - - String __quotedRampJson = JsonUtil.getObject(json, "quoted_ramp"); - if (__quotedRampJson != null) { - builder.quotedRamp(QuotedRamp.fromJson(__quotedRampJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse QuoteEditUpdateSubscriptionQuoteForItemsResponse from JSON", e); - } - } - - /** Create a new builder for QuoteEditUpdateSubscriptionQuoteForItemsResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for QuoteEditUpdateSubscriptionQuoteForItemsResponse. */ - public static class Builder { - - private Quote quote; - - private QuotedSubscription quotedSubscription; - - private QuotedRamp quotedRamp; - - private Response httpResponse; - - private Builder() {} - - public Builder quote(Quote quote) { - this.quote = quote; - return this; - } - - public Builder quotedSubscription(QuotedSubscription quotedSubscription) { - this.quotedSubscription = quotedSubscription; - return this; - } - - public Builder quotedRamp(QuotedRamp quotedRamp) { - this.quotedRamp = quotedRamp; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public QuoteEditUpdateSubscriptionQuoteForItemsResponse build() { - return new QuoteEditUpdateSubscriptionQuoteForItemsResponse(this); - } - } - - /** Get the quote from the response. */ - public Quote getQuote() { - return quote; - } - - /** Get the quotedSubscription from the response. */ - public QuotedSubscription getQuotedSubscription() { - return quotedSubscription; - } - - /** Get the quotedRamp from the response. */ - public QuotedRamp getQuotedRamp() { - return quotedRamp; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditUpdateSubscriptionQuoteResponse.java b/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditUpdateSubscriptionQuoteResponse.java deleted file mode 100644 index fd13b17f..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditUpdateSubscriptionQuoteResponse.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.chargebee.v4.core.responses.quote; - -import com.chargebee.v4.core.models.quote.Quote; - -import com.chargebee.v4.core.models.quotedSubscription.QuotedSubscription; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for QuoteEditUpdateSubscriptionQuote operation. Contains the response - * data from the API. - */ -public final class QuoteEditUpdateSubscriptionQuoteResponse extends BaseResponse { - private final Quote quote; - - private final QuotedSubscription quotedSubscription; - - private QuoteEditUpdateSubscriptionQuoteResponse(Builder builder) { - super(builder.httpResponse); - - this.quote = builder.quote; - - this.quotedSubscription = builder.quotedSubscription; - } - - /** Parse JSON response into QuoteEditUpdateSubscriptionQuoteResponse object. */ - public static QuoteEditUpdateSubscriptionQuoteResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into QuoteEditUpdateSubscriptionQuoteResponse object with HTTP response. - */ - public static QuoteEditUpdateSubscriptionQuoteResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __quoteJson = JsonUtil.getObject(json, "quote"); - if (__quoteJson != null) { - builder.quote(Quote.fromJson(__quoteJson)); - } - - String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); - if (__quotedSubscriptionJson != null) { - builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse QuoteEditUpdateSubscriptionQuoteResponse from JSON", e); - } - } - - /** Create a new builder for QuoteEditUpdateSubscriptionQuoteResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for QuoteEditUpdateSubscriptionQuoteResponse. */ - public static class Builder { - - private Quote quote; - - private QuotedSubscription quotedSubscription; - - private Response httpResponse; - - private Builder() {} - - public Builder quote(Quote quote) { - this.quote = quote; - return this; - } - - public Builder quotedSubscription(QuotedSubscription quotedSubscription) { - this.quotedSubscription = quotedSubscription; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public QuoteEditUpdateSubscriptionQuoteResponse build() { - return new QuoteEditUpdateSubscriptionQuoteResponse(this); - } - } - - /** Get the quote from the response. */ - public Quote getQuote() { - return quote; - } - - /** Get the quotedSubscription from the response. */ - public QuotedSubscription getQuotedSubscription() { - return quotedSubscription; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteQuoteLineGroupsForQuoteResponse.java b/src/main/java/com/chargebee/v4/core/responses/quote/QuoteQuoteLineGroupsForQuoteResponse.java deleted file mode 100644 index ba1d7725..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteQuoteLineGroupsForQuoteResponse.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.chargebee.v4.core.responses.quote; - -import java.util.List; - -import com.chargebee.v4.core.models.quoteLineGroup.QuoteLineGroup; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.QuoteService; -import com.chargebee.v4.core.models.quote.params.QuoteQuoteLineGroupsForQuoteParams; - -/** - * Immutable response object for QuoteQuoteLineGroupsForQuote operation. Contains paginated list - * data. - */ -public final class QuoteQuoteLineGroupsForQuoteResponse { - - private final List list; - - private final String nextOffset; - - private final String quoteId; - - private final QuoteService service; - private final QuoteQuoteLineGroupsForQuoteParams originalParams; - private final Response httpResponse; - - private QuoteQuoteLineGroupsForQuoteResponse( - List list, - String nextOffset, - String quoteId, - QuoteService service, - QuoteQuoteLineGroupsForQuoteParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.quoteId = quoteId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into QuoteQuoteLineGroupsForQuoteResponse object (no service context). Use - * this when you only need to read a single page (no nextPage()). - */ - public static QuoteQuoteLineGroupsForQuoteResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(QuoteQuoteLineGroupsForQuoteItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new QuoteQuoteLineGroupsForQuoteResponse(list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse QuoteQuoteLineGroupsForQuoteResponse from JSON", e); - } - } - - /** - * Parse JSON response into QuoteQuoteLineGroupsForQuoteResponse object with service context for - * pagination (enables nextPage()). - */ - public static QuoteQuoteLineGroupsForQuoteResponse fromJson( - String json, - QuoteService service, - QuoteQuoteLineGroupsForQuoteParams originalParams, - String quoteId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(QuoteQuoteLineGroupsForQuoteItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new QuoteQuoteLineGroupsForQuoteResponse( - list, nextOffset, quoteId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse QuoteQuoteLineGroupsForQuoteResponse 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 QuoteQuoteLineGroupsForQuoteResponse 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)."); - } - - QuoteQuoteLineGroupsForQuoteParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : QuoteQuoteLineGroupsForQuoteParams.builder()) - .offset(nextOffset) - .build(); - - return service.quoteLineGroupsForQuote(quoteId, 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 QuoteQuoteLineGroupsForQuoteItem { - - private QuoteLineGroup quoteLineGroup; - - public QuoteLineGroup getQuoteLineGroup() { - return quoteLineGroup; - } - - public static QuoteQuoteLineGroupsForQuoteItem fromJson(String json) { - QuoteQuoteLineGroupsForQuoteItem item = new QuoteQuoteLineGroupsForQuoteItem(); - - String __quoteLineGroupJson = JsonUtil.getObject(json, "quote_line_group"); - if (__quoteLineGroupJson != null) { - item.quoteLineGroup = QuoteLineGroup.fromJson(__quoteLineGroupJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/quote/QuoteRetrieveResponse.java deleted file mode 100644 index 6dae5314..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteRetrieveResponse.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.chargebee.v4.core.responses.quote; - -import com.chargebee.v4.core.models.quote.Quote; - -import com.chargebee.v4.core.models.quotedSubscription.QuotedSubscription; - -import com.chargebee.v4.core.models.quotedCharge.QuotedCharge; - -import com.chargebee.v4.core.models.quotedRamp.QuotedRamp; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for QuoteRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class QuoteRetrieveResponse extends BaseResponse { - private final Quote quote; - - private final QuotedSubscription quotedSubscription; - - private final QuotedCharge quotedCharge; - - private final QuotedRamp quotedRamp; - - private QuoteRetrieveResponse( - Quote quote, - QuotedSubscription quotedSubscription, - QuotedCharge quotedCharge, - QuotedRamp quotedRamp, - Response httpResponse) { - super(httpResponse); - - this.quote = quote; - - this.quotedSubscription = quotedSubscription; - - this.quotedCharge = quotedCharge; - - this.quotedRamp = quotedRamp; - } - - /** Parse JSON response into QuoteRetrieveResponse object. */ - public static QuoteRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into QuoteRetrieveResponse object with HTTP response. */ - public static QuoteRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Quote quote = Quote.fromJson(JsonUtil.getObject(json, "quote")); - - QuotedSubscription quotedSubscription = - QuotedSubscription.fromJson(JsonUtil.getObject(json, "quoted_subscription")); - - QuotedCharge quotedCharge = QuotedCharge.fromJson(JsonUtil.getObject(json, "quoted_charge")); - - QuotedRamp quotedRamp = QuotedRamp.fromJson(JsonUtil.getObject(json, "quoted_ramp")); - - return new QuoteRetrieveResponse( - quote, quotedSubscription, quotedCharge, quotedRamp, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse QuoteRetrieveResponse from JSON", e); - } - } - - /** Get the quote from the response. */ - public Quote getQuote() { - return quote; - } - - /** Get the quotedSubscription from the response. */ - public QuotedSubscription getQuotedSubscription() { - return quotedSubscription; - } - - /** Get the quotedCharge from the response. */ - public QuotedCharge getQuotedCharge() { - return quotedCharge; - } - - /** Get the quotedRamp from the response. */ - public QuotedRamp getQuotedRamp() { - return quotedRamp; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteUpdateSubscriptionQuoteForItemsResponse.java b/src/main/java/com/chargebee/v4/core/responses/quote/QuoteUpdateSubscriptionQuoteForItemsResponse.java deleted file mode 100644 index b5766c29..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteUpdateSubscriptionQuoteForItemsResponse.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.chargebee.v4.core.responses.quote; - -import com.chargebee.v4.core.models.quote.Quote; - -import com.chargebee.v4.core.models.quotedRamp.QuotedRamp; - -import com.chargebee.v4.core.models.quotedSubscription.QuotedSubscription; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for QuoteUpdateSubscriptionQuoteForItems operation. Contains the - * response data from the API. - */ -public final class QuoteUpdateSubscriptionQuoteForItemsResponse extends BaseResponse { - private final Quote quote; - - private final QuotedSubscription quotedSubscription; - - private final QuotedRamp quotedRamp; - - private QuoteUpdateSubscriptionQuoteForItemsResponse(Builder builder) { - super(builder.httpResponse); - - this.quote = builder.quote; - - this.quotedSubscription = builder.quotedSubscription; - - this.quotedRamp = builder.quotedRamp; - } - - /** Parse JSON response into QuoteUpdateSubscriptionQuoteForItemsResponse object. */ - public static QuoteUpdateSubscriptionQuoteForItemsResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into QuoteUpdateSubscriptionQuoteForItemsResponse object with HTTP - * response. - */ - public static QuoteUpdateSubscriptionQuoteForItemsResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __quoteJson = JsonUtil.getObject(json, "quote"); - if (__quoteJson != null) { - builder.quote(Quote.fromJson(__quoteJson)); - } - - String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); - if (__quotedSubscriptionJson != null) { - builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); - } - - String __quotedRampJson = JsonUtil.getObject(json, "quoted_ramp"); - if (__quotedRampJson != null) { - builder.quotedRamp(QuotedRamp.fromJson(__quotedRampJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse QuoteUpdateSubscriptionQuoteForItemsResponse from JSON", e); - } - } - - /** Create a new builder for QuoteUpdateSubscriptionQuoteForItemsResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for QuoteUpdateSubscriptionQuoteForItemsResponse. */ - public static class Builder { - - private Quote quote; - - private QuotedSubscription quotedSubscription; - - private QuotedRamp quotedRamp; - - private Response httpResponse; - - private Builder() {} - - public Builder quote(Quote quote) { - this.quote = quote; - return this; - } - - public Builder quotedSubscription(QuotedSubscription quotedSubscription) { - this.quotedSubscription = quotedSubscription; - return this; - } - - public Builder quotedRamp(QuotedRamp quotedRamp) { - this.quotedRamp = quotedRamp; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public QuoteUpdateSubscriptionQuoteForItemsResponse build() { - return new QuoteUpdateSubscriptionQuoteForItemsResponse(this); - } - } - - /** Get the quote from the response. */ - public Quote getQuote() { - return quote; - } - - /** Get the quotedSubscription from the response. */ - public QuotedSubscription getQuotedSubscription() { - return quotedSubscription; - } - - /** Get the quotedRamp from the response. */ - public QuotedRamp getQuotedRamp() { - return quotedRamp; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteUpdateSubscriptionQuoteResponse.java b/src/main/java/com/chargebee/v4/core/responses/quote/QuoteUpdateSubscriptionQuoteResponse.java deleted file mode 100644 index 88526bfc..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteUpdateSubscriptionQuoteResponse.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.chargebee.v4.core.responses.quote; - -import com.chargebee.v4.core.models.quote.Quote; - -import com.chargebee.v4.core.models.quotedSubscription.QuotedSubscription; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for QuoteUpdateSubscriptionQuote operation. Contains the response data - * from the API. - */ -public final class QuoteUpdateSubscriptionQuoteResponse extends BaseResponse { - private final Quote quote; - - private final QuotedSubscription quotedSubscription; - - private QuoteUpdateSubscriptionQuoteResponse(Builder builder) { - super(builder.httpResponse); - - this.quote = builder.quote; - - this.quotedSubscription = builder.quotedSubscription; - } - - /** Parse JSON response into QuoteUpdateSubscriptionQuoteResponse object. */ - public static QuoteUpdateSubscriptionQuoteResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into QuoteUpdateSubscriptionQuoteResponse object with HTTP response. */ - public static QuoteUpdateSubscriptionQuoteResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __quoteJson = JsonUtil.getObject(json, "quote"); - if (__quoteJson != null) { - builder.quote(Quote.fromJson(__quoteJson)); - } - - String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); - if (__quotedSubscriptionJson != null) { - builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse QuoteUpdateSubscriptionQuoteResponse from JSON", e); - } - } - - /** Create a new builder for QuoteUpdateSubscriptionQuoteResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for QuoteUpdateSubscriptionQuoteResponse. */ - public static class Builder { - - private Quote quote; - - private QuotedSubscription quotedSubscription; - - private Response httpResponse; - - private Builder() {} - - public Builder quote(Quote quote) { - this.quote = quote; - return this; - } - - public Builder quotedSubscription(QuotedSubscription quotedSubscription) { - this.quotedSubscription = quotedSubscription; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public QuoteUpdateSubscriptionQuoteResponse build() { - return new QuoteUpdateSubscriptionQuoteResponse(this); - } - } - - /** Get the quote from the response. */ - public Quote getQuote() { - return quote; - } - - /** Get the quotedSubscription from the response. */ - public QuotedSubscription getQuotedSubscription() { - return quotedSubscription; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/ramp/RampRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/ramp/RampRetrieveResponse.java deleted file mode 100644 index 4caa84e1..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/ramp/RampRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.ramp; - -import com.chargebee.v4.core.models.ramp.Ramp; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for RampRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class RampRetrieveResponse extends BaseResponse { - private final Ramp ramp; - - private RampRetrieveResponse(Ramp ramp, Response httpResponse) { - super(httpResponse); - - this.ramp = ramp; - } - - /** Parse JSON response into RampRetrieveResponse object. */ - public static RampRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into RampRetrieveResponse object with HTTP response. */ - public static RampRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Ramp ramp = Ramp.fromJson(JsonUtil.getObject(json, "ramp")); - - return new RampRetrieveResponse(ramp, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse RampRetrieveResponse from JSON", e); - } - } - - /** Get the ramp from the response. */ - public Ramp getRamp() { - return ramp; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/recordedPurchase/RecordedPurchaseRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/recordedPurchase/RecordedPurchaseRetrieveResponse.java deleted file mode 100644 index 053ddee4..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/recordedPurchase/RecordedPurchaseRetrieveResponse.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.chargebee.v4.core.responses.recordedPurchase; - -import com.chargebee.v4.core.models.recordedPurchase.RecordedPurchase; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for RecordedPurchaseRetrieve operation. Contains the response data from - * a single resource get operation. - */ -public final class RecordedPurchaseRetrieveResponse extends BaseResponse { - private final RecordedPurchase recordedPurchase; - - private RecordedPurchaseRetrieveResponse( - RecordedPurchase recordedPurchase, Response httpResponse) { - super(httpResponse); - - this.recordedPurchase = recordedPurchase; - } - - /** Parse JSON response into RecordedPurchaseRetrieveResponse object. */ - public static RecordedPurchaseRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into RecordedPurchaseRetrieveResponse object with HTTP response. */ - public static RecordedPurchaseRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - RecordedPurchase recordedPurchase = - RecordedPurchase.fromJson(JsonUtil.getObject(json, "recorded_purchase")); - - return new RecordedPurchaseRetrieveResponse(recordedPurchase, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse RecordedPurchaseRetrieveResponse from JSON", e); - } - } - - /** Get the recordedPurchase from the response. */ - public RecordedPurchase getRecordedPurchase() { - return recordedPurchase; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/resourceMigration/ResourceMigrationRetrieveLatestResponse.java b/src/main/java/com/chargebee/v4/core/responses/resourceMigration/ResourceMigrationRetrieveLatestResponse.java deleted file mode 100644 index d043e11f..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/resourceMigration/ResourceMigrationRetrieveLatestResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.chargebee.v4.core.responses.resourceMigration; - -import com.chargebee.v4.core.models.resourceMigration.ResourceMigration; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for ResourceMigrationRetrieveLatest operation. Contains the response - * data from a single resource get operation. - */ -public final class ResourceMigrationRetrieveLatestResponse extends BaseResponse { - private final ResourceMigration resourceMigration; - - private ResourceMigrationRetrieveLatestResponse( - ResourceMigration resourceMigration, Response httpResponse) { - super(httpResponse); - - this.resourceMigration = resourceMigration; - } - - /** Parse JSON response into ResourceMigrationRetrieveLatestResponse object. */ - public static ResourceMigrationRetrieveLatestResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into ResourceMigrationRetrieveLatestResponse object with HTTP response. */ - public static ResourceMigrationRetrieveLatestResponse fromJson( - String json, Response httpResponse) { - try { - - ResourceMigration resourceMigration = - ResourceMigration.fromJson(JsonUtil.getObject(json, "resource_migration")); - - return new ResourceMigrationRetrieveLatestResponse(resourceMigration, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse ResourceMigrationRetrieveLatestResponse from JSON", e); - } - } - - /** Get the resourceMigration from the response. */ - public ResourceMigration getResourceMigration() { - return resourceMigration; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/rule/RuleRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/rule/RuleRetrieveResponse.java deleted file mode 100644 index 36eb31d2..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/rule/RuleRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.rule; - -import com.chargebee.v4.core.models.rule.Rule; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for RuleRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class RuleRetrieveResponse extends BaseResponse { - private final Rule rule; - - private RuleRetrieveResponse(Rule rule, Response httpResponse) { - super(httpResponse); - - this.rule = rule; - } - - /** Parse JSON response into RuleRetrieveResponse object. */ - public static RuleRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into RuleRetrieveResponse object with HTTP response. */ - public static RuleRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Rule rule = Rule.fromJson(JsonUtil.getObject(json, "rule")); - - return new RuleRetrieveResponse(rule, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse RuleRetrieveResponse from JSON", e); - } - } - - /** Get the rule from the response. */ - public Rule getRule() { - return rule; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionContractTermsForSubscriptionResponse.java b/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionContractTermsForSubscriptionResponse.java deleted file mode 100644 index 0ab502f6..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionContractTermsForSubscriptionResponse.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.chargebee.v4.core.responses.subscription; - -import java.util.List; - -import com.chargebee.v4.core.models.contractTerm.ContractTerm; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.SubscriptionService; -import com.chargebee.v4.core.models.subscription.params.SubscriptionContractTermsForSubscriptionParams; - -/** - * Immutable response object for SubscriptionContractTermsForSubscription operation. Contains - * paginated list data. - */ -public final class SubscriptionContractTermsForSubscriptionResponse { - - private final List list; - - private final String nextOffset; - - private final String subscriptionId; - - private final SubscriptionService service; - private final SubscriptionContractTermsForSubscriptionParams originalParams; - private final Response httpResponse; - - private SubscriptionContractTermsForSubscriptionResponse( - List list, - String nextOffset, - String subscriptionId, - SubscriptionService service, - SubscriptionContractTermsForSubscriptionParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.subscriptionId = subscriptionId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into SubscriptionContractTermsForSubscriptionResponse object (no service - * context). Use this when you only need to read a single page (no nextPage()). - */ - public static SubscriptionContractTermsForSubscriptionResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(SubscriptionContractTermsForSubscriptionItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new SubscriptionContractTermsForSubscriptionResponse( - list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse SubscriptionContractTermsForSubscriptionResponse from JSON", e); - } - } - - /** - * Parse JSON response into SubscriptionContractTermsForSubscriptionResponse object with service - * context for pagination (enables nextPage()). - */ - public static SubscriptionContractTermsForSubscriptionResponse fromJson( - String json, - SubscriptionService service, - SubscriptionContractTermsForSubscriptionParams originalParams, - String subscriptionId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(SubscriptionContractTermsForSubscriptionItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new SubscriptionContractTermsForSubscriptionResponse( - list, nextOffset, subscriptionId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse SubscriptionContractTermsForSubscriptionResponse 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 SubscriptionContractTermsForSubscriptionResponse 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)."); - } - - SubscriptionContractTermsForSubscriptionParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : SubscriptionContractTermsForSubscriptionParams.builder()) - .offset(nextOffset) - .build(); - - return service.contractTermsForSubscription(subscriptionId, 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 SubscriptionContractTermsForSubscriptionItem { - - private ContractTerm contractTerm; - - public ContractTerm getContractTerm() { - return contractTerm; - } - - public static SubscriptionContractTermsForSubscriptionItem fromJson(String json) { - SubscriptionContractTermsForSubscriptionItem item = - new SubscriptionContractTermsForSubscriptionItem(); - - String __contractTermJson = JsonUtil.getObject(json, "contract_term"); - if (__contractTermJson != null) { - item.contractTerm = ContractTerm.fromJson(__contractTermJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionImportSubscriptionResponse.java b/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionImportSubscriptionResponse.java deleted file mode 100644 index 2cb9b4fc..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionImportSubscriptionResponse.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.chargebee.v4.core.responses.subscription; - -import com.chargebee.v4.core.models.invoice.Invoice; - -import com.chargebee.v4.core.models.customer.Customer; - -import com.chargebee.v4.core.models.subscription.Subscription; - -import com.chargebee.v4.core.models.card.Card; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for SubscriptionImportSubscription operation. Contains the response - * data from the API. - */ -public final class SubscriptionImportSubscriptionResponse extends BaseResponse { - private final Subscription subscription; - - private final Customer customer; - - private final Card card; - - private final Invoice invoice; - - private SubscriptionImportSubscriptionResponse(Builder builder) { - super(builder.httpResponse); - - this.subscription = builder.subscription; - - this.customer = builder.customer; - - this.card = builder.card; - - this.invoice = builder.invoice; - } - - /** Parse JSON response into SubscriptionImportSubscriptionResponse object. */ - public static SubscriptionImportSubscriptionResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into SubscriptionImportSubscriptionResponse object with HTTP response. */ - public static SubscriptionImportSubscriptionResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __subscriptionJson = JsonUtil.getObject(json, "subscription"); - if (__subscriptionJson != null) { - builder.subscription(Subscription.fromJson(__subscriptionJson)); - } - - 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)); - } - - String __invoiceJson = JsonUtil.getObject(json, "invoice"); - if (__invoiceJson != null) { - builder.invoice(Invoice.fromJson(__invoiceJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse SubscriptionImportSubscriptionResponse from JSON", e); - } - } - - /** Create a new builder for SubscriptionImportSubscriptionResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for SubscriptionImportSubscriptionResponse. */ - public static class Builder { - - private Subscription subscription; - - private Customer customer; - - private Card card; - - private Invoice invoice; - - private Response httpResponse; - - private Builder() {} - - public Builder subscription(Subscription subscription) { - this.subscription = subscription; - return this; - } - - public Builder customer(Customer customer) { - this.customer = customer; - return this; - } - - public Builder card(Card card) { - this.card = card; - return this; - } - - public Builder invoice(Invoice invoice) { - this.invoice = invoice; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public SubscriptionImportSubscriptionResponse build() { - return new SubscriptionImportSubscriptionResponse(this); - } - } - - /** Get the subscription from the response. */ - public Subscription getSubscription() { - return subscription; - } - - /** Get the customer from the response. */ - public Customer getCustomer() { - return customer; - } - - /** Get the card from the response. */ - public Card getCard() { - return card; - } - - /** Get the invoice from the response. */ - public Invoice getInvoice() { - return invoice; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRetrieveAdvanceInvoiceScheduleResponse.java b/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRetrieveAdvanceInvoiceScheduleResponse.java deleted file mode 100644 index b8f5ac59..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRetrieveAdvanceInvoiceScheduleResponse.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.chargebee.v4.core.responses.subscription; - -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import java.util.List; - -/** - * Immutable response object for SubscriptionRetrieveAdvanceInvoiceSchedule operation. Contains the - * response data from a single resource get operation. - */ -public final class SubscriptionRetrieveAdvanceInvoiceScheduleResponse extends BaseResponse { - private final List advanceInvoiceSchedules; - - private SubscriptionRetrieveAdvanceInvoiceScheduleResponse( - List advanceInvoiceSchedules, Response httpResponse) { - super(httpResponse); - - this.advanceInvoiceSchedules = advanceInvoiceSchedules; - } - - /** Parse JSON response into SubscriptionRetrieveAdvanceInvoiceScheduleResponse object. */ - public static SubscriptionRetrieveAdvanceInvoiceScheduleResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into SubscriptionRetrieveAdvanceInvoiceScheduleResponse object with HTTP - * response. - */ - public static SubscriptionRetrieveAdvanceInvoiceScheduleResponse fromJson( - String json, Response httpResponse) { - try { - - List advanceInvoiceSchedules = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "advance_invoice_schedules")).stream() - .map(AdvanceInvoiceSchedule::fromJson) - .collect(java.util.stream.Collectors.toList()); - - return new SubscriptionRetrieveAdvanceInvoiceScheduleResponse( - advanceInvoiceSchedules, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse SubscriptionRetrieveAdvanceInvoiceScheduleResponse from JSON", e); - } - } - - /** Get the advanceInvoiceSchedules from the response. */ - public List getAdvanceInvoiceSchedules() { - return advanceInvoiceSchedules; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRetrieveResponse.java deleted file mode 100644 index fbdeb729..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRetrieveResponse.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.chargebee.v4.core.responses.subscription; - -import com.chargebee.v4.core.models.subscription.Subscription; - -import com.chargebee.v4.core.models.customer.Customer; - -import com.chargebee.v4.core.models.card.Card; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for SubscriptionRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class SubscriptionRetrieveResponse extends BaseResponse { - private final Subscription subscription; - - private final Customer customer; - - private final Card card; - - private SubscriptionRetrieveResponse( - Subscription subscription, Customer customer, Card card, Response httpResponse) { - super(httpResponse); - - this.subscription = subscription; - - this.customer = customer; - - this.card = card; - } - - /** Parse JSON response into SubscriptionRetrieveResponse object. */ - public static SubscriptionRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into SubscriptionRetrieveResponse object with HTTP response. */ - public static SubscriptionRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Subscription subscription = Subscription.fromJson(JsonUtil.getObject(json, "subscription")); - - Customer customer = Customer.fromJson(JsonUtil.getObject(json, "customer")); - - Card card = Card.fromJson(JsonUtil.getObject(json, "card")); - - return new SubscriptionRetrieveResponse(subscription, customer, card, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse SubscriptionRetrieveResponse from JSON", e); - } - } - - /** Get the subscription from the response. */ - public Subscription getSubscription() { - return subscription; - } - - /** 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/core/responses/subscription/SubscriptionRetrieveWithScheduledChangesResponse.java b/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRetrieveWithScheduledChangesResponse.java deleted file mode 100644 index 0f783a21..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRetrieveWithScheduledChangesResponse.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.chargebee.v4.core.responses.subscription; - -import com.chargebee.v4.core.models.subscription.Subscription; - -import com.chargebee.v4.core.models.customer.Customer; - -import com.chargebee.v4.core.models.card.Card; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for SubscriptionRetrieveWithScheduledChanges operation. Contains the - * response data from a single resource get operation. - */ -public final class SubscriptionRetrieveWithScheduledChangesResponse extends BaseResponse { - private final Subscription subscription; - - private final Customer customer; - - private final Card card; - - private SubscriptionRetrieveWithScheduledChangesResponse( - Subscription subscription, Customer customer, Card card, Response httpResponse) { - super(httpResponse); - - this.subscription = subscription; - - this.customer = customer; - - this.card = card; - } - - /** Parse JSON response into SubscriptionRetrieveWithScheduledChangesResponse object. */ - public static SubscriptionRetrieveWithScheduledChangesResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into SubscriptionRetrieveWithScheduledChangesResponse object with HTTP - * response. - */ - public static SubscriptionRetrieveWithScheduledChangesResponse fromJson( - String json, Response httpResponse) { - try { - - Subscription subscription = Subscription.fromJson(JsonUtil.getObject(json, "subscription")); - - Customer customer = Customer.fromJson(JsonUtil.getObject(json, "customer")); - - Card card = Card.fromJson(JsonUtil.getObject(json, "card")); - - return new SubscriptionRetrieveWithScheduledChangesResponse( - subscription, customer, card, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse SubscriptionRetrieveWithScheduledChangesResponse from JSON", e); - } - } - - /** Get the subscription from the response. */ - public Subscription getSubscription() { - return subscription; - } - - /** 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/core/responses/subscription/SubscriptionSubscriptionsForCustomerResponse.java b/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionSubscriptionsForCustomerResponse.java deleted file mode 100644 index 297f3b90..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionSubscriptionsForCustomerResponse.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.chargebee.v4.core.responses.subscription; - -import java.util.List; - -import com.chargebee.v4.core.models.subscription.Subscription; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.SubscriptionService; -import com.chargebee.v4.core.models.subscription.params.SubscriptionSubscriptionsForCustomerParams; - -/** - * Immutable response object for SubscriptionSubscriptionsForCustomer operation. Contains paginated - * list data. - */ -public final class SubscriptionSubscriptionsForCustomerResponse { - - private final List list; - - private final String nextOffset; - - private final String customerId; - - private final SubscriptionService service; - private final SubscriptionSubscriptionsForCustomerParams originalParams; - private final Response httpResponse; - - private SubscriptionSubscriptionsForCustomerResponse( - List list, - String nextOffset, - String customerId, - SubscriptionService service, - SubscriptionSubscriptionsForCustomerParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.customerId = customerId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into SubscriptionSubscriptionsForCustomerResponse object (no service - * context). Use this when you only need to read a single page (no nextPage()). - */ - public static SubscriptionSubscriptionsForCustomerResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(SubscriptionSubscriptionsForCustomerItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new SubscriptionSubscriptionsForCustomerResponse( - list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse SubscriptionSubscriptionsForCustomerResponse from JSON", e); - } - } - - /** - * Parse JSON response into SubscriptionSubscriptionsForCustomerResponse object with service - * context for pagination (enables nextPage()). - */ - public static SubscriptionSubscriptionsForCustomerResponse fromJson( - String json, - SubscriptionService service, - SubscriptionSubscriptionsForCustomerParams originalParams, - String customerId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(SubscriptionSubscriptionsForCustomerItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new SubscriptionSubscriptionsForCustomerResponse( - list, nextOffset, customerId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse SubscriptionSubscriptionsForCustomerResponse 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 SubscriptionSubscriptionsForCustomerResponse 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)."); - } - - SubscriptionSubscriptionsForCustomerParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : SubscriptionSubscriptionsForCustomerParams.builder()) - .offset(nextOffset) - .build(); - - return service.subscriptionsForCustomer(customerId, 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 SubscriptionSubscriptionsForCustomerItem { - - private Subscription subscription; - - public Subscription getSubscription() { - return subscription; - } - - public static SubscriptionSubscriptionsForCustomerItem fromJson(String json) { - SubscriptionSubscriptionsForCustomerItem item = - new SubscriptionSubscriptionsForCustomerItem(); - - String __subscriptionJson = JsonUtil.getObject(json, "subscription"); - if (__subscriptionJson != null) { - item.subscription = Subscription.fromJson(__subscriptionJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/subscriptionEntitlement/SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse.java b/src/main/java/com/chargebee/v4/core/responses/subscriptionEntitlement/SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse.java deleted file mode 100644 index f65aebd3..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/subscriptionEntitlement/SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.chargebee.v4.core.responses.subscriptionEntitlement; - -import java.util.List; - -import com.chargebee.v4.core.models.subscriptionEntitlement.SubscriptionEntitlement; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for SubscriptionEntitlementSetSubscriptionEntitlementAvailability - * operation. Contains the response data from the API. - */ -public final class SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse - extends BaseResponse { - private final List list; - - private SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse(Builder builder) { - super(builder.httpResponse); - - this.list = builder.list; - } - - /** - * Parse JSON response into SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse - * object. - */ - public static SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse fromJson( - String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse - * object with HTTP response. - */ - public static SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - builder.list( - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(SubscriptionEntitlement::fromJson) - .collect(java.util.stream.Collectors.toList())); - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse from JSON", - e); - } - } - - /** - * Create a new builder for SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse. - */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse. */ - public static class Builder { - - private List list; - - private Response httpResponse; - - private Builder() {} - - public Builder list(List list) { - this.list = list; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse build() { - return new SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse(this); - } - } - - /** Get the list from the response. */ - public List getList() { - return list; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/subscriptionEntitlement/SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse.java b/src/main/java/com/chargebee/v4/core/responses/subscriptionEntitlement/SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse.java deleted file mode 100644 index dd7089c7..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/subscriptionEntitlement/SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.chargebee.v4.core.responses.subscriptionEntitlement; - -import java.util.List; - -import com.chargebee.v4.core.models.subscriptionEntitlement.SubscriptionEntitlement; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.SubscriptionEntitlementService; -import com.chargebee.v4.core.models.subscriptionEntitlement.params.SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams; - -/** - * Immutable response object for SubscriptionEntitlementSubscriptionEntitlementsForSubscription - * operation. Contains paginated list data. - */ -public final class SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse { - - private final List list; - - private final String nextOffset; - - private final String subscriptionId; - - private final SubscriptionEntitlementService service; - private final SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams originalParams; - private final Response httpResponse; - - private SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse( - List list, - String nextOffset, - String subscriptionId, - SubscriptionEntitlementService service, - SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.subscriptionId = subscriptionId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse - * object (no service context). Use this when you only need to read a single page (no nextPage()). - */ - public static SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse fromJson( - String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse( - list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse from JSON", - e); - } - } - - /** - * Parse JSON response into SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse - * object with service context for pagination (enables nextPage()). - */ - public static SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse fromJson( - String json, - SubscriptionEntitlementService service, - SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams originalParams, - String subscriptionId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse( - list, nextOffset, subscriptionId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse 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 SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse 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)."); - } - - SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams.builder()) - .offset(nextOffset) - .build(); - - return service.subscriptionEntitlementsForSubscription(subscriptionId, 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 SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionItem { - - private SubscriptionEntitlement subscriptionEntitlement; - - public SubscriptionEntitlement getSubscriptionEntitlement() { - return subscriptionEntitlement; - } - - public static SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionItem fromJson( - String json) { - SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionItem item = - new SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionItem(); - - String __subscriptionEntitlementJson = JsonUtil.getObject(json, "subscription_entitlement"); - if (__subscriptionEntitlementJson != null) { - item.subscriptionEntitlement = - SubscriptionEntitlement.fromJson(__subscriptionEntitlementJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/subscriptionSetting/SubscriptionSettingRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/subscriptionSetting/SubscriptionSettingRetrieveResponse.java deleted file mode 100644 index 1a9d7d12..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/subscriptionSetting/SubscriptionSettingRetrieveResponse.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.chargebee.v4.core.responses.subscriptionSetting; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for SubscriptionSettingRetrieve operation. Contains the response data - * from a single resource get operation. - */ -public final class SubscriptionSettingRetrieveResponse extends BaseResponse { - private final Object subscriptionSetting; - - private SubscriptionSettingRetrieveResponse(Object subscriptionSetting, Response httpResponse) { - super(httpResponse); - - this.subscriptionSetting = subscriptionSetting; - } - - /** Parse JSON response into SubscriptionSettingRetrieveResponse object. */ - public static SubscriptionSettingRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into SubscriptionSettingRetrieveResponse object with HTTP response. */ - public static SubscriptionSettingRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Object subscriptionSetting = JsonUtil.getObject(json, "subscription_setting"); - - return new SubscriptionSettingRetrieveResponse(subscriptionSetting, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse SubscriptionSettingRetrieveResponse from JSON", e); - } - } - - /** Get the subscriptionSetting from the response. */ - public Object getSubscriptionSetting() { - return subscriptionSetting; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/thirdPartyConfiguration/ThirdPartyConfigurationConfigurationsResponse.java b/src/main/java/com/chargebee/v4/core/responses/thirdPartyConfiguration/ThirdPartyConfigurationConfigurationsResponse.java deleted file mode 100644 index bced60d5..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/thirdPartyConfiguration/ThirdPartyConfigurationConfigurationsResponse.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.chargebee.v4.core.responses.thirdPartyConfiguration; - -import com.chargebee.v4.core.models.thirdPartyConfiguration.ThirdPartyConfiguration; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for ThirdPartyConfigurationConfigurations operation. Contains the - * response data from a single resource get operation. - */ -public final class ThirdPartyConfigurationConfigurationsResponse extends BaseResponse { - private final ThirdPartyConfiguration thirdPartyConfiguration; - - private ThirdPartyConfigurationConfigurationsResponse( - ThirdPartyConfiguration thirdPartyConfiguration, Response httpResponse) { - super(httpResponse); - - this.thirdPartyConfiguration = thirdPartyConfiguration; - } - - /** Parse JSON response into ThirdPartyConfigurationConfigurationsResponse object. */ - public static ThirdPartyConfigurationConfigurationsResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into ThirdPartyConfigurationConfigurationsResponse object with HTTP - * response. - */ - public static ThirdPartyConfigurationConfigurationsResponse fromJson( - String json, Response httpResponse) { - try { - - ThirdPartyConfiguration thirdPartyConfiguration = - ThirdPartyConfiguration.fromJson(JsonUtil.getObject(json, "third_party_configuration")); - - return new ThirdPartyConfigurationConfigurationsResponse( - thirdPartyConfiguration, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse ThirdPartyConfigurationConfigurationsResponse from JSON", e); - } - } - - /** Get the thirdPartyConfiguration from the response. */ - public ThirdPartyConfiguration getThirdPartyConfiguration() { - return thirdPartyConfiguration; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/thirdPartyConfiguration/ThirdPartyConfigurationRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/thirdPartyConfiguration/ThirdPartyConfigurationRetrieveResponse.java deleted file mode 100644 index b783d4ae..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/thirdPartyConfiguration/ThirdPartyConfigurationRetrieveResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.chargebee.v4.core.responses.thirdPartyConfiguration; - -import com.chargebee.v4.core.models.thirdPartyConfiguration.ThirdPartyConfiguration; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for ThirdPartyConfigurationRetrieve operation. Contains the response - * data from a single resource get operation. - */ -public final class ThirdPartyConfigurationRetrieveResponse extends BaseResponse { - private final ThirdPartyConfiguration thirdPartyConfiguration; - - private ThirdPartyConfigurationRetrieveResponse( - ThirdPartyConfiguration thirdPartyConfiguration, Response httpResponse) { - super(httpResponse); - - this.thirdPartyConfiguration = thirdPartyConfiguration; - } - - /** Parse JSON response into ThirdPartyConfigurationRetrieveResponse object. */ - public static ThirdPartyConfigurationRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into ThirdPartyConfigurationRetrieveResponse object with HTTP response. */ - public static ThirdPartyConfigurationRetrieveResponse fromJson( - String json, Response httpResponse) { - try { - - ThirdPartyConfiguration thirdPartyConfiguration = - ThirdPartyConfiguration.fromJson(JsonUtil.getObject(json, "third_party_configuration")); - - return new ThirdPartyConfigurationRetrieveResponse(thirdPartyConfiguration, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse ThirdPartyConfigurationRetrieveResponse from JSON", e); - } - } - - /** Get the thirdPartyConfiguration from the response. */ - public ThirdPartyConfiguration getThirdPartyConfiguration() { - return thirdPartyConfiguration; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/thirdPartyEntityMapping/ThirdPartyEntityMappingListAllResponse.java b/src/main/java/com/chargebee/v4/core/responses/thirdPartyEntityMapping/ThirdPartyEntityMappingListAllResponse.java deleted file mode 100644 index a5b969c7..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/thirdPartyEntityMapping/ThirdPartyEntityMappingListAllResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.chargebee.v4.core.responses.thirdPartyEntityMapping; - -import com.chargebee.v4.core.models.thirdPartyEntityMapping.ThirdPartyEntityMapping; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for ThirdPartyEntityMappingListAll operation. Contains the response - * data from a single resource get operation. - */ -public final class ThirdPartyEntityMappingListAllResponse extends BaseResponse { - private final ThirdPartyEntityMapping thirdPartyEntityMapping; - - private ThirdPartyEntityMappingListAllResponse( - ThirdPartyEntityMapping thirdPartyEntityMapping, Response httpResponse) { - super(httpResponse); - - this.thirdPartyEntityMapping = thirdPartyEntityMapping; - } - - /** Parse JSON response into ThirdPartyEntityMappingListAllResponse object. */ - public static ThirdPartyEntityMappingListAllResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into ThirdPartyEntityMappingListAllResponse object with HTTP response. */ - public static ThirdPartyEntityMappingListAllResponse fromJson( - String json, Response httpResponse) { - try { - - ThirdPartyEntityMapping thirdPartyEntityMapping = - ThirdPartyEntityMapping.fromJson(JsonUtil.getObject(json, "third_party_entity_mapping")); - - return new ThirdPartyEntityMappingListAllResponse(thirdPartyEntityMapping, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse ThirdPartyEntityMappingListAllResponse from JSON", e); - } - } - - /** Get the thirdPartyEntityMapping from the response. */ - public ThirdPartyEntityMapping getThirdPartyEntityMapping() { - return thirdPartyEntityMapping; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/thirdPartyEntityMapping/ThirdPartyEntityMappingRetrieveEntityResponse.java b/src/main/java/com/chargebee/v4/core/responses/thirdPartyEntityMapping/ThirdPartyEntityMappingRetrieveEntityResponse.java deleted file mode 100644 index f86095e5..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/thirdPartyEntityMapping/ThirdPartyEntityMappingRetrieveEntityResponse.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.chargebee.v4.core.responses.thirdPartyEntityMapping; - -import com.chargebee.v4.core.models.thirdPartyEntityMapping.ThirdPartyEntityMapping; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for ThirdPartyEntityMappingRetrieveEntity operation. Contains the - * response data from a single resource get operation. - */ -public final class ThirdPartyEntityMappingRetrieveEntityResponse extends BaseResponse { - private final ThirdPartyEntityMapping thirdPartyEntityMapping; - - private ThirdPartyEntityMappingRetrieveEntityResponse( - ThirdPartyEntityMapping thirdPartyEntityMapping, Response httpResponse) { - super(httpResponse); - - this.thirdPartyEntityMapping = thirdPartyEntityMapping; - } - - /** Parse JSON response into ThirdPartyEntityMappingRetrieveEntityResponse object. */ - public static ThirdPartyEntityMappingRetrieveEntityResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into ThirdPartyEntityMappingRetrieveEntityResponse object with HTTP - * response. - */ - public static ThirdPartyEntityMappingRetrieveEntityResponse fromJson( - String json, Response httpResponse) { - try { - - ThirdPartyEntityMapping thirdPartyEntityMapping = - ThirdPartyEntityMapping.fromJson(JsonUtil.getObject(json, "third_party_entity_mapping")); - - return new ThirdPartyEntityMappingRetrieveEntityResponse( - thirdPartyEntityMapping, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse ThirdPartyEntityMappingRetrieveEntityResponse from JSON", e); - } - } - - /** Get the thirdPartyEntityMapping from the response. */ - public ThirdPartyEntityMapping getThirdPartyEntityMapping() { - return thirdPartyEntityMapping; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/thirdPartySyncDetail/ThirdPartySyncDetailRetrieveLatestSyncResponse.java b/src/main/java/com/chargebee/v4/core/responses/thirdPartySyncDetail/ThirdPartySyncDetailRetrieveLatestSyncResponse.java deleted file mode 100644 index 3ff377bd..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/thirdPartySyncDetail/ThirdPartySyncDetailRetrieveLatestSyncResponse.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.chargebee.v4.core.responses.thirdPartySyncDetail; - -import com.chargebee.v4.core.models.thirdPartySyncDetail.ThirdPartySyncDetail; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for ThirdPartySyncDetailRetrieveLatestSync operation. Contains the - * response data from a single resource get operation. - */ -public final class ThirdPartySyncDetailRetrieveLatestSyncResponse extends BaseResponse { - private final ThirdPartySyncDetail thirdPartySyncDetail; - - private ThirdPartySyncDetailRetrieveLatestSyncResponse( - ThirdPartySyncDetail thirdPartySyncDetail, Response httpResponse) { - super(httpResponse); - - this.thirdPartySyncDetail = thirdPartySyncDetail; - } - - /** Parse JSON response into ThirdPartySyncDetailRetrieveLatestSyncResponse object. */ - public static ThirdPartySyncDetailRetrieveLatestSyncResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into ThirdPartySyncDetailRetrieveLatestSyncResponse object with HTTP - * response. - */ - public static ThirdPartySyncDetailRetrieveLatestSyncResponse fromJson( - String json, Response httpResponse) { - try { - - ThirdPartySyncDetail thirdPartySyncDetail = - ThirdPartySyncDetail.fromJson(JsonUtil.getObject(json, "third_party_sync_detail")); - - return new ThirdPartySyncDetailRetrieveLatestSyncResponse(thirdPartySyncDetail, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse ThirdPartySyncDetailRetrieveLatestSyncResponse from JSON", e); - } - } - - /** Get the thirdPartySyncDetail from the response. */ - public ThirdPartySyncDetail getThirdPartySyncDetail() { - return thirdPartySyncDetail; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/thirdPartySyncDetail/ThirdPartySyncDetailRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/thirdPartySyncDetail/ThirdPartySyncDetailRetrieveResponse.java deleted file mode 100644 index aac1f7c0..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/thirdPartySyncDetail/ThirdPartySyncDetailRetrieveResponse.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.chargebee.v4.core.responses.thirdPartySyncDetail; - -import com.chargebee.v4.core.models.thirdPartySyncDetail.ThirdPartySyncDetail; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for ThirdPartySyncDetailRetrieve operation. Contains the response data - * from a single resource get operation. - */ -public final class ThirdPartySyncDetailRetrieveResponse extends BaseResponse { - private final ThirdPartySyncDetail thirdPartySyncDetail; - - private ThirdPartySyncDetailRetrieveResponse( - ThirdPartySyncDetail thirdPartySyncDetail, Response httpResponse) { - super(httpResponse); - - this.thirdPartySyncDetail = thirdPartySyncDetail; - } - - /** Parse JSON response into ThirdPartySyncDetailRetrieveResponse object. */ - public static ThirdPartySyncDetailRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into ThirdPartySyncDetailRetrieveResponse object with HTTP response. */ - public static ThirdPartySyncDetailRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - ThirdPartySyncDetail thirdPartySyncDetail = - ThirdPartySyncDetail.fromJson(JsonUtil.getObject(json, "third_party_sync_detail")); - - return new ThirdPartySyncDetailRetrieveResponse(thirdPartySyncDetail, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse ThirdPartySyncDetailRetrieveResponse from JSON", e); - } - } - - /** Get the thirdPartySyncDetail from the response. */ - public ThirdPartySyncDetail getThirdPartySyncDetail() { - return thirdPartySyncDetail; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/timeMachine/TimeMachineRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/timeMachine/TimeMachineRetrieveResponse.java deleted file mode 100644 index 7da73cd1..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/timeMachine/TimeMachineRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.timeMachine; - -import com.chargebee.v4.core.models.timeMachine.TimeMachine; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for TimeMachineRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class TimeMachineRetrieveResponse extends BaseResponse { - private final TimeMachine timeMachine; - - private TimeMachineRetrieveResponse(TimeMachine timeMachine, Response httpResponse) { - super(httpResponse); - - this.timeMachine = timeMachine; - } - - /** Parse JSON response into TimeMachineRetrieveResponse object. */ - public static TimeMachineRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into TimeMachineRetrieveResponse object with HTTP response. */ - public static TimeMachineRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - TimeMachine timeMachine = TimeMachine.fromJson(JsonUtil.getObject(json, "time_machine")); - - return new TimeMachineRetrieveResponse(timeMachine, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse TimeMachineRetrieveResponse from JSON", e); - } - } - - /** Get the timeMachine from the response. */ - public TimeMachine getTimeMachine() { - return timeMachine; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/tpSiteUser/TpSiteUserGuestsForTpSiteUserResponse.java b/src/main/java/com/chargebee/v4/core/responses/tpSiteUser/TpSiteUserGuestsForTpSiteUserResponse.java deleted file mode 100644 index b610bd79..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/tpSiteUser/TpSiteUserGuestsForTpSiteUserResponse.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.chargebee.v4.core.responses.tpSiteUser; - -import java.util.List; - -import com.chargebee.v4.core.models.tpSiteUser.TpSiteUser; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.TpSiteUserService; -import com.chargebee.v4.core.models.tpSiteUser.params.TpSiteUserGuestsForTpSiteUserParams; - -/** - * Immutable response object for TpSiteUserGuestsForTpSiteUser operation. Contains paginated list - * data. - */ -public final class TpSiteUserGuestsForTpSiteUserResponse { - - private final List list; - - private final String nextOffset; - - private final String tpSiteUserDomain; - - private final TpSiteUserService service; - private final TpSiteUserGuestsForTpSiteUserParams originalParams; - private final Response httpResponse; - - private TpSiteUserGuestsForTpSiteUserResponse( - List list, - String nextOffset, - String tpSiteUserDomain, - TpSiteUserService service, - TpSiteUserGuestsForTpSiteUserParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.tpSiteUserDomain = tpSiteUserDomain; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into TpSiteUserGuestsForTpSiteUserResponse object (no service context). Use - * this when you only need to read a single page (no nextPage()). - */ - public static TpSiteUserGuestsForTpSiteUserResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(TpSiteUserGuestsForTpSiteUserItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new TpSiteUserGuestsForTpSiteUserResponse(list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse TpSiteUserGuestsForTpSiteUserResponse from JSON", e); - } - } - - /** - * Parse JSON response into TpSiteUserGuestsForTpSiteUserResponse object with service context for - * pagination (enables nextPage()). - */ - public static TpSiteUserGuestsForTpSiteUserResponse fromJson( - String json, - TpSiteUserService service, - TpSiteUserGuestsForTpSiteUserParams originalParams, - String tpSiteUserDomain, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(TpSiteUserGuestsForTpSiteUserItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new TpSiteUserGuestsForTpSiteUserResponse( - list, nextOffset, tpSiteUserDomain, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse TpSiteUserGuestsForTpSiteUserResponse 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 TpSiteUserGuestsForTpSiteUserResponse 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)."); - } - - TpSiteUserGuestsForTpSiteUserParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : TpSiteUserGuestsForTpSiteUserParams.builder()) - .offset(nextOffset) - .build(); - - return service.guestsForTpSiteUser(tpSiteUserDomain, 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 TpSiteUserGuestsForTpSiteUserItem { - - private TpSiteUser tpSiteUser; - - public TpSiteUser getTpSiteUser() { - return tpSiteUser; - } - - public static TpSiteUserGuestsForTpSiteUserItem fromJson(String json) { - TpSiteUserGuestsForTpSiteUserItem item = new TpSiteUserGuestsForTpSiteUserItem(); - - String __tpSiteUserJson = JsonUtil.getObject(json, "tp_site_user"); - if (__tpSiteUserJson != null) { - item.tpSiteUser = TpSiteUser.fromJson(__tpSiteUserJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/tpSiteUser/TpSiteUserUsersForTpSiteUserResponse.java b/src/main/java/com/chargebee/v4/core/responses/tpSiteUser/TpSiteUserUsersForTpSiteUserResponse.java deleted file mode 100644 index 72d7e3e3..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/tpSiteUser/TpSiteUserUsersForTpSiteUserResponse.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.chargebee.v4.core.responses.tpSiteUser; - -import java.util.List; - -import com.chargebee.v4.core.models.tpSiteUser.TpSiteUser; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.TpSiteUserService; -import com.chargebee.v4.core.models.tpSiteUser.params.TpSiteUserUsersForTpSiteUserParams; - -/** - * Immutable response object for TpSiteUserUsersForTpSiteUser operation. Contains paginated list - * data. - */ -public final class TpSiteUserUsersForTpSiteUserResponse { - - private final List list; - - private final String nextOffset; - - private final String tpSiteUserDomain; - - private final TpSiteUserService service; - private final TpSiteUserUsersForTpSiteUserParams originalParams; - private final Response httpResponse; - - private TpSiteUserUsersForTpSiteUserResponse( - List list, - String nextOffset, - String tpSiteUserDomain, - TpSiteUserService service, - TpSiteUserUsersForTpSiteUserParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.tpSiteUserDomain = tpSiteUserDomain; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into TpSiteUserUsersForTpSiteUserResponse object (no service context). Use - * this when you only need to read a single page (no nextPage()). - */ - public static TpSiteUserUsersForTpSiteUserResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(TpSiteUserUsersForTpSiteUserItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new TpSiteUserUsersForTpSiteUserResponse(list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse TpSiteUserUsersForTpSiteUserResponse from JSON", e); - } - } - - /** - * Parse JSON response into TpSiteUserUsersForTpSiteUserResponse object with service context for - * pagination (enables nextPage()). - */ - public static TpSiteUserUsersForTpSiteUserResponse fromJson( - String json, - TpSiteUserService service, - TpSiteUserUsersForTpSiteUserParams originalParams, - String tpSiteUserDomain, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(TpSiteUserUsersForTpSiteUserItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new TpSiteUserUsersForTpSiteUserResponse( - list, nextOffset, tpSiteUserDomain, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse TpSiteUserUsersForTpSiteUserResponse 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 TpSiteUserUsersForTpSiteUserResponse 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)."); - } - - TpSiteUserUsersForTpSiteUserParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : TpSiteUserUsersForTpSiteUserParams.builder()) - .offset(nextOffset) - .build(); - - return service.usersForTpSiteUser(tpSiteUserDomain, 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 TpSiteUserUsersForTpSiteUserItem { - - private TpSiteUser tpSiteUser; - - public TpSiteUser getTpSiteUser() { - return tpSiteUser; - } - - public static TpSiteUserUsersForTpSiteUserItem fromJson(String json) { - TpSiteUserUsersForTpSiteUserItem item = new TpSiteUserUsersForTpSiteUserItem(); - - String __tpSiteUserJson = JsonUtil.getObject(json, "tp_site_user"); - if (__tpSiteUserJson != null) { - item.tpSiteUser = TpSiteUser.fromJson(__tpSiteUserJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionDeleteOfflineTransactionResponse.java b/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionDeleteOfflineTransactionResponse.java deleted file mode 100644 index 5fd4a4dd..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionDeleteOfflineTransactionResponse.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.chargebee.v4.core.responses.transaction; - -import com.chargebee.v4.core.models.transaction.Transaction; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for TransactionDeleteOfflineTransaction operation. Contains the - * response data from the API. - */ -public final class TransactionDeleteOfflineTransactionResponse extends BaseResponse { - private final Transaction transaction; - - private TransactionDeleteOfflineTransactionResponse(Builder builder) { - super(builder.httpResponse); - - this.transaction = builder.transaction; - } - - /** Parse JSON response into TransactionDeleteOfflineTransactionResponse object. */ - public static TransactionDeleteOfflineTransactionResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into TransactionDeleteOfflineTransactionResponse object with HTTP response. - */ - public static TransactionDeleteOfflineTransactionResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __transactionJson = JsonUtil.getObject(json, "transaction"); - if (__transactionJson != null) { - builder.transaction(Transaction.fromJson(__transactionJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse TransactionDeleteOfflineTransactionResponse from JSON", e); - } - } - - /** Create a new builder for TransactionDeleteOfflineTransactionResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for TransactionDeleteOfflineTransactionResponse. */ - public static class Builder { - - private Transaction transaction; - - private Response httpResponse; - - private Builder() {} - - public Builder transaction(Transaction transaction) { - this.transaction = transaction; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public TransactionDeleteOfflineTransactionResponse build() { - return new TransactionDeleteOfflineTransactionResponse(this); - } - } - - /** Get the transaction from the response. */ - public Transaction getTransaction() { - return transaction; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionRetrieveResponse.java deleted file mode 100644 index 0576dbc0..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.transaction; - -import com.chargebee.v4.core.models.transaction.Transaction; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for TransactionRetrieve operation. Contains the response data from a - * single resource get operation. - */ -public final class TransactionRetrieveResponse extends BaseResponse { - private final Transaction transaction; - - private TransactionRetrieveResponse(Transaction transaction, Response httpResponse) { - super(httpResponse); - - this.transaction = transaction; - } - - /** Parse JSON response into TransactionRetrieveResponse object. */ - public static TransactionRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into TransactionRetrieveResponse object with HTTP response. */ - public static TransactionRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Transaction transaction = Transaction.fromJson(JsonUtil.getObject(json, "transaction")); - - return new TransactionRetrieveResponse(transaction, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse TransactionRetrieveResponse from JSON", e); - } - } - - /** Get the transaction from the response. */ - public Transaction getTransaction() { - return transaction; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionSyncTransactionResponse.java b/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionSyncTransactionResponse.java deleted file mode 100644 index bb4dcbae..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionSyncTransactionResponse.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.chargebee.v4.core.responses.transaction; - -import com.chargebee.v4.core.models.transaction.Transaction; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for TransactionSyncTransaction operation. Contains the response data - * from the API. - */ -public final class TransactionSyncTransactionResponse extends BaseResponse { - private final Transaction transaction; - - private TransactionSyncTransactionResponse(Builder builder) { - super(builder.httpResponse); - - this.transaction = builder.transaction; - } - - /** Parse JSON response into TransactionSyncTransactionResponse object. */ - public static TransactionSyncTransactionResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into TransactionSyncTransactionResponse object with HTTP response. */ - public static TransactionSyncTransactionResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __transactionJson = JsonUtil.getObject(json, "transaction"); - if (__transactionJson != null) { - builder.transaction(Transaction.fromJson(__transactionJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException("Failed to parse TransactionSyncTransactionResponse from JSON", e); - } - } - - /** Create a new builder for TransactionSyncTransactionResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for TransactionSyncTransactionResponse. */ - public static class Builder { - - private Transaction transaction; - - private Response httpResponse; - - private Builder() {} - - public Builder transaction(Transaction transaction) { - this.transaction = transaction; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public TransactionSyncTransactionResponse build() { - return new TransactionSyncTransactionResponse(this); - } - } - - /** Get the transaction from the response. */ - public Transaction getTransaction() { - return transaction; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionTransactionsForCustomerResponse.java b/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionTransactionsForCustomerResponse.java deleted file mode 100644 index 56193705..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionTransactionsForCustomerResponse.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.chargebee.v4.core.responses.transaction; - -import java.util.List; - -import com.chargebee.v4.core.models.transaction.Transaction; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.TransactionService; -import com.chargebee.v4.core.models.transaction.params.TransactionTransactionsForCustomerParams; - -/** - * Immutable response object for TransactionTransactionsForCustomer operation. Contains paginated - * list data. - */ -public final class TransactionTransactionsForCustomerResponse { - - private final List list; - - private final String nextOffset; - - private final String customerId; - - private final TransactionService service; - private final TransactionTransactionsForCustomerParams originalParams; - private final Response httpResponse; - - private TransactionTransactionsForCustomerResponse( - List list, - String nextOffset, - String customerId, - TransactionService service, - TransactionTransactionsForCustomerParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.customerId = customerId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into TransactionTransactionsForCustomerResponse object (no service - * context). Use this when you only need to read a single page (no nextPage()). - */ - public static TransactionTransactionsForCustomerResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(TransactionTransactionsForCustomerItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new TransactionTransactionsForCustomerResponse( - list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse TransactionTransactionsForCustomerResponse from JSON", e); - } - } - - /** - * Parse JSON response into TransactionTransactionsForCustomerResponse object with service context - * for pagination (enables nextPage()). - */ - public static TransactionTransactionsForCustomerResponse fromJson( - String json, - TransactionService service, - TransactionTransactionsForCustomerParams originalParams, - String customerId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(TransactionTransactionsForCustomerItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new TransactionTransactionsForCustomerResponse( - list, nextOffset, customerId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse TransactionTransactionsForCustomerResponse 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 TransactionTransactionsForCustomerResponse 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)."); - } - - TransactionTransactionsForCustomerParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : TransactionTransactionsForCustomerParams.builder()) - .offset(nextOffset) - .build(); - - return service.transactionsForCustomer(customerId, 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 TransactionTransactionsForCustomerItem { - - private Transaction transaction; - - public Transaction getTransaction() { - return transaction; - } - - public static TransactionTransactionsForCustomerItem fromJson(String json) { - TransactionTransactionsForCustomerItem item = new TransactionTransactionsForCustomerItem(); - - String __transactionJson = JsonUtil.getObject(json, "transaction"); - if (__transactionJson != null) { - item.transaction = Transaction.fromJson(__transactionJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionTransactionsForSubscriptionResponse.java b/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionTransactionsForSubscriptionResponse.java deleted file mode 100644 index 6df2c7f9..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionTransactionsForSubscriptionResponse.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.chargebee.v4.core.responses.transaction; - -import java.util.List; - -import com.chargebee.v4.core.models.transaction.Transaction; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.TransactionService; -import com.chargebee.v4.core.models.transaction.params.TransactionTransactionsForSubscriptionParams; - -/** - * Immutable response object for TransactionTransactionsForSubscription operation. Contains - * paginated list data. - */ -public final class TransactionTransactionsForSubscriptionResponse { - - private final List list; - - private final String nextOffset; - - private final String subscriptionId; - - private final TransactionService service; - private final TransactionTransactionsForSubscriptionParams originalParams; - private final Response httpResponse; - - private TransactionTransactionsForSubscriptionResponse( - List list, - String nextOffset, - String subscriptionId, - TransactionService service, - TransactionTransactionsForSubscriptionParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.subscriptionId = subscriptionId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into TransactionTransactionsForSubscriptionResponse object (no service - * context). Use this when you only need to read a single page (no nextPage()). - */ - public static TransactionTransactionsForSubscriptionResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(TransactionTransactionsForSubscriptionItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new TransactionTransactionsForSubscriptionResponse( - list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse TransactionTransactionsForSubscriptionResponse from JSON", e); - } - } - - /** - * Parse JSON response into TransactionTransactionsForSubscriptionResponse object with service - * context for pagination (enables nextPage()). - */ - public static TransactionTransactionsForSubscriptionResponse fromJson( - String json, - TransactionService service, - TransactionTransactionsForSubscriptionParams originalParams, - String subscriptionId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(TransactionTransactionsForSubscriptionItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new TransactionTransactionsForSubscriptionResponse( - list, nextOffset, subscriptionId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse TransactionTransactionsForSubscriptionResponse 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 TransactionTransactionsForSubscriptionResponse 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)."); - } - - TransactionTransactionsForSubscriptionParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : TransactionTransactionsForSubscriptionParams.builder()) - .offset(nextOffset) - .build(); - - return service.transactionsForSubscription(subscriptionId, 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 TransactionTransactionsForSubscriptionItem { - - private Transaction transaction; - - public Transaction getTransaction() { - return transaction; - } - - public static TransactionTransactionsForSubscriptionItem fromJson(String json) { - TransactionTransactionsForSubscriptionItem item = - new TransactionTransactionsForSubscriptionItem(); - - String __transactionJson = JsonUtil.getObject(json, "transaction"); - if (__transactionJson != null) { - item.transaction = Transaction.fromJson(__transactionJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionVoidTransactionResponse.java b/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionVoidTransactionResponse.java deleted file mode 100644 index 672b3bb4..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionVoidTransactionResponse.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.chargebee.v4.core.responses.transaction; - -import com.chargebee.v4.core.models.transaction.Transaction; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for TransactionVoidTransaction operation. Contains the response data - * from the API. - */ -public final class TransactionVoidTransactionResponse extends BaseResponse { - private final Transaction transaction; - - private TransactionVoidTransactionResponse(Builder builder) { - super(builder.httpResponse); - - this.transaction = builder.transaction; - } - - /** Parse JSON response into TransactionVoidTransactionResponse object. */ - public static TransactionVoidTransactionResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into TransactionVoidTransactionResponse object with HTTP response. */ - public static TransactionVoidTransactionResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __transactionJson = JsonUtil.getObject(json, "transaction"); - if (__transactionJson != null) { - builder.transaction(Transaction.fromJson(__transactionJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException("Failed to parse TransactionVoidTransactionResponse from JSON", e); - } - } - - /** Create a new builder for TransactionVoidTransactionResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for TransactionVoidTransactionResponse. */ - public static class Builder { - - private Transaction transaction; - - private Response httpResponse; - - private Builder() {} - - public Builder transaction(Transaction transaction) { - this.transaction = transaction; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public TransactionVoidTransactionResponse build() { - return new TransactionVoidTransactionResponse(this); - } - } - - /** Get the transaction from the response. */ - public Transaction getTransaction() { - return transaction; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeCreateUnbilledChargeResponse.java b/src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeCreateUnbilledChargeResponse.java deleted file mode 100644 index c4587429..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeCreateUnbilledChargeResponse.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.chargebee.v4.core.responses.unbilledCharge; - -import java.util.List; - -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for UnbilledChargeCreateUnbilledCharge operation. Contains the response - * data from the API. - */ -public final class UnbilledChargeCreateUnbilledChargeResponse extends BaseResponse { - private final List unbilledCharges; - - private UnbilledChargeCreateUnbilledChargeResponse(Builder builder) { - super(builder.httpResponse); - - this.unbilledCharges = builder.unbilledCharges; - } - - /** Parse JSON response into UnbilledChargeCreateUnbilledChargeResponse object. */ - public static UnbilledChargeCreateUnbilledChargeResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into UnbilledChargeCreateUnbilledChargeResponse object with HTTP response. - */ - public static UnbilledChargeCreateUnbilledChargeResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - builder.unbilledCharges( - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "unbilled_charges")).stream() - .map(UnbilledCharge::fromJson) - .collect(java.util.stream.Collectors.toList())); - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse UnbilledChargeCreateUnbilledChargeResponse from JSON", e); - } - } - - /** Create a new builder for UnbilledChargeCreateUnbilledChargeResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for UnbilledChargeCreateUnbilledChargeResponse. */ - public static class Builder { - - private List unbilledCharges; - - private Response httpResponse; - - private Builder() {} - - public Builder unbilledCharges(List unbilledCharges) { - this.unbilledCharges = unbilledCharges; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public UnbilledChargeCreateUnbilledChargeResponse build() { - return new UnbilledChargeCreateUnbilledChargeResponse(this); - } - } - - /** Get the unbilledCharges from the response. */ - public List getUnbilledCharges() { - return unbilledCharges; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeInvoiceUnbilledChargesResponse.java b/src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeInvoiceUnbilledChargesResponse.java deleted file mode 100644 index 050b7c68..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeInvoiceUnbilledChargesResponse.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.chargebee.v4.core.responses.unbilledCharge; - -import java.util.List; - -import com.chargebee.v4.core.models.invoice.Invoice; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for UnbilledChargeInvoiceUnbilledCharges operation. Contains the - * response data from the API. - */ -public final class UnbilledChargeInvoiceUnbilledChargesResponse extends BaseResponse { - private final List invoices; - - private UnbilledChargeInvoiceUnbilledChargesResponse(Builder builder) { - super(builder.httpResponse); - - this.invoices = builder.invoices; - } - - /** Parse JSON response into UnbilledChargeInvoiceUnbilledChargesResponse object. */ - public static UnbilledChargeInvoiceUnbilledChargesResponse fromJson(String json) { - return fromJson(json, null); - } - - /** - * Parse JSON response into UnbilledChargeInvoiceUnbilledChargesResponse object with HTTP - * response. - */ - public static UnbilledChargeInvoiceUnbilledChargesResponse fromJson( - String json, Response httpResponse) { - try { - Builder builder = builder(); - - builder.invoices( - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "invoices")).stream() - .map(Invoice::fromJson) - .collect(java.util.stream.Collectors.toList())); - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse UnbilledChargeInvoiceUnbilledChargesResponse from JSON", e); - } - } - - /** Create a new builder for UnbilledChargeInvoiceUnbilledChargesResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for UnbilledChargeInvoiceUnbilledChargesResponse. */ - public static class Builder { - - private List invoices; - - private Response httpResponse; - - private Builder() {} - - public Builder invoices(List invoices) { - this.invoices = invoices; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public UnbilledChargeInvoiceUnbilledChargesResponse build() { - return new UnbilledChargeInvoiceUnbilledChargesResponse(this); - } - } - - /** Get the invoices from the response. */ - public List getInvoices() { - return invoices; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/unbilledChargesSetting/UnbilledChargesSettingRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/unbilledChargesSetting/UnbilledChargesSettingRetrieveResponse.java deleted file mode 100644 index 80b6ee26..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/unbilledChargesSetting/UnbilledChargesSettingRetrieveResponse.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.chargebee.v4.core.responses.unbilledChargesSetting; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for UnbilledChargesSettingRetrieve operation. Contains the response - * data from a single resource get operation. - */ -public final class UnbilledChargesSettingRetrieveResponse extends BaseResponse { - private final Object unbilledChargesSetting; - - private UnbilledChargesSettingRetrieveResponse( - Object unbilledChargesSetting, Response httpResponse) { - super(httpResponse); - - this.unbilledChargesSetting = unbilledChargesSetting; - } - - /** Parse JSON response into UnbilledChargesSettingRetrieveResponse object. */ - public static UnbilledChargesSettingRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into UnbilledChargesSettingRetrieveResponse object with HTTP response. */ - public static UnbilledChargesSettingRetrieveResponse fromJson( - String json, Response httpResponse) { - try { - - Object unbilledChargesSetting = JsonUtil.getObject(json, "unbilled_charges_setting"); - - return new UnbilledChargesSettingRetrieveResponse(unbilledChargesSetting, httpResponse); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse UnbilledChargesSettingRetrieveResponse from JSON", e); - } - } - - /** Get the unbilledChargesSetting from the response. */ - public Object getUnbilledChargesSetting() { - return unbilledChargesSetting; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/usage/UsageRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/usage/UsageRetrieveResponse.java deleted file mode 100644 index f6bc0a38..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/usage/UsageRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.usage; - -import com.chargebee.v4.core.models.usage.Usage; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for UsageRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class UsageRetrieveResponse extends BaseResponse { - private final Usage usage; - - private UsageRetrieveResponse(Usage usage, Response httpResponse) { - super(httpResponse); - - this.usage = usage; - } - - /** Parse JSON response into UsageRetrieveResponse object. */ - public static UsageRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into UsageRetrieveResponse object with HTTP response. */ - public static UsageRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Usage usage = Usage.fromJson(JsonUtil.getObject(json, "usage")); - - return new UsageRetrieveResponse(usage, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse UsageRetrieveResponse from JSON", e); - } - } - - /** Get the usage from the response. */ - public Usage getUsage() { - return usage; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/usageFile/UsageFileProcessingStatusResponse.java b/src/main/java/com/chargebee/v4/core/responses/usageFile/UsageFileProcessingStatusResponse.java deleted file mode 100644 index a35fd950..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/usageFile/UsageFileProcessingStatusResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.usageFile; - -import com.chargebee.v4.core.models.usageFile.UsageFile; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for UsageFileProcessingStatus operation. Contains the response data - * from a single resource get operation. - */ -public final class UsageFileProcessingStatusResponse extends BaseResponse { - private final UsageFile usageFile; - - private UsageFileProcessingStatusResponse(UsageFile usageFile, Response httpResponse) { - super(httpResponse); - - this.usageFile = usageFile; - } - - /** Parse JSON response into UsageFileProcessingStatusResponse object. */ - public static UsageFileProcessingStatusResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into UsageFileProcessingStatusResponse object with HTTP response. */ - public static UsageFileProcessingStatusResponse fromJson(String json, Response httpResponse) { - try { - - UsageFile usageFile = UsageFile.fromJson(JsonUtil.getObject(json, "usage_file")); - - return new UsageFileProcessingStatusResponse(usageFile, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse UsageFileProcessingStatusResponse from JSON", e); - } - } - - /** Get the usageFile from the response. */ - public UsageFile getUsageFile() { - return usageFile; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/variant/VariantCreateProductVariantResponse.java b/src/main/java/com/chargebee/v4/core/responses/variant/VariantCreateProductVariantResponse.java deleted file mode 100644 index 834b141b..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/variant/VariantCreateProductVariantResponse.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.chargebee.v4.core.responses.variant; - -import com.chargebee.v4.core.models.variant.Variant; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for VariantCreateProductVariant operation. Contains the response data - * from the API. - */ -public final class VariantCreateProductVariantResponse extends BaseResponse { - private final Variant variant; - - private VariantCreateProductVariantResponse(Builder builder) { - super(builder.httpResponse); - - this.variant = builder.variant; - } - - /** Parse JSON response into VariantCreateProductVariantResponse object. */ - public static VariantCreateProductVariantResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into VariantCreateProductVariantResponse object with HTTP response. */ - public static VariantCreateProductVariantResponse fromJson(String json, Response httpResponse) { - try { - Builder builder = builder(); - - String __variantJson = JsonUtil.getObject(json, "variant"); - if (__variantJson != null) { - builder.variant(Variant.fromJson(__variantJson)); - } - - builder.httpResponse(httpResponse); - return builder.build(); - } catch (Exception e) { - throw new RuntimeException( - "Failed to parse VariantCreateProductVariantResponse from JSON", e); - } - } - - /** Create a new builder for VariantCreateProductVariantResponse. */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for VariantCreateProductVariantResponse. */ - public static class Builder { - - private Variant variant; - - private Response httpResponse; - - private Builder() {} - - public Builder variant(Variant variant) { - this.variant = variant; - return this; - } - - public Builder httpResponse(Response httpResponse) { - this.httpResponse = httpResponse; - return this; - } - - public VariantCreateProductVariantResponse build() { - return new VariantCreateProductVariantResponse(this); - } - } - - /** Get the variant from the response. */ - public Variant getVariant() { - return variant; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/variant/VariantListProductVariantsResponse.java b/src/main/java/com/chargebee/v4/core/responses/variant/VariantListProductVariantsResponse.java deleted file mode 100644 index e34ca08c..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/variant/VariantListProductVariantsResponse.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.chargebee.v4.core.responses.variant; - -import java.util.List; - -import com.chargebee.v4.core.models.variant.Variant; - -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.VariantService; -import com.chargebee.v4.core.models.variant.params.VariantListProductVariantsParams; - -/** - * Immutable response object for VariantListProductVariants operation. Contains paginated list data. - */ -public final class VariantListProductVariantsResponse { - - private final List list; - - private final String nextOffset; - - private final String productId; - - private final VariantService service; - private final VariantListProductVariantsParams originalParams; - private final Response httpResponse; - - private VariantListProductVariantsResponse( - List list, - String nextOffset, - String productId, - VariantService service, - VariantListProductVariantsParams originalParams, - Response httpResponse) { - - this.list = list; - - this.nextOffset = nextOffset; - - this.productId = productId; - - this.service = service; - this.originalParams = originalParams; - this.httpResponse = httpResponse; - } - - /** - * Parse JSON response into VariantListProductVariantsResponse object (no service context). Use - * this when you only need to read a single page (no nextPage()). - */ - public static VariantListProductVariantsResponse fromJson(String json) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(VariantListProductVariantsItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new VariantListProductVariantsResponse(list, nextOffset, null, null, null, null); - } catch (Exception e) { - throw new RuntimeException("Failed to parse VariantListProductVariantsResponse from JSON", e); - } - } - - /** - * Parse JSON response into VariantListProductVariantsResponse object with service context for - * pagination (enables nextPage()). - */ - public static VariantListProductVariantsResponse fromJson( - String json, - VariantService service, - VariantListProductVariantsParams originalParams, - String productId, - Response httpResponse) { - try { - - List list = - JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() - .map(VariantListProductVariantsItem::fromJson) - .collect(java.util.stream.Collectors.toList()); - - String nextOffset = JsonUtil.getString(json, "next_offset"); - - return new VariantListProductVariantsResponse( - list, nextOffset, productId, service, originalParams, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse VariantListProductVariantsResponse 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 VariantListProductVariantsResponse 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)."); - } - - VariantListProductVariantsParams nextParams = - (originalParams != null - ? originalParams.toBuilder() - : VariantListProductVariantsParams.builder()) - .offset(nextOffset) - .build(); - - return service.listProductVariants(productId, 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 VariantListProductVariantsItem { - - private Variant variant; - - public Variant getVariant() { - return variant; - } - - public static VariantListProductVariantsItem fromJson(String json) { - VariantListProductVariantsItem item = new VariantListProductVariantsItem(); - - String __variantJson = JsonUtil.getObject(json, "variant"); - if (__variantJson != null) { - item.variant = Variant.fromJson(__variantJson); - } - - return item; - } - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/variant/VariantRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/variant/VariantRetrieveResponse.java deleted file mode 100644 index 22004822..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/variant/VariantRetrieveResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.chargebee.v4.core.responses.variant; - -import com.chargebee.v4.core.models.variant.Variant; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for VariantRetrieve operation. Contains the response data from a single - * resource get operation. - */ -public final class VariantRetrieveResponse extends BaseResponse { - private final Variant variant; - - private VariantRetrieveResponse(Variant variant, Response httpResponse) { - super(httpResponse); - - this.variant = variant; - } - - /** Parse JSON response into VariantRetrieveResponse object. */ - public static VariantRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into VariantRetrieveResponse object with HTTP response. */ - public static VariantRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - Variant variant = Variant.fromJson(JsonUtil.getObject(json, "variant")); - - return new VariantRetrieveResponse(variant, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse VariantRetrieveResponse from JSON", e); - } - } - - /** Get the variant from the response. */ - public Variant getVariant() { - return variant; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountRetrieveResponse.java deleted file mode 100644 index e761ba35..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountRetrieveResponse.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.chargebee.v4.core.responses.virtualBankAccount; - -import com.chargebee.v4.core.models.virtualBankAccount.VirtualBankAccount; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for VirtualBankAccountRetrieve operation. Contains the response data - * from a single resource get operation. - */ -public final class VirtualBankAccountRetrieveResponse extends BaseResponse { - private final VirtualBankAccount virtualBankAccount; - - private VirtualBankAccountRetrieveResponse( - VirtualBankAccount virtualBankAccount, Response httpResponse) { - super(httpResponse); - - this.virtualBankAccount = virtualBankAccount; - } - - /** Parse JSON response into VirtualBankAccountRetrieveResponse object. */ - public static VirtualBankAccountRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into VirtualBankAccountRetrieveResponse object with HTTP response. */ - public static VirtualBankAccountRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - VirtualBankAccount virtualBankAccount = - VirtualBankAccount.fromJson(JsonUtil.getObject(json, "virtual_bank_account")); - - return new VirtualBankAccountRetrieveResponse(virtualBankAccount, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse VirtualBankAccountRetrieveResponse from JSON", e); - } - } - - /** Get the virtualBankAccount from the response. */ - public VirtualBankAccount getVirtualBankAccount() { - return virtualBankAccount; - } -} diff --git a/src/main/java/com/chargebee/v4/core/responses/webhookEndpoint/WebhookEndpointRetrieveResponse.java b/src/main/java/com/chargebee/v4/core/responses/webhookEndpoint/WebhookEndpointRetrieveResponse.java deleted file mode 100644 index cdfca2be..00000000 --- a/src/main/java/com/chargebee/v4/core/responses/webhookEndpoint/WebhookEndpointRetrieveResponse.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.chargebee.v4.core.responses.webhookEndpoint; - -import com.chargebee.v4.core.models.webhookEndpoint.WebhookEndpoint; - -import com.chargebee.v4.core.responses.BaseResponse; -import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.Response; - -/** - * Immutable response object for WebhookEndpointRetrieve operation. Contains the response data from - * a single resource get operation. - */ -public final class WebhookEndpointRetrieveResponse extends BaseResponse { - private final WebhookEndpoint webhookEndpoint; - - private WebhookEndpointRetrieveResponse(WebhookEndpoint webhookEndpoint, Response httpResponse) { - super(httpResponse); - - this.webhookEndpoint = webhookEndpoint; - } - - /** Parse JSON response into WebhookEndpointRetrieveResponse object. */ - public static WebhookEndpointRetrieveResponse fromJson(String json) { - return fromJson(json, null); - } - - /** Parse JSON response into WebhookEndpointRetrieveResponse object with HTTP response. */ - public static WebhookEndpointRetrieveResponse fromJson(String json, Response httpResponse) { - try { - - WebhookEndpoint webhookEndpoint = - WebhookEndpoint.fromJson(JsonUtil.getObject(json, "webhook_endpoint")); - - return new WebhookEndpointRetrieveResponse(webhookEndpoint, httpResponse); - } catch (Exception e) { - throw new RuntimeException("Failed to parse WebhookEndpointRetrieveResponse from JSON", e); - } - } - - /** Get the webhookEndpoint from the response. */ - public WebhookEndpoint getWebhookEndpoint() { - return webhookEndpoint; - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/AddonService.java b/src/main/java/com/chargebee/v4/core/services/AddonService.java deleted file mode 100644 index 2b6bd08f..00000000 --- a/src/main/java/com/chargebee/v4/core/services/AddonService.java +++ /dev/null @@ -1,194 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.addon.params.AddonCopyParams; - -import com.chargebee.v4.core.models.addon.params.AddonUpdateParams; - -import com.chargebee.v4.core.models.addon.params.AddonListParams; - -import com.chargebee.v4.core.models.addon.params.AddonCreateParams; - -import com.chargebee.v4.core.responses.addon.AddonCopyResponse; - -import com.chargebee.v4.core.responses.addon.AddonUnarchiveResponse; - -import com.chargebee.v4.core.responses.addon.AddonRetrieveResponse; - -import com.chargebee.v4.core.responses.addon.AddonUpdateResponse; - -import com.chargebee.v4.core.responses.addon.AddonListResponse; - -import com.chargebee.v4.core.responses.addon.AddonCreateResponse; - -import com.chargebee.v4.core.responses.addon.AddonDeleteResponse; - -public final class AddonService extends BaseService { - - private final ServiceConfig config; - - public AddonService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private AddonService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private AddonService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - AddonService with(RequestOptions newOptions) { - return new AddonService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public AddonService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** copy a addon using immutable params (executes immediately) - returns raw Response. */ - Response copyRaw(AddonCopyParams params) throws Exception { - - return post("/addons/copy", params != null ? params.toFormData() : null); - } - - /** copy a addon using raw JSON payload (executes immediately) - returns raw Response. */ - Response copyRaw(String jsonPayload) throws Exception { - - return postJson("/addons/copy", jsonPayload); - } - - public AddonCopyResponse copy(AddonCopyParams params) throws Exception { - Response response = copyRaw(params); - - return AddonCopyResponse.fromJson(response.getBodyAsString(), response); - } - - /** unarchive a addon (executes immediately) - returns raw Response. */ - Response unarchiveRaw(String addonId) throws Exception { - String path = buildPathWithParams("/addons/{addon-id}/unarchive", "addon-id", addonId); - - return post(path, null); - } - - public AddonUnarchiveResponse unarchive(String addonId) throws Exception { - Response response = unarchiveRaw(addonId); - return AddonUnarchiveResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a addon (executes immediately) - returns raw Response. */ - Response retrieveRaw(String addonId) throws Exception { - String path = buildPathWithParams("/addons/{addon-id}", "addon-id", addonId); - - return get(path, null); - } - - public AddonRetrieveResponse retrieve(String addonId) throws Exception { - Response response = retrieveRaw(addonId); - return AddonRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** update a addon (executes immediately) - returns raw Response. */ - Response updateRaw(String addonId) throws Exception { - String path = buildPathWithParams("/addons/{addon-id}", "addon-id", addonId); - - return post(path, null); - } - - /** update a addon using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String addonId, AddonUpdateParams params) throws Exception { - String path = buildPathWithParams("/addons/{addon-id}", "addon-id", addonId); - return post(path, params.toFormData()); - } - - /** update a addon using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String addonId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/addons/{addon-id}", "addon-id", addonId); - return postJson(path, jsonPayload); - } - - public AddonUpdateResponse update(String addonId, AddonUpdateParams params) throws Exception { - Response response = updateRaw(addonId, params); - return AddonUpdateResponse.fromJson(response.getBodyAsString(), response); - } - - /** list a addon using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(AddonListParams params) throws Exception { - - return get("/addons", params != null ? params.toQueryParams() : null); - } - - /** list a addon without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/addons", null); - } - - /** list a addon using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public AddonListResponse list(AddonListParams params) throws Exception { - Response response = listRaw(params); - - return AddonListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public AddonListResponse list() throws Exception { - Response response = listRaw(); - return AddonListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** create a addon using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(AddonCreateParams params) throws Exception { - - return post("/addons", params != null ? params.toFormData() : null); - } - - /** create a addon using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { - - return postJson("/addons", jsonPayload); - } - - public AddonCreateResponse create(AddonCreateParams params) throws Exception { - Response response = createRaw(params); - - return AddonCreateResponse.fromJson(response.getBodyAsString(), response); - } - - /** delete a addon (executes immediately) - returns raw Response. */ - Response deleteRaw(String addonId) throws Exception { - String path = buildPathWithParams("/addons/{addon-id}/delete", "addon-id", addonId); - - return post(path, null); - } - - public AddonDeleteResponse delete(String addonId) throws Exception { - Response response = deleteRaw(addonId); - return AddonDeleteResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/AttachedItemService.java b/src/main/java/com/chargebee/v4/core/services/AttachedItemService.java deleted file mode 100644 index 5e4dafc0..00000000 --- a/src/main/java/com/chargebee/v4/core/services/AttachedItemService.java +++ /dev/null @@ -1,198 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.attachedItem.params.AttachedItemUpdateParams; - -import com.chargebee.v4.core.models.attachedItem.params.AttachedItemListParams; - -import com.chargebee.v4.core.models.attachedItem.params.AttachedItemCreateParams; - -import com.chargebee.v4.core.models.attachedItem.params.AttachedItemDeleteParams; - -import com.chargebee.v4.core.responses.attachedItem.AttachedItemRetrieveResponse; - -import com.chargebee.v4.core.responses.attachedItem.AttachedItemUpdateResponse; - -import com.chargebee.v4.core.responses.attachedItem.AttachedItemListResponse; - -import com.chargebee.v4.core.responses.attachedItem.AttachedItemCreateResponse; - -import com.chargebee.v4.core.responses.attachedItem.AttachedItemDeleteResponse; - -public final class AttachedItemService extends BaseService { - - private final ServiceConfig config; - - public AttachedItemService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private AttachedItemService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private AttachedItemService( - ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - AttachedItemService with(RequestOptions newOptions) { - return new AttachedItemService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public AttachedItemService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** retrieve a attachedItem (executes immediately) - returns raw Response. */ - Response retrieveRaw(String attachedItemId) throws Exception { - String path = - buildPathWithParams( - "/attached_items/{attached-item-id}", "attached-item-id", attachedItemId); - - return get(path, null); - } - - public AttachedItemRetrieveResponse retrieve(String attachedItemId) throws Exception { - Response response = retrieveRaw(attachedItemId); - return AttachedItemRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** update a attachedItem (executes immediately) - returns raw Response. */ - Response updateRaw(String attachedItemId) throws Exception { - String path = - buildPathWithParams( - "/attached_items/{attached-item-id}", "attached-item-id", attachedItemId); - - return post(path, null); - } - - /** update a attachedItem using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String attachedItemId, AttachedItemUpdateParams params) throws Exception { - String path = - buildPathWithParams( - "/attached_items/{attached-item-id}", "attached-item-id", attachedItemId); - return post(path, params.toFormData()); - } - - /** update a attachedItem using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String attachedItemId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/attached_items/{attached-item-id}", "attached-item-id", attachedItemId); - return postJson(path, jsonPayload); - } - - public AttachedItemUpdateResponse update(String attachedItemId, AttachedItemUpdateParams params) - throws Exception { - Response response = updateRaw(attachedItemId, params); - return AttachedItemUpdateResponse.fromJson(response.getBodyAsString(), response); - } - - /** list a attachedItem using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(String itemId, AttachedItemListParams params) throws Exception { - String path = buildPathWithParams("/items/{item-id}/attached_items", "item-id", itemId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** list a attachedItem without params (executes immediately) - returns raw Response. */ - Response listRaw(String itemId) throws Exception { - String path = buildPathWithParams("/items/{item-id}/attached_items", "item-id", itemId); - return get(path, null); - } - - /** list a attachedItem using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String itemId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/items/{item-id}/attached_items", "item-id", itemId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public AttachedItemListResponse list(String itemId, AttachedItemListParams params) - throws Exception { - Response response = listRaw(itemId, params); - return AttachedItemListResponse.fromJson( - response.getBodyAsString(), this, params, itemId, response); - } - - public AttachedItemListResponse list(String itemId) throws Exception { - Response response = listRaw(itemId); - return AttachedItemListResponse.fromJson( - response.getBodyAsString(), this, null, itemId, response); - } - - /** create a attachedItem (executes immediately) - returns raw Response. */ - Response createRaw(String itemId) throws Exception { - String path = buildPathWithParams("/items/{item-id}/attached_items", "item-id", itemId); - - return post(path, null); - } - - /** create a attachedItem using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(String itemId, AttachedItemCreateParams params) throws Exception { - String path = buildPathWithParams("/items/{item-id}/attached_items", "item-id", itemId); - return post(path, params.toFormData()); - } - - /** create a attachedItem using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String itemId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/items/{item-id}/attached_items", "item-id", itemId); - return postJson(path, jsonPayload); - } - - public AttachedItemCreateResponse create(String itemId, AttachedItemCreateParams params) - throws Exception { - Response response = createRaw(itemId, params); - return AttachedItemCreateResponse.fromJson(response.getBodyAsString(), response); - } - - /** delete a attachedItem (executes immediately) - returns raw Response. */ - Response deleteRaw(String attachedItemId) throws Exception { - String path = - buildPathWithParams( - "/attached_items/{attached-item-id}/delete", "attached-item-id", attachedItemId); - - return post(path, null); - } - - /** delete a attachedItem using immutable params (executes immediately) - returns raw Response. */ - Response deleteRaw(String attachedItemId, AttachedItemDeleteParams params) throws Exception { - String path = - buildPathWithParams( - "/attached_items/{attached-item-id}/delete", "attached-item-id", attachedItemId); - return post(path, params.toFormData()); - } - - /** delete a attachedItem using raw JSON payload (executes immediately) - returns raw Response. */ - Response deleteRaw(String attachedItemId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/attached_items/{attached-item-id}/delete", "attached-item-id", attachedItemId); - return postJson(path, jsonPayload); - } - - public AttachedItemDeleteResponse delete(String attachedItemId, AttachedItemDeleteParams params) - throws Exception { - Response response = deleteRaw(attachedItemId, params); - return AttachedItemDeleteResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/CardService.java b/src/main/java/com/chargebee/v4/core/services/CardService.java deleted file mode 100644 index 85d1249e..00000000 --- a/src/main/java/com/chargebee/v4/core/services/CardService.java +++ /dev/null @@ -1,194 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.card.params.CardCopyCardForCustomerParams; - -import com.chargebee.v4.core.models.card.params.CardSwitchGatewayForCustomerParams; - -import com.chargebee.v4.core.models.card.params.CardUpdateCardForCustomerParams; - -import com.chargebee.v4.core.responses.card.CardCopyCardForCustomerResponse; - -import com.chargebee.v4.core.responses.card.CardRetrieveResponse; - -import com.chargebee.v4.core.responses.card.CardSwitchGatewayForCustomerResponse; - -import com.chargebee.v4.core.responses.card.CardDeleteCardForCustomerResponse; - -import com.chargebee.v4.core.responses.card.CardUpdateCardForCustomerResponse; - -public final class CardService extends BaseService { - - private final ServiceConfig config; - - public CardService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private CardService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private CardService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - CardService with(RequestOptions newOptions) { - return new CardService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public CardService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** copyCardForCustomer a card (executes immediately) - returns raw Response. */ - Response copyCardForCustomerRaw(String customerId) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/copy_card", "customer-id", customerId); - - return post(path, null); - } - - /** - * copyCardForCustomer a card using immutable params (executes immediately) - returns raw - * Response. - */ - Response copyCardForCustomerRaw(String customerId, CardCopyCardForCustomerParams params) - throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/copy_card", "customer-id", customerId); - return post(path, params.toFormData()); - } - - /** - * copyCardForCustomer a card using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response copyCardForCustomerRaw(String customerId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/copy_card", "customer-id", customerId); - return postJson(path, jsonPayload); - } - - public CardCopyCardForCustomerResponse copyCardForCustomer( - String customerId, CardCopyCardForCustomerParams params) throws Exception { - Response response = copyCardForCustomerRaw(customerId, params); - return CardCopyCardForCustomerResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a card (executes immediately) - returns raw Response. */ - Response retrieveRaw(String customerId) throws Exception { - String path = buildPathWithParams("/cards/{customer-id}", "customer-id", customerId); - - return get(path, null); - } - - public CardRetrieveResponse retrieve(String customerId) throws Exception { - Response response = retrieveRaw(customerId); - return CardRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** switchGatewayForCustomer a card (executes immediately) - returns raw Response. */ - Response switchGatewayForCustomerRaw(String customerId) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/switch_gateway", "customer-id", customerId); - - return post(path, null); - } - - /** - * switchGatewayForCustomer a card using immutable params (executes immediately) - returns raw - * Response. - */ - Response switchGatewayForCustomerRaw(String customerId, CardSwitchGatewayForCustomerParams params) - throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/switch_gateway", "customer-id", customerId); - return post(path, params.toFormData()); - } - - /** - * switchGatewayForCustomer a card using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response switchGatewayForCustomerRaw(String customerId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/switch_gateway", "customer-id", customerId); - return postJson(path, jsonPayload); - } - - public CardSwitchGatewayForCustomerResponse switchGatewayForCustomer( - String customerId, CardSwitchGatewayForCustomerParams params) throws Exception { - Response response = switchGatewayForCustomerRaw(customerId, params); - return CardSwitchGatewayForCustomerResponse.fromJson(response.getBodyAsString(), response); - } - - /** deleteCardForCustomer a card (executes immediately) - returns raw Response. */ - Response deleteCardForCustomerRaw(String customerId) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/delete_card", "customer-id", customerId); - - return post(path, null); - } - - public CardDeleteCardForCustomerResponse deleteCardForCustomer(String customerId) - throws Exception { - Response response = deleteCardForCustomerRaw(customerId); - return CardDeleteCardForCustomerResponse.fromJson(response.getBodyAsString(), response); - } - - /** updateCardForCustomer a card (executes immediately) - returns raw Response. */ - Response updateCardForCustomerRaw(String customerId) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/credit_card", "customer-id", customerId); - - return post(path, null); - } - - /** - * updateCardForCustomer a card using immutable params (executes immediately) - returns raw - * Response. - */ - Response updateCardForCustomerRaw(String customerId, CardUpdateCardForCustomerParams params) - throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/credit_card", "customer-id", customerId); - return post(path, params.toFormData()); - } - - /** - * updateCardForCustomer a card using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response updateCardForCustomerRaw(String customerId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/credit_card", "customer-id", customerId); - return postJson(path, jsonPayload); - } - - public CardUpdateCardForCustomerResponse updateCardForCustomer( - String customerId, CardUpdateCardForCustomerParams params) throws Exception { - Response response = updateCardForCustomerRaw(customerId, params); - return CardUpdateCardForCustomerResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/CommentService.java b/src/main/java/com/chargebee/v4/core/services/CommentService.java deleted file mode 100644 index c766da0f..00000000 --- a/src/main/java/com/chargebee/v4/core/services/CommentService.java +++ /dev/null @@ -1,130 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.comment.params.CommentListParams; - -import com.chargebee.v4.core.models.comment.params.CommentCreateParams; - -import com.chargebee.v4.core.responses.comment.CommentDeleteResponse; - -import com.chargebee.v4.core.responses.comment.CommentRetrieveResponse; - -import com.chargebee.v4.core.responses.comment.CommentListResponse; - -import com.chargebee.v4.core.responses.comment.CommentCreateResponse; - -public final class CommentService extends BaseService { - - private final ServiceConfig config; - - public CommentService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private CommentService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private CommentService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - CommentService with(RequestOptions newOptions) { - return new CommentService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public CommentService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** delete a comment (executes immediately) - returns raw Response. */ - Response deleteRaw(String commentId) throws Exception { - String path = buildPathWithParams("/comments/{comment-id}/delete", "comment-id", commentId); - - return post(path, null); - } - - public CommentDeleteResponse delete(String commentId) throws Exception { - Response response = deleteRaw(commentId); - return CommentDeleteResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a comment (executes immediately) - returns raw Response. */ - Response retrieveRaw(String commentId) throws Exception { - String path = buildPathWithParams("/comments/{comment-id}", "comment-id", commentId); - - return get(path, null); - } - - public CommentRetrieveResponse retrieve(String commentId) throws Exception { - Response response = retrieveRaw(commentId); - return CommentRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** list a comment using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(CommentListParams params) throws Exception { - - return get("/comments", params != null ? params.toQueryParams() : null); - } - - /** list a comment without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/comments", null); - } - - /** list a comment using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public CommentListResponse list(CommentListParams params) throws Exception { - Response response = listRaw(params); - - return CommentListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public CommentListResponse list() throws Exception { - Response response = listRaw(); - return CommentListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** create a comment using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(CommentCreateParams params) throws Exception { - - return post("/comments", params != null ? params.toFormData() : null); - } - - /** create a comment using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { - - return postJson("/comments", jsonPayload); - } - - public CommentCreateResponse create(CommentCreateParams params) throws Exception { - Response response = createRaw(params); - - return CommentCreateResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/CouponCodeService.java b/src/main/java/com/chargebee/v4/core/services/CouponCodeService.java deleted file mode 100644 index 4af5ca63..00000000 --- a/src/main/java/com/chargebee/v4/core/services/CouponCodeService.java +++ /dev/null @@ -1,133 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.couponCode.params.CouponCodeListParams; - -import com.chargebee.v4.core.models.couponCode.params.CouponCodeCreateParams; - -import com.chargebee.v4.core.responses.couponCode.CouponCodeListResponse; - -import com.chargebee.v4.core.responses.couponCode.CouponCodeCreateResponse; - -import com.chargebee.v4.core.responses.couponCode.CouponCodeRetrieveResponse; - -import com.chargebee.v4.core.responses.couponCode.CouponCodeArchiveResponse; - -public final class CouponCodeService extends BaseService { - - private final ServiceConfig config; - - public CouponCodeService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private CouponCodeService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private CouponCodeService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - CouponCodeService with(RequestOptions newOptions) { - return new CouponCodeService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public CouponCodeService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** list a couponCode using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(CouponCodeListParams params) throws Exception { - - return get("/coupon_codes", params != null ? params.toQueryParams() : null); - } - - /** list a couponCode without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/coupon_codes", null); - } - - /** list a couponCode using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public CouponCodeListResponse list(CouponCodeListParams params) throws Exception { - Response response = listRaw(params); - - return CouponCodeListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public CouponCodeListResponse list() throws Exception { - Response response = listRaw(); - return CouponCodeListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** create a couponCode using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(CouponCodeCreateParams params) throws Exception { - - return post("/coupon_codes", params != null ? params.toFormData() : null); - } - - /** create a couponCode using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { - - return postJson("/coupon_codes", jsonPayload); - } - - public CouponCodeCreateResponse create(CouponCodeCreateParams params) throws Exception { - Response response = createRaw(params); - - return CouponCodeCreateResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a couponCode (executes immediately) - returns raw Response. */ - Response retrieveRaw(String couponCodeCode) throws Exception { - String path = - buildPathWithParams("/coupon_codes/{coupon-code-code}", "coupon-code-code", couponCodeCode); - - return get(path, null); - } - - public CouponCodeRetrieveResponse retrieve(String couponCodeCode) throws Exception { - Response response = retrieveRaw(couponCodeCode); - return CouponCodeRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** archive a couponCode (executes immediately) - returns raw Response. */ - Response archiveRaw(String couponCodeCode) throws Exception { - String path = - buildPathWithParams( - "/coupon_codes/{coupon-code-code}/archive", "coupon-code-code", couponCodeCode); - - return post(path, null); - } - - public CouponCodeArchiveResponse archive(String couponCodeCode) throws Exception { - Response response = archiveRaw(couponCodeCode); - return CouponCodeArchiveResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/CouponService.java b/src/main/java/com/chargebee/v4/core/services/CouponService.java deleted file mode 100644 index 8dfba009..00000000 --- a/src/main/java/com/chargebee/v4/core/services/CouponService.java +++ /dev/null @@ -1,257 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.coupon.params.CouponListParams; - -import com.chargebee.v4.core.models.coupon.params.CouponCreateParams; - -import com.chargebee.v4.core.models.coupon.params.CouponUpdateForItemsParams; - -import com.chargebee.v4.core.models.coupon.params.CouponCopyParams; - -import com.chargebee.v4.core.models.coupon.params.CouponUpdateParams; - -import com.chargebee.v4.core.models.coupon.params.CouponCreateForItemsParams; - -import com.chargebee.v4.core.responses.coupon.CouponListResponse; - -import com.chargebee.v4.core.responses.coupon.CouponCreateResponse; - -import com.chargebee.v4.core.responses.coupon.CouponUpdateForItemsResponse; - -import com.chargebee.v4.core.responses.coupon.CouponUnarchiveResponse; - -import com.chargebee.v4.core.responses.coupon.CouponDeleteResponse; - -import com.chargebee.v4.core.responses.coupon.CouponCopyResponse; - -import com.chargebee.v4.core.responses.coupon.CouponRetrieveResponse; - -import com.chargebee.v4.core.responses.coupon.CouponUpdateResponse; - -import com.chargebee.v4.core.responses.coupon.CouponCreateForItemsResponse; - -public final class CouponService extends BaseService { - - private final ServiceConfig config; - - public CouponService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private CouponService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private CouponService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - CouponService with(RequestOptions newOptions) { - return new CouponService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public CouponService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** list a coupon using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(CouponListParams params) throws Exception { - - return get("/coupons", params != null ? params.toQueryParams() : null); - } - - /** list a coupon without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/coupons", null); - } - - /** list a coupon using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public CouponListResponse list(CouponListParams params) throws Exception { - Response response = listRaw(params); - - return CouponListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public CouponListResponse list() throws Exception { - Response response = listRaw(); - return CouponListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** create a coupon using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(CouponCreateParams params) throws Exception { - - return post("/coupons", params != null ? params.toFormData() : null); - } - - /** create a coupon using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { - - return postJson("/coupons", jsonPayload); - } - - public CouponCreateResponse create(CouponCreateParams params) throws Exception { - Response response = createRaw(params); - - return CouponCreateResponse.fromJson(response.getBodyAsString(), response); - } - - /** updateForItems a coupon (executes immediately) - returns raw Response. */ - Response updateForItemsRaw(String couponId) throws Exception { - String path = - buildPathWithParams("/coupons/{coupon-id}/update_for_items", "coupon-id", couponId); - - return post(path, null); - } - - /** - * updateForItems a coupon using immutable params (executes immediately) - returns raw Response. - */ - Response updateForItemsRaw(String couponId, CouponUpdateForItemsParams params) throws Exception { - String path = - buildPathWithParams("/coupons/{coupon-id}/update_for_items", "coupon-id", couponId); - return post(path, params.toFormData()); - } - - /** - * updateForItems a coupon using raw JSON payload (executes immediately) - returns raw Response. - */ - Response updateForItemsRaw(String couponId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/coupons/{coupon-id}/update_for_items", "coupon-id", couponId); - return postJson(path, jsonPayload); - } - - public CouponUpdateForItemsResponse updateForItems( - String couponId, CouponUpdateForItemsParams params) throws Exception { - Response response = updateForItemsRaw(couponId, params); - return CouponUpdateForItemsResponse.fromJson(response.getBodyAsString(), response); - } - - /** unarchive a coupon (executes immediately) - returns raw Response. */ - Response unarchiveRaw(String couponId) throws Exception { - String path = buildPathWithParams("/coupons/{coupon-id}/unarchive", "coupon-id", couponId); - - return post(path, null); - } - - public CouponUnarchiveResponse unarchive(String couponId) throws Exception { - Response response = unarchiveRaw(couponId); - return CouponUnarchiveResponse.fromJson(response.getBodyAsString(), response); - } - - /** delete a coupon (executes immediately) - returns raw Response. */ - Response deleteRaw(String couponId) throws Exception { - String path = buildPathWithParams("/coupons/{coupon-id}/delete", "coupon-id", couponId); - - return post(path, null); - } - - public CouponDeleteResponse delete(String couponId) throws Exception { - Response response = deleteRaw(couponId); - return CouponDeleteResponse.fromJson(response.getBodyAsString(), response); - } - - /** copy a coupon using immutable params (executes immediately) - returns raw Response. */ - Response copyRaw(CouponCopyParams params) throws Exception { - - return post("/coupons/copy", params != null ? params.toFormData() : null); - } - - /** copy a coupon using raw JSON payload (executes immediately) - returns raw Response. */ - Response copyRaw(String jsonPayload) throws Exception { - - return postJson("/coupons/copy", jsonPayload); - } - - public CouponCopyResponse copy(CouponCopyParams params) throws Exception { - Response response = copyRaw(params); - - return CouponCopyResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a coupon (executes immediately) - returns raw Response. */ - Response retrieveRaw(String couponId) throws Exception { - String path = buildPathWithParams("/coupons/{coupon-id}", "coupon-id", couponId); - - return get(path, null); - } - - public CouponRetrieveResponse retrieve(String couponId) throws Exception { - Response response = retrieveRaw(couponId); - return CouponRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** update a coupon (executes immediately) - returns raw Response. */ - Response updateRaw(String couponId) throws Exception { - String path = buildPathWithParams("/coupons/{coupon-id}", "coupon-id", couponId); - - return post(path, null); - } - - /** update a coupon using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String couponId, CouponUpdateParams params) throws Exception { - String path = buildPathWithParams("/coupons/{coupon-id}", "coupon-id", couponId); - return post(path, params.toFormData()); - } - - /** update a coupon using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String couponId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/coupons/{coupon-id}", "coupon-id", couponId); - return postJson(path, jsonPayload); - } - - public CouponUpdateResponse update(String couponId, CouponUpdateParams params) throws Exception { - Response response = updateRaw(couponId, params); - return CouponUpdateResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createForItems a coupon using immutable params (executes immediately) - returns raw Response. - */ - Response createForItemsRaw(CouponCreateForItemsParams params) throws Exception { - - return post("/coupons/create_for_items", params != null ? params.toFormData() : null); - } - - /** - * createForItems a coupon using raw JSON payload (executes immediately) - returns raw Response. - */ - Response createForItemsRaw(String jsonPayload) throws Exception { - - return postJson("/coupons/create_for_items", jsonPayload); - } - - public CouponCreateForItemsResponse createForItems(CouponCreateForItemsParams params) - throws Exception { - Response response = createForItemsRaw(params); - - return CouponCreateForItemsResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/CreditNoteService.java b/src/main/java/com/chargebee/v4/core/services/CreditNoteService.java deleted file mode 100644 index 7eb9de23..00000000 --- a/src/main/java/com/chargebee/v4/core/services/CreditNoteService.java +++ /dev/null @@ -1,472 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.creditNote.params.CreditNoteVoidCreditNoteParams; - -import com.chargebee.v4.core.models.creditNote.params.CreditNoteRefundParams; - -import com.chargebee.v4.core.models.creditNote.params.CreditNoteListParams; - -import com.chargebee.v4.core.models.creditNote.params.CreditNoteCreateParams; - -import com.chargebee.v4.core.models.creditNote.params.CreditNoteRecordRefundParams; - -import com.chargebee.v4.core.models.creditNote.params.CreditNoteImportCreditNoteParams; - -import com.chargebee.v4.core.models.creditNote.params.CreditNoteDeleteParams; - -import com.chargebee.v4.core.models.creditNote.params.CreditNoteCreditNotesForCustomerParams; - -import com.chargebee.v4.core.models.creditNote.params.CreditNotePdfParams; - -import com.chargebee.v4.core.models.creditNote.params.CreditNoteRemoveTaxWithheldRefundParams; - -import com.chargebee.v4.core.responses.creditNote.CreditNoteVoidCreditNoteResponse; - -import com.chargebee.v4.core.responses.creditNote.CreditNoteRefundResponse; - -import com.chargebee.v4.core.responses.creditNote.CreditNoteListResponse; - -import com.chargebee.v4.core.responses.creditNote.CreditNoteCreateResponse; - -import com.chargebee.v4.core.responses.creditNote.CreditNoteRecordRefundResponse; - -import com.chargebee.v4.core.responses.creditNote.CreditNoteImportCreditNoteResponse; - -import com.chargebee.v4.core.responses.creditNote.CreditNoteDeleteResponse; - -import com.chargebee.v4.core.responses.creditNote.CreditNoteCreditNotesForCustomerResponse; - -import com.chargebee.v4.core.responses.creditNote.CreditNoteDownloadEinvoiceResponse; - -import com.chargebee.v4.core.responses.creditNote.CreditNotePdfResponse; - -import com.chargebee.v4.core.responses.creditNote.CreditNoteResendEinvoiceResponse; - -import com.chargebee.v4.core.responses.creditNote.CreditNoteRemoveTaxWithheldRefundResponse; - -import com.chargebee.v4.core.responses.creditNote.CreditNoteRetrieveResponse; - -import com.chargebee.v4.core.responses.creditNote.CreditNoteSendEinvoiceResponse; - -public final class CreditNoteService extends BaseService { - - private final ServiceConfig config; - - public CreditNoteService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private CreditNoteService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private CreditNoteService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - CreditNoteService with(RequestOptions newOptions) { - return new CreditNoteService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public CreditNoteService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** voidCreditNote a creditNote (executes immediately) - returns raw Response. */ - Response voidCreditNoteRaw(String creditNoteId) throws Exception { - String path = - buildPathWithParams("/credit_notes/{credit-note-id}/void", "credit-note-id", creditNoteId); - - return post(path, null); - } - - /** - * voidCreditNote a creditNote using immutable params (executes immediately) - returns raw - * Response. - */ - Response voidCreditNoteRaw(String creditNoteId, CreditNoteVoidCreditNoteParams params) - throws Exception { - String path = - buildPathWithParams("/credit_notes/{credit-note-id}/void", "credit-note-id", creditNoteId); - return post(path, params.toFormData()); - } - - /** - * voidCreditNote a creditNote using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response voidCreditNoteRaw(String creditNoteId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/credit_notes/{credit-note-id}/void", "credit-note-id", creditNoteId); - return postJson(path, jsonPayload); - } - - public CreditNoteVoidCreditNoteResponse voidCreditNote( - String creditNoteId, CreditNoteVoidCreditNoteParams params) throws Exception { - Response response = voidCreditNoteRaw(creditNoteId, params); - return CreditNoteVoidCreditNoteResponse.fromJson(response.getBodyAsString(), response); - } - - /** refund a creditNote (executes immediately) - returns raw Response. */ - Response refundRaw(String creditNoteId) throws Exception { - String path = - buildPathWithParams( - "/credit_notes/{credit-note-id}/refund", "credit-note-id", creditNoteId); - - return post(path, null); - } - - /** refund a creditNote using immutable params (executes immediately) - returns raw Response. */ - Response refundRaw(String creditNoteId, CreditNoteRefundParams params) throws Exception { - String path = - buildPathWithParams( - "/credit_notes/{credit-note-id}/refund", "credit-note-id", creditNoteId); - return post(path, params.toFormData()); - } - - /** refund a creditNote using raw JSON payload (executes immediately) - returns raw Response. */ - Response refundRaw(String creditNoteId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/credit_notes/{credit-note-id}/refund", "credit-note-id", creditNoteId); - return postJson(path, jsonPayload); - } - - public CreditNoteRefundResponse refund(String creditNoteId, CreditNoteRefundParams params) - throws Exception { - Response response = refundRaw(creditNoteId, params); - return CreditNoteRefundResponse.fromJson(response.getBodyAsString(), response); - } - - /** list a creditNote using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(CreditNoteListParams params) throws Exception { - - return get("/credit_notes", params != null ? params.toQueryParams() : null); - } - - /** list a creditNote without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/credit_notes", null); - } - - /** list a creditNote using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public CreditNoteListResponse list(CreditNoteListParams params) throws Exception { - Response response = listRaw(params); - - return CreditNoteListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public CreditNoteListResponse list() throws Exception { - Response response = listRaw(); - return CreditNoteListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** create a creditNote using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(CreditNoteCreateParams params) throws Exception { - - return post("/credit_notes", params != null ? params.toFormData() : null); - } - - /** create a creditNote using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { - - return postJson("/credit_notes", jsonPayload); - } - - public CreditNoteCreateResponse create(CreditNoteCreateParams params) throws Exception { - Response response = createRaw(params); - - return CreditNoteCreateResponse.fromJson(response.getBodyAsString(), response); - } - - /** recordRefund a creditNote (executes immediately) - returns raw Response. */ - Response recordRefundRaw(String creditNoteId) throws Exception { - String path = - buildPathWithParams( - "/credit_notes/{credit-note-id}/record_refund", "credit-note-id", creditNoteId); - - return post(path, null); - } - - /** - * recordRefund a creditNote using immutable params (executes immediately) - returns raw Response. - */ - Response recordRefundRaw(String creditNoteId, CreditNoteRecordRefundParams params) - throws Exception { - String path = - buildPathWithParams( - "/credit_notes/{credit-note-id}/record_refund", "credit-note-id", creditNoteId); - return post(path, params.toFormData()); - } - - /** - * recordRefund a creditNote using raw JSON payload (executes immediately) - returns raw Response. - */ - Response recordRefundRaw(String creditNoteId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/credit_notes/{credit-note-id}/record_refund", "credit-note-id", creditNoteId); - return postJson(path, jsonPayload); - } - - public CreditNoteRecordRefundResponse recordRefund( - String creditNoteId, CreditNoteRecordRefundParams params) throws Exception { - Response response = recordRefundRaw(creditNoteId, params); - return CreditNoteRecordRefundResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * importCreditNote a creditNote using immutable params (executes immediately) - returns raw - * Response. - */ - Response importCreditNoteRaw(CreditNoteImportCreditNoteParams params) throws Exception { - - return post("/credit_notes/import_credit_note", params != null ? params.toFormData() : null); - } - - /** - * importCreditNote a creditNote using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response importCreditNoteRaw(String jsonPayload) throws Exception { - - return postJson("/credit_notes/import_credit_note", jsonPayload); - } - - public CreditNoteImportCreditNoteResponse importCreditNote( - CreditNoteImportCreditNoteParams params) throws Exception { - Response response = importCreditNoteRaw(params); - - return CreditNoteImportCreditNoteResponse.fromJson(response.getBodyAsString(), response); - } - - /** delete a creditNote (executes immediately) - returns raw Response. */ - Response deleteRaw(String creditNoteId) throws Exception { - String path = - buildPathWithParams( - "/credit_notes/{credit-note-id}/delete", "credit-note-id", creditNoteId); - - return post(path, null); - } - - /** delete a creditNote using immutable params (executes immediately) - returns raw Response. */ - Response deleteRaw(String creditNoteId, CreditNoteDeleteParams params) throws Exception { - String path = - buildPathWithParams( - "/credit_notes/{credit-note-id}/delete", "credit-note-id", creditNoteId); - return post(path, params.toFormData()); - } - - /** delete a creditNote using raw JSON payload (executes immediately) - returns raw Response. */ - Response deleteRaw(String creditNoteId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/credit_notes/{credit-note-id}/delete", "credit-note-id", creditNoteId); - return postJson(path, jsonPayload); - } - - public CreditNoteDeleteResponse delete(String creditNoteId, CreditNoteDeleteParams params) - throws Exception { - Response response = deleteRaw(creditNoteId, params); - return CreditNoteDeleteResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * creditNotesForCustomer a creditNote using immutable params (executes immediately) - returns raw - * Response. - */ - Response creditNotesForCustomerRaw( - String customerId, CreditNoteCreditNotesForCustomerParams params) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/credit_notes", "customer-id", customerId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * creditNotesForCustomer a creditNote without params (executes immediately) - returns raw - * Response. - */ - Response creditNotesForCustomerRaw(String customerId) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/credit_notes", "customer-id", customerId); - return get(path, null); - } - - /** - * creditNotesForCustomer a creditNote using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response creditNotesForCustomerRaw(String customerId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/credit_notes", "customer-id", customerId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public CreditNoteCreditNotesForCustomerResponse creditNotesForCustomer( - String customerId, CreditNoteCreditNotesForCustomerParams params) throws Exception { - Response response = creditNotesForCustomerRaw(customerId, params); - return CreditNoteCreditNotesForCustomerResponse.fromJson( - response.getBodyAsString(), this, params, customerId, response); - } - - public CreditNoteCreditNotesForCustomerResponse creditNotesForCustomer(String customerId) - throws Exception { - Response response = creditNotesForCustomerRaw(customerId); - return CreditNoteCreditNotesForCustomerResponse.fromJson( - response.getBodyAsString(), this, null, customerId, response); - } - - /** downloadEinvoice a creditNote (executes immediately) - returns raw Response. */ - Response downloadEinvoiceRaw(String creditNoteId) throws Exception { - String path = - buildPathWithParams( - "/credit_notes/{credit-note-id}/download_einvoice", "credit-note-id", creditNoteId); - - return get(path, null); - } - - public CreditNoteDownloadEinvoiceResponse downloadEinvoice(String creditNoteId) throws Exception { - Response response = downloadEinvoiceRaw(creditNoteId); - return CreditNoteDownloadEinvoiceResponse.fromJson(response.getBodyAsString(), response); - } - - /** pdf a creditNote (executes immediately) - returns raw Response. */ - Response pdfRaw(String creditNoteId) throws Exception { - String path = - buildPathWithParams("/credit_notes/{credit-note-id}/pdf", "credit-note-id", creditNoteId); - - return post(path, null); - } - - /** pdf a creditNote using immutable params (executes immediately) - returns raw Response. */ - Response pdfRaw(String creditNoteId, CreditNotePdfParams params) throws Exception { - String path = - buildPathWithParams("/credit_notes/{credit-note-id}/pdf", "credit-note-id", creditNoteId); - return post(path, params.toFormData()); - } - - /** pdf a creditNote using raw JSON payload (executes immediately) - returns raw Response. */ - Response pdfRaw(String creditNoteId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/credit_notes/{credit-note-id}/pdf", "credit-note-id", creditNoteId); - return postJson(path, jsonPayload); - } - - public CreditNotePdfResponse pdf(String creditNoteId, CreditNotePdfParams params) - throws Exception { - Response response = pdfRaw(creditNoteId, params); - return CreditNotePdfResponse.fromJson(response.getBodyAsString(), response); - } - - /** resendEinvoice a creditNote (executes immediately) - returns raw Response. */ - Response resendEinvoiceRaw(String creditNoteId) throws Exception { - String path = - buildPathWithParams( - "/credit_notes/{credit-note-id}/resend_einvoice", "credit-note-id", creditNoteId); - - return post(path, null); - } - - public CreditNoteResendEinvoiceResponse resendEinvoice(String creditNoteId) throws Exception { - Response response = resendEinvoiceRaw(creditNoteId); - return CreditNoteResendEinvoiceResponse.fromJson(response.getBodyAsString(), response); - } - - /** removeTaxWithheldRefund a creditNote (executes immediately) - returns raw Response. */ - Response removeTaxWithheldRefundRaw(String creditNoteId) throws Exception { - String path = - buildPathWithParams( - "/credit_notes/{credit-note-id}/remove_tax_withheld_refund", - "credit-note-id", - creditNoteId); - - return post(path, null); - } - - /** - * removeTaxWithheldRefund a creditNote using immutable params (executes immediately) - returns - * raw Response. - */ - Response removeTaxWithheldRefundRaw( - String creditNoteId, CreditNoteRemoveTaxWithheldRefundParams params) throws Exception { - String path = - buildPathWithParams( - "/credit_notes/{credit-note-id}/remove_tax_withheld_refund", - "credit-note-id", - creditNoteId); - return post(path, params.toFormData()); - } - - /** - * removeTaxWithheldRefund a creditNote using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response removeTaxWithheldRefundRaw(String creditNoteId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/credit_notes/{credit-note-id}/remove_tax_withheld_refund", - "credit-note-id", - creditNoteId); - return postJson(path, jsonPayload); - } - - public CreditNoteRemoveTaxWithheldRefundResponse removeTaxWithheldRefund( - String creditNoteId, CreditNoteRemoveTaxWithheldRefundParams params) throws Exception { - Response response = removeTaxWithheldRefundRaw(creditNoteId, params); - return CreditNoteRemoveTaxWithheldRefundResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a creditNote (executes immediately) - returns raw Response. */ - Response retrieveRaw(String creditNoteId) throws Exception { - String path = - buildPathWithParams("/credit_notes/{credit-note-id}", "credit-note-id", creditNoteId); - - return get(path, null); - } - - public CreditNoteRetrieveResponse retrieve(String creditNoteId) throws Exception { - Response response = retrieveRaw(creditNoteId); - return CreditNoteRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** sendEinvoice a creditNote (executes immediately) - returns raw Response. */ - Response sendEinvoiceRaw(String creditNoteId) throws Exception { - String path = - buildPathWithParams( - "/credit_notes/{credit-note-id}/send_einvoice", "credit-note-id", creditNoteId); - - return post(path, null); - } - - public CreditNoteSendEinvoiceResponse sendEinvoice(String creditNoteId) throws Exception { - Response response = sendEinvoiceRaw(creditNoteId); - return CreditNoteSendEinvoiceResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/CustomerService_old.java b/src/main/java/com/chargebee/v4/core/services/CustomerService_old.java deleted file mode 100644 index 684fbc53..00000000 --- a/src/main/java/com/chargebee/v4/core/services/CustomerService_old.java +++ /dev/null @@ -1,284 +0,0 @@ -//package com.chargebee.v4.core.services; -// -// -//import com.chargebee.v4.client.ChargebeeClient; -//import com.chargebee.v4.client.request.RequestOptions; -//import com.chargebee.core.http.ChargebeeApiResponse; -//import com.chargebee.core.models.customer.Customer; -//import com.chargebee.core.models.customer.CustomerList; -//import com.chargebee.core.models.customer.builder.CustomerCreateBuilder; -//import com.chargebee.core.models.customer.builder.CustomerCreateBuilderRaw; -//import com.chargebee.core.models.customer.builder.CustomerListBuilder; -//import com.chargebee.core.models.customer.builder.CustomerListBuilderRaw; -//import com.chargebee.core.models.customer.params.CustomerCreateParams; -//import com.chargebee.core.models.customer.params.CustomerListParams; -//import com.chargebee.v4.internal.JsonUtil; -//import com.chargebee.v4.transport.Response; -// -//import java.util.concurrent.CompletableFuture; -// -///** -// * Customer service for fluent API access. -// * Provides both quick-start fluent builders and params-based methods. -// */ -//public final class CustomerService_old extends BaseService { -// -// private final ServiceConfig config; -// -// public CustomerService_old(ChargebeeClient client) { -// super(client); -// this.config = ServiceConfig.defaultConfig(); -// } -// -// private CustomerService_old(ChargebeeClient client, RequestOptions options) { -// super(client, options); -// this.config = ServiceConfig.defaultConfig(); -// } -// -// private CustomerService_old(ChargebeeClient client, RequestOptions options, ServiceConfig config) { -// super(client, options); -// this.config = config; -// } -// -// @Override -// CustomerService_old with(RequestOptions newOptions) { -// return new CustomerService_old(client, newOptions, config); -// } -// -// private RawApi rawApiInstance; -// -// /** -// * Access methods that return raw responses (ChargebeeApiResponse). -// */ -// public RawApi withRawResponse() { -// if (this.rawApiInstance == null) { -// this.rawApiInstance = new RawApi(this); -// } -// return this.rawApiInstance; -// } -// -// /** -// * Start building a customer creation request. -// * For reusable params, prefer {@link #create(CustomerCreateParams)}. -// */ -// public CustomerCreateBuilder create() { -// return new CustomerCreateBuilder(this); -// } -// -// /** -// * Create a customer using immutable params (executes immediately) - returns raw Response. -// */ -// Response createRaw(CustomerCreateParams params) throws Exception { -// return post("/customers", params.toFormData()); -// } -// -// /** -// * Create a customer using raw JSON payload (executes immediately) - returns raw Response. -// */ -// Response createRaw(String jsonPayload) throws Exception { -// return postJson("/customers", jsonPayload); -// } -// -// public Customer create(CustomerCreateParams params) throws Exception { -// Response response = createRaw(params); -// return parseCustomerFromResponse(response); -// } -// -// /** -// * Create a customer using immutable params asynchronously - returns raw Response. -// */ -// CompletableFuture createRawAsync(CustomerCreateParams params) { -// return postAsync("/customers", params.toFormData()); -// } -// -// /** -// * Create a customer using raw JSON payload asynchronously - returns raw Response. -// */ -// CompletableFuture createRawAsync(String jsonPayload) { -// return postJsonAsync("/customers", jsonPayload); -// } -// -// /** -// * Start building a customer list request. -// * For reusable params, prefer {@link #list(CustomerListParams)}. -// */ -// public CustomerListBuilder list() { -// return new CustomerListBuilder(this); -// } -// -// /** -// * List customers using immutable params (executes immediately) - returns raw Response. -// */ -// public Response listRaw(CustomerListParams params) throws Exception { -// return get("/customers", params.toQueryParams()); -// } -// -// /** -// * List customers using immutable params asynchronously - returns raw Response. -// */ -// CompletableFuture listRawAsync(CustomerListParams params) { -// return getAsync("/customers", params.toQueryParams()); -// } -// -// // === Fluent Response API === -// -// /** -// * Create a customer and return a fluent Customer object. -// */ -// -// -// /** -// * Create a customer with JSON payload and return a fluent Customer object. -// */ -// public Customer create(String jsonPayload) throws Exception { -// Response response = createRaw(jsonPayload); -// return parseCustomerFromResponse(response); -// } -// -// /** -// * Create a customer asynchronously and return a fluent Customer object. -// */ -// public CompletableFuture createAsync(CustomerCreateParams params) { -// return createRawAsync(params).thenApply(this::parseCustomerFromResponse); -// } -// -// /** -// * Create a customer with JSON payload asynchronously and return a fluent Customer object. -// */ -// public CompletableFuture createAsync(String jsonPayload) { -// return createRawAsync(jsonPayload).thenApply(this::parseCustomerFromResponse); -// } -// -// -// -// /** -// * List all customers and return a fluent CustomerList with pagination support. -// */ -// public CustomerList listAll() throws Exception { -// CustomerListParams params = CustomerListParams.builder().build(); -// return list(params); -// } -// -// /** -// * List customers with params and return a fluent CustomerList with pagination support. -// */ -// public CustomerList list(CustomerListParams params) throws Exception { -// Response response = listRaw(params); -// return new CustomerList(this, params, response, false); -// } -// -// -// -// /** -// * List all customers asynchronously and return a fluent CustomerList with pagination support. -// */ -// public CompletableFuture listAllAsync() { -// CustomerListParams params = CustomerListParams.builder().build(); -// return listAsync(params); -// } -// -// /** -// * List customers with params asynchronously and return a fluent CustomerList with pagination support. -// */ -// public CompletableFuture listAsync(CustomerListParams params) { -// return listRawAsync(params).thenApply(response -> { -// try { -// return new CustomerList(this, params, response, false); -// } catch (Exception e) { -// throw new RuntimeException("Failed to parse customer list response", e); -// } -// }); -// } -// -// -// -// // === Helper Methods === -// -// private Customer parseCustomerFromResponse(Response response) { -// try { -// String json = response.getBodyAsString(); -// -// // Try parsing as wrapped format first: {"customer": {...}} -// String customerJson = JsonUtil.getObject(json, "customer"); -// if (customerJson != null) { -// return Customer.fromJson(customerJson); -// } -// -// // Fallback to direct format for testing: {"id": "...", "first_name": "..."} -// if (JsonUtil.hasValue(json, "id")) { -// return Customer.fromJson(json); -// } -// -// throw new IllegalStateException("Response does not contain customer data"); -// } catch (Exception e) { -// throw new RuntimeException("Failed to parse customer from response", e); -// } -// } -// -// /** -// * API methods that return raw responses, including status code and headers. -// */ -// public class RawApi { -// private final CustomerService_old service; -// -// RawApi(CustomerService_old service) { -// this.service = service; -// } -// -// /** -// * Start building a customer creation request that will return a raw response. -// */ -// public CustomerCreateBuilderRaw create() { -// return new CustomerCreateBuilderRaw(this); -// } -// -// /** -// * Create a customer and return a raw response object. -// */ -// public ChargebeeApiResponse create(CustomerCreateParams params) throws Exception { -// Response response = service.createRaw(params); -// Customer customer = service.parseCustomerFromResponse(response); -// return new ChargebeeApiResponse<>(response, customer); -// } -// -// /** -// * Create a customer asynchronously and return a raw response object. -// */ -// public CompletableFuture> createAsync(CustomerCreateParams params) { -// return service.createRawAsync(params).thenApply(response -> { -// Customer customer = service.parseCustomerFromResponse(response); -// return new ChargebeeApiResponse<>(response, customer); -// }); -// } -// -// /** -// * Start building a customer list request that will return a raw response. -// */ -// public CustomerListBuilderRaw list() { -// return new CustomerListBuilderRaw(this); -// } -// -// /** -// * List customers and return a raw response object. -// */ -// public ChargebeeApiResponse list(CustomerListParams params) throws Exception { -// Response response = service.listRaw(params); -// CustomerList customerList = new CustomerList(service, params, response, false); -// return new ChargebeeApiResponse<>(response, customerList); -// } -// -// /** -// * List customers asynchronously and return a raw response object. -// */ -// public CompletableFuture> listAsync(CustomerListParams params) { -// return service.listRawAsync(params).thenApply(response -> { -// try { -// CustomerList customerList = new CustomerList(service, params, response, false); -// return new ChargebeeApiResponse<>(response, customerList); -// } catch (Exception e) { -// throw new RuntimeException(e); -// } -// }); -// } -// } -//} \ No newline at end of file diff --git a/src/main/java/com/chargebee/v4/core/services/DifferentialPriceService.java b/src/main/java/com/chargebee/v4/core/services/DifferentialPriceService.java deleted file mode 100644 index bcbb5df4..00000000 --- a/src/main/java/com/chargebee/v4/core/services/DifferentialPriceService.java +++ /dev/null @@ -1,241 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.differentialPrice.params.DifferentialPriceDeleteParams; - -import com.chargebee.v4.core.models.differentialPrice.params.DifferentialPriceCreateParams; - -import com.chargebee.v4.core.models.differentialPrice.params.DifferentialPriceListParams; - -import com.chargebee.v4.core.models.differentialPrice.params.DifferentialPriceUpdateParams; - -import com.chargebee.v4.core.responses.differentialPrice.DifferentialPriceDeleteResponse; - -import com.chargebee.v4.core.responses.differentialPrice.DifferentialPriceCreateResponse; - -import com.chargebee.v4.core.responses.differentialPrice.DifferentialPriceListResponse; - -import com.chargebee.v4.core.responses.differentialPrice.DifferentialPriceRetrieveResponse; - -import com.chargebee.v4.core.responses.differentialPrice.DifferentialPriceUpdateResponse; - -public final class DifferentialPriceService extends BaseService { - - private final ServiceConfig config; - - public DifferentialPriceService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private DifferentialPriceService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private DifferentialPriceService( - ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - DifferentialPriceService with(RequestOptions newOptions) { - return new DifferentialPriceService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public DifferentialPriceService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** delete a differentialPrice (executes immediately) - returns raw Response. */ - Response deleteRaw(String differentialPriceId) throws Exception { - String path = - buildPathWithParams( - "/differential_prices/{differential-price-id}/delete", - "differential-price-id", - differentialPriceId); - - return post(path, null); - } - - /** - * delete a differentialPrice using immutable params (executes immediately) - returns raw - * Response. - */ - Response deleteRaw(String differentialPriceId, DifferentialPriceDeleteParams params) - throws Exception { - String path = - buildPathWithParams( - "/differential_prices/{differential-price-id}/delete", - "differential-price-id", - differentialPriceId); - return post(path, params.toFormData()); - } - - /** - * delete a differentialPrice using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response deleteRaw(String differentialPriceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/differential_prices/{differential-price-id}/delete", - "differential-price-id", - differentialPriceId); - return postJson(path, jsonPayload); - } - - public DifferentialPriceDeleteResponse delete( - String differentialPriceId, DifferentialPriceDeleteParams params) throws Exception { - Response response = deleteRaw(differentialPriceId, params); - return DifferentialPriceDeleteResponse.fromJson(response.getBodyAsString(), response); - } - - /** create a differentialPrice (executes immediately) - returns raw Response. */ - Response createRaw(String itemPriceId) throws Exception { - String path = - buildPathWithParams( - "/item_prices/{item-price-id}/differential_prices", "item-price-id", itemPriceId); - - return post(path, null); - } - - /** - * create a differentialPrice using immutable params (executes immediately) - returns raw - * Response. - */ - Response createRaw(String itemPriceId, DifferentialPriceCreateParams params) throws Exception { - String path = - buildPathWithParams( - "/item_prices/{item-price-id}/differential_prices", "item-price-id", itemPriceId); - return post(path, params.toFormData()); - } - - /** - * create a differentialPrice using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response createRaw(String itemPriceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/item_prices/{item-price-id}/differential_prices", "item-price-id", itemPriceId); - return postJson(path, jsonPayload); - } - - public DifferentialPriceCreateResponse create( - String itemPriceId, DifferentialPriceCreateParams params) throws Exception { - Response response = createRaw(itemPriceId, params); - return DifferentialPriceCreateResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * list a differentialPrice using immutable params (executes immediately) - returns raw Response. - */ - Response listRaw(DifferentialPriceListParams params) throws Exception { - - return get("/differential_prices", params != null ? params.toQueryParams() : null); - } - - /** list a differentialPrice without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/differential_prices", null); - } - - /** - * list a differentialPrice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public DifferentialPriceListResponse list(DifferentialPriceListParams params) throws Exception { - Response response = listRaw(params); - - return DifferentialPriceListResponse.fromJson( - response.getBodyAsString(), this, params, response); - } - - public DifferentialPriceListResponse list() throws Exception { - Response response = listRaw(); - return DifferentialPriceListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** retrieve a differentialPrice (executes immediately) - returns raw Response. */ - Response retrieveRaw(String differentialPriceId) throws Exception { - String path = - buildPathWithParams( - "/differential_prices/{differential-price-id}", - "differential-price-id", - differentialPriceId); - - return get(path, null); - } - - public DifferentialPriceRetrieveResponse retrieve(String differentialPriceId) throws Exception { - Response response = retrieveRaw(differentialPriceId); - return DifferentialPriceRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** update a differentialPrice (executes immediately) - returns raw Response. */ - Response updateRaw(String differentialPriceId) throws Exception { - String path = - buildPathWithParams( - "/differential_prices/{differential-price-id}", - "differential-price-id", - differentialPriceId); - - return post(path, null); - } - - /** - * update a differentialPrice using immutable params (executes immediately) - returns raw - * Response. - */ - Response updateRaw(String differentialPriceId, DifferentialPriceUpdateParams params) - throws Exception { - String path = - buildPathWithParams( - "/differential_prices/{differential-price-id}", - "differential-price-id", - differentialPriceId); - return post(path, params.toFormData()); - } - - /** - * update a differentialPrice using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response updateRaw(String differentialPriceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/differential_prices/{differential-price-id}", - "differential-price-id", - differentialPriceId); - return postJson(path, jsonPayload); - } - - public DifferentialPriceUpdateResponse update( - String differentialPriceId, DifferentialPriceUpdateParams params) throws Exception { - Response response = updateRaw(differentialPriceId, params); - return DifferentialPriceUpdateResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/EntitlementOverrideService.java b/src/main/java/com/chargebee/v4/core/services/EntitlementOverrideService.java deleted file mode 100644 index 55ccedc8..00000000 --- a/src/main/java/com/chargebee/v4/core/services/EntitlementOverrideService.java +++ /dev/null @@ -1,168 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.entitlementOverride.params.EntitlementOverrideListEntitlementOverrideForSubscriptionParams; - -import com.chargebee.v4.core.models.entitlementOverride.params.EntitlementOverrideAddEntitlementOverrideForSubscriptionParams; - -import com.chargebee.v4.core.responses.entitlementOverride.EntitlementOverrideListEntitlementOverrideForSubscriptionResponse; - -import com.chargebee.v4.core.responses.entitlementOverride.EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse; - -public final class EntitlementOverrideService extends BaseService { - - private final ServiceConfig config; - - public EntitlementOverrideService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private EntitlementOverrideService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private EntitlementOverrideService( - ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - EntitlementOverrideService with(RequestOptions newOptions) { - return new EntitlementOverrideService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public EntitlementOverrideService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** - * listEntitlementOverrideForSubscription a entitlementOverride using immutable params (executes - * immediately) - returns raw Response. - */ - Response listEntitlementOverrideForSubscriptionRaw( - String subscriptionId, EntitlementOverrideListEntitlementOverrideForSubscriptionParams params) - throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/entitlement_overrides", - "subscription-id", - subscriptionId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * listEntitlementOverrideForSubscription a entitlementOverride without params (executes - * immediately) - returns raw Response. - */ - Response listEntitlementOverrideForSubscriptionRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/entitlement_overrides", - "subscription-id", - subscriptionId); - return get(path, null); - } - - /** - * listEntitlementOverrideForSubscription a entitlementOverride using raw JSON payload (executes - * immediately) - returns raw Response. - */ - Response listEntitlementOverrideForSubscriptionRaw(String subscriptionId, String jsonPayload) - throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/entitlement_overrides", - "subscription-id", - subscriptionId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public EntitlementOverrideListEntitlementOverrideForSubscriptionResponse - listEntitlementOverrideForSubscription( - String subscriptionId, - EntitlementOverrideListEntitlementOverrideForSubscriptionParams params) - throws Exception { - Response response = listEntitlementOverrideForSubscriptionRaw(subscriptionId, params); - return EntitlementOverrideListEntitlementOverrideForSubscriptionResponse.fromJson( - response.getBodyAsString(), this, params, subscriptionId, response); - } - - public EntitlementOverrideListEntitlementOverrideForSubscriptionResponse - listEntitlementOverrideForSubscription(String subscriptionId) throws Exception { - Response response = listEntitlementOverrideForSubscriptionRaw(subscriptionId); - return EntitlementOverrideListEntitlementOverrideForSubscriptionResponse.fromJson( - response.getBodyAsString(), this, null, subscriptionId, response); - } - - /** - * addEntitlementOverrideForSubscription a entitlementOverride (executes immediately) - returns - * raw Response. - */ - Response addEntitlementOverrideForSubscriptionRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/entitlement_overrides", - "subscription-id", - subscriptionId); - - return post(path, null); - } - - /** - * addEntitlementOverrideForSubscription a entitlementOverride using immutable params (executes - * immediately) - returns raw Response. - */ - Response addEntitlementOverrideForSubscriptionRaw( - String subscriptionId, EntitlementOverrideAddEntitlementOverrideForSubscriptionParams params) - throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/entitlement_overrides", - "subscription-id", - subscriptionId); - return post(path, params.toFormData()); - } - - /** - * addEntitlementOverrideForSubscription a entitlementOverride using raw JSON payload (executes - * immediately) - returns raw Response. - */ - Response addEntitlementOverrideForSubscriptionRaw(String subscriptionId, String jsonPayload) - throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/entitlement_overrides", - "subscription-id", - subscriptionId); - return postJson(path, jsonPayload); - } - - public EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse - addEntitlementOverrideForSubscription( - String subscriptionId, - EntitlementOverrideAddEntitlementOverrideForSubscriptionParams params) - throws Exception { - Response response = addEntitlementOverrideForSubscriptionRaw(subscriptionId, params); - return EntitlementOverrideAddEntitlementOverrideForSubscriptionResponse.fromJson( - response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/EstimateService.java b/src/main/java/com/chargebee/v4/core/services/EstimateService.java deleted file mode 100644 index fbc7a6c8..00000000 --- a/src/main/java/com/chargebee/v4/core/services/EstimateService.java +++ /dev/null @@ -1,750 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.estimate.params.EstimateCreateSubItemEstimateParams; - -import com.chargebee.v4.core.models.estimate.params.EstimatePaymentSchedulesParams; - -import com.chargebee.v4.core.models.estimate.params.EstimateCancelSubscriptionForItemsParams; - -import com.chargebee.v4.core.models.estimate.params.EstimateResumeSubscriptionParams; - -import com.chargebee.v4.core.models.estimate.params.EstimateCreateInvoiceForItemsParams; - -import com.chargebee.v4.core.models.estimate.params.EstimateGiftSubscriptionForItemsParams; - -import com.chargebee.v4.core.models.estimate.params.EstimateUpdateSubscriptionForItemsParams; - -import com.chargebee.v4.core.models.estimate.params.EstimateRegenerateInvoiceEstimateParams; - -import com.chargebee.v4.core.models.estimate.params.EstimateCreateSubItemForCustomerEstimateParams; - -import com.chargebee.v4.core.models.estimate.params.EstimateChangeTermEndParams; - -import com.chargebee.v4.core.models.estimate.params.EstimatePauseSubscriptionParams; - -import com.chargebee.v4.core.models.estimate.params.EstimateAdvanceInvoiceEstimateParams; - -import com.chargebee.v4.core.models.estimate.params.EstimateUpdateSubscriptionParams; - -import com.chargebee.v4.core.models.estimate.params.EstimateGiftSubscriptionParams; - -import com.chargebee.v4.core.models.estimate.params.EstimateCreateSubscriptionParams; - -import com.chargebee.v4.core.models.estimate.params.EstimateCreateInvoiceParams; - -import com.chargebee.v4.core.models.estimate.params.EstimateCancelSubscriptionParams; - -import com.chargebee.v4.core.responses.estimate.EstimateRenewalEstimateResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateCreateSubItemEstimateResponse; - -import com.chargebee.v4.core.responses.estimate.EstimatePaymentSchedulesResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateCancelSubscriptionForItemsResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateResumeSubscriptionResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateCreateInvoiceForItemsResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateGiftSubscriptionForItemsResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateUpdateSubscriptionForItemsResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateUpcomingInvoicesEstimateResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateRegenerateInvoiceEstimateResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateCreateSubItemForCustomerEstimateResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateChangeTermEndResponse; - -import com.chargebee.v4.core.responses.estimate.EstimatePauseSubscriptionResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateAdvanceInvoiceEstimateResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateUpdateSubscriptionResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateGiftSubscriptionResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateCreateSubForCustomerEstimateResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateCreateSubscriptionResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateCreateInvoiceResponse; - -import com.chargebee.v4.core.responses.estimate.EstimateCancelSubscriptionResponse; - -public final class EstimateService extends BaseService { - - private final ServiceConfig config; - - public EstimateService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private EstimateService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private EstimateService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - EstimateService with(RequestOptions newOptions) { - return new EstimateService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public EstimateService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** renewalEstimate a estimate (executes immediately) - returns raw Response. */ - Response renewalEstimateRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/renewal_estimate", "subscription-id", subscriptionId); - - return get(path, null); - } - - public EstimateRenewalEstimateResponse renewalEstimate(String subscriptionId) throws Exception { - Response response = renewalEstimateRaw(subscriptionId); - return EstimateRenewalEstimateResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createSubItemEstimate a estimate using immutable params (executes immediately) - returns raw - * Response. - */ - Response createSubItemEstimateRaw(EstimateCreateSubItemEstimateParams params) throws Exception { - - return post( - "/estimates/create_subscription_for_items", params != null ? params.toFormData() : null); - } - - /** - * createSubItemEstimate a estimate using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response createSubItemEstimateRaw(String jsonPayload) throws Exception { - - return postJson("/estimates/create_subscription_for_items", jsonPayload); - } - - public EstimateCreateSubItemEstimateResponse createSubItemEstimate( - EstimateCreateSubItemEstimateParams params) throws Exception { - Response response = createSubItemEstimateRaw(params); - - return EstimateCreateSubItemEstimateResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * paymentSchedules a estimate using immutable params (executes immediately) - returns raw - * Response. - */ - Response paymentSchedulesRaw(EstimatePaymentSchedulesParams params) throws Exception { - - return post("/estimates/payment_schedules", params != null ? params.toFormData() : null); - } - - /** - * paymentSchedules a estimate using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response paymentSchedulesRaw(String jsonPayload) throws Exception { - - return postJson("/estimates/payment_schedules", jsonPayload); - } - - public EstimatePaymentSchedulesResponse paymentSchedules(EstimatePaymentSchedulesParams params) - throws Exception { - Response response = paymentSchedulesRaw(params); - - return EstimatePaymentSchedulesResponse.fromJson(response.getBodyAsString(), response); - } - - /** cancelSubscriptionForItems a estimate (executes immediately) - returns raw Response. */ - Response cancelSubscriptionForItemsRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/cancel_subscription_for_items_estimate", - "subscription-id", - subscriptionId); - - return post(path, null); - } - - /** - * cancelSubscriptionForItems a estimate using immutable params (executes immediately) - returns - * raw Response. - */ - Response cancelSubscriptionForItemsRaw( - String subscriptionId, EstimateCancelSubscriptionForItemsParams params) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/cancel_subscription_for_items_estimate", - "subscription-id", - subscriptionId); - return post(path, params.toFormData()); - } - - /** - * cancelSubscriptionForItems a estimate using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response cancelSubscriptionForItemsRaw(String subscriptionId, String jsonPayload) - throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/cancel_subscription_for_items_estimate", - "subscription-id", - subscriptionId); - return postJson(path, jsonPayload); - } - - public EstimateCancelSubscriptionForItemsResponse cancelSubscriptionForItems( - String subscriptionId, EstimateCancelSubscriptionForItemsParams params) throws Exception { - Response response = cancelSubscriptionForItemsRaw(subscriptionId, params); - return EstimateCancelSubscriptionForItemsResponse.fromJson( - response.getBodyAsString(), response); - } - - /** resumeSubscription a estimate (executes immediately) - returns raw Response. */ - Response resumeSubscriptionRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/resume_subscription_estimate", - "subscription-id", - subscriptionId); - - return post(path, null); - } - - /** - * resumeSubscription a estimate using immutable params (executes immediately) - returns raw - * Response. - */ - Response resumeSubscriptionRaw(String subscriptionId, EstimateResumeSubscriptionParams params) - throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/resume_subscription_estimate", - "subscription-id", - subscriptionId); - return post(path, params.toFormData()); - } - - /** - * resumeSubscription a estimate using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response resumeSubscriptionRaw(String subscriptionId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/resume_subscription_estimate", - "subscription-id", - subscriptionId); - return postJson(path, jsonPayload); - } - - public EstimateResumeSubscriptionResponse resumeSubscription( - String subscriptionId, EstimateResumeSubscriptionParams params) throws Exception { - Response response = resumeSubscriptionRaw(subscriptionId, params); - return EstimateResumeSubscriptionResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createInvoiceForItems a estimate using immutable params (executes immediately) - returns raw - * Response. - */ - Response createInvoiceForItemsRaw(EstimateCreateInvoiceForItemsParams params) throws Exception { - - return post("/estimates/create_invoice_for_items", params != null ? params.toFormData() : null); - } - - /** - * createInvoiceForItems a estimate using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response createInvoiceForItemsRaw(String jsonPayload) throws Exception { - - return postJson("/estimates/create_invoice_for_items", jsonPayload); - } - - public EstimateCreateInvoiceForItemsResponse createInvoiceForItems( - EstimateCreateInvoiceForItemsParams params) throws Exception { - Response response = createInvoiceForItemsRaw(params); - - return EstimateCreateInvoiceForItemsResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * giftSubscriptionForItems a estimate using immutable params (executes immediately) - returns raw - * Response. - */ - Response giftSubscriptionForItemsRaw(EstimateGiftSubscriptionForItemsParams params) - throws Exception { - - return post( - "/estimates/gift_subscription_for_items", params != null ? params.toFormData() : null); - } - - /** - * giftSubscriptionForItems a estimate using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response giftSubscriptionForItemsRaw(String jsonPayload) throws Exception { - - return postJson("/estimates/gift_subscription_for_items", jsonPayload); - } - - public EstimateGiftSubscriptionForItemsResponse giftSubscriptionForItems( - EstimateGiftSubscriptionForItemsParams params) throws Exception { - Response response = giftSubscriptionForItemsRaw(params); - - return EstimateGiftSubscriptionForItemsResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * updateSubscriptionForItems a estimate using immutable params (executes immediately) - returns - * raw Response. - */ - Response updateSubscriptionForItemsRaw(EstimateUpdateSubscriptionForItemsParams params) - throws Exception { - - return post( - "/estimates/update_subscription_for_items", params != null ? params.toFormData() : null); - } - - /** - * updateSubscriptionForItems a estimate using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response updateSubscriptionForItemsRaw(String jsonPayload) throws Exception { - - return postJson("/estimates/update_subscription_for_items", jsonPayload); - } - - public EstimateUpdateSubscriptionForItemsResponse updateSubscriptionForItems( - EstimateUpdateSubscriptionForItemsParams params) throws Exception { - Response response = updateSubscriptionForItemsRaw(params); - - return EstimateUpdateSubscriptionForItemsResponse.fromJson( - response.getBodyAsString(), response); - } - - /** upcomingInvoicesEstimate a estimate (executes immediately) - returns raw Response. */ - Response upcomingInvoicesEstimateRaw(String customerId) throws Exception { - String path = - buildPathWithParams( - "/customers/{customer-id}/upcoming_invoices_estimate", "customer-id", customerId); - - return get(path, null); - } - - public EstimateUpcomingInvoicesEstimateResponse upcomingInvoicesEstimate(String customerId) - throws Exception { - Response response = upcomingInvoicesEstimateRaw(customerId); - return EstimateUpcomingInvoicesEstimateResponse.fromJson(response.getBodyAsString(), response); - } - - /** regenerateInvoiceEstimate a estimate (executes immediately) - returns raw Response. */ - Response regenerateInvoiceEstimateRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/regenerate_invoice_estimate", - "subscription-id", - subscriptionId); - - return post(path, null); - } - - /** - * regenerateInvoiceEstimate a estimate using immutable params (executes immediately) - returns - * raw Response. - */ - Response regenerateInvoiceEstimateRaw( - String subscriptionId, EstimateRegenerateInvoiceEstimateParams params) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/regenerate_invoice_estimate", - "subscription-id", - subscriptionId); - return post(path, params.toFormData()); - } - - /** - * regenerateInvoiceEstimate a estimate using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response regenerateInvoiceEstimateRaw(String subscriptionId, String jsonPayload) - throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/regenerate_invoice_estimate", - "subscription-id", - subscriptionId); - return postJson(path, jsonPayload); - } - - public EstimateRegenerateInvoiceEstimateResponse regenerateInvoiceEstimate( - String subscriptionId, EstimateRegenerateInvoiceEstimateParams params) throws Exception { - Response response = regenerateInvoiceEstimateRaw(subscriptionId, params); - return EstimateRegenerateInvoiceEstimateResponse.fromJson(response.getBodyAsString(), response); - } - - /** createSubItemForCustomerEstimate a estimate (executes immediately) - returns raw Response. */ - Response createSubItemForCustomerEstimateRaw(String customerId) throws Exception { - String path = - buildPathWithParams( - "/customers/{customer-id}/create_subscription_for_items_estimate", - "customer-id", - customerId); - - return post(path, null); - } - - /** - * createSubItemForCustomerEstimate a estimate using immutable params (executes immediately) - - * returns raw Response. - */ - Response createSubItemForCustomerEstimateRaw( - String customerId, EstimateCreateSubItemForCustomerEstimateParams params) throws Exception { - String path = - buildPathWithParams( - "/customers/{customer-id}/create_subscription_for_items_estimate", - "customer-id", - customerId); - return post(path, params.toFormData()); - } - - /** - * createSubItemForCustomerEstimate a estimate using raw JSON payload (executes immediately) - - * returns raw Response. - */ - Response createSubItemForCustomerEstimateRaw(String customerId, String jsonPayload) - throws Exception { - String path = - buildPathWithParams( - "/customers/{customer-id}/create_subscription_for_items_estimate", - "customer-id", - customerId); - return postJson(path, jsonPayload); - } - - public EstimateCreateSubItemForCustomerEstimateResponse createSubItemForCustomerEstimate( - String customerId, EstimateCreateSubItemForCustomerEstimateParams params) throws Exception { - Response response = createSubItemForCustomerEstimateRaw(customerId, params); - return EstimateCreateSubItemForCustomerEstimateResponse.fromJson( - response.getBodyAsString(), response); - } - - /** changeTermEnd a estimate (executes immediately) - returns raw Response. */ - Response changeTermEndRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/change_term_end_estimate", - "subscription-id", - subscriptionId); - - return post(path, null); - } - - /** - * changeTermEnd a estimate using immutable params (executes immediately) - returns raw Response. - */ - Response changeTermEndRaw(String subscriptionId, EstimateChangeTermEndParams params) - throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/change_term_end_estimate", - "subscription-id", - subscriptionId); - return post(path, params.toFormData()); - } - - /** - * changeTermEnd a estimate using raw JSON payload (executes immediately) - returns raw Response. - */ - Response changeTermEndRaw(String subscriptionId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/change_term_end_estimate", - "subscription-id", - subscriptionId); - return postJson(path, jsonPayload); - } - - public EstimateChangeTermEndResponse changeTermEnd( - String subscriptionId, EstimateChangeTermEndParams params) throws Exception { - Response response = changeTermEndRaw(subscriptionId, params); - return EstimateChangeTermEndResponse.fromJson(response.getBodyAsString(), response); - } - - /** pauseSubscription a estimate (executes immediately) - returns raw Response. */ - Response pauseSubscriptionRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/pause_subscription_estimate", - "subscription-id", - subscriptionId); - - return post(path, null); - } - - /** - * pauseSubscription a estimate using immutable params (executes immediately) - returns raw - * Response. - */ - Response pauseSubscriptionRaw(String subscriptionId, EstimatePauseSubscriptionParams params) - throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/pause_subscription_estimate", - "subscription-id", - subscriptionId); - return post(path, params.toFormData()); - } - - /** - * pauseSubscription a estimate using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response pauseSubscriptionRaw(String subscriptionId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/pause_subscription_estimate", - "subscription-id", - subscriptionId); - return postJson(path, jsonPayload); - } - - public EstimatePauseSubscriptionResponse pauseSubscription( - String subscriptionId, EstimatePauseSubscriptionParams params) throws Exception { - Response response = pauseSubscriptionRaw(subscriptionId, params); - return EstimatePauseSubscriptionResponse.fromJson(response.getBodyAsString(), response); - } - - /** advanceInvoiceEstimate a estimate (executes immediately) - returns raw Response. */ - Response advanceInvoiceEstimateRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/advance_invoice_estimate", - "subscription-id", - subscriptionId); - - return post(path, null); - } - - /** - * advanceInvoiceEstimate a estimate using immutable params (executes immediately) - returns raw - * Response. - */ - Response advanceInvoiceEstimateRaw( - String subscriptionId, EstimateAdvanceInvoiceEstimateParams params) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/advance_invoice_estimate", - "subscription-id", - subscriptionId); - return post(path, params.toFormData()); - } - - /** - * advanceInvoiceEstimate a estimate using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response advanceInvoiceEstimateRaw(String subscriptionId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/advance_invoice_estimate", - "subscription-id", - subscriptionId); - return postJson(path, jsonPayload); - } - - public EstimateAdvanceInvoiceEstimateResponse advanceInvoiceEstimate( - String subscriptionId, EstimateAdvanceInvoiceEstimateParams params) throws Exception { - Response response = advanceInvoiceEstimateRaw(subscriptionId, params); - return EstimateAdvanceInvoiceEstimateResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * updateSubscription a estimate using immutable params (executes immediately) - returns raw - * Response. - */ - Response updateSubscriptionRaw(EstimateUpdateSubscriptionParams params) throws Exception { - - return post("/estimates/update_subscription", params != null ? params.toFormData() : null); - } - - /** - * updateSubscription a estimate using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response updateSubscriptionRaw(String jsonPayload) throws Exception { - - return postJson("/estimates/update_subscription", jsonPayload); - } - - public EstimateUpdateSubscriptionResponse updateSubscription( - EstimateUpdateSubscriptionParams params) throws Exception { - Response response = updateSubscriptionRaw(params); - - return EstimateUpdateSubscriptionResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * giftSubscription a estimate using immutable params (executes immediately) - returns raw - * Response. - */ - Response giftSubscriptionRaw(EstimateGiftSubscriptionParams params) throws Exception { - - return post("/estimates/gift_subscription", params != null ? params.toFormData() : null); - } - - /** - * giftSubscription a estimate using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response giftSubscriptionRaw(String jsonPayload) throws Exception { - - return postJson("/estimates/gift_subscription", jsonPayload); - } - - public EstimateGiftSubscriptionResponse giftSubscription(EstimateGiftSubscriptionParams params) - throws Exception { - Response response = giftSubscriptionRaw(params); - - return EstimateGiftSubscriptionResponse.fromJson(response.getBodyAsString(), response); - } - - /** createSubForCustomerEstimate a estimate (executes immediately) - returns raw Response. */ - Response createSubForCustomerEstimateRaw(String customerId) throws Exception { - String path = - buildPathWithParams( - "/customers/{customer-id}/create_subscription_estimate", "customer-id", customerId); - - return get(path, null); - } - - public EstimateCreateSubForCustomerEstimateResponse createSubForCustomerEstimate( - String customerId) throws Exception { - Response response = createSubForCustomerEstimateRaw(customerId); - return EstimateCreateSubForCustomerEstimateResponse.fromJson( - response.getBodyAsString(), response); - } - - /** - * createSubscription a estimate using immutable params (executes immediately) - returns raw - * Response. - */ - Response createSubscriptionRaw(EstimateCreateSubscriptionParams params) throws Exception { - - return post("/estimates/create_subscription", params != null ? params.toFormData() : null); - } - - /** - * createSubscription a estimate using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response createSubscriptionRaw(String jsonPayload) throws Exception { - - return postJson("/estimates/create_subscription", jsonPayload); - } - - public EstimateCreateSubscriptionResponse createSubscription( - EstimateCreateSubscriptionParams params) throws Exception { - Response response = createSubscriptionRaw(params); - - return EstimateCreateSubscriptionResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createInvoice a estimate using immutable params (executes immediately) - returns raw Response. - */ - Response createInvoiceRaw(EstimateCreateInvoiceParams params) throws Exception { - - return post("/estimates/create_invoice", params != null ? params.toFormData() : null); - } - - /** - * createInvoice a estimate using raw JSON payload (executes immediately) - returns raw Response. - */ - Response createInvoiceRaw(String jsonPayload) throws Exception { - - return postJson("/estimates/create_invoice", jsonPayload); - } - - public EstimateCreateInvoiceResponse createInvoice(EstimateCreateInvoiceParams params) - throws Exception { - Response response = createInvoiceRaw(params); - - return EstimateCreateInvoiceResponse.fromJson(response.getBodyAsString(), response); - } - - /** cancelSubscription a estimate (executes immediately) - returns raw Response. */ - Response cancelSubscriptionRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/cancel_subscription_estimate", - "subscription-id", - subscriptionId); - - return post(path, null); - } - - /** - * cancelSubscription a estimate using immutable params (executes immediately) - returns raw - * Response. - */ - Response cancelSubscriptionRaw(String subscriptionId, EstimateCancelSubscriptionParams params) - throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/cancel_subscription_estimate", - "subscription-id", - subscriptionId); - return post(path, params.toFormData()); - } - - /** - * cancelSubscription a estimate using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response cancelSubscriptionRaw(String subscriptionId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/cancel_subscription_estimate", - "subscription-id", - subscriptionId); - return postJson(path, jsonPayload); - } - - public EstimateCancelSubscriptionResponse cancelSubscription( - String subscriptionId, EstimateCancelSubscriptionParams params) throws Exception { - Response response = cancelSubscriptionRaw(subscriptionId, params); - return EstimateCancelSubscriptionResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/ExportService.java b/src/main/java/com/chargebee/v4/core/services/ExportService.java deleted file mode 100644 index 9607042e..00000000 --- a/src/main/java/com/chargebee/v4/core/services/ExportService.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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.export.params.ExportCustomersParams; - -import com.chargebee.v4.core.models.export.params.ExportAttachedItemsParams; - -import com.chargebee.v4.core.models.export.params.ExportTransactionsParams; - -import com.chargebee.v4.core.models.export.params.ExportDifferentialPricesParams; - -import com.chargebee.v4.core.models.export.params.ExportItemFamiliesParams; - -import com.chargebee.v4.core.models.export.params.ExportInvoicesParams; - -import com.chargebee.v4.core.models.export.params.ExportPriceVariantsParams; - -import com.chargebee.v4.core.models.export.params.ExportItemsParams; - -import com.chargebee.v4.core.models.export.params.ExportDeferredRevenueParams; - -import com.chargebee.v4.core.models.export.params.ExportRevenueRecognitionParams; - -import com.chargebee.v4.core.models.export.params.ExportCreditNotesParams; - -import com.chargebee.v4.core.models.export.params.ExportCouponsParams; - -import com.chargebee.v4.core.models.export.params.ExportOrdersParams; - -import com.chargebee.v4.core.models.export.params.ExportItemPricesParams; - -import com.chargebee.v4.core.models.export.params.ExportSubscriptionsParams; - -import com.chargebee.v4.core.models.export.params.ExportAddonsParams; - -import com.chargebee.v4.core.models.export.params.ExportPlansParams; - -import com.chargebee.v4.core.responses.export.ExportCustomersResponse; - -import com.chargebee.v4.core.responses.export.ExportAttachedItemsResponse; - -import com.chargebee.v4.core.responses.export.ExportTransactionsResponse; - -import com.chargebee.v4.core.responses.export.ExportDifferentialPricesResponse; - -import com.chargebee.v4.core.responses.export.ExportItemFamiliesResponse; - -import com.chargebee.v4.core.responses.export.ExportInvoicesResponse; - -import com.chargebee.v4.core.responses.export.ExportRetrieveResponse; - -import com.chargebee.v4.core.responses.export.ExportPriceVariantsResponse; - -import com.chargebee.v4.core.responses.export.ExportItemsResponse; - -import com.chargebee.v4.core.responses.export.ExportDeferredRevenueResponse; - -import com.chargebee.v4.core.responses.export.ExportRevenueRecognitionResponse; - -import com.chargebee.v4.core.responses.export.ExportCreditNotesResponse; - -import com.chargebee.v4.core.responses.export.ExportCouponsResponse; - -import com.chargebee.v4.core.responses.export.ExportOrdersResponse; - -import com.chargebee.v4.core.responses.export.ExportItemPricesResponse; - -import com.chargebee.v4.core.responses.export.ExportSubscriptionsResponse; - -import com.chargebee.v4.core.responses.export.ExportAddonsResponse; - -import com.chargebee.v4.core.responses.export.ExportPlansResponse; - -public final class ExportService extends BaseService { - - private final ServiceConfig config; - - public ExportService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private ExportService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private ExportService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - ExportService with(RequestOptions newOptions) { - return new ExportService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public ExportService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** customers a export using immutable params (executes immediately) - returns raw Response. */ - Response customersRaw(ExportCustomersParams params) throws Exception { - - return post("/exports/customers", params != null ? params.toFormData() : null); - } - - /** customers a export using raw JSON payload (executes immediately) - returns raw Response. */ - Response customersRaw(String jsonPayload) throws Exception { - - return postJson("/exports/customers", jsonPayload); - } - - public ExportCustomersResponse customers(ExportCustomersParams params) throws Exception { - Response response = customersRaw(params); - - return ExportCustomersResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * attachedItems a export using immutable params (executes immediately) - returns raw Response. - */ - Response attachedItemsRaw(ExportAttachedItemsParams params) throws Exception { - - return post("/exports/attached_items", params != null ? params.toFormData() : null); - } - - /** - * attachedItems a export using raw JSON payload (executes immediately) - returns raw Response. - */ - Response attachedItemsRaw(String jsonPayload) throws Exception { - - return postJson("/exports/attached_items", jsonPayload); - } - - public ExportAttachedItemsResponse attachedItems(ExportAttachedItemsParams params) - throws Exception { - Response response = attachedItemsRaw(params); - - return ExportAttachedItemsResponse.fromJson(response.getBodyAsString(), response); - } - - /** transactions a export using immutable params (executes immediately) - returns raw Response. */ - Response transactionsRaw(ExportTransactionsParams params) throws Exception { - - return post("/exports/transactions", params != null ? params.toFormData() : null); - } - - /** transactions a export using raw JSON payload (executes immediately) - returns raw Response. */ - Response transactionsRaw(String jsonPayload) throws Exception { - - return postJson("/exports/transactions", jsonPayload); - } - - public ExportTransactionsResponse transactions(ExportTransactionsParams params) throws Exception { - Response response = transactionsRaw(params); - - return ExportTransactionsResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * differentialPrices a export using immutable params (executes immediately) - returns raw - * Response. - */ - Response differentialPricesRaw(ExportDifferentialPricesParams params) throws Exception { - - return post("/exports/differential_prices", params != null ? params.toFormData() : null); - } - - /** - * differentialPrices a export using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response differentialPricesRaw(String jsonPayload) throws Exception { - - return postJson("/exports/differential_prices", jsonPayload); - } - - public ExportDifferentialPricesResponse differentialPrices(ExportDifferentialPricesParams params) - throws Exception { - Response response = differentialPricesRaw(params); - - return ExportDifferentialPricesResponse.fromJson(response.getBodyAsString(), response); - } - - /** itemFamilies a export using immutable params (executes immediately) - returns raw Response. */ - Response itemFamiliesRaw(ExportItemFamiliesParams params) throws Exception { - - return post("/exports/item_families", params != null ? params.toFormData() : null); - } - - /** itemFamilies a export using raw JSON payload (executes immediately) - returns raw Response. */ - Response itemFamiliesRaw(String jsonPayload) throws Exception { - - return postJson("/exports/item_families", jsonPayload); - } - - public ExportItemFamiliesResponse itemFamilies(ExportItemFamiliesParams params) throws Exception { - Response response = itemFamiliesRaw(params); - - return ExportItemFamiliesResponse.fromJson(response.getBodyAsString(), response); - } - - /** invoices a export using immutable params (executes immediately) - returns raw Response. */ - Response invoicesRaw(ExportInvoicesParams params) throws Exception { - - return post("/exports/invoices", params != null ? params.toFormData() : null); - } - - /** invoices a export using raw JSON payload (executes immediately) - returns raw Response. */ - Response invoicesRaw(String jsonPayload) throws Exception { - - return postJson("/exports/invoices", jsonPayload); - } - - public ExportInvoicesResponse invoices(ExportInvoicesParams params) throws Exception { - Response response = invoicesRaw(params); - - return ExportInvoicesResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a export (executes immediately) - returns raw Response. */ - Response retrieveRaw(String exportId) throws Exception { - String path = buildPathWithParams("/exports/{export-id}", "export-id", exportId); - - return get(path, null); - } - - public ExportRetrieveResponse retrieve(String exportId) throws Exception { - Response response = retrieveRaw(exportId); - return ExportRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * priceVariants a export using immutable params (executes immediately) - returns raw Response. - */ - Response priceVariantsRaw(ExportPriceVariantsParams params) throws Exception { - - return post("/exports/price_variants", params != null ? params.toFormData() : null); - } - - /** - * priceVariants a export using raw JSON payload (executes immediately) - returns raw Response. - */ - Response priceVariantsRaw(String jsonPayload) throws Exception { - - return postJson("/exports/price_variants", jsonPayload); - } - - public ExportPriceVariantsResponse priceVariants(ExportPriceVariantsParams params) - throws Exception { - Response response = priceVariantsRaw(params); - - return ExportPriceVariantsResponse.fromJson(response.getBodyAsString(), response); - } - - /** items a export using immutable params (executes immediately) - returns raw Response. */ - Response itemsRaw(ExportItemsParams params) throws Exception { - - return post("/exports/items", params != null ? params.toFormData() : null); - } - - /** items a export using raw JSON payload (executes immediately) - returns raw Response. */ - Response itemsRaw(String jsonPayload) throws Exception { - - return postJson("/exports/items", jsonPayload); - } - - public ExportItemsResponse items(ExportItemsParams params) throws Exception { - Response response = itemsRaw(params); - - return ExportItemsResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * deferredRevenue a export using immutable params (executes immediately) - returns raw Response. - */ - Response deferredRevenueRaw(ExportDeferredRevenueParams params) throws Exception { - - return post("/exports/deferred_revenue", params != null ? params.toFormData() : null); - } - - /** - * deferredRevenue a export using raw JSON payload (executes immediately) - returns raw Response. - */ - Response deferredRevenueRaw(String jsonPayload) throws Exception { - - return postJson("/exports/deferred_revenue", jsonPayload); - } - - public ExportDeferredRevenueResponse deferredRevenue(ExportDeferredRevenueParams params) - throws Exception { - Response response = deferredRevenueRaw(params); - - return ExportDeferredRevenueResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * revenueRecognition a export using immutable params (executes immediately) - returns raw - * Response. - */ - Response revenueRecognitionRaw(ExportRevenueRecognitionParams params) throws Exception { - - return post("/exports/revenue_recognition", params != null ? params.toFormData() : null); - } - - /** - * revenueRecognition a export using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response revenueRecognitionRaw(String jsonPayload) throws Exception { - - return postJson("/exports/revenue_recognition", jsonPayload); - } - - public ExportRevenueRecognitionResponse revenueRecognition(ExportRevenueRecognitionParams params) - throws Exception { - Response response = revenueRecognitionRaw(params); - - return ExportRevenueRecognitionResponse.fromJson(response.getBodyAsString(), response); - } - - /** creditNotes a export using immutable params (executes immediately) - returns raw Response. */ - Response creditNotesRaw(ExportCreditNotesParams params) throws Exception { - - return post("/exports/credit_notes", params != null ? params.toFormData() : null); - } - - /** creditNotes a export using raw JSON payload (executes immediately) - returns raw Response. */ - Response creditNotesRaw(String jsonPayload) throws Exception { - - return postJson("/exports/credit_notes", jsonPayload); - } - - public ExportCreditNotesResponse creditNotes(ExportCreditNotesParams params) throws Exception { - Response response = creditNotesRaw(params); - - return ExportCreditNotesResponse.fromJson(response.getBodyAsString(), response); - } - - /** coupons a export using immutable params (executes immediately) - returns raw Response. */ - Response couponsRaw(ExportCouponsParams params) throws Exception { - - return post("/exports/coupons", params != null ? params.toFormData() : null); - } - - /** coupons a export using raw JSON payload (executes immediately) - returns raw Response. */ - Response couponsRaw(String jsonPayload) throws Exception { - - return postJson("/exports/coupons", jsonPayload); - } - - public ExportCouponsResponse coupons(ExportCouponsParams params) throws Exception { - Response response = couponsRaw(params); - - return ExportCouponsResponse.fromJson(response.getBodyAsString(), response); - } - - /** orders a export using immutable params (executes immediately) - returns raw Response. */ - Response ordersRaw(ExportOrdersParams params) throws Exception { - - return post("/exports/orders", params != null ? params.toFormData() : null); - } - - /** orders a export using raw JSON payload (executes immediately) - returns raw Response. */ - Response ordersRaw(String jsonPayload) throws Exception { - - return postJson("/exports/orders", jsonPayload); - } - - public ExportOrdersResponse orders(ExportOrdersParams params) throws Exception { - Response response = ordersRaw(params); - - return ExportOrdersResponse.fromJson(response.getBodyAsString(), response); - } - - /** itemPrices a export using immutable params (executes immediately) - returns raw Response. */ - Response itemPricesRaw(ExportItemPricesParams params) throws Exception { - - return post("/exports/item_prices", params != null ? params.toFormData() : null); - } - - /** itemPrices a export using raw JSON payload (executes immediately) - returns raw Response. */ - Response itemPricesRaw(String jsonPayload) throws Exception { - - return postJson("/exports/item_prices", jsonPayload); - } - - public ExportItemPricesResponse itemPrices(ExportItemPricesParams params) throws Exception { - Response response = itemPricesRaw(params); - - return ExportItemPricesResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * subscriptions a export using immutable params (executes immediately) - returns raw Response. - */ - Response subscriptionsRaw(ExportSubscriptionsParams params) throws Exception { - - return post("/exports/subscriptions", params != null ? params.toFormData() : null); - } - - /** - * subscriptions a export using raw JSON payload (executes immediately) - returns raw Response. - */ - Response subscriptionsRaw(String jsonPayload) throws Exception { - - return postJson("/exports/subscriptions", jsonPayload); - } - - public ExportSubscriptionsResponse subscriptions(ExportSubscriptionsParams params) - throws Exception { - Response response = subscriptionsRaw(params); - - return ExportSubscriptionsResponse.fromJson(response.getBodyAsString(), response); - } - - /** addons a export using immutable params (executes immediately) - returns raw Response. */ - Response addonsRaw(ExportAddonsParams params) throws Exception { - - return post("/exports/addons", params != null ? params.toFormData() : null); - } - - /** addons a export using raw JSON payload (executes immediately) - returns raw Response. */ - Response addonsRaw(String jsonPayload) throws Exception { - - return postJson("/exports/addons", jsonPayload); - } - - public ExportAddonsResponse addons(ExportAddonsParams params) throws Exception { - Response response = addonsRaw(params); - - return ExportAddonsResponse.fromJson(response.getBodyAsString(), response); - } - - /** plans a export using immutable params (executes immediately) - returns raw Response. */ - Response plansRaw(ExportPlansParams params) throws Exception { - - return post("/exports/plans", params != null ? params.toFormData() : null); - } - - /** plans a export using raw JSON payload (executes immediately) - returns raw Response. */ - Response plansRaw(String jsonPayload) throws Exception { - - return postJson("/exports/plans", jsonPayload); - } - - public ExportPlansResponse plans(ExportPlansParams params) throws Exception { - Response response = plansRaw(params); - - return ExportPlansResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/FeatureService.java b/src/main/java/com/chargebee/v4/core/services/FeatureService.java deleted file mode 100644 index e5a57fcc..00000000 --- a/src/main/java/com/chargebee/v4/core/services/FeatureService.java +++ /dev/null @@ -1,204 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.feature.params.FeatureListParams; - -import com.chargebee.v4.core.models.feature.params.FeatureCreateParams; - -import com.chargebee.v4.core.models.feature.params.FeatureUpdateParams; - -import com.chargebee.v4.core.responses.feature.FeatureListResponse; - -import com.chargebee.v4.core.responses.feature.FeatureCreateResponse; - -import com.chargebee.v4.core.responses.feature.FeatureDeleteResponse; - -import com.chargebee.v4.core.responses.feature.FeatureRetrieveResponse; - -import com.chargebee.v4.core.responses.feature.FeatureUpdateResponse; - -import com.chargebee.v4.core.responses.feature.FeatureArchiveResponse; - -import com.chargebee.v4.core.responses.feature.FeatureActivateResponse; - -import com.chargebee.v4.core.responses.feature.FeatureReactivateResponse; - -public final class FeatureService extends BaseService { - - private final ServiceConfig config; - - public FeatureService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private FeatureService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private FeatureService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - FeatureService with(RequestOptions newOptions) { - return new FeatureService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public FeatureService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** list a feature using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(FeatureListParams params) throws Exception { - - return get("/features", params != null ? params.toQueryParams() : null); - } - - /** list a feature without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/features", null); - } - - /** list a feature using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public FeatureListResponse list(FeatureListParams params) throws Exception { - Response response = listRaw(params); - - return FeatureListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public FeatureListResponse list() throws Exception { - Response response = listRaw(); - return FeatureListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** create a feature using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(FeatureCreateParams params) throws Exception { - - return post("/features", params != null ? params.toFormData() : null); - } - - /** create a feature using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { - - return postJson("/features", jsonPayload); - } - - public FeatureCreateResponse create(FeatureCreateParams params) throws Exception { - Response response = createRaw(params); - - return FeatureCreateResponse.fromJson(response.getBodyAsString(), response); - } - - /** delete a feature (executes immediately) - returns raw Response. */ - Response deleteRaw(String featureId) throws Exception { - String path = buildPathWithParams("/features/{feature-id}/delete", "feature-id", featureId); - - return post(path, null); - } - - public FeatureDeleteResponse delete(String featureId) throws Exception { - Response response = deleteRaw(featureId); - return FeatureDeleteResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a feature (executes immediately) - returns raw Response. */ - Response retrieveRaw(String featureId) throws Exception { - String path = buildPathWithParams("/features/{feature-id}", "feature-id", featureId); - - return get(path, null); - } - - public FeatureRetrieveResponse retrieve(String featureId) throws Exception { - Response response = retrieveRaw(featureId); - return FeatureRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** update a feature (executes immediately) - returns raw Response. */ - Response updateRaw(String featureId) throws Exception { - String path = buildPathWithParams("/features/{feature-id}", "feature-id", featureId); - - return post(path, null); - } - - /** update a feature using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String featureId, FeatureUpdateParams params) throws Exception { - String path = buildPathWithParams("/features/{feature-id}", "feature-id", featureId); - return post(path, params.toFormData()); - } - - /** update a feature using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String featureId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/features/{feature-id}", "feature-id", featureId); - return postJson(path, jsonPayload); - } - - public FeatureUpdateResponse update(String featureId, FeatureUpdateParams params) - throws Exception { - Response response = updateRaw(featureId, params); - return FeatureUpdateResponse.fromJson(response.getBodyAsString(), response); - } - - /** archive a feature (executes immediately) - returns raw Response. */ - Response archiveRaw(String featureId) throws Exception { - String path = - buildPathWithParams("/features/{feature-id}/archive_command", "feature-id", featureId); - - return post(path, null); - } - - public FeatureArchiveResponse archive(String featureId) throws Exception { - Response response = archiveRaw(featureId); - return FeatureArchiveResponse.fromJson(response.getBodyAsString(), response); - } - - /** activate a feature (executes immediately) - returns raw Response. */ - Response activateRaw(String featureId) throws Exception { - String path = - buildPathWithParams("/features/{feature-id}/activate_command", "feature-id", featureId); - - return post(path, null); - } - - public FeatureActivateResponse activate(String featureId) throws Exception { - Response response = activateRaw(featureId); - return FeatureActivateResponse.fromJson(response.getBodyAsString(), response); - } - - /** reactivate a feature (executes immediately) - returns raw Response. */ - Response reactivateRaw(String featureId) throws Exception { - String path = - buildPathWithParams("/features/{feature-id}/reactivate_command", "feature-id", featureId); - - return post(path, null); - } - - public FeatureReactivateResponse reactivate(String featureId) throws Exception { - Response response = reactivateRaw(featureId); - return FeatureReactivateResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/GiftService.java b/src/main/java/com/chargebee/v4/core/services/GiftService.java deleted file mode 100644 index 97d64076..00000000 --- a/src/main/java/com/chargebee/v4/core/services/GiftService.java +++ /dev/null @@ -1,196 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.gift.params.GiftCreateForItemsParams; - -import com.chargebee.v4.core.models.gift.params.GiftUpdateGiftParams; - -import com.chargebee.v4.core.models.gift.params.GiftListParams; - -import com.chargebee.v4.core.models.gift.params.GiftCreateParams; - -import com.chargebee.v4.core.responses.gift.GiftCreateForItemsResponse; - -import com.chargebee.v4.core.responses.gift.GiftCancelResponse; - -import com.chargebee.v4.core.responses.gift.GiftUpdateGiftResponse; - -import com.chargebee.v4.core.responses.gift.GiftListResponse; - -import com.chargebee.v4.core.responses.gift.GiftCreateResponse; - -import com.chargebee.v4.core.responses.gift.GiftRetrieveResponse; - -import com.chargebee.v4.core.responses.gift.GiftClaimResponse; - -public final class GiftService extends BaseService { - - private final ServiceConfig config; - - public GiftService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private GiftService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private GiftService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - GiftService with(RequestOptions newOptions) { - return new GiftService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public GiftService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** createForItems a gift using immutable params (executes immediately) - returns raw Response. */ - Response createForItemsRaw(GiftCreateForItemsParams params) throws Exception { - - return post("/gifts/create_for_items", params != null ? params.toFormData() : null); - } - - /** createForItems a gift using raw JSON payload (executes immediately) - returns raw Response. */ - Response createForItemsRaw(String jsonPayload) throws Exception { - - return postJson("/gifts/create_for_items", jsonPayload); - } - - public GiftCreateForItemsResponse createForItems(GiftCreateForItemsParams params) - throws Exception { - Response response = createForItemsRaw(params); - - return GiftCreateForItemsResponse.fromJson(response.getBodyAsString(), response); - } - - /** cancel a gift (executes immediately) - returns raw Response. */ - Response cancelRaw(String giftId) throws Exception { - String path = buildPathWithParams("/gifts/{gift-id}/cancel", "gift-id", giftId); - - return post(path, null); - } - - public GiftCancelResponse cancel(String giftId) throws Exception { - Response response = cancelRaw(giftId); - return GiftCancelResponse.fromJson(response.getBodyAsString(), response); - } - - /** updateGift a gift (executes immediately) - returns raw Response. */ - Response updateGiftRaw(String giftId) throws Exception { - String path = buildPathWithParams("/gifts/{gift-id}/update_gift", "gift-id", giftId); - - return post(path, null); - } - - /** updateGift a gift using immutable params (executes immediately) - returns raw Response. */ - Response updateGiftRaw(String giftId, GiftUpdateGiftParams params) throws Exception { - String path = buildPathWithParams("/gifts/{gift-id}/update_gift", "gift-id", giftId); - return post(path, params.toFormData()); - } - - /** updateGift a gift using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateGiftRaw(String giftId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/gifts/{gift-id}/update_gift", "gift-id", giftId); - return postJson(path, jsonPayload); - } - - public GiftUpdateGiftResponse updateGift(String giftId, GiftUpdateGiftParams params) - throws Exception { - Response response = updateGiftRaw(giftId, params); - return GiftUpdateGiftResponse.fromJson(response.getBodyAsString(), response); - } - - /** list a gift using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(GiftListParams params) throws Exception { - - return get("/gifts", params != null ? params.toQueryParams() : null); - } - - /** list a gift without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/gifts", null); - } - - /** list a gift using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public GiftListResponse list(GiftListParams params) throws Exception { - Response response = listRaw(params); - - return GiftListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public GiftListResponse list() throws Exception { - Response response = listRaw(); - return GiftListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** create a gift using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(GiftCreateParams params) throws Exception { - - return post("/gifts", params != null ? params.toFormData() : null); - } - - /** create a gift using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { - - return postJson("/gifts", jsonPayload); - } - - public GiftCreateResponse create(GiftCreateParams params) throws Exception { - Response response = createRaw(params); - - return GiftCreateResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a gift (executes immediately) - returns raw Response. */ - Response retrieveRaw(String giftId) throws Exception { - String path = buildPathWithParams("/gifts/{gift-id}", "gift-id", giftId); - - return get(path, null); - } - - public GiftRetrieveResponse retrieve(String giftId) throws Exception { - Response response = retrieveRaw(giftId); - return GiftRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** claim a gift (executes immediately) - returns raw Response. */ - Response claimRaw(String giftId) throws Exception { - String path = buildPathWithParams("/gifts/{gift-id}/claim", "gift-id", giftId); - - return post(path, null); - } - - public GiftClaimResponse claim(String giftId) throws Exception { - Response response = claimRaw(giftId); - return GiftClaimResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/HostedPageService.java b/src/main/java/com/chargebee/v4/core/services/HostedPageService.java deleted file mode 100644 index 69a65f3a..00000000 --- a/src/main/java/com/chargebee/v4/core/services/HostedPageService.java +++ /dev/null @@ -1,646 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageCheckoutOneTimeForItemsParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageUpdatePaymentMethodParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageUpdateCardParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageExtendSubscriptionParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageEventsParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageCheckoutGiftForItemsParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageListParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageViewVoucherParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageCollectNowParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageAcceptQuoteParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageCheckoutNewForItemsParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageClaimGiftParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageCheckoutExistingForItemsParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPagePreCancelParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageRetrieveAgreementPdfParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageManagePaymentSourcesParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageCheckoutOneTimeParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageCheckoutNewParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageCheckoutGiftParams; - -import com.chargebee.v4.core.models.hostedPage.params.HostedPageCheckoutExistingParams; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageCheckoutOneTimeForItemsResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageUpdatePaymentMethodResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageUpdateCardResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageExtendSubscriptionResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageEventsResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageCheckoutGiftForItemsResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageListResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageViewVoucherResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageCollectNowResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageAcceptQuoteResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageCheckoutNewForItemsResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageClaimGiftResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageCheckoutExistingForItemsResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPagePreCancelResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageAcknowledgeResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageRetrieveAgreementPdfResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageRetrieveResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageManagePaymentSourcesResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageCheckoutOneTimeResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageCheckoutNewResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageCheckoutGiftResponse; - -import com.chargebee.v4.core.responses.hostedPage.HostedPageCheckoutExistingResponse; - -public final class HostedPageService extends BaseService { - - private final ServiceConfig config; - - public HostedPageService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private HostedPageService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private HostedPageService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - HostedPageService with(RequestOptions newOptions) { - return new HostedPageService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public HostedPageService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** - * checkoutOneTimeForItems a hostedPage using immutable params (executes immediately) - returns - * raw Response. - */ - Response checkoutOneTimeForItemsRaw(HostedPageCheckoutOneTimeForItemsParams params) - throws Exception { - - return post( - "/hosted_pages/checkout_one_time_for_items", params != null ? params.toFormData() : null); - } - - /** - * checkoutOneTimeForItems a hostedPage using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response checkoutOneTimeForItemsRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/checkout_one_time_for_items", jsonPayload); - } - - public HostedPageCheckoutOneTimeForItemsResponse checkoutOneTimeForItems( - HostedPageCheckoutOneTimeForItemsParams params) throws Exception { - Response response = checkoutOneTimeForItemsRaw(params); - - return HostedPageCheckoutOneTimeForItemsResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * updatePaymentMethod a hostedPage using immutable params (executes immediately) - returns raw - * Response. - */ - Response updatePaymentMethodRaw(HostedPageUpdatePaymentMethodParams params) throws Exception { - - return post("/hosted_pages/update_payment_method", params != null ? params.toFormData() : null); - } - - /** - * updatePaymentMethod a hostedPage using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response updatePaymentMethodRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/update_payment_method", jsonPayload); - } - - public HostedPageUpdatePaymentMethodResponse updatePaymentMethod( - HostedPageUpdatePaymentMethodParams params) throws Exception { - Response response = updatePaymentMethodRaw(params); - - return HostedPageUpdatePaymentMethodResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * updateCard a hostedPage using immutable params (executes immediately) - returns raw Response. - */ - Response updateCardRaw(HostedPageUpdateCardParams params) throws Exception { - - return post("/hosted_pages/update_card", params != null ? params.toFormData() : null); - } - - /** - * updateCard a hostedPage using raw JSON payload (executes immediately) - returns raw Response. - */ - Response updateCardRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/update_card", jsonPayload); - } - - public HostedPageUpdateCardResponse updateCard(HostedPageUpdateCardParams params) - throws Exception { - Response response = updateCardRaw(params); - - return HostedPageUpdateCardResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * extendSubscription a hostedPage using immutable params (executes immediately) - returns raw - * Response. - */ - Response extendSubscriptionRaw(HostedPageExtendSubscriptionParams params) throws Exception { - - return post("/hosted_pages/extend_subscription", params != null ? params.toFormData() : null); - } - - /** - * extendSubscription a hostedPage using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response extendSubscriptionRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/extend_subscription", jsonPayload); - } - - public HostedPageExtendSubscriptionResponse extendSubscription( - HostedPageExtendSubscriptionParams params) throws Exception { - Response response = extendSubscriptionRaw(params); - - return HostedPageExtendSubscriptionResponse.fromJson(response.getBodyAsString(), response); - } - - /** events a hostedPage using immutable params (executes immediately) - returns raw Response. */ - Response eventsRaw(HostedPageEventsParams params) throws Exception { - - return post("/hosted_pages/events", params != null ? params.toFormData() : null); - } - - /** events a hostedPage using raw JSON payload (executes immediately) - returns raw Response. */ - Response eventsRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/events", jsonPayload); - } - - public HostedPageEventsResponse events(HostedPageEventsParams params) throws Exception { - Response response = eventsRaw(params); - - return HostedPageEventsResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * checkoutGiftForItems a hostedPage using immutable params (executes immediately) - returns raw - * Response. - */ - Response checkoutGiftForItemsRaw(HostedPageCheckoutGiftForItemsParams params) throws Exception { - - return post( - "/hosted_pages/checkout_gift_for_items", params != null ? params.toFormData() : null); - } - - /** - * checkoutGiftForItems a hostedPage using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response checkoutGiftForItemsRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/checkout_gift_for_items", jsonPayload); - } - - public HostedPageCheckoutGiftForItemsResponse checkoutGiftForItems( - HostedPageCheckoutGiftForItemsParams params) throws Exception { - Response response = checkoutGiftForItemsRaw(params); - - return HostedPageCheckoutGiftForItemsResponse.fromJson(response.getBodyAsString(), response); - } - - /** list a hostedPage using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(HostedPageListParams params) throws Exception { - - return get("/hosted_pages", params != null ? params.toQueryParams() : null); - } - - /** list a hostedPage without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/hosted_pages", null); - } - - /** list a hostedPage using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public HostedPageListResponse list(HostedPageListParams params) throws Exception { - Response response = listRaw(params); - - return HostedPageListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public HostedPageListResponse list() throws Exception { - Response response = listRaw(); - return HostedPageListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** - * viewVoucher a hostedPage using immutable params (executes immediately) - returns raw Response. - */ - Response viewVoucherRaw(HostedPageViewVoucherParams params) throws Exception { - - return post("/hosted_pages/view_voucher", params != null ? params.toFormData() : null); - } - - /** - * viewVoucher a hostedPage using raw JSON payload (executes immediately) - returns raw Response. - */ - Response viewVoucherRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/view_voucher", jsonPayload); - } - - public HostedPageViewVoucherResponse viewVoucher(HostedPageViewVoucherParams params) - throws Exception { - Response response = viewVoucherRaw(params); - - return HostedPageViewVoucherResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * collectNow a hostedPage using immutable params (executes immediately) - returns raw Response. - */ - Response collectNowRaw(HostedPageCollectNowParams params) throws Exception { - - return post("/hosted_pages/collect_now", params != null ? params.toFormData() : null); - } - - /** - * collectNow a hostedPage using raw JSON payload (executes immediately) - returns raw Response. - */ - Response collectNowRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/collect_now", jsonPayload); - } - - public HostedPageCollectNowResponse collectNow(HostedPageCollectNowParams params) - throws Exception { - Response response = collectNowRaw(params); - - return HostedPageCollectNowResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * acceptQuote a hostedPage using immutable params (executes immediately) - returns raw Response. - */ - Response acceptQuoteRaw(HostedPageAcceptQuoteParams params) throws Exception { - - return post("/hosted_pages/accept_quote", params != null ? params.toFormData() : null); - } - - /** - * acceptQuote a hostedPage using raw JSON payload (executes immediately) - returns raw Response. - */ - Response acceptQuoteRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/accept_quote", jsonPayload); - } - - public HostedPageAcceptQuoteResponse acceptQuote(HostedPageAcceptQuoteParams params) - throws Exception { - Response response = acceptQuoteRaw(params); - - return HostedPageAcceptQuoteResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * checkoutNewForItems a hostedPage using immutable params (executes immediately) - returns raw - * Response. - */ - Response checkoutNewForItemsRaw(HostedPageCheckoutNewForItemsParams params) throws Exception { - - return post( - "/hosted_pages/checkout_new_for_items", params != null ? params.toFormData() : null); - } - - /** - * checkoutNewForItems a hostedPage using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response checkoutNewForItemsRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/checkout_new_for_items", jsonPayload); - } - - public HostedPageCheckoutNewForItemsResponse checkoutNewForItems( - HostedPageCheckoutNewForItemsParams params) throws Exception { - Response response = checkoutNewForItemsRaw(params); - - return HostedPageCheckoutNewForItemsResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * claimGift a hostedPage using immutable params (executes immediately) - returns raw Response. - */ - Response claimGiftRaw(HostedPageClaimGiftParams params) throws Exception { - - return post("/hosted_pages/claim_gift", params != null ? params.toFormData() : null); - } - - /** - * claimGift a hostedPage using raw JSON payload (executes immediately) - returns raw Response. - */ - Response claimGiftRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/claim_gift", jsonPayload); - } - - public HostedPageClaimGiftResponse claimGift(HostedPageClaimGiftParams params) throws Exception { - Response response = claimGiftRaw(params); - - return HostedPageClaimGiftResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * checkoutExistingForItems a hostedPage using immutable params (executes immediately) - returns - * raw Response. - */ - Response checkoutExistingForItemsRaw(HostedPageCheckoutExistingForItemsParams params) - throws Exception { - - return post( - "/hosted_pages/checkout_existing_for_items", params != null ? params.toFormData() : null); - } - - /** - * checkoutExistingForItems a hostedPage using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response checkoutExistingForItemsRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/checkout_existing_for_items", jsonPayload); - } - - public HostedPageCheckoutExistingForItemsResponse checkoutExistingForItems( - HostedPageCheckoutExistingForItemsParams params) throws Exception { - Response response = checkoutExistingForItemsRaw(params); - - return HostedPageCheckoutExistingForItemsResponse.fromJson( - response.getBodyAsString(), response); - } - - /** - * preCancel a hostedPage using immutable params (executes immediately) - returns raw Response. - */ - Response preCancelRaw(HostedPagePreCancelParams params) throws Exception { - - return post("/hosted_pages/pre_cancel", params != null ? params.toFormData() : null); - } - - /** - * preCancel a hostedPage using raw JSON payload (executes immediately) - returns raw Response. - */ - Response preCancelRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/pre_cancel", jsonPayload); - } - - public HostedPagePreCancelResponse preCancel(HostedPagePreCancelParams params) throws Exception { - Response response = preCancelRaw(params); - - return HostedPagePreCancelResponse.fromJson(response.getBodyAsString(), response); - } - - /** acknowledge a hostedPage (executes immediately) - returns raw Response. */ - Response acknowledgeRaw(String hostedPageId) throws Exception { - String path = - buildPathWithParams( - "/hosted_pages/{hosted-page-id}/acknowledge", "hosted-page-id", hostedPageId); - - return post(path, null); - } - - public HostedPageAcknowledgeResponse acknowledge(String hostedPageId) throws Exception { - Response response = acknowledgeRaw(hostedPageId); - return HostedPageAcknowledgeResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * retrieveAgreementPdf a hostedPage using immutable params (executes immediately) - returns raw - * Response. - */ - Response retrieveAgreementPdfRaw(HostedPageRetrieveAgreementPdfParams params) throws Exception { - - return post( - "/hosted_pages/retrieve_agreement_pdf", params != null ? params.toFormData() : null); - } - - /** - * retrieveAgreementPdf a hostedPage using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response retrieveAgreementPdfRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/retrieve_agreement_pdf", jsonPayload); - } - - public HostedPageRetrieveAgreementPdfResponse retrieveAgreementPdf( - HostedPageRetrieveAgreementPdfParams params) throws Exception { - Response response = retrieveAgreementPdfRaw(params); - - return HostedPageRetrieveAgreementPdfResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a hostedPage (executes immediately) - returns raw Response. */ - Response retrieveRaw(String hostedPageId) throws Exception { - String path = - buildPathWithParams("/hosted_pages/{hosted-page-id}", "hosted-page-id", hostedPageId); - - return get(path, null); - } - - public HostedPageRetrieveResponse retrieve(String hostedPageId) throws Exception { - Response response = retrieveRaw(hostedPageId); - return HostedPageRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * managePaymentSources a hostedPage using immutable params (executes immediately) - returns raw - * Response. - */ - Response managePaymentSourcesRaw(HostedPageManagePaymentSourcesParams params) throws Exception { - - return post( - "/hosted_pages/manage_payment_sources", params != null ? params.toFormData() : null); - } - - /** - * managePaymentSources a hostedPage using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response managePaymentSourcesRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/manage_payment_sources", jsonPayload); - } - - public HostedPageManagePaymentSourcesResponse managePaymentSources( - HostedPageManagePaymentSourcesParams params) throws Exception { - Response response = managePaymentSourcesRaw(params); - - return HostedPageManagePaymentSourcesResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * checkoutOneTime a hostedPage using immutable params (executes immediately) - returns raw - * Response. - */ - Response checkoutOneTimeRaw(HostedPageCheckoutOneTimeParams params) throws Exception { - - return post("/hosted_pages/checkout_one_time", params != null ? params.toFormData() : null); - } - - /** - * checkoutOneTime a hostedPage using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response checkoutOneTimeRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/checkout_one_time", jsonPayload); - } - - public HostedPageCheckoutOneTimeResponse checkoutOneTime(HostedPageCheckoutOneTimeParams params) - throws Exception { - Response response = checkoutOneTimeRaw(params); - - return HostedPageCheckoutOneTimeResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * checkoutNew a hostedPage using immutable params (executes immediately) - returns raw Response. - */ - Response checkoutNewRaw(HostedPageCheckoutNewParams params) throws Exception { - - return post("/hosted_pages/checkout_new", params != null ? params.toFormData() : null); - } - - /** - * checkoutNew a hostedPage using raw JSON payload (executes immediately) - returns raw Response. - */ - Response checkoutNewRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/checkout_new", jsonPayload); - } - - public HostedPageCheckoutNewResponse checkoutNew(HostedPageCheckoutNewParams params) - throws Exception { - Response response = checkoutNewRaw(params); - - return HostedPageCheckoutNewResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * checkoutGift a hostedPage using immutable params (executes immediately) - returns raw Response. - */ - Response checkoutGiftRaw(HostedPageCheckoutGiftParams params) throws Exception { - - return post("/hosted_pages/checkout_gift", params != null ? params.toFormData() : null); - } - - /** - * checkoutGift a hostedPage using raw JSON payload (executes immediately) - returns raw Response. - */ - Response checkoutGiftRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/checkout_gift", jsonPayload); - } - - public HostedPageCheckoutGiftResponse checkoutGift(HostedPageCheckoutGiftParams params) - throws Exception { - Response response = checkoutGiftRaw(params); - - return HostedPageCheckoutGiftResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * checkoutExisting a hostedPage using immutable params (executes immediately) - returns raw - * Response. - */ - Response checkoutExistingRaw(HostedPageCheckoutExistingParams params) throws Exception { - - return post("/hosted_pages/checkout_existing", params != null ? params.toFormData() : null); - } - - /** - * checkoutExisting a hostedPage using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response checkoutExistingRaw(String jsonPayload) throws Exception { - - return postJson("/hosted_pages/checkout_existing", jsonPayload); - } - - public HostedPageCheckoutExistingResponse checkoutExisting( - HostedPageCheckoutExistingParams params) throws Exception { - Response response = checkoutExistingRaw(params); - - return HostedPageCheckoutExistingResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/InvoiceService.java b/src/main/java/com/chargebee/v4/core/services/InvoiceService.java deleted file mode 100644 index a47986ba..00000000 --- a/src/main/java/com/chargebee/v4/core/services/InvoiceService.java +++ /dev/null @@ -1,1332 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.invoice.params.InvoiceDeleteLineItemsParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceRemoveCreditNoteParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceRemovePaymentParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceStopDunningParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceApplyPaymentsParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceApplyPaymentScheduleSchemeParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceVoidInvoiceParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceAddChargeParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceWriteOffParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceAddChargeItemParams; - -import com.chargebee.v4.core.models.invoice.params.InvoicePauseDunningParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceListParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceCreateParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceCloseParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceApplyCreditsParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceCreateForChargeItemParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceCreateForChargeItemsAndChargesParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceDeleteImportedParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceUpdateDetailsParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceInvoicesForCustomerParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceRecordPaymentParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceDeleteParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceImportInvoiceParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceResumeDunningParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceRecordTaxWithheldParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceRemoveTaxWithheldParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceListPaymentReferenceNumbersParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceCollectPaymentParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceRefundParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceRecordRefundParams; - -import com.chargebee.v4.core.models.invoice.params.InvoicePdfParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceInvoicesForSubscriptionParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceChargeAddonParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceAddAddonChargeParams; - -import com.chargebee.v4.core.models.invoice.params.InvoiceChargeParams; - -import com.chargebee.v4.core.responses.invoice.InvoiceDeleteLineItemsResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceRemoveCreditNoteResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceRemovePaymentResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceStopDunningResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceApplyPaymentsResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceApplyPaymentScheduleSchemeResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceVoidInvoiceResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceAddChargeResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceSendEinvoiceResponse; - -import com.chargebee.v4.core.responses.invoice.InvoicePaymentSchedulesResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceWriteOffResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceAddChargeItemResponse; - -import com.chargebee.v4.core.responses.invoice.InvoicePauseDunningResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceListResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceCreateResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceCloseResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceApplyCreditsResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceRetrieveResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceCreateForChargeItemResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceCreateForChargeItemsAndChargesResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceDeleteImportedResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceUpdateDetailsResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceInvoicesForCustomerResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceRecordPaymentResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceDeleteResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceImportInvoiceResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceResumeDunningResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceRecordTaxWithheldResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceResendEinvoiceResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceRemoveTaxWithheldResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceListPaymentReferenceNumbersResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceCollectPaymentResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceSyncUsagesResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceRefundResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceRecordRefundResponse; - -import com.chargebee.v4.core.responses.invoice.InvoicePdfResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceInvoicesForSubscriptionResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceDownloadEinvoiceResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceChargeAddonResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceAddAddonChargeResponse; - -import com.chargebee.v4.core.responses.invoice.InvoiceChargeResponse; - -public final class InvoiceService extends BaseService { - - private final ServiceConfig config; - - public InvoiceService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private InvoiceService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private InvoiceService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - InvoiceService with(RequestOptions newOptions) { - return new InvoiceService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public InvoiceService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** deleteLineItems a invoice (executes immediately) - returns raw Response. */ - Response deleteLineItemsRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/delete_line_items", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * deleteLineItems a invoice using immutable params (executes immediately) - returns raw Response. - */ - Response deleteLineItemsRaw(String invoiceId, InvoiceDeleteLineItemsParams params) - throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/delete_line_items", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * deleteLineItems a invoice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response deleteLineItemsRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/delete_line_items", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceDeleteLineItemsResponse deleteLineItems( - String invoiceId, InvoiceDeleteLineItemsParams params) throws Exception { - Response response = deleteLineItemsRaw(invoiceId, params); - return InvoiceDeleteLineItemsResponse.fromJson(response.getBodyAsString(), response); - } - - /** removeCreditNote a invoice (executes immediately) - returns raw Response. */ - Response removeCreditNoteRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/remove_credit_note", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * removeCreditNote a invoice using immutable params (executes immediately) - returns raw - * Response. - */ - Response removeCreditNoteRaw(String invoiceId, InvoiceRemoveCreditNoteParams params) - throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/remove_credit_note", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * removeCreditNote a invoice using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response removeCreditNoteRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/remove_credit_note", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceRemoveCreditNoteResponse removeCreditNote( - String invoiceId, InvoiceRemoveCreditNoteParams params) throws Exception { - Response response = removeCreditNoteRaw(invoiceId, params); - return InvoiceRemoveCreditNoteResponse.fromJson(response.getBodyAsString(), response); - } - - /** removePayment a invoice (executes immediately) - returns raw Response. */ - Response removePaymentRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/remove_payment", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * removePayment a invoice using immutable params (executes immediately) - returns raw Response. - */ - Response removePaymentRaw(String invoiceId, InvoiceRemovePaymentParams params) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/remove_payment", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * removePayment a invoice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response removePaymentRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/remove_payment", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceRemovePaymentResponse removePayment( - String invoiceId, InvoiceRemovePaymentParams params) throws Exception { - Response response = removePaymentRaw(invoiceId, params); - return InvoiceRemovePaymentResponse.fromJson(response.getBodyAsString(), response); - } - - /** stopDunning a invoice (executes immediately) - returns raw Response. */ - Response stopDunningRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/stop_dunning", "invoice-id", invoiceId); - - return post(path, null); - } - - /** stopDunning a invoice using immutable params (executes immediately) - returns raw Response. */ - Response stopDunningRaw(String invoiceId, InvoiceStopDunningParams params) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/stop_dunning", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** stopDunning a invoice using raw JSON payload (executes immediately) - returns raw Response. */ - Response stopDunningRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/stop_dunning", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceStopDunningResponse stopDunning(String invoiceId, InvoiceStopDunningParams params) - throws Exception { - Response response = stopDunningRaw(invoiceId, params); - return InvoiceStopDunningResponse.fromJson(response.getBodyAsString(), response); - } - - /** applyPayments a invoice (executes immediately) - returns raw Response. */ - Response applyPaymentsRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/apply_payments", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * applyPayments a invoice using immutable params (executes immediately) - returns raw Response. - */ - Response applyPaymentsRaw(String invoiceId, InvoiceApplyPaymentsParams params) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/apply_payments", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * applyPayments a invoice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response applyPaymentsRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/apply_payments", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceApplyPaymentsResponse applyPayments( - String invoiceId, InvoiceApplyPaymentsParams params) throws Exception { - Response response = applyPaymentsRaw(invoiceId, params); - return InvoiceApplyPaymentsResponse.fromJson(response.getBodyAsString(), response); - } - - /** applyPaymentScheduleScheme a invoice (executes immediately) - returns raw Response. */ - Response applyPaymentScheduleSchemeRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams( - "/invoices/{invoice-id}/apply_payment_schedule_scheme", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * applyPaymentScheduleScheme a invoice using immutable params (executes immediately) - returns - * raw Response. - */ - Response applyPaymentScheduleSchemeRaw( - String invoiceId, InvoiceApplyPaymentScheduleSchemeParams params) throws Exception { - String path = - buildPathWithParams( - "/invoices/{invoice-id}/apply_payment_schedule_scheme", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * applyPaymentScheduleScheme a invoice using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response applyPaymentScheduleSchemeRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/invoices/{invoice-id}/apply_payment_schedule_scheme", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceApplyPaymentScheduleSchemeResponse applyPaymentScheduleScheme( - String invoiceId, InvoiceApplyPaymentScheduleSchemeParams params) throws Exception { - Response response = applyPaymentScheduleSchemeRaw(invoiceId, params); - return InvoiceApplyPaymentScheduleSchemeResponse.fromJson(response.getBodyAsString(), response); - } - - /** voidInvoice a invoice (executes immediately) - returns raw Response. */ - Response voidInvoiceRaw(String invoiceId) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/void", "invoice-id", invoiceId); - - return post(path, null); - } - - /** voidInvoice a invoice using immutable params (executes immediately) - returns raw Response. */ - Response voidInvoiceRaw(String invoiceId, InvoiceVoidInvoiceParams params) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/void", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** voidInvoice a invoice using raw JSON payload (executes immediately) - returns raw Response. */ - Response voidInvoiceRaw(String invoiceId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/void", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceVoidInvoiceResponse voidInvoice(String invoiceId, InvoiceVoidInvoiceParams params) - throws Exception { - Response response = voidInvoiceRaw(invoiceId, params); - return InvoiceVoidInvoiceResponse.fromJson(response.getBodyAsString(), response); - } - - /** addCharge a invoice (executes immediately) - returns raw Response. */ - Response addChargeRaw(String invoiceId) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/add_charge", "invoice-id", invoiceId); - - return post(path, null); - } - - /** addCharge a invoice using immutable params (executes immediately) - returns raw Response. */ - Response addChargeRaw(String invoiceId, InvoiceAddChargeParams params) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/add_charge", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** addCharge a invoice using raw JSON payload (executes immediately) - returns raw Response. */ - Response addChargeRaw(String invoiceId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/add_charge", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceAddChargeResponse addCharge(String invoiceId, InvoiceAddChargeParams params) - throws Exception { - Response response = addChargeRaw(invoiceId, params); - return InvoiceAddChargeResponse.fromJson(response.getBodyAsString(), response); - } - - /** sendEinvoice a invoice (executes immediately) - returns raw Response. */ - Response sendEinvoiceRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/send_einvoice", "invoice-id", invoiceId); - - return post(path, null); - } - - public InvoiceSendEinvoiceResponse sendEinvoice(String invoiceId) throws Exception { - Response response = sendEinvoiceRaw(invoiceId); - return InvoiceSendEinvoiceResponse.fromJson(response.getBodyAsString(), response); - } - - /** paymentSchedules a invoice (executes immediately) - returns raw Response. */ - Response paymentSchedulesRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/payment_schedules", "invoice-id", invoiceId); - - return get(path, null); - } - - public InvoicePaymentSchedulesResponse paymentSchedules(String invoiceId) throws Exception { - Response response = paymentSchedulesRaw(invoiceId); - return InvoicePaymentSchedulesResponse.fromJson(response.getBodyAsString(), response); - } - - /** writeOff a invoice (executes immediately) - returns raw Response. */ - Response writeOffRaw(String invoiceId) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/write_off", "invoice-id", invoiceId); - - return post(path, null); - } - - /** writeOff a invoice using immutable params (executes immediately) - returns raw Response. */ - Response writeOffRaw(String invoiceId, InvoiceWriteOffParams params) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/write_off", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** writeOff a invoice using raw JSON payload (executes immediately) - returns raw Response. */ - Response writeOffRaw(String invoiceId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/write_off", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceWriteOffResponse writeOff(String invoiceId, InvoiceWriteOffParams params) - throws Exception { - Response response = writeOffRaw(invoiceId, params); - return InvoiceWriteOffResponse.fromJson(response.getBodyAsString(), response); - } - - /** addChargeItem a invoice (executes immediately) - returns raw Response. */ - Response addChargeItemRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/add_charge_item", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * addChargeItem a invoice using immutable params (executes immediately) - returns raw Response. - */ - Response addChargeItemRaw(String invoiceId, InvoiceAddChargeItemParams params) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/add_charge_item", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * addChargeItem a invoice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response addChargeItemRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/add_charge_item", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceAddChargeItemResponse addChargeItem( - String invoiceId, InvoiceAddChargeItemParams params) throws Exception { - Response response = addChargeItemRaw(invoiceId, params); - return InvoiceAddChargeItemResponse.fromJson(response.getBodyAsString(), response); - } - - /** pauseDunning a invoice (executes immediately) - returns raw Response. */ - Response pauseDunningRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/pause_dunning", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * pauseDunning a invoice using immutable params (executes immediately) - returns raw Response. - */ - Response pauseDunningRaw(String invoiceId, InvoicePauseDunningParams params) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/pause_dunning", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * pauseDunning a invoice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response pauseDunningRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/pause_dunning", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoicePauseDunningResponse pauseDunning( - String invoiceId, InvoicePauseDunningParams params) throws Exception { - Response response = pauseDunningRaw(invoiceId, params); - return InvoicePauseDunningResponse.fromJson(response.getBodyAsString(), response); - } - - /** list a invoice using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(InvoiceListParams params) throws Exception { - - return get("/invoices", params != null ? params.toQueryParams() : null); - } - - /** list a invoice without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/invoices", null); - } - - /** list a invoice using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public InvoiceListResponse list(InvoiceListParams params) throws Exception { - Response response = listRaw(params); - - return InvoiceListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public InvoiceListResponse list() throws Exception { - Response response = listRaw(); - return InvoiceListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** create a invoice using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(InvoiceCreateParams params) throws Exception { - - return post("/invoices", params != null ? params.toFormData() : null); - } - - /** create a invoice using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { - - return postJson("/invoices", jsonPayload); - } - - public InvoiceCreateResponse create(InvoiceCreateParams params) throws Exception { - Response response = createRaw(params); - - return InvoiceCreateResponse.fromJson(response.getBodyAsString(), response); - } - - /** close a invoice (executes immediately) - returns raw Response. */ - Response closeRaw(String invoiceId) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/close", "invoice-id", invoiceId); - - return post(path, null); - } - - /** close a invoice using immutable params (executes immediately) - returns raw Response. */ - Response closeRaw(String invoiceId, InvoiceCloseParams params) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/close", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** close a invoice using raw JSON payload (executes immediately) - returns raw Response. */ - Response closeRaw(String invoiceId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/close", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceCloseResponse close(String invoiceId, InvoiceCloseParams params) throws Exception { - Response response = closeRaw(invoiceId, params); - return InvoiceCloseResponse.fromJson(response.getBodyAsString(), response); - } - - /** applyCredits a invoice (executes immediately) - returns raw Response. */ - Response applyCreditsRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/apply_credits", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * applyCredits a invoice using immutable params (executes immediately) - returns raw Response. - */ - Response applyCreditsRaw(String invoiceId, InvoiceApplyCreditsParams params) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/apply_credits", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * applyCredits a invoice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response applyCreditsRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/apply_credits", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceApplyCreditsResponse applyCredits( - String invoiceId, InvoiceApplyCreditsParams params) throws Exception { - Response response = applyCreditsRaw(invoiceId, params); - return InvoiceApplyCreditsResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a invoice (executes immediately) - returns raw Response. */ - Response retrieveRaw(String invoiceId) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}", "invoice-id", invoiceId); - - return get(path, null); - } - - public InvoiceRetrieveResponse retrieve(String invoiceId) throws Exception { - Response response = retrieveRaw(invoiceId); - return InvoiceRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createForChargeItem a invoice using immutable params (executes immediately) - returns raw - * Response. - */ - Response createForChargeItemRaw(InvoiceCreateForChargeItemParams params) throws Exception { - - return post("/invoices/create_for_charge_item", params != null ? params.toFormData() : null); - } - - /** - * createForChargeItem a invoice using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response createForChargeItemRaw(String jsonPayload) throws Exception { - - return postJson("/invoices/create_for_charge_item", jsonPayload); - } - - public InvoiceCreateForChargeItemResponse createForChargeItem( - InvoiceCreateForChargeItemParams params) throws Exception { - Response response = createForChargeItemRaw(params); - - return InvoiceCreateForChargeItemResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createForChargeItemsAndCharges a invoice using immutable params (executes immediately) - - * returns raw Response. - */ - Response createForChargeItemsAndChargesRaw(InvoiceCreateForChargeItemsAndChargesParams params) - throws Exception { - - return post( - "/invoices/create_for_charge_items_and_charges", - params != null ? params.toFormData() : null); - } - - /** - * createForChargeItemsAndCharges a invoice using raw JSON payload (executes immediately) - - * returns raw Response. - */ - Response createForChargeItemsAndChargesRaw(String jsonPayload) throws Exception { - - return postJson("/invoices/create_for_charge_items_and_charges", jsonPayload); - } - - public InvoiceCreateForChargeItemsAndChargesResponse createForChargeItemsAndCharges( - InvoiceCreateForChargeItemsAndChargesParams params) throws Exception { - Response response = createForChargeItemsAndChargesRaw(params); - - return InvoiceCreateForChargeItemsAndChargesResponse.fromJson( - response.getBodyAsString(), response); - } - - /** deleteImported a invoice (executes immediately) - returns raw Response. */ - Response deleteImportedRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/delete_imported", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * deleteImported a invoice using immutable params (executes immediately) - returns raw Response. - */ - Response deleteImportedRaw(String invoiceId, InvoiceDeleteImportedParams params) - throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/delete_imported", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * deleteImported a invoice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response deleteImportedRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/delete_imported", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceDeleteImportedResponse deleteImported( - String invoiceId, InvoiceDeleteImportedParams params) throws Exception { - Response response = deleteImportedRaw(invoiceId, params); - return InvoiceDeleteImportedResponse.fromJson(response.getBodyAsString(), response); - } - - /** updateDetails a invoice (executes immediately) - returns raw Response. */ - Response updateDetailsRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/update_details", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * updateDetails a invoice using immutable params (executes immediately) - returns raw Response. - */ - Response updateDetailsRaw(String invoiceId, InvoiceUpdateDetailsParams params) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/update_details", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * updateDetails a invoice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response updateDetailsRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/update_details", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceUpdateDetailsResponse updateDetails( - String invoiceId, InvoiceUpdateDetailsParams params) throws Exception { - Response response = updateDetailsRaw(invoiceId, params); - return InvoiceUpdateDetailsResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * invoicesForCustomer a invoice using immutable params (executes immediately) - returns raw - * Response. - */ - Response invoicesForCustomerRaw(String customerId, InvoiceInvoicesForCustomerParams params) - throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/invoices", "customer-id", customerId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** invoicesForCustomer a invoice without params (executes immediately) - returns raw Response. */ - Response invoicesForCustomerRaw(String customerId) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/invoices", "customer-id", customerId); - return get(path, null); - } - - /** - * invoicesForCustomer a invoice using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response invoicesForCustomerRaw(String customerId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/invoices", "customer-id", customerId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public InvoiceInvoicesForCustomerResponse invoicesForCustomer( - String customerId, InvoiceInvoicesForCustomerParams params) throws Exception { - Response response = invoicesForCustomerRaw(customerId, params); - return InvoiceInvoicesForCustomerResponse.fromJson( - response.getBodyAsString(), this, params, customerId, response); - } - - public InvoiceInvoicesForCustomerResponse invoicesForCustomer(String customerId) - throws Exception { - Response response = invoicesForCustomerRaw(customerId); - return InvoiceInvoicesForCustomerResponse.fromJson( - response.getBodyAsString(), this, null, customerId, response); - } - - /** recordPayment a invoice (executes immediately) - returns raw Response. */ - Response recordPaymentRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/record_payment", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * recordPayment a invoice using immutable params (executes immediately) - returns raw Response. - */ - Response recordPaymentRaw(String invoiceId, InvoiceRecordPaymentParams params) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/record_payment", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * recordPayment a invoice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response recordPaymentRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/record_payment", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceRecordPaymentResponse recordPayment( - String invoiceId, InvoiceRecordPaymentParams params) throws Exception { - Response response = recordPaymentRaw(invoiceId, params); - return InvoiceRecordPaymentResponse.fromJson(response.getBodyAsString(), response); - } - - /** delete a invoice (executes immediately) - returns raw Response. */ - Response deleteRaw(String invoiceId) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/delete", "invoice-id", invoiceId); - - return post(path, null); - } - - /** delete a invoice using immutable params (executes immediately) - returns raw Response. */ - Response deleteRaw(String invoiceId, InvoiceDeleteParams params) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/delete", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** delete a invoice using raw JSON payload (executes immediately) - returns raw Response. */ - Response deleteRaw(String invoiceId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/delete", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceDeleteResponse delete(String invoiceId, InvoiceDeleteParams params) - throws Exception { - Response response = deleteRaw(invoiceId, params); - return InvoiceDeleteResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * importInvoice a invoice using immutable params (executes immediately) - returns raw Response. - */ - Response importInvoiceRaw(InvoiceImportInvoiceParams params) throws Exception { - - return post("/invoices/import_invoice", params != null ? params.toFormData() : null); - } - - /** - * importInvoice a invoice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response importInvoiceRaw(String jsonPayload) throws Exception { - - return postJson("/invoices/import_invoice", jsonPayload); - } - - public InvoiceImportInvoiceResponse importInvoice(InvoiceImportInvoiceParams params) - throws Exception { - Response response = importInvoiceRaw(params); - - return InvoiceImportInvoiceResponse.fromJson(response.getBodyAsString(), response); - } - - /** resumeDunning a invoice (executes immediately) - returns raw Response. */ - Response resumeDunningRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/resume_dunning", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * resumeDunning a invoice using immutable params (executes immediately) - returns raw Response. - */ - Response resumeDunningRaw(String invoiceId, InvoiceResumeDunningParams params) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/resume_dunning", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * resumeDunning a invoice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response resumeDunningRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/resume_dunning", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceResumeDunningResponse resumeDunning( - String invoiceId, InvoiceResumeDunningParams params) throws Exception { - Response response = resumeDunningRaw(invoiceId, params); - return InvoiceResumeDunningResponse.fromJson(response.getBodyAsString(), response); - } - - /** recordTaxWithheld a invoice (executes immediately) - returns raw Response. */ - Response recordTaxWithheldRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/record_tax_withheld", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * recordTaxWithheld a invoice using immutable params (executes immediately) - returns raw - * Response. - */ - Response recordTaxWithheldRaw(String invoiceId, InvoiceRecordTaxWithheldParams params) - throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/record_tax_withheld", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * recordTaxWithheld a invoice using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response recordTaxWithheldRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/record_tax_withheld", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceRecordTaxWithheldResponse recordTaxWithheld( - String invoiceId, InvoiceRecordTaxWithheldParams params) throws Exception { - Response response = recordTaxWithheldRaw(invoiceId, params); - return InvoiceRecordTaxWithheldResponse.fromJson(response.getBodyAsString(), response); - } - - /** resendEinvoice a invoice (executes immediately) - returns raw Response. */ - Response resendEinvoiceRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/resend_einvoice", "invoice-id", invoiceId); - - return post(path, null); - } - - public InvoiceResendEinvoiceResponse resendEinvoice(String invoiceId) throws Exception { - Response response = resendEinvoiceRaw(invoiceId); - return InvoiceResendEinvoiceResponse.fromJson(response.getBodyAsString(), response); - } - - /** removeTaxWithheld a invoice (executes immediately) - returns raw Response. */ - Response removeTaxWithheldRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/remove_tax_withheld", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * removeTaxWithheld a invoice using immutable params (executes immediately) - returns raw - * Response. - */ - Response removeTaxWithheldRaw(String invoiceId, InvoiceRemoveTaxWithheldParams params) - throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/remove_tax_withheld", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * removeTaxWithheld a invoice using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response removeTaxWithheldRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/remove_tax_withheld", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceRemoveTaxWithheldResponse removeTaxWithheld( - String invoiceId, InvoiceRemoveTaxWithheldParams params) throws Exception { - Response response = removeTaxWithheldRaw(invoiceId, params); - return InvoiceRemoveTaxWithheldResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * listPaymentReferenceNumbers a invoice using immutable params (executes immediately) - returns - * raw Response. - */ - Response listPaymentReferenceNumbersRaw(InvoiceListPaymentReferenceNumbersParams params) - throws Exception { - - return get( - "/invoices/payment_reference_numbers", params != null ? params.toQueryParams() : null); - } - - /** - * listPaymentReferenceNumbers a invoice without params (executes immediately) - returns raw - * Response. - */ - Response listPaymentReferenceNumbersRaw() throws Exception { - - return get("/invoices/payment_reference_numbers", null); - } - - /** - * listPaymentReferenceNumbers a invoice using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response listPaymentReferenceNumbersRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public InvoiceListPaymentReferenceNumbersResponse listPaymentReferenceNumbers( - InvoiceListPaymentReferenceNumbersParams params) throws Exception { - Response response = listPaymentReferenceNumbersRaw(params); - - return InvoiceListPaymentReferenceNumbersResponse.fromJson( - response.getBodyAsString(), this, params, response); - } - - public InvoiceListPaymentReferenceNumbersResponse listPaymentReferenceNumbers() throws Exception { - Response response = listPaymentReferenceNumbersRaw(); - return InvoiceListPaymentReferenceNumbersResponse.fromJson( - response.getBodyAsString(), this, null, response); - } - - /** collectPayment a invoice (executes immediately) - returns raw Response. */ - Response collectPaymentRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/collect_payment", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * collectPayment a invoice using immutable params (executes immediately) - returns raw Response. - */ - Response collectPaymentRaw(String invoiceId, InvoiceCollectPaymentParams params) - throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/collect_payment", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * collectPayment a invoice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response collectPaymentRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/collect_payment", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceCollectPaymentResponse collectPayment( - String invoiceId, InvoiceCollectPaymentParams params) throws Exception { - Response response = collectPaymentRaw(invoiceId, params); - return InvoiceCollectPaymentResponse.fromJson(response.getBodyAsString(), response); - } - - /** syncUsages a invoice (executes immediately) - returns raw Response. */ - Response syncUsagesRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/sync_usages", "invoice-id", invoiceId); - - return post(path, null); - } - - public InvoiceSyncUsagesResponse syncUsages(String invoiceId) throws Exception { - Response response = syncUsagesRaw(invoiceId); - return InvoiceSyncUsagesResponse.fromJson(response.getBodyAsString(), response); - } - - /** refund a invoice (executes immediately) - returns raw Response. */ - Response refundRaw(String invoiceId) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/refund", "invoice-id", invoiceId); - - return post(path, null); - } - - /** refund a invoice using immutable params (executes immediately) - returns raw Response. */ - Response refundRaw(String invoiceId, InvoiceRefundParams params) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/refund", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** refund a invoice using raw JSON payload (executes immediately) - returns raw Response. */ - Response refundRaw(String invoiceId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/refund", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceRefundResponse refund(String invoiceId, InvoiceRefundParams params) - throws Exception { - Response response = refundRaw(invoiceId, params); - return InvoiceRefundResponse.fromJson(response.getBodyAsString(), response); - } - - /** recordRefund a invoice (executes immediately) - returns raw Response. */ - Response recordRefundRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/record_refund", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * recordRefund a invoice using immutable params (executes immediately) - returns raw Response. - */ - Response recordRefundRaw(String invoiceId, InvoiceRecordRefundParams params) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/record_refund", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * recordRefund a invoice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response recordRefundRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/record_refund", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceRecordRefundResponse recordRefund( - String invoiceId, InvoiceRecordRefundParams params) throws Exception { - Response response = recordRefundRaw(invoiceId, params); - return InvoiceRecordRefundResponse.fromJson(response.getBodyAsString(), response); - } - - /** pdf a invoice (executes immediately) - returns raw Response. */ - Response pdfRaw(String invoiceId) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/pdf", "invoice-id", invoiceId); - - return post(path, null); - } - - /** pdf a invoice using immutable params (executes immediately) - returns raw Response. */ - Response pdfRaw(String invoiceId, InvoicePdfParams params) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/pdf", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** pdf a invoice using raw JSON payload (executes immediately) - returns raw Response. */ - Response pdfRaw(String invoiceId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/pdf", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoicePdfResponse pdf(String invoiceId, InvoicePdfParams params) throws Exception { - Response response = pdfRaw(invoiceId, params); - return InvoicePdfResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * invoicesForSubscription a invoice using immutable params (executes immediately) - returns raw - * Response. - */ - Response invoicesForSubscriptionRaw( - String subscriptionId, InvoiceInvoicesForSubscriptionParams params) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/invoices", "subscription-id", subscriptionId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * invoicesForSubscription a invoice without params (executes immediately) - returns raw Response. - */ - Response invoicesForSubscriptionRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/invoices", "subscription-id", subscriptionId); - return get(path, null); - } - - /** - * invoicesForSubscription a invoice using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response invoicesForSubscriptionRaw(String subscriptionId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/invoices", "subscription-id", subscriptionId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public InvoiceInvoicesForSubscriptionResponse invoicesForSubscription( - String subscriptionId, InvoiceInvoicesForSubscriptionParams params) throws Exception { - Response response = invoicesForSubscriptionRaw(subscriptionId, params); - return InvoiceInvoicesForSubscriptionResponse.fromJson( - response.getBodyAsString(), this, params, subscriptionId, response); - } - - public InvoiceInvoicesForSubscriptionResponse invoicesForSubscription(String subscriptionId) - throws Exception { - Response response = invoicesForSubscriptionRaw(subscriptionId); - return InvoiceInvoicesForSubscriptionResponse.fromJson( - response.getBodyAsString(), this, null, subscriptionId, response); - } - - /** downloadEinvoice a invoice (executes immediately) - returns raw Response. */ - Response downloadEinvoiceRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/download_einvoice", "invoice-id", invoiceId); - - return get(path, null); - } - - public InvoiceDownloadEinvoiceResponse downloadEinvoice(String invoiceId) throws Exception { - Response response = downloadEinvoiceRaw(invoiceId); - return InvoiceDownloadEinvoiceResponse.fromJson(response.getBodyAsString(), response); - } - - /** chargeAddon a invoice using immutable params (executes immediately) - returns raw Response. */ - Response chargeAddonRaw(InvoiceChargeAddonParams params) throws Exception { - - return post("/invoices/charge_addon", params != null ? params.toFormData() : null); - } - - /** chargeAddon a invoice using raw JSON payload (executes immediately) - returns raw Response. */ - Response chargeAddonRaw(String jsonPayload) throws Exception { - - return postJson("/invoices/charge_addon", jsonPayload); - } - - public InvoiceChargeAddonResponse chargeAddon(InvoiceChargeAddonParams params) throws Exception { - Response response = chargeAddonRaw(params); - - return InvoiceChargeAddonResponse.fromJson(response.getBodyAsString(), response); - } - - /** addAddonCharge a invoice (executes immediately) - returns raw Response. */ - Response addAddonChargeRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/add_addon_charge", "invoice-id", invoiceId); - - return post(path, null); - } - - /** - * addAddonCharge a invoice using immutable params (executes immediately) - returns raw Response. - */ - Response addAddonChargeRaw(String invoiceId, InvoiceAddAddonChargeParams params) - throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/add_addon_charge", "invoice-id", invoiceId); - return post(path, params.toFormData()); - } - - /** - * addAddonCharge a invoice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response addAddonChargeRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/add_addon_charge", "invoice-id", invoiceId); - return postJson(path, jsonPayload); - } - - public InvoiceAddAddonChargeResponse addAddonCharge( - String invoiceId, InvoiceAddAddonChargeParams params) throws Exception { - Response response = addAddonChargeRaw(invoiceId, params); - return InvoiceAddAddonChargeResponse.fromJson(response.getBodyAsString(), response); - } - - /** charge a invoice using immutable params (executes immediately) - returns raw Response. */ - Response chargeRaw(InvoiceChargeParams params) throws Exception { - - return post("/invoices/charge", params != null ? params.toFormData() : null); - } - - /** charge a invoice using raw JSON payload (executes immediately) - returns raw Response. */ - Response chargeRaw(String jsonPayload) throws Exception { - - return postJson("/invoices/charge", jsonPayload); - } - - public InvoiceChargeResponse charge(InvoiceChargeParams params) throws Exception { - Response response = chargeRaw(params); - - return InvoiceChargeResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/ItemEntitlementService.java b/src/main/java/com/chargebee/v4/core/services/ItemEntitlementService.java deleted file mode 100644 index f73383b5..00000000 --- a/src/main/java/com/chargebee/v4/core/services/ItemEntitlementService.java +++ /dev/null @@ -1,227 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.itemEntitlement.params.ItemEntitlementItemEntitlementsForFeatureParams; - -import com.chargebee.v4.core.models.itemEntitlement.params.ItemEntitlementAddItemEntitlementsParams; - -import com.chargebee.v4.core.models.itemEntitlement.params.ItemEntitlementItemEntitlementsForItemParams; - -import com.chargebee.v4.core.models.itemEntitlement.params.ItemEntitlementUpsertOrRemoveItemEntitlementsForItemParams; - -import com.chargebee.v4.core.responses.itemEntitlement.ItemEntitlementItemEntitlementsForFeatureResponse; - -import com.chargebee.v4.core.responses.itemEntitlement.ItemEntitlementAddItemEntitlementsResponse; - -import com.chargebee.v4.core.responses.itemEntitlement.ItemEntitlementItemEntitlementsForItemResponse; - -import com.chargebee.v4.core.responses.itemEntitlement.ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse; - -public final class ItemEntitlementService extends BaseService { - - private final ServiceConfig config; - - public ItemEntitlementService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private ItemEntitlementService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private ItemEntitlementService( - ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - ItemEntitlementService with(RequestOptions newOptions) { - return new ItemEntitlementService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public ItemEntitlementService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** - * itemEntitlementsForFeature a itemEntitlement using immutable params (executes immediately) - - * returns raw Response. - */ - Response itemEntitlementsForFeatureRaw( - String featureId, ItemEntitlementItemEntitlementsForFeatureParams params) throws Exception { - String path = - buildPathWithParams("/features/{feature-id}/item_entitlements", "feature-id", featureId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * itemEntitlementsForFeature a itemEntitlement without params (executes immediately) - returns - * raw Response. - */ - Response itemEntitlementsForFeatureRaw(String featureId) throws Exception { - String path = - buildPathWithParams("/features/{feature-id}/item_entitlements", "feature-id", featureId); - return get(path, null); - } - - /** - * itemEntitlementsForFeature a itemEntitlement using raw JSON payload (executes immediately) - - * returns raw Response. - */ - Response itemEntitlementsForFeatureRaw(String featureId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/features/{feature-id}/item_entitlements", "feature-id", featureId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public ItemEntitlementItemEntitlementsForFeatureResponse itemEntitlementsForFeature( - String featureId, ItemEntitlementItemEntitlementsForFeatureParams params) throws Exception { - Response response = itemEntitlementsForFeatureRaw(featureId, params); - return ItemEntitlementItemEntitlementsForFeatureResponse.fromJson( - response.getBodyAsString(), this, params, featureId, response); - } - - public ItemEntitlementItemEntitlementsForFeatureResponse itemEntitlementsForFeature( - String featureId) throws Exception { - Response response = itemEntitlementsForFeatureRaw(featureId); - return ItemEntitlementItemEntitlementsForFeatureResponse.fromJson( - response.getBodyAsString(), this, null, featureId, response); - } - - /** addItemEntitlements a itemEntitlement (executes immediately) - returns raw Response. */ - Response addItemEntitlementsRaw(String featureId) throws Exception { - String path = - buildPathWithParams("/features/{feature-id}/item_entitlements", "feature-id", featureId); - - return post(path, null); - } - - /** - * addItemEntitlements a itemEntitlement using immutable params (executes immediately) - returns - * raw Response. - */ - Response addItemEntitlementsRaw(String featureId, ItemEntitlementAddItemEntitlementsParams params) - throws Exception { - String path = - buildPathWithParams("/features/{feature-id}/item_entitlements", "feature-id", featureId); - return post(path, params.toFormData()); - } - - /** - * addItemEntitlements a itemEntitlement using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response addItemEntitlementsRaw(String featureId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/features/{feature-id}/item_entitlements", "feature-id", featureId); - return postJson(path, jsonPayload); - } - - public ItemEntitlementAddItemEntitlementsResponse addItemEntitlements( - String featureId, ItemEntitlementAddItemEntitlementsParams params) throws Exception { - Response response = addItemEntitlementsRaw(featureId, params); - return ItemEntitlementAddItemEntitlementsResponse.fromJson( - response.getBodyAsString(), response); - } - - /** - * itemEntitlementsForItem a itemEntitlement using immutable params (executes immediately) - - * returns raw Response. - */ - Response itemEntitlementsForItemRaw( - String itemId, ItemEntitlementItemEntitlementsForItemParams params) throws Exception { - String path = buildPathWithParams("/items/{item-id}/item_entitlements", "item-id", itemId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * itemEntitlementsForItem a itemEntitlement without params (executes immediately) - returns raw - * Response. - */ - Response itemEntitlementsForItemRaw(String itemId) throws Exception { - String path = buildPathWithParams("/items/{item-id}/item_entitlements", "item-id", itemId); - return get(path, null); - } - - /** - * itemEntitlementsForItem a itemEntitlement using raw JSON payload (executes immediately) - - * returns raw Response. - */ - Response itemEntitlementsForItemRaw(String itemId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/items/{item-id}/item_entitlements", "item-id", itemId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public ItemEntitlementItemEntitlementsForItemResponse itemEntitlementsForItem( - String itemId, ItemEntitlementItemEntitlementsForItemParams params) throws Exception { - Response response = itemEntitlementsForItemRaw(itemId, params); - return ItemEntitlementItemEntitlementsForItemResponse.fromJson( - response.getBodyAsString(), this, params, itemId, response); - } - - public ItemEntitlementItemEntitlementsForItemResponse itemEntitlementsForItem(String itemId) - throws Exception { - Response response = itemEntitlementsForItemRaw(itemId); - return ItemEntitlementItemEntitlementsForItemResponse.fromJson( - response.getBodyAsString(), this, null, itemId, response); - } - - /** - * upsertOrRemoveItemEntitlementsForItem a itemEntitlement (executes immediately) - returns raw - * Response. - */ - Response upsertOrRemoveItemEntitlementsForItemRaw(String itemId) throws Exception { - String path = buildPathWithParams("/items/{item-id}/item_entitlements", "item-id", itemId); - - return post(path, null); - } - - /** - * upsertOrRemoveItemEntitlementsForItem a itemEntitlement using immutable params (executes - * immediately) - returns raw Response. - */ - Response upsertOrRemoveItemEntitlementsForItemRaw( - String itemId, ItemEntitlementUpsertOrRemoveItemEntitlementsForItemParams params) - throws Exception { - String path = buildPathWithParams("/items/{item-id}/item_entitlements", "item-id", itemId); - return post(path, params.toFormData()); - } - - /** - * upsertOrRemoveItemEntitlementsForItem a itemEntitlement using raw JSON payload (executes - * immediately) - returns raw Response. - */ - Response upsertOrRemoveItemEntitlementsForItemRaw(String itemId, String jsonPayload) - throws Exception { - String path = buildPathWithParams("/items/{item-id}/item_entitlements", "item-id", itemId); - return postJson(path, jsonPayload); - } - - public ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse - upsertOrRemoveItemEntitlementsForItem( - String itemId, ItemEntitlementUpsertOrRemoveItemEntitlementsForItemParams params) - throws Exception { - Response response = upsertOrRemoveItemEntitlementsForItemRaw(itemId, params); - return ItemEntitlementUpsertOrRemoveItemEntitlementsForItemResponse.fromJson( - response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/ItemPriceService.java b/src/main/java/com/chargebee/v4/core/services/ItemPriceService.java deleted file mode 100644 index 3382f2c4..00000000 --- a/src/main/java/com/chargebee/v4/core/services/ItemPriceService.java +++ /dev/null @@ -1,263 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.itemPrice.params.ItemPriceFindApplicableItemsParams; - -import com.chargebee.v4.core.models.itemPrice.params.ItemPriceUpdateParams; - -import com.chargebee.v4.core.models.itemPrice.params.ItemPriceFindApplicableItemPricesParams; - -import com.chargebee.v4.core.models.itemPrice.params.ItemPriceListParams; - -import com.chargebee.v4.core.models.itemPrice.params.ItemPriceCreateParams; - -import com.chargebee.v4.core.responses.itemPrice.ItemPriceFindApplicableItemsResponse; - -import com.chargebee.v4.core.responses.itemPrice.ItemPriceRetrieveResponse; - -import com.chargebee.v4.core.responses.itemPrice.ItemPriceUpdateResponse; - -import com.chargebee.v4.core.responses.itemPrice.ItemPriceDeleteResponse; - -import com.chargebee.v4.core.responses.itemPrice.ItemPriceFindApplicableItemPricesResponse; - -import com.chargebee.v4.core.responses.itemPrice.ItemPriceListResponse; - -import com.chargebee.v4.core.responses.itemPrice.ItemPriceCreateResponse; - -public final class ItemPriceService extends BaseService { - - private final ServiceConfig config; - - public ItemPriceService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private ItemPriceService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private ItemPriceService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - ItemPriceService with(RequestOptions newOptions) { - return new ItemPriceService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public ItemPriceService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** - * findApplicableItems a itemPrice using immutable params (executes immediately) - returns raw - * Response. - */ - Response findApplicableItemsRaw(String itemPriceId, ItemPriceFindApplicableItemsParams params) - throws Exception { - String path = - buildPathWithParams( - "/item_prices/{item-price-id}/applicable_items", "item-price-id", itemPriceId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * findApplicableItems a itemPrice without params (executes immediately) - returns raw Response. - */ - Response findApplicableItemsRaw(String itemPriceId) throws Exception { - String path = - buildPathWithParams( - "/item_prices/{item-price-id}/applicable_items", "item-price-id", itemPriceId); - return get(path, null); - } - - /** - * findApplicableItems a itemPrice using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response findApplicableItemsRaw(String itemPriceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/item_prices/{item-price-id}/applicable_items", "item-price-id", itemPriceId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public ItemPriceFindApplicableItemsResponse findApplicableItems( - String itemPriceId, ItemPriceFindApplicableItemsParams params) throws Exception { - Response response = findApplicableItemsRaw(itemPriceId, params); - return ItemPriceFindApplicableItemsResponse.fromJson( - response.getBodyAsString(), this, params, itemPriceId, response); - } - - public ItemPriceFindApplicableItemsResponse findApplicableItems(String itemPriceId) - throws Exception { - Response response = findApplicableItemsRaw(itemPriceId); - return ItemPriceFindApplicableItemsResponse.fromJson( - response.getBodyAsString(), this, null, itemPriceId, response); - } - - /** retrieve a itemPrice (executes immediately) - returns raw Response. */ - Response retrieveRaw(String itemPriceId) throws Exception { - String path = buildPathWithParams("/item_prices/{item-price-id}", "item-price-id", itemPriceId); - - return get(path, null); - } - - public ItemPriceRetrieveResponse retrieve(String itemPriceId) throws Exception { - Response response = retrieveRaw(itemPriceId); - return ItemPriceRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** update a itemPrice (executes immediately) - returns raw Response. */ - Response updateRaw(String itemPriceId) throws Exception { - String path = buildPathWithParams("/item_prices/{item-price-id}", "item-price-id", itemPriceId); - - return post(path, null); - } - - /** update a itemPrice using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String itemPriceId, ItemPriceUpdateParams params) throws Exception { - String path = buildPathWithParams("/item_prices/{item-price-id}", "item-price-id", itemPriceId); - return post(path, params.toFormData()); - } - - /** update a itemPrice using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String itemPriceId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/item_prices/{item-price-id}", "item-price-id", itemPriceId); - return postJson(path, jsonPayload); - } - - public ItemPriceUpdateResponse update(String itemPriceId, ItemPriceUpdateParams params) - throws Exception { - Response response = updateRaw(itemPriceId, params); - return ItemPriceUpdateResponse.fromJson(response.getBodyAsString(), response); - } - - /** delete a itemPrice (executes immediately) - returns raw Response. */ - Response deleteRaw(String itemPriceId) throws Exception { - String path = - buildPathWithParams("/item_prices/{item-price-id}/delete", "item-price-id", itemPriceId); - - return post(path, null); - } - - public ItemPriceDeleteResponse delete(String itemPriceId) throws Exception { - Response response = deleteRaw(itemPriceId); - return ItemPriceDeleteResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * findApplicableItemPrices a itemPrice using immutable params (executes immediately) - returns - * raw Response. - */ - Response findApplicableItemPricesRaw( - String itemPriceId, ItemPriceFindApplicableItemPricesParams params) throws Exception { - String path = - buildPathWithParams( - "/item_prices/{item-price-id}/applicable_item_prices", "item-price-id", itemPriceId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * findApplicableItemPrices a itemPrice without params (executes immediately) - returns raw - * Response. - */ - Response findApplicableItemPricesRaw(String itemPriceId) throws Exception { - String path = - buildPathWithParams( - "/item_prices/{item-price-id}/applicable_item_prices", "item-price-id", itemPriceId); - return get(path, null); - } - - /** - * findApplicableItemPrices a itemPrice using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response findApplicableItemPricesRaw(String itemPriceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/item_prices/{item-price-id}/applicable_item_prices", "item-price-id", itemPriceId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public ItemPriceFindApplicableItemPricesResponse findApplicableItemPrices( - String itemPriceId, ItemPriceFindApplicableItemPricesParams params) throws Exception { - Response response = findApplicableItemPricesRaw(itemPriceId, params); - return ItemPriceFindApplicableItemPricesResponse.fromJson( - response.getBodyAsString(), this, params, itemPriceId, response); - } - - public ItemPriceFindApplicableItemPricesResponse findApplicableItemPrices(String itemPriceId) - throws Exception { - Response response = findApplicableItemPricesRaw(itemPriceId); - return ItemPriceFindApplicableItemPricesResponse.fromJson( - response.getBodyAsString(), this, null, itemPriceId, response); - } - - /** list a itemPrice using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(ItemPriceListParams params) throws Exception { - - return get("/item_prices", params != null ? params.toQueryParams() : null); - } - - /** list a itemPrice without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/item_prices", null); - } - - /** list a itemPrice using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public ItemPriceListResponse list(ItemPriceListParams params) throws Exception { - Response response = listRaw(params); - - return ItemPriceListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public ItemPriceListResponse list() throws Exception { - Response response = listRaw(); - return ItemPriceListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** create a itemPrice using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(ItemPriceCreateParams params) throws Exception { - - return post("/item_prices", params != null ? params.toFormData() : null); - } - - /** create a itemPrice using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { - - return postJson("/item_prices", jsonPayload); - } - - public ItemPriceCreateResponse create(ItemPriceCreateParams params) throws Exception { - Response response = createRaw(params); - - return ItemPriceCreateResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/ItemService.java b/src/main/java/com/chargebee/v4/core/services/ItemService.java deleted file mode 100644 index dd0adae7..00000000 --- a/src/main/java/com/chargebee/v4/core/services/ItemService.java +++ /dev/null @@ -1,158 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.item.params.ItemListParams; - -import com.chargebee.v4.core.models.item.params.ItemCreateParams; - -import com.chargebee.v4.core.models.item.params.ItemUpdateParams; - -import com.chargebee.v4.core.responses.item.ItemListResponse; - -import com.chargebee.v4.core.responses.item.ItemCreateResponse; - -import com.chargebee.v4.core.responses.item.ItemDeleteResponse; - -import com.chargebee.v4.core.responses.item.ItemRetrieveResponse; - -import com.chargebee.v4.core.responses.item.ItemUpdateResponse; - -public final class ItemService extends BaseService { - - private final ServiceConfig config; - - public ItemService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private ItemService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private ItemService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - ItemService with(RequestOptions newOptions) { - return new ItemService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public ItemService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** list a item using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(ItemListParams params) throws Exception { - - return get("/items", params != null ? params.toQueryParams() : null); - } - - /** list a item without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/items", null); - } - - /** list a item using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public ItemListResponse list(ItemListParams params) throws Exception { - Response response = listRaw(params); - - return ItemListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public ItemListResponse list() throws Exception { - Response response = listRaw(); - return ItemListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** create a item using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(ItemCreateParams params) throws Exception { - - return post("/items", params != null ? params.toFormData() : null); - } - - /** create a item using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { - - return postJson("/items", jsonPayload); - } - - public ItemCreateResponse create(ItemCreateParams params) throws Exception { - Response response = createRaw(params); - - return ItemCreateResponse.fromJson(response.getBodyAsString(), response); - } - - /** delete a item (executes immediately) - returns raw Response. */ - Response deleteRaw(String itemId) throws Exception { - String path = buildPathWithParams("/items/{item-id}/delete", "item-id", itemId); - - return post(path, null); - } - - public ItemDeleteResponse delete(String itemId) throws Exception { - Response response = deleteRaw(itemId); - return ItemDeleteResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a item (executes immediately) - returns raw Response. */ - Response retrieveRaw(String itemId) throws Exception { - String path = buildPathWithParams("/items/{item-id}", "item-id", itemId); - - return get(path, null); - } - - public ItemRetrieveResponse retrieve(String itemId) throws Exception { - Response response = retrieveRaw(itemId); - return ItemRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** update a item (executes immediately) - returns raw Response. */ - Response updateRaw(String itemId) throws Exception { - String path = buildPathWithParams("/items/{item-id}", "item-id", itemId); - - return post(path, null); - } - - /** update a item using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String itemId, ItemUpdateParams params) throws Exception { - String path = buildPathWithParams("/items/{item-id}", "item-id", itemId); - return post(path, params.toFormData()); - } - - /** update a item using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String itemId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/items/{item-id}", "item-id", itemId); - return postJson(path, jsonPayload); - } - - public ItemUpdateResponse update(String itemId, ItemUpdateParams params) throws Exception { - Response response = updateRaw(itemId, params); - return ItemUpdateResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/MediaService.java b/src/main/java/com/chargebee/v4/core/services/MediaService.java deleted file mode 100644 index 0eb61a7e..00000000 --- a/src/main/java/com/chargebee/v4/core/services/MediaService.java +++ /dev/null @@ -1,83 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.media.params.MediaCreateMediaAndAttachToItemParams; - -import com.chargebee.v4.core.responses.media.MediaCreateMediaAndAttachToItemResponse; - -public final class MediaService extends BaseService { - - private final ServiceConfig config; - - public MediaService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private MediaService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private MediaService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - MediaService with(RequestOptions newOptions) { - return new MediaService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public MediaService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** createMediaAndAttachToItem a media (executes immediately) - returns raw Response. */ - Response createMediaAndAttachToItemRaw(String itemId) throws Exception { - String path = buildPathWithParams("/items/{item-id}/media", "item-id", itemId); - - return post(path, null); - } - - /** - * createMediaAndAttachToItem a media using immutable params (executes immediately) - returns raw - * Response. - */ - Response createMediaAndAttachToItemRaw( - String itemId, MediaCreateMediaAndAttachToItemParams params) throws Exception { - String path = buildPathWithParams("/items/{item-id}/media", "item-id", itemId); - return post(path, params.toFormData()); - } - - /** - * createMediaAndAttachToItem a media using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response createMediaAndAttachToItemRaw(String itemId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/items/{item-id}/media", "item-id", itemId); - return postJson(path, jsonPayload); - } - - public MediaCreateMediaAndAttachToItemResponse createMediaAndAttachToItem( - String itemId, MediaCreateMediaAndAttachToItemParams params) throws Exception { - Response response = createMediaAndAttachToItemRaw(itemId, params); - return MediaCreateMediaAndAttachToItemResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/OfferFulfillmentService.java b/src/main/java/com/chargebee/v4/core/services/OfferFulfillmentService.java deleted file mode 100644 index 82e036a5..00000000 --- a/src/main/java/com/chargebee/v4/core/services/OfferFulfillmentService.java +++ /dev/null @@ -1,149 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.offerFulfillment.params.OfferFulfillmentOfferFulfillmentsParams; - -import com.chargebee.v4.core.models.offerFulfillment.params.OfferFulfillmentOfferFulfillmentsUpdateParams; - -import com.chargebee.v4.core.responses.offerFulfillment.OfferFulfillmentOfferFulfillmentsResponse; - -import com.chargebee.v4.core.responses.offerFulfillment.OfferFulfillmentOfferFulfillmentsGetResponse; - -import com.chargebee.v4.core.responses.offerFulfillment.OfferFulfillmentOfferFulfillmentsUpdateResponse; - -public final class OfferFulfillmentService extends BaseService { - - private final ServiceConfig config; - - public OfferFulfillmentService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private OfferFulfillmentService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private OfferFulfillmentService( - ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - OfferFulfillmentService with(RequestOptions newOptions) { - return new OfferFulfillmentService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public OfferFulfillmentService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** - * offerFulfillments a offerFulfillment using immutable params (executes immediately) - returns - * raw Response. - */ - Response offerFulfillmentsRaw(OfferFulfillmentOfferFulfillmentsParams params) throws Exception { - - return post("/offer_fulfillments", params != null ? params.toFormData() : null); - } - - /** - * offerFulfillments a offerFulfillment using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response offerFulfillmentsRaw(String jsonPayload) throws Exception { - - return postJson("/offer_fulfillments", jsonPayload); - } - - public OfferFulfillmentOfferFulfillmentsResponse offerFulfillments( - OfferFulfillmentOfferFulfillmentsParams params) throws Exception { - Response response = offerFulfillmentsRaw(params); - - return OfferFulfillmentOfferFulfillmentsResponse.fromJson(response.getBodyAsString(), response); - } - - /** offerFulfillmentsGet a offerFulfillment (executes immediately) - returns raw Response. */ - Response offerFulfillmentsGetRaw(String offerFulfillmentId) throws Exception { - String path = - buildPathWithParams( - "/offer_fulfillments/{offer-fulfillment-id}", - "offer-fulfillment-id", - offerFulfillmentId); - - return get(path, null); - } - - public OfferFulfillmentOfferFulfillmentsGetResponse offerFulfillmentsGet( - String offerFulfillmentId) throws Exception { - Response response = offerFulfillmentsGetRaw(offerFulfillmentId); - return OfferFulfillmentOfferFulfillmentsGetResponse.fromJson( - response.getBodyAsString(), response); - } - - /** offerFulfillmentsUpdate a offerFulfillment (executes immediately) - returns raw Response. */ - Response offerFulfillmentsUpdateRaw(String offerFulfillmentId) throws Exception { - String path = - buildPathWithParams( - "/offer_fulfillments/{offer-fulfillment-id}", - "offer-fulfillment-id", - offerFulfillmentId); - - return post(path, null); - } - - /** - * offerFulfillmentsUpdate a offerFulfillment using immutable params (executes immediately) - - * returns raw Response. - */ - Response offerFulfillmentsUpdateRaw( - String offerFulfillmentId, OfferFulfillmentOfferFulfillmentsUpdateParams params) - throws Exception { - String path = - buildPathWithParams( - "/offer_fulfillments/{offer-fulfillment-id}", - "offer-fulfillment-id", - offerFulfillmentId); - return post(path, params.toFormData()); - } - - /** - * offerFulfillmentsUpdate a offerFulfillment using raw JSON payload (executes immediately) - - * returns raw Response. - */ - Response offerFulfillmentsUpdateRaw(String offerFulfillmentId, String jsonPayload) - throws Exception { - String path = - buildPathWithParams( - "/offer_fulfillments/{offer-fulfillment-id}", - "offer-fulfillment-id", - offerFulfillmentId); - return postJson(path, jsonPayload); - } - - public OfferFulfillmentOfferFulfillmentsUpdateResponse offerFulfillmentsUpdate( - String offerFulfillmentId, OfferFulfillmentOfferFulfillmentsUpdateParams params) - throws Exception { - Response response = offerFulfillmentsUpdateRaw(offerFulfillmentId, params); - return OfferFulfillmentOfferFulfillmentsUpdateResponse.fromJson( - response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/OmnichannelSubscriptionItemService.java b/src/main/java/com/chargebee/v4/core/services/OmnichannelSubscriptionItemService.java deleted file mode 100644 index 508ecd2a..00000000 --- a/src/main/java/com/chargebee/v4/core/services/OmnichannelSubscriptionItemService.java +++ /dev/null @@ -1,114 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.params.OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams; - -import com.chargebee.v4.core.responses.omnichannelSubscriptionItem.OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse; - -public final class OmnichannelSubscriptionItemService - extends BaseService { - - private final ServiceConfig config; - - public OmnichannelSubscriptionItemService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private OmnichannelSubscriptionItemService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private OmnichannelSubscriptionItemService( - ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - OmnichannelSubscriptionItemService with(RequestOptions newOptions) { - return new OmnichannelSubscriptionItemService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public OmnichannelSubscriptionItemService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** - * listOmniSubItemScheduleChanges a omnichannelSubscriptionItem using immutable params (executes - * immediately) - returns raw Response. - */ - Response listOmniSubItemScheduleChangesRaw( - String omnichannelSubscriptionItemId, - OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams params) - throws Exception { - String path = - buildPathWithParams( - "/omnichannel_subscription_items/{omnichannel-subscription-item-id}/scheduled_changes", - "omnichannel-subscription-item-id", - omnichannelSubscriptionItemId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * listOmniSubItemScheduleChanges a omnichannelSubscriptionItem without params (executes - * immediately) - returns raw Response. - */ - Response listOmniSubItemScheduleChangesRaw(String omnichannelSubscriptionItemId) - throws Exception { - String path = - buildPathWithParams( - "/omnichannel_subscription_items/{omnichannel-subscription-item-id}/scheduled_changes", - "omnichannel-subscription-item-id", - omnichannelSubscriptionItemId); - return get(path, null); - } - - /** - * listOmniSubItemScheduleChanges a omnichannelSubscriptionItem using raw JSON payload (executes - * immediately) - returns raw Response. - */ - Response listOmniSubItemScheduleChangesRaw( - String omnichannelSubscriptionItemId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/omnichannel_subscription_items/{omnichannel-subscription-item-id}/scheduled_changes", - "omnichannel-subscription-item-id", - omnichannelSubscriptionItemId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse - listOmniSubItemScheduleChanges( - String omnichannelSubscriptionItemId, - OmnichannelSubscriptionItemListOmniSubItemScheduleChangesParams params) - throws Exception { - Response response = listOmniSubItemScheduleChangesRaw(omnichannelSubscriptionItemId, params); - return OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse.fromJson( - response.getBodyAsString(), this, params, omnichannelSubscriptionItemId, response); - } - - public OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse - listOmniSubItemScheduleChanges(String omnichannelSubscriptionItemId) throws Exception { - Response response = listOmniSubItemScheduleChangesRaw(omnichannelSubscriptionItemId); - return OmnichannelSubscriptionItemListOmniSubItemScheduleChangesResponse.fromJson( - response.getBodyAsString(), this, null, omnichannelSubscriptionItemId, response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/OrderService.java b/src/main/java/com/chargebee/v4/core/services/OrderService.java deleted file mode 100644 index b554ae08..00000000 --- a/src/main/java/com/chargebee/v4/core/services/OrderService.java +++ /dev/null @@ -1,361 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.order.params.OrderListParams; - -import com.chargebee.v4.core.models.order.params.OrderCreateParams; - -import com.chargebee.v4.core.models.order.params.OrderImportOrderParams; - -import com.chargebee.v4.core.models.order.params.OrderResendParams; - -import com.chargebee.v4.core.models.order.params.OrderReopenParams; - -import com.chargebee.v4.core.models.order.params.OrderOrdersForInvoiceParams; - -import com.chargebee.v4.core.models.order.params.OrderCancelParams; - -import com.chargebee.v4.core.models.order.params.OrderUpdateParams; - -import com.chargebee.v4.core.models.order.params.OrderCreateRefundableCreditNoteParams; - -import com.chargebee.v4.core.responses.order.OrderListResponse; - -import com.chargebee.v4.core.responses.order.OrderCreateResponse; - -import com.chargebee.v4.core.responses.order.OrderImportOrderResponse; - -import com.chargebee.v4.core.responses.order.OrderAssignOrderNumberResponse; - -import com.chargebee.v4.core.responses.order.OrderResendResponse; - -import com.chargebee.v4.core.responses.order.OrderReopenResponse; - -import com.chargebee.v4.core.responses.order.OrderOrdersForInvoiceResponse; - -import com.chargebee.v4.core.responses.order.OrderCancelResponse; - -import com.chargebee.v4.core.responses.order.OrderRetrieveResponse; - -import com.chargebee.v4.core.responses.order.OrderUpdateResponse; - -import com.chargebee.v4.core.responses.order.OrderDeleteResponse; - -import com.chargebee.v4.core.responses.order.OrderCreateRefundableCreditNoteResponse; - -public final class OrderService extends BaseService { - - private final ServiceConfig config; - - public OrderService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private OrderService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private OrderService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - OrderService with(RequestOptions newOptions) { - return new OrderService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public OrderService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** list a order using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(OrderListParams params) throws Exception { - - return get("/orders", params != null ? params.toQueryParams() : null); - } - - /** list a order without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/orders", null); - } - - /** list a order using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public OrderListResponse list(OrderListParams params) throws Exception { - Response response = listRaw(params); - - return OrderListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public OrderListResponse list() throws Exception { - Response response = listRaw(); - return OrderListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** create a order using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(OrderCreateParams params) throws Exception { - - return post("/orders", params != null ? params.toFormData() : null); - } - - /** create a order using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { - - return postJson("/orders", jsonPayload); - } - - public OrderCreateResponse create(OrderCreateParams params) throws Exception { - Response response = createRaw(params); - - return OrderCreateResponse.fromJson(response.getBodyAsString(), response); - } - - /** importOrder a order using immutable params (executes immediately) - returns raw Response. */ - Response importOrderRaw(OrderImportOrderParams params) throws Exception { - - return post("/orders/import_order", params != null ? params.toFormData() : null); - } - - /** importOrder a order using raw JSON payload (executes immediately) - returns raw Response. */ - Response importOrderRaw(String jsonPayload) throws Exception { - - return postJson("/orders/import_order", jsonPayload); - } - - public OrderImportOrderResponse importOrder(OrderImportOrderParams params) throws Exception { - Response response = importOrderRaw(params); - - return OrderImportOrderResponse.fromJson(response.getBodyAsString(), response); - } - - /** assignOrderNumber a order (executes immediately) - returns raw Response. */ - Response assignOrderNumberRaw(String orderId) throws Exception { - String path = - buildPathWithParams("/orders/{order-id}/assign_order_number", "order-id", orderId); - - return post(path, null); - } - - public OrderAssignOrderNumberResponse assignOrderNumber(String orderId) throws Exception { - Response response = assignOrderNumberRaw(orderId); - return OrderAssignOrderNumberResponse.fromJson(response.getBodyAsString(), response); - } - - /** resend a order (executes immediately) - returns raw Response. */ - Response resendRaw(String orderId) throws Exception { - String path = buildPathWithParams("/orders/{order-id}/resend", "order-id", orderId); - - return post(path, null); - } - - /** resend a order using immutable params (executes immediately) - returns raw Response. */ - Response resendRaw(String orderId, OrderResendParams params) throws Exception { - String path = buildPathWithParams("/orders/{order-id}/resend", "order-id", orderId); - return post(path, params.toFormData()); - } - - /** resend a order using raw JSON payload (executes immediately) - returns raw Response. */ - Response resendRaw(String orderId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/orders/{order-id}/resend", "order-id", orderId); - return postJson(path, jsonPayload); - } - - public OrderResendResponse resend(String orderId, OrderResendParams params) throws Exception { - Response response = resendRaw(orderId, params); - return OrderResendResponse.fromJson(response.getBodyAsString(), response); - } - - /** reopen a order (executes immediately) - returns raw Response. */ - Response reopenRaw(String orderId) throws Exception { - String path = buildPathWithParams("/orders/{order-id}/reopen", "order-id", orderId); - - return post(path, null); - } - - /** reopen a order using immutable params (executes immediately) - returns raw Response. */ - Response reopenRaw(String orderId, OrderReopenParams params) throws Exception { - String path = buildPathWithParams("/orders/{order-id}/reopen", "order-id", orderId); - return post(path, params.toFormData()); - } - - /** reopen a order using raw JSON payload (executes immediately) - returns raw Response. */ - Response reopenRaw(String orderId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/orders/{order-id}/reopen", "order-id", orderId); - return postJson(path, jsonPayload); - } - - public OrderReopenResponse reopen(String orderId, OrderReopenParams params) throws Exception { - Response response = reopenRaw(orderId, params); - return OrderReopenResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * ordersForInvoice a order using immutable params (executes immediately) - returns raw Response. - */ - Response ordersForInvoiceRaw(String invoiceId, OrderOrdersForInvoiceParams params) - throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/orders", "invoice-id", invoiceId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** ordersForInvoice a order without params (executes immediately) - returns raw Response. */ - Response ordersForInvoiceRaw(String invoiceId) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/orders", "invoice-id", invoiceId); - return get(path, null); - } - - /** - * ordersForInvoice a order using raw JSON payload (executes immediately) - returns raw Response. - */ - Response ordersForInvoiceRaw(String invoiceId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/orders", "invoice-id", invoiceId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public OrderOrdersForInvoiceResponse ordersForInvoice( - String invoiceId, OrderOrdersForInvoiceParams params) throws Exception { - Response response = ordersForInvoiceRaw(invoiceId, params); - return OrderOrdersForInvoiceResponse.fromJson( - response.getBodyAsString(), this, params, invoiceId, response); - } - - public OrderOrdersForInvoiceResponse ordersForInvoice(String invoiceId) throws Exception { - Response response = ordersForInvoiceRaw(invoiceId); - return OrderOrdersForInvoiceResponse.fromJson( - response.getBodyAsString(), this, null, invoiceId, response); - } - - /** cancel a order (executes immediately) - returns raw Response. */ - Response cancelRaw(String orderId) throws Exception { - String path = buildPathWithParams("/orders/{order-id}/cancel", "order-id", orderId); - - return post(path, null); - } - - /** cancel a order using immutable params (executes immediately) - returns raw Response. */ - Response cancelRaw(String orderId, OrderCancelParams params) throws Exception { - String path = buildPathWithParams("/orders/{order-id}/cancel", "order-id", orderId); - return post(path, params.toFormData()); - } - - /** cancel a order using raw JSON payload (executes immediately) - returns raw Response. */ - Response cancelRaw(String orderId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/orders/{order-id}/cancel", "order-id", orderId); - return postJson(path, jsonPayload); - } - - public OrderCancelResponse cancel(String orderId, OrderCancelParams params) throws Exception { - Response response = cancelRaw(orderId, params); - return OrderCancelResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a order (executes immediately) - returns raw Response. */ - Response retrieveRaw(String orderId) throws Exception { - String path = buildPathWithParams("/orders/{order-id}", "order-id", orderId); - - return get(path, null); - } - - public OrderRetrieveResponse retrieve(String orderId) throws Exception { - Response response = retrieveRaw(orderId); - return OrderRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** update a order (executes immediately) - returns raw Response. */ - Response updateRaw(String orderId) throws Exception { - String path = buildPathWithParams("/orders/{order-id}", "order-id", orderId); - - return post(path, null); - } - - /** update a order using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String orderId, OrderUpdateParams params) throws Exception { - String path = buildPathWithParams("/orders/{order-id}", "order-id", orderId); - return post(path, params.toFormData()); - } - - /** update a order using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String orderId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/orders/{order-id}", "order-id", orderId); - return postJson(path, jsonPayload); - } - - public OrderUpdateResponse update(String orderId, OrderUpdateParams params) throws Exception { - Response response = updateRaw(orderId, params); - return OrderUpdateResponse.fromJson(response.getBodyAsString(), response); - } - - /** delete a order (executes immediately) - returns raw Response. */ - Response deleteRaw(String orderId) throws Exception { - String path = buildPathWithParams("/orders/{order-id}/delete", "order-id", orderId); - - return post(path, null); - } - - public OrderDeleteResponse delete(String orderId) throws Exception { - Response response = deleteRaw(orderId); - return OrderDeleteResponse.fromJson(response.getBodyAsString(), response); - } - - /** createRefundableCreditNote a order (executes immediately) - returns raw Response. */ - Response createRefundableCreditNoteRaw(String orderId) throws Exception { - String path = - buildPathWithParams( - "/orders/{order-id}/create_refundable_credit_note", "order-id", orderId); - - return post(path, null); - } - - /** - * createRefundableCreditNote a order using immutable params (executes immediately) - returns raw - * Response. - */ - Response createRefundableCreditNoteRaw( - String orderId, OrderCreateRefundableCreditNoteParams params) throws Exception { - String path = - buildPathWithParams( - "/orders/{order-id}/create_refundable_credit_note", "order-id", orderId); - return post(path, params.toFormData()); - } - - /** - * createRefundableCreditNote a order using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response createRefundableCreditNoteRaw(String orderId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/orders/{order-id}/create_refundable_credit_note", "order-id", orderId); - return postJson(path, jsonPayload); - } - - public OrderCreateRefundableCreditNoteResponse createRefundableCreditNote( - String orderId, OrderCreateRefundableCreditNoteParams params) throws Exception { - Response response = createRefundableCreditNoteRaw(orderId, params); - return OrderCreateRefundableCreditNoteResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/PaymentSourceService.java b/src/main/java/com/chargebee/v4/core/services/PaymentSourceService.java deleted file mode 100644 index e1f4b1fa..00000000 --- a/src/main/java/com/chargebee/v4/core/services/PaymentSourceService.java +++ /dev/null @@ -1,613 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.paymentSource.params.PaymentSourceCreateUsingPermanentTokenParams; - -import com.chargebee.v4.core.models.paymentSource.params.PaymentSourceCreateCardParams; - -import com.chargebee.v4.core.models.paymentSource.params.PaymentSourceVerifyBankAccountParams; - -import com.chargebee.v4.core.models.paymentSource.params.PaymentSourceListParams; - -import com.chargebee.v4.core.models.paymentSource.params.PaymentSourceExportPaymentSourceParams; - -import com.chargebee.v4.core.models.paymentSource.params.PaymentSourceCreateUsingPaymentIntentParams; - -import com.chargebee.v4.core.models.paymentSource.params.PaymentSourceCreateVoucherPaymentSourceParams; - -import com.chargebee.v4.core.models.paymentSource.params.PaymentSourceCreateUsingTempTokenParams; - -import com.chargebee.v4.core.models.paymentSource.params.PaymentSourceUpdateCardParams; - -import com.chargebee.v4.core.models.paymentSource.params.PaymentSourceSwitchGatewayAccountParams; - -import com.chargebee.v4.core.models.paymentSource.params.PaymentSourceCreateUsingTokenParams; - -import com.chargebee.v4.core.models.paymentSource.params.PaymentSourceCreateBankAccountParams; - -import com.chargebee.v4.core.models.paymentSource.params.PaymentSourceUpdateBankAccountParams; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceCreateUsingPermanentTokenResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceDeleteResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceCreateCardResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceVerifyBankAccountResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceListResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceExportPaymentSourceResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceCreateUsingPaymentIntentResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceAgreementPdfResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceRetrieveResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceCreateVoucherPaymentSourceResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceCreateUsingTempTokenResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceUpdateCardResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceSwitchGatewayAccountResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceCreateUsingTokenResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceDeleteLocalResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceCreateBankAccountResponse; - -import com.chargebee.v4.core.responses.paymentSource.PaymentSourceUpdateBankAccountResponse; - -public final class PaymentSourceService extends BaseService { - - private final ServiceConfig config; - - public PaymentSourceService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private PaymentSourceService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private PaymentSourceService( - ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - PaymentSourceService with(RequestOptions newOptions) { - return new PaymentSourceService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public PaymentSourceService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** - * createUsingPermanentToken a paymentSource using immutable params (executes immediately) - - * returns raw Response. - */ - Response createUsingPermanentTokenRaw(PaymentSourceCreateUsingPermanentTokenParams params) - throws Exception { - - return post( - "/payment_sources/create_using_permanent_token", - params != null ? params.toFormData() : null); - } - - /** - * createUsingPermanentToken a paymentSource using raw JSON payload (executes immediately) - - * returns raw Response. - */ - Response createUsingPermanentTokenRaw(String jsonPayload) throws Exception { - - return postJson("/payment_sources/create_using_permanent_token", jsonPayload); - } - - public PaymentSourceCreateUsingPermanentTokenResponse createUsingPermanentToken( - PaymentSourceCreateUsingPermanentTokenParams params) throws Exception { - Response response = createUsingPermanentTokenRaw(params); - - return PaymentSourceCreateUsingPermanentTokenResponse.fromJson( - response.getBodyAsString(), response); - } - - /** delete a paymentSource (executes immediately) - returns raw Response. */ - Response deleteRaw(String custPaymentSourceId) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/delete", - "cust-payment-source-id", - custPaymentSourceId); - - return post(path, null); - } - - public PaymentSourceDeleteResponse delete(String custPaymentSourceId) throws Exception { - Response response = deleteRaw(custPaymentSourceId); - return PaymentSourceDeleteResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createCard a paymentSource using immutable params (executes immediately) - returns raw - * Response. - */ - Response createCardRaw(PaymentSourceCreateCardParams params) throws Exception { - - return post("/payment_sources/create_card", params != null ? params.toFormData() : null); - } - - /** - * createCard a paymentSource using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response createCardRaw(String jsonPayload) throws Exception { - - return postJson("/payment_sources/create_card", jsonPayload); - } - - public PaymentSourceCreateCardResponse createCard(PaymentSourceCreateCardParams params) - throws Exception { - Response response = createCardRaw(params); - - return PaymentSourceCreateCardResponse.fromJson(response.getBodyAsString(), response); - } - - /** verifyBankAccount a paymentSource (executes immediately) - returns raw Response. */ - Response verifyBankAccountRaw(String custPaymentSourceId) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/verify_bank_account", - "cust-payment-source-id", - custPaymentSourceId); - - return post(path, null); - } - - /** - * verifyBankAccount a paymentSource using immutable params (executes immediately) - returns raw - * Response. - */ - Response verifyBankAccountRaw( - String custPaymentSourceId, PaymentSourceVerifyBankAccountParams params) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/verify_bank_account", - "cust-payment-source-id", - custPaymentSourceId); - return post(path, params.toFormData()); - } - - /** - * verifyBankAccount a paymentSource using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response verifyBankAccountRaw(String custPaymentSourceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/verify_bank_account", - "cust-payment-source-id", - custPaymentSourceId); - return postJson(path, jsonPayload); - } - - public PaymentSourceVerifyBankAccountResponse verifyBankAccount( - String custPaymentSourceId, PaymentSourceVerifyBankAccountParams params) throws Exception { - Response response = verifyBankAccountRaw(custPaymentSourceId, params); - return PaymentSourceVerifyBankAccountResponse.fromJson(response.getBodyAsString(), response); - } - - /** list a paymentSource using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(PaymentSourceListParams params) throws Exception { - - return get("/payment_sources", params != null ? params.toQueryParams() : null); - } - - /** list a paymentSource without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/payment_sources", null); - } - - /** list a paymentSource using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public PaymentSourceListResponse list(PaymentSourceListParams params) throws Exception { - Response response = listRaw(params); - - return PaymentSourceListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public PaymentSourceListResponse list() throws Exception { - Response response = listRaw(); - return PaymentSourceListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** exportPaymentSource a paymentSource (executes immediately) - returns raw Response. */ - Response exportPaymentSourceRaw(String custPaymentSourceId) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/export_payment_source", - "cust-payment-source-id", - custPaymentSourceId); - - return post(path, null); - } - - /** - * exportPaymentSource a paymentSource using immutable params (executes immediately) - returns raw - * Response. - */ - Response exportPaymentSourceRaw( - String custPaymentSourceId, PaymentSourceExportPaymentSourceParams params) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/export_payment_source", - "cust-payment-source-id", - custPaymentSourceId); - return post(path, params.toFormData()); - } - - /** - * exportPaymentSource a paymentSource using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response exportPaymentSourceRaw(String custPaymentSourceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/export_payment_source", - "cust-payment-source-id", - custPaymentSourceId); - return postJson(path, jsonPayload); - } - - public PaymentSourceExportPaymentSourceResponse exportPaymentSource( - String custPaymentSourceId, PaymentSourceExportPaymentSourceParams params) throws Exception { - Response response = exportPaymentSourceRaw(custPaymentSourceId, params); - return PaymentSourceExportPaymentSourceResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createUsingPaymentIntent a paymentSource using immutable params (executes immediately) - - * returns raw Response. - */ - Response createUsingPaymentIntentRaw(PaymentSourceCreateUsingPaymentIntentParams params) - throws Exception { - - return post( - "/payment_sources/create_using_payment_intent", - params != null ? params.toFormData() : null); - } - - /** - * createUsingPaymentIntent a paymentSource using raw JSON payload (executes immediately) - - * returns raw Response. - */ - Response createUsingPaymentIntentRaw(String jsonPayload) throws Exception { - - return postJson("/payment_sources/create_using_payment_intent", jsonPayload); - } - - public PaymentSourceCreateUsingPaymentIntentResponse createUsingPaymentIntent( - PaymentSourceCreateUsingPaymentIntentParams params) throws Exception { - Response response = createUsingPaymentIntentRaw(params); - - return PaymentSourceCreateUsingPaymentIntentResponse.fromJson( - response.getBodyAsString(), response); - } - - /** agreementPdf a paymentSource (executes immediately) - returns raw Response. */ - Response agreementPdfRaw(String custPaymentSourceId) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/agreement_pdf", - "cust-payment-source-id", - custPaymentSourceId); - - return post(path, null); - } - - public PaymentSourceAgreementPdfResponse agreementPdf(String custPaymentSourceId) - throws Exception { - Response response = agreementPdfRaw(custPaymentSourceId); - return PaymentSourceAgreementPdfResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a paymentSource (executes immediately) - returns raw Response. */ - Response retrieveRaw(String custPaymentSourceId) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}", - "cust-payment-source-id", - custPaymentSourceId); - - return get(path, null); - } - - public PaymentSourceRetrieveResponse retrieve(String custPaymentSourceId) throws Exception { - Response response = retrieveRaw(custPaymentSourceId); - return PaymentSourceRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createVoucherPaymentSource a paymentSource using immutable params (executes immediately) - - * returns raw Response. - */ - Response createVoucherPaymentSourceRaw(PaymentSourceCreateVoucherPaymentSourceParams params) - throws Exception { - - return post( - "/payment_sources/create_voucher_payment_source", - params != null ? params.toFormData() : null); - } - - /** - * createVoucherPaymentSource a paymentSource using raw JSON payload (executes immediately) - - * returns raw Response. - */ - Response createVoucherPaymentSourceRaw(String jsonPayload) throws Exception { - - return postJson("/payment_sources/create_voucher_payment_source", jsonPayload); - } - - public PaymentSourceCreateVoucherPaymentSourceResponse createVoucherPaymentSource( - PaymentSourceCreateVoucherPaymentSourceParams params) throws Exception { - Response response = createVoucherPaymentSourceRaw(params); - - return PaymentSourceCreateVoucherPaymentSourceResponse.fromJson( - response.getBodyAsString(), response); - } - - /** - * createUsingTempToken a paymentSource using immutable params (executes immediately) - returns - * raw Response. - */ - Response createUsingTempTokenRaw(PaymentSourceCreateUsingTempTokenParams params) - throws Exception { - - return post( - "/payment_sources/create_using_temp_token", params != null ? params.toFormData() : null); - } - - /** - * createUsingTempToken a paymentSource using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response createUsingTempTokenRaw(String jsonPayload) throws Exception { - - return postJson("/payment_sources/create_using_temp_token", jsonPayload); - } - - public PaymentSourceCreateUsingTempTokenResponse createUsingTempToken( - PaymentSourceCreateUsingTempTokenParams params) throws Exception { - Response response = createUsingTempTokenRaw(params); - - return PaymentSourceCreateUsingTempTokenResponse.fromJson(response.getBodyAsString(), response); - } - - /** updateCard a paymentSource (executes immediately) - returns raw Response. */ - Response updateCardRaw(String custPaymentSourceId) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/update_card", - "cust-payment-source-id", - custPaymentSourceId); - - return post(path, null); - } - - /** - * updateCard a paymentSource using immutable params (executes immediately) - returns raw - * Response. - */ - Response updateCardRaw(String custPaymentSourceId, PaymentSourceUpdateCardParams params) - throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/update_card", - "cust-payment-source-id", - custPaymentSourceId); - return post(path, params.toFormData()); - } - - /** - * updateCard a paymentSource using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response updateCardRaw(String custPaymentSourceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/update_card", - "cust-payment-source-id", - custPaymentSourceId); - return postJson(path, jsonPayload); - } - - public PaymentSourceUpdateCardResponse updateCard( - String custPaymentSourceId, PaymentSourceUpdateCardParams params) throws Exception { - Response response = updateCardRaw(custPaymentSourceId, params); - return PaymentSourceUpdateCardResponse.fromJson(response.getBodyAsString(), response); - } - - /** switchGatewayAccount a paymentSource (executes immediately) - returns raw Response. */ - Response switchGatewayAccountRaw(String custPaymentSourceId) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/switch_gateway_account", - "cust-payment-source-id", - custPaymentSourceId); - - return post(path, null); - } - - /** - * switchGatewayAccount a paymentSource using immutable params (executes immediately) - returns - * raw Response. - */ - Response switchGatewayAccountRaw( - String custPaymentSourceId, PaymentSourceSwitchGatewayAccountParams params) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/switch_gateway_account", - "cust-payment-source-id", - custPaymentSourceId); - return post(path, params.toFormData()); - } - - /** - * switchGatewayAccount a paymentSource using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response switchGatewayAccountRaw(String custPaymentSourceId, String jsonPayload) - throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/switch_gateway_account", - "cust-payment-source-id", - custPaymentSourceId); - return postJson(path, jsonPayload); - } - - public PaymentSourceSwitchGatewayAccountResponse switchGatewayAccount( - String custPaymentSourceId, PaymentSourceSwitchGatewayAccountParams params) throws Exception { - Response response = switchGatewayAccountRaw(custPaymentSourceId, params); - return PaymentSourceSwitchGatewayAccountResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createUsingToken a paymentSource using immutable params (executes immediately) - returns raw - * Response. - */ - Response createUsingTokenRaw(PaymentSourceCreateUsingTokenParams params) throws Exception { - - return post("/payment_sources/create_using_token", params != null ? params.toFormData() : null); - } - - /** - * createUsingToken a paymentSource using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response createUsingTokenRaw(String jsonPayload) throws Exception { - - return postJson("/payment_sources/create_using_token", jsonPayload); - } - - public PaymentSourceCreateUsingTokenResponse createUsingToken( - PaymentSourceCreateUsingTokenParams params) throws Exception { - Response response = createUsingTokenRaw(params); - - return PaymentSourceCreateUsingTokenResponse.fromJson(response.getBodyAsString(), response); - } - - /** deleteLocal a paymentSource (executes immediately) - returns raw Response. */ - Response deleteLocalRaw(String custPaymentSourceId) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/delete_local", - "cust-payment-source-id", - custPaymentSourceId); - - return post(path, null); - } - - public PaymentSourceDeleteLocalResponse deleteLocal(String custPaymentSourceId) throws Exception { - Response response = deleteLocalRaw(custPaymentSourceId); - return PaymentSourceDeleteLocalResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createBankAccount a paymentSource using immutable params (executes immediately) - returns raw - * Response. - */ - Response createBankAccountRaw(PaymentSourceCreateBankAccountParams params) throws Exception { - - return post( - "/payment_sources/create_bank_account", params != null ? params.toFormData() : null); - } - - /** - * createBankAccount a paymentSource using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response createBankAccountRaw(String jsonPayload) throws Exception { - - return postJson("/payment_sources/create_bank_account", jsonPayload); - } - - public PaymentSourceCreateBankAccountResponse createBankAccount( - PaymentSourceCreateBankAccountParams params) throws Exception { - Response response = createBankAccountRaw(params); - - return PaymentSourceCreateBankAccountResponse.fromJson(response.getBodyAsString(), response); - } - - /** updateBankAccount a paymentSource (executes immediately) - returns raw Response. */ - Response updateBankAccountRaw(String custPaymentSourceId) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/update_bank_account", - "cust-payment-source-id", - custPaymentSourceId); - - return post(path, null); - } - - /** - * updateBankAccount a paymentSource using immutable params (executes immediately) - returns raw - * Response. - */ - Response updateBankAccountRaw( - String custPaymentSourceId, PaymentSourceUpdateBankAccountParams params) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/update_bank_account", - "cust-payment-source-id", - custPaymentSourceId); - return post(path, params.toFormData()); - } - - /** - * updateBankAccount a paymentSource using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response updateBankAccountRaw(String custPaymentSourceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/payment_sources/{cust-payment-source-id}/update_bank_account", - "cust-payment-source-id", - custPaymentSourceId); - return postJson(path, jsonPayload); - } - - public PaymentSourceUpdateBankAccountResponse updateBankAccount( - String custPaymentSourceId, PaymentSourceUpdateBankAccountParams params) throws Exception { - Response response = updateBankAccountRaw(custPaymentSourceId, params); - return PaymentSourceUpdateBankAccountResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/PaymentVoucherService.java b/src/main/java/com/chargebee/v4/core/services/PaymentVoucherService.java deleted file mode 100644 index fcfcebc7..00000000 --- a/src/main/java/com/chargebee/v4/core/services/PaymentVoucherService.java +++ /dev/null @@ -1,188 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.paymentVoucher.params.PaymentVoucherPaymentVouchersForCustomerParams; - -import com.chargebee.v4.core.models.paymentVoucher.params.PaymentVoucherPaymentVouchersForInvoiceParams; - -import com.chargebee.v4.core.models.paymentVoucher.params.PaymentVoucherCreateParams; - -import com.chargebee.v4.core.responses.paymentVoucher.PaymentVoucherPaymentVouchersForCustomerResponse; - -import com.chargebee.v4.core.responses.paymentVoucher.PaymentVoucherPaymentVouchersForInvoiceResponse; - -import com.chargebee.v4.core.responses.paymentVoucher.PaymentVoucherRetrieveResponse; - -import com.chargebee.v4.core.responses.paymentVoucher.PaymentVoucherCreateResponse; - -public final class PaymentVoucherService extends BaseService { - - private final ServiceConfig config; - - public PaymentVoucherService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private PaymentVoucherService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private PaymentVoucherService( - ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - PaymentVoucherService with(RequestOptions newOptions) { - return new PaymentVoucherService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public PaymentVoucherService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** - * paymentVouchersForCustomer a paymentVoucher using immutable params (executes immediately) - - * returns raw Response. - */ - Response paymentVouchersForCustomerRaw( - String customerId, PaymentVoucherPaymentVouchersForCustomerParams params) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/payment_vouchers", "customer-id", customerId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * paymentVouchersForCustomer a paymentVoucher without params (executes immediately) - returns raw - * Response. - */ - Response paymentVouchersForCustomerRaw(String customerId) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/payment_vouchers", "customer-id", customerId); - return get(path, null); - } - - /** - * paymentVouchersForCustomer a paymentVoucher using raw JSON payload (executes immediately) - - * returns raw Response. - */ - Response paymentVouchersForCustomerRaw(String customerId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/payment_vouchers", "customer-id", customerId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public PaymentVoucherPaymentVouchersForCustomerResponse paymentVouchersForCustomer( - String customerId, PaymentVoucherPaymentVouchersForCustomerParams params) throws Exception { - Response response = paymentVouchersForCustomerRaw(customerId, params); - return PaymentVoucherPaymentVouchersForCustomerResponse.fromJson( - response.getBodyAsString(), this, params, customerId, response); - } - - public PaymentVoucherPaymentVouchersForCustomerResponse paymentVouchersForCustomer( - String customerId) throws Exception { - Response response = paymentVouchersForCustomerRaw(customerId); - return PaymentVoucherPaymentVouchersForCustomerResponse.fromJson( - response.getBodyAsString(), this, null, customerId, response); - } - - /** - * paymentVouchersForInvoice a paymentVoucher using immutable params (executes immediately) - - * returns raw Response. - */ - Response paymentVouchersForInvoiceRaw( - String invoiceId, PaymentVoucherPaymentVouchersForInvoiceParams params) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/payment_vouchers", "invoice-id", invoiceId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * paymentVouchersForInvoice a paymentVoucher without params (executes immediately) - returns raw - * Response. - */ - Response paymentVouchersForInvoiceRaw(String invoiceId) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/payment_vouchers", "invoice-id", invoiceId); - return get(path, null); - } - - /** - * paymentVouchersForInvoice a paymentVoucher using raw JSON payload (executes immediately) - - * returns raw Response. - */ - Response paymentVouchersForInvoiceRaw(String invoiceId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/invoices/{invoice-id}/payment_vouchers", "invoice-id", invoiceId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public PaymentVoucherPaymentVouchersForInvoiceResponse paymentVouchersForInvoice( - String invoiceId, PaymentVoucherPaymentVouchersForInvoiceParams params) throws Exception { - Response response = paymentVouchersForInvoiceRaw(invoiceId, params); - return PaymentVoucherPaymentVouchersForInvoiceResponse.fromJson( - response.getBodyAsString(), this, params, invoiceId, response); - } - - public PaymentVoucherPaymentVouchersForInvoiceResponse paymentVouchersForInvoice(String invoiceId) - throws Exception { - Response response = paymentVouchersForInvoiceRaw(invoiceId); - return PaymentVoucherPaymentVouchersForInvoiceResponse.fromJson( - response.getBodyAsString(), this, null, invoiceId, response); - } - - /** retrieve a paymentVoucher (executes immediately) - returns raw Response. */ - Response retrieveRaw(String paymentVoucherId) throws Exception { - String path = - buildPathWithParams( - "/payment_vouchers/{payment-voucher-id}", "payment-voucher-id", paymentVoucherId); - - return get(path, null); - } - - public PaymentVoucherRetrieveResponse retrieve(String paymentVoucherId) throws Exception { - Response response = retrieveRaw(paymentVoucherId); - return PaymentVoucherRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * create a paymentVoucher using immutable params (executes immediately) - returns raw Response. - */ - Response createRaw(PaymentVoucherCreateParams params) throws Exception { - - return post("/payment_vouchers", params != null ? params.toFormData() : null); - } - - /** - * create a paymentVoucher using raw JSON payload (executes immediately) - returns raw Response. - */ - Response createRaw(String jsonPayload) throws Exception { - - return postJson("/payment_vouchers", jsonPayload); - } - - public PaymentVoucherCreateResponse create(PaymentVoucherCreateParams params) throws Exception { - Response response = createRaw(params); - - return PaymentVoucherCreateResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/PersonalizedOfferService.java b/src/main/java/com/chargebee/v4/core/services/PersonalizedOfferService.java deleted file mode 100644 index 99095bf5..00000000 --- a/src/main/java/com/chargebee/v4/core/services/PersonalizedOfferService.java +++ /dev/null @@ -1,79 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.personalizedOffer.params.PersonalizedOfferPersonalizedOffersParams; - -import com.chargebee.v4.core.responses.personalizedOffer.PersonalizedOfferPersonalizedOffersResponse; - -public final class PersonalizedOfferService extends BaseService { - - private final ServiceConfig config; - - public PersonalizedOfferService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private PersonalizedOfferService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private PersonalizedOfferService( - ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - PersonalizedOfferService with(RequestOptions newOptions) { - return new PersonalizedOfferService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public PersonalizedOfferService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** - * personalizedOffers a personalizedOffer using immutable params (executes immediately) - returns - * raw Response. - */ - Response personalizedOffersRaw(PersonalizedOfferPersonalizedOffersParams params) - throws Exception { - - return post("/personalized_offers", params != null ? params.toFormData() : null); - } - - /** - * personalizedOffers a personalizedOffer using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response personalizedOffersRaw(String jsonPayload) throws Exception { - - return postJson("/personalized_offers", jsonPayload); - } - - public PersonalizedOfferPersonalizedOffersResponse personalizedOffers( - PersonalizedOfferPersonalizedOffersParams params) throws Exception { - Response response = personalizedOffersRaw(params); - - return PersonalizedOfferPersonalizedOffersResponse.fromJson( - response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/PlanService.java b/src/main/java/com/chargebee/v4/core/services/PlanService.java deleted file mode 100644 index 44f288b9..00000000 --- a/src/main/java/com/chargebee/v4/core/services/PlanService.java +++ /dev/null @@ -1,194 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.plan.params.PlanCopyParams; - -import com.chargebee.v4.core.models.plan.params.PlanListParams; - -import com.chargebee.v4.core.models.plan.params.PlanCreateParams; - -import com.chargebee.v4.core.models.plan.params.PlanUpdateParams; - -import com.chargebee.v4.core.responses.plan.PlanUnarchiveResponse; - -import com.chargebee.v4.core.responses.plan.PlanDeleteResponse; - -import com.chargebee.v4.core.responses.plan.PlanCopyResponse; - -import com.chargebee.v4.core.responses.plan.PlanListResponse; - -import com.chargebee.v4.core.responses.plan.PlanCreateResponse; - -import com.chargebee.v4.core.responses.plan.PlanRetrieveResponse; - -import com.chargebee.v4.core.responses.plan.PlanUpdateResponse; - -public final class PlanService extends BaseService { - - private final ServiceConfig config; - - public PlanService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private PlanService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private PlanService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - PlanService with(RequestOptions newOptions) { - return new PlanService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public PlanService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** unarchive a plan (executes immediately) - returns raw Response. */ - Response unarchiveRaw(String planId) throws Exception { - String path = buildPathWithParams("/plans/{plan-id}/unarchive", "plan-id", planId); - - return post(path, null); - } - - public PlanUnarchiveResponse unarchive(String planId) throws Exception { - Response response = unarchiveRaw(planId); - return PlanUnarchiveResponse.fromJson(response.getBodyAsString(), response); - } - - /** delete a plan (executes immediately) - returns raw Response. */ - Response deleteRaw(String planId) throws Exception { - String path = buildPathWithParams("/plans/{plan-id}/delete", "plan-id", planId); - - return post(path, null); - } - - public PlanDeleteResponse delete(String planId) throws Exception { - Response response = deleteRaw(planId); - return PlanDeleteResponse.fromJson(response.getBodyAsString(), response); - } - - /** copy a plan using immutable params (executes immediately) - returns raw Response. */ - Response copyRaw(PlanCopyParams params) throws Exception { - - return post("/plans/copy", params != null ? params.toFormData() : null); - } - - /** copy a plan using raw JSON payload (executes immediately) - returns raw Response. */ - Response copyRaw(String jsonPayload) throws Exception { - - return postJson("/plans/copy", jsonPayload); - } - - public PlanCopyResponse copy(PlanCopyParams params) throws Exception { - Response response = copyRaw(params); - - return PlanCopyResponse.fromJson(response.getBodyAsString(), response); - } - - /** list a plan using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(PlanListParams params) throws Exception { - - return get("/plans", params != null ? params.toQueryParams() : null); - } - - /** list a plan without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/plans", null); - } - - /** list a plan using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public PlanListResponse list(PlanListParams params) throws Exception { - Response response = listRaw(params); - - return PlanListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public PlanListResponse list() throws Exception { - Response response = listRaw(); - return PlanListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** create a plan using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(PlanCreateParams params) throws Exception { - - return post("/plans", params != null ? params.toFormData() : null); - } - - /** create a plan using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { - - return postJson("/plans", jsonPayload); - } - - public PlanCreateResponse create(PlanCreateParams params) throws Exception { - Response response = createRaw(params); - - return PlanCreateResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a plan (executes immediately) - returns raw Response. */ - Response retrieveRaw(String planId) throws Exception { - String path = buildPathWithParams("/plans/{plan-id}", "plan-id", planId); - - return get(path, null); - } - - public PlanRetrieveResponse retrieve(String planId) throws Exception { - Response response = retrieveRaw(planId); - return PlanRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** update a plan (executes immediately) - returns raw Response. */ - Response updateRaw(String planId) throws Exception { - String path = buildPathWithParams("/plans/{plan-id}", "plan-id", planId); - - return post(path, null); - } - - /** update a plan using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String planId, PlanUpdateParams params) throws Exception { - String path = buildPathWithParams("/plans/{plan-id}", "plan-id", planId); - return post(path, params.toFormData()); - } - - /** update a plan using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String planId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/plans/{plan-id}", "plan-id", planId); - return postJson(path, jsonPayload); - } - - public PlanUpdateResponse update(String planId, PlanUpdateParams params) throws Exception { - Response response = updateRaw(planId, params); - return PlanUpdateResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/PromotionalCreditService.java b/src/main/java/com/chargebee/v4/core/services/PromotionalCreditService.java deleted file mode 100644 index 4f8711fc..00000000 --- a/src/main/java/com/chargebee/v4/core/services/PromotionalCreditService.java +++ /dev/null @@ -1,183 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.promotionalCredit.params.PromotionalCreditListParams; - -import com.chargebee.v4.core.models.promotionalCredit.params.PromotionalCreditDeductParams; - -import com.chargebee.v4.core.models.promotionalCredit.params.PromotionalCreditSetParams; - -import com.chargebee.v4.core.models.promotionalCredit.params.PromotionalCreditAddParams; - -import com.chargebee.v4.core.responses.promotionalCredit.PromotionalCreditRetrieveResponse; - -import com.chargebee.v4.core.responses.promotionalCredit.PromotionalCreditListResponse; - -import com.chargebee.v4.core.responses.promotionalCredit.PromotionalCreditDeductResponse; - -import com.chargebee.v4.core.responses.promotionalCredit.PromotionalCreditSetResponse; - -import com.chargebee.v4.core.responses.promotionalCredit.PromotionalCreditAddResponse; - -public final class PromotionalCreditService extends BaseService { - - private final ServiceConfig config; - - public PromotionalCreditService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private PromotionalCreditService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private PromotionalCreditService( - ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - PromotionalCreditService with(RequestOptions newOptions) { - return new PromotionalCreditService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public PromotionalCreditService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** retrieve a promotionalCredit (executes immediately) - returns raw Response. */ - Response retrieveRaw(String accountCreditId) throws Exception { - String path = - buildPathWithParams( - "/promotional_credits/{account-credit-id}", "account-credit-id", accountCreditId); - - return get(path, null); - } - - public PromotionalCreditRetrieveResponse retrieve(String accountCreditId) throws Exception { - Response response = retrieveRaw(accountCreditId); - return PromotionalCreditRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * list a promotionalCredit using immutable params (executes immediately) - returns raw Response. - */ - Response listRaw(PromotionalCreditListParams params) throws Exception { - - return get("/promotional_credits", params != null ? params.toQueryParams() : null); - } - - /** list a promotionalCredit without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/promotional_credits", null); - } - - /** - * list a promotionalCredit using raw JSON payload (executes immediately) - returns raw Response. - */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public PromotionalCreditListResponse list(PromotionalCreditListParams params) throws Exception { - Response response = listRaw(params); - - return PromotionalCreditListResponse.fromJson( - response.getBodyAsString(), this, params, response); - } - - public PromotionalCreditListResponse list() throws Exception { - Response response = listRaw(); - return PromotionalCreditListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** - * deduct a promotionalCredit using immutable params (executes immediately) - returns raw - * Response. - */ - Response deductRaw(PromotionalCreditDeductParams params) throws Exception { - - return post("/promotional_credits/deduct", params != null ? params.toFormData() : null); - } - - /** - * deduct a promotionalCredit using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response deductRaw(String jsonPayload) throws Exception { - - return postJson("/promotional_credits/deduct", jsonPayload); - } - - public PromotionalCreditDeductResponse deduct(PromotionalCreditDeductParams params) - throws Exception { - Response response = deductRaw(params); - - return PromotionalCreditDeductResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * set a promotionalCredit using immutable params (executes immediately) - returns raw Response. - */ - Response setRaw(PromotionalCreditSetParams params) throws Exception { - - return post("/promotional_credits/set", params != null ? params.toFormData() : null); - } - - /** - * set a promotionalCredit using raw JSON payload (executes immediately) - returns raw Response. - */ - Response setRaw(String jsonPayload) throws Exception { - - return postJson("/promotional_credits/set", jsonPayload); - } - - public PromotionalCreditSetResponse set(PromotionalCreditSetParams params) throws Exception { - Response response = setRaw(params); - - return PromotionalCreditSetResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * add a promotionalCredit using immutable params (executes immediately) - returns raw Response. - */ - Response addRaw(PromotionalCreditAddParams params) throws Exception { - - return post("/promotional_credits/add", params != null ? params.toFormData() : null); - } - - /** - * add a promotionalCredit using raw JSON payload (executes immediately) - returns raw Response. - */ - Response addRaw(String jsonPayload) throws Exception { - - return postJson("/promotional_credits/add", jsonPayload); - } - - public PromotionalCreditAddResponse add(PromotionalCreditAddParams params) throws Exception { - Response response = addRaw(params); - - return PromotionalCreditAddResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/QuoteService.java b/src/main/java/com/chargebee/v4/core/services/QuoteService.java deleted file mode 100644 index 44e82e1e..00000000 --- a/src/main/java/com/chargebee/v4/core/services/QuoteService.java +++ /dev/null @@ -1,752 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.quote.params.QuoteCreateSubItemsForCustomerQuoteParams; - -import com.chargebee.v4.core.models.quote.params.QuoteEditCreateSubCustomerQuoteForItemsParams; - -import com.chargebee.v4.core.models.quote.params.QuoteUpdateStatusParams; - -import com.chargebee.v4.core.models.quote.params.QuoteUpdateSubscriptionQuoteForItemsParams; - -import com.chargebee.v4.core.models.quote.params.QuoteQuoteLineGroupsForQuoteParams; - -import com.chargebee.v4.core.models.quote.params.QuoteExtendExpiryDateParams; - -import com.chargebee.v4.core.models.quote.params.QuoteEditForChargeItemsAndChargesParams; - -import com.chargebee.v4.core.models.quote.params.QuoteEditUpdateSubscriptionQuoteForItemsParams; - -import com.chargebee.v4.core.models.quote.params.QuoteListParams; - -import com.chargebee.v4.core.models.quote.params.QuotePdfParams; - -import com.chargebee.v4.core.models.quote.params.QuoteConvertParams; - -import com.chargebee.v4.core.models.quote.params.QuoteCreateForChargeItemsAndChargesParams; - -import com.chargebee.v4.core.models.quote.params.QuoteDeleteParams; - -import com.chargebee.v4.core.models.quote.params.QuoteEditOneTimeQuoteParams; - -import com.chargebee.v4.core.models.quote.params.QuoteUpdateSubscriptionQuoteParams; - -import com.chargebee.v4.core.models.quote.params.QuoteCreateForOnetimeChargesParams; - -import com.chargebee.v4.core.models.quote.params.QuoteCreateSubForCustomerQuoteParams; - -import com.chargebee.v4.core.models.quote.params.QuoteEditUpdateSubscriptionQuoteParams; - -import com.chargebee.v4.core.models.quote.params.QuoteEditCreateSubForCustomerQuoteParams; - -import com.chargebee.v4.core.responses.quote.QuoteCreateSubItemsForCustomerQuoteResponse; - -import com.chargebee.v4.core.responses.quote.QuoteRetrieveResponse; - -import com.chargebee.v4.core.responses.quote.QuoteEditCreateSubCustomerQuoteForItemsResponse; - -import com.chargebee.v4.core.responses.quote.QuoteUpdateStatusResponse; - -import com.chargebee.v4.core.responses.quote.QuoteUpdateSubscriptionQuoteForItemsResponse; - -import com.chargebee.v4.core.responses.quote.QuoteQuoteLineGroupsForQuoteResponse; - -import com.chargebee.v4.core.responses.quote.QuoteExtendExpiryDateResponse; - -import com.chargebee.v4.core.responses.quote.QuoteEditForChargeItemsAndChargesResponse; - -import com.chargebee.v4.core.responses.quote.QuoteEditUpdateSubscriptionQuoteForItemsResponse; - -import com.chargebee.v4.core.responses.quote.QuoteListResponse; - -import com.chargebee.v4.core.responses.quote.QuotePdfResponse; - -import com.chargebee.v4.core.responses.quote.QuoteConvertResponse; - -import com.chargebee.v4.core.responses.quote.QuoteCreateForChargeItemsAndChargesResponse; - -import com.chargebee.v4.core.responses.quote.QuoteDeleteResponse; - -import com.chargebee.v4.core.responses.quote.QuoteEditOneTimeQuoteResponse; - -import com.chargebee.v4.core.responses.quote.QuoteUpdateSubscriptionQuoteResponse; - -import com.chargebee.v4.core.responses.quote.QuoteCreateForOnetimeChargesResponse; - -import com.chargebee.v4.core.responses.quote.QuoteCreateSubForCustomerQuoteResponse; - -import com.chargebee.v4.core.responses.quote.QuoteEditUpdateSubscriptionQuoteResponse; - -import com.chargebee.v4.core.responses.quote.QuoteEditCreateSubForCustomerQuoteResponse; - -public final class QuoteService extends BaseService { - - private final ServiceConfig config; - - public QuoteService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private QuoteService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private QuoteService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - QuoteService with(RequestOptions newOptions) { - return new QuoteService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public QuoteService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** createSubItemsForCustomerQuote a quote (executes immediately) - returns raw Response. */ - Response createSubItemsForCustomerQuoteRaw(String customerId) throws Exception { - String path = - buildPathWithParams( - "/customers/{customer-id}/create_subscription_quote_for_items", - "customer-id", - customerId); - - return post(path, null); - } - - /** - * createSubItemsForCustomerQuote a quote using immutable params (executes immediately) - returns - * raw Response. - */ - Response createSubItemsForCustomerQuoteRaw( - String customerId, QuoteCreateSubItemsForCustomerQuoteParams params) throws Exception { - String path = - buildPathWithParams( - "/customers/{customer-id}/create_subscription_quote_for_items", - "customer-id", - customerId); - return post(path, params.toFormData()); - } - - /** - * createSubItemsForCustomerQuote a quote using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response createSubItemsForCustomerQuoteRaw(String customerId, String jsonPayload) - throws Exception { - String path = - buildPathWithParams( - "/customers/{customer-id}/create_subscription_quote_for_items", - "customer-id", - customerId); - return postJson(path, jsonPayload); - } - - public QuoteCreateSubItemsForCustomerQuoteResponse createSubItemsForCustomerQuote( - String customerId, QuoteCreateSubItemsForCustomerQuoteParams params) throws Exception { - Response response = createSubItemsForCustomerQuoteRaw(customerId, params); - return QuoteCreateSubItemsForCustomerQuoteResponse.fromJson( - response.getBodyAsString(), response); - } - - /** retrieve a quote (executes immediately) - returns raw Response. */ - Response retrieveRaw(String quoteId) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}", "quote-id", quoteId); - - return get(path, null); - } - - public QuoteRetrieveResponse retrieve(String quoteId) throws Exception { - Response response = retrieveRaw(quoteId); - return QuoteRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** editCreateSubCustomerQuoteForItems a quote (executes immediately) - returns raw Response. */ - Response editCreateSubCustomerQuoteForItemsRaw(String quoteId) throws Exception { - String path = - buildPathWithParams( - "/quotes/{quote-id}/edit_create_subscription_quote_for_items", "quote-id", quoteId); - - return post(path, null); - } - - /** - * editCreateSubCustomerQuoteForItems a quote using immutable params (executes immediately) - - * returns raw Response. - */ - Response editCreateSubCustomerQuoteForItemsRaw( - String quoteId, QuoteEditCreateSubCustomerQuoteForItemsParams params) throws Exception { - String path = - buildPathWithParams( - "/quotes/{quote-id}/edit_create_subscription_quote_for_items", "quote-id", quoteId); - return post(path, params.toFormData()); - } - - /** - * editCreateSubCustomerQuoteForItems a quote using raw JSON payload (executes immediately) - - * returns raw Response. - */ - Response editCreateSubCustomerQuoteForItemsRaw(String quoteId, String jsonPayload) - throws Exception { - String path = - buildPathWithParams( - "/quotes/{quote-id}/edit_create_subscription_quote_for_items", "quote-id", quoteId); - return postJson(path, jsonPayload); - } - - public QuoteEditCreateSubCustomerQuoteForItemsResponse editCreateSubCustomerQuoteForItems( - String quoteId, QuoteEditCreateSubCustomerQuoteForItemsParams params) throws Exception { - Response response = editCreateSubCustomerQuoteForItemsRaw(quoteId, params); - return QuoteEditCreateSubCustomerQuoteForItemsResponse.fromJson( - response.getBodyAsString(), response); - } - - /** updateStatus a quote (executes immediately) - returns raw Response. */ - Response updateStatusRaw(String quoteId) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/update_status", "quote-id", quoteId); - - return post(path, null); - } - - /** updateStatus a quote using immutable params (executes immediately) - returns raw Response. */ - Response updateStatusRaw(String quoteId, QuoteUpdateStatusParams params) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/update_status", "quote-id", quoteId); - return post(path, params.toFormData()); - } - - /** updateStatus a quote using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateStatusRaw(String quoteId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/update_status", "quote-id", quoteId); - return postJson(path, jsonPayload); - } - - public QuoteUpdateStatusResponse updateStatus(String quoteId, QuoteUpdateStatusParams params) - throws Exception { - Response response = updateStatusRaw(quoteId, params); - return QuoteUpdateStatusResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * updateSubscriptionQuoteForItems a quote using immutable params (executes immediately) - returns - * raw Response. - */ - Response updateSubscriptionQuoteForItemsRaw(QuoteUpdateSubscriptionQuoteForItemsParams params) - throws Exception { - - return post( - "/quotes/update_subscription_quote_for_items", params != null ? params.toFormData() : null); - } - - /** - * updateSubscriptionQuoteForItems a quote using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response updateSubscriptionQuoteForItemsRaw(String jsonPayload) throws Exception { - - return postJson("/quotes/update_subscription_quote_for_items", jsonPayload); - } - - public QuoteUpdateSubscriptionQuoteForItemsResponse updateSubscriptionQuoteForItems( - QuoteUpdateSubscriptionQuoteForItemsParams params) throws Exception { - Response response = updateSubscriptionQuoteForItemsRaw(params); - - return QuoteUpdateSubscriptionQuoteForItemsResponse.fromJson( - response.getBodyAsString(), response); - } - - /** - * quoteLineGroupsForQuote a quote using immutable params (executes immediately) - returns raw - * Response. - */ - Response quoteLineGroupsForQuoteRaw(String quoteId, QuoteQuoteLineGroupsForQuoteParams params) - throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/quote_line_groups", "quote-id", quoteId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * quoteLineGroupsForQuote a quote without params (executes immediately) - returns raw Response. - */ - Response quoteLineGroupsForQuoteRaw(String quoteId) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/quote_line_groups", "quote-id", quoteId); - return get(path, null); - } - - /** - * quoteLineGroupsForQuote a quote using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response quoteLineGroupsForQuoteRaw(String quoteId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/quote_line_groups", "quote-id", quoteId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public QuoteQuoteLineGroupsForQuoteResponse quoteLineGroupsForQuote( - String quoteId, QuoteQuoteLineGroupsForQuoteParams params) throws Exception { - Response response = quoteLineGroupsForQuoteRaw(quoteId, params); - return QuoteQuoteLineGroupsForQuoteResponse.fromJson( - response.getBodyAsString(), this, params, quoteId, response); - } - - public QuoteQuoteLineGroupsForQuoteResponse quoteLineGroupsForQuote(String quoteId) - throws Exception { - Response response = quoteLineGroupsForQuoteRaw(quoteId); - return QuoteQuoteLineGroupsForQuoteResponse.fromJson( - response.getBodyAsString(), this, null, quoteId, response); - } - - /** extendExpiryDate a quote (executes immediately) - returns raw Response. */ - Response extendExpiryDateRaw(String quoteId) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/extend_expiry_date", "quote-id", quoteId); - - return post(path, null); - } - - /** - * extendExpiryDate a quote using immutable params (executes immediately) - returns raw Response. - */ - Response extendExpiryDateRaw(String quoteId, QuoteExtendExpiryDateParams params) - throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/extend_expiry_date", "quote-id", quoteId); - return post(path, params.toFormData()); - } - - /** - * extendExpiryDate a quote using raw JSON payload (executes immediately) - returns raw Response. - */ - Response extendExpiryDateRaw(String quoteId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/extend_expiry_date", "quote-id", quoteId); - return postJson(path, jsonPayload); - } - - public QuoteExtendExpiryDateResponse extendExpiryDate( - String quoteId, QuoteExtendExpiryDateParams params) throws Exception { - Response response = extendExpiryDateRaw(quoteId, params); - return QuoteExtendExpiryDateResponse.fromJson(response.getBodyAsString(), response); - } - - /** editForChargeItemsAndCharges a quote (executes immediately) - returns raw Response. */ - Response editForChargeItemsAndChargesRaw(String quoteId) throws Exception { - String path = - buildPathWithParams( - "/quotes/{quote-id}/edit_for_charge_items_and_charges", "quote-id", quoteId); - - return post(path, null); - } - - /** - * editForChargeItemsAndCharges a quote using immutable params (executes immediately) - returns - * raw Response. - */ - Response editForChargeItemsAndChargesRaw( - String quoteId, QuoteEditForChargeItemsAndChargesParams params) throws Exception { - String path = - buildPathWithParams( - "/quotes/{quote-id}/edit_for_charge_items_and_charges", "quote-id", quoteId); - return post(path, params.toFormData()); - } - - /** - * editForChargeItemsAndCharges a quote using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response editForChargeItemsAndChargesRaw(String quoteId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/quotes/{quote-id}/edit_for_charge_items_and_charges", "quote-id", quoteId); - return postJson(path, jsonPayload); - } - - public QuoteEditForChargeItemsAndChargesResponse editForChargeItemsAndCharges( - String quoteId, QuoteEditForChargeItemsAndChargesParams params) throws Exception { - Response response = editForChargeItemsAndChargesRaw(quoteId, params); - return QuoteEditForChargeItemsAndChargesResponse.fromJson(response.getBodyAsString(), response); - } - - /** editUpdateSubscriptionQuoteForItems a quote (executes immediately) - returns raw Response. */ - Response editUpdateSubscriptionQuoteForItemsRaw(String quoteId) throws Exception { - String path = - buildPathWithParams( - "/quotes/{quote-id}/edit_update_subscription_quote_for_items", "quote-id", quoteId); - - return post(path, null); - } - - /** - * editUpdateSubscriptionQuoteForItems a quote using immutable params (executes immediately) - - * returns raw Response. - */ - Response editUpdateSubscriptionQuoteForItemsRaw( - String quoteId, QuoteEditUpdateSubscriptionQuoteForItemsParams params) throws Exception { - String path = - buildPathWithParams( - "/quotes/{quote-id}/edit_update_subscription_quote_for_items", "quote-id", quoteId); - return post(path, params.toFormData()); - } - - /** - * editUpdateSubscriptionQuoteForItems a quote using raw JSON payload (executes immediately) - - * returns raw Response. - */ - Response editUpdateSubscriptionQuoteForItemsRaw(String quoteId, String jsonPayload) - throws Exception { - String path = - buildPathWithParams( - "/quotes/{quote-id}/edit_update_subscription_quote_for_items", "quote-id", quoteId); - return postJson(path, jsonPayload); - } - - public QuoteEditUpdateSubscriptionQuoteForItemsResponse editUpdateSubscriptionQuoteForItems( - String quoteId, QuoteEditUpdateSubscriptionQuoteForItemsParams params) throws Exception { - Response response = editUpdateSubscriptionQuoteForItemsRaw(quoteId, params); - return QuoteEditUpdateSubscriptionQuoteForItemsResponse.fromJson( - response.getBodyAsString(), response); - } - - /** list a quote using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(QuoteListParams params) throws Exception { - - return get("/quotes", params != null ? params.toQueryParams() : null); - } - - /** list a quote without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/quotes", null); - } - - /** list a quote using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public QuoteListResponse list(QuoteListParams params) throws Exception { - Response response = listRaw(params); - - return QuoteListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public QuoteListResponse list() throws Exception { - Response response = listRaw(); - return QuoteListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** pdf a quote (executes immediately) - returns raw Response. */ - Response pdfRaw(String quoteId) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/pdf", "quote-id", quoteId); - - return post(path, null); - } - - /** pdf a quote using immutable params (executes immediately) - returns raw Response. */ - Response pdfRaw(String quoteId, QuotePdfParams params) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/pdf", "quote-id", quoteId); - return post(path, params.toFormData()); - } - - /** pdf a quote using raw JSON payload (executes immediately) - returns raw Response. */ - Response pdfRaw(String quoteId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/pdf", "quote-id", quoteId); - return postJson(path, jsonPayload); - } - - public QuotePdfResponse pdf(String quoteId, QuotePdfParams params) throws Exception { - Response response = pdfRaw(quoteId, params); - return QuotePdfResponse.fromJson(response.getBodyAsString(), response); - } - - /** convert a quote (executes immediately) - returns raw Response. */ - Response convertRaw(String quoteId) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/convert", "quote-id", quoteId); - - return post(path, null); - } - - /** convert a quote using immutable params (executes immediately) - returns raw Response. */ - Response convertRaw(String quoteId, QuoteConvertParams params) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/convert", "quote-id", quoteId); - return post(path, params.toFormData()); - } - - /** convert a quote using raw JSON payload (executes immediately) - returns raw Response. */ - Response convertRaw(String quoteId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/convert", "quote-id", quoteId); - return postJson(path, jsonPayload); - } - - public QuoteConvertResponse convert(String quoteId, QuoteConvertParams params) throws Exception { - Response response = convertRaw(quoteId, params); - return QuoteConvertResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createForChargeItemsAndCharges a quote using immutable params (executes immediately) - returns - * raw Response. - */ - Response createForChargeItemsAndChargesRaw(QuoteCreateForChargeItemsAndChargesParams params) - throws Exception { - - return post( - "/quotes/create_for_charge_items_and_charges", params != null ? params.toFormData() : null); - } - - /** - * createForChargeItemsAndCharges a quote using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response createForChargeItemsAndChargesRaw(String jsonPayload) throws Exception { - - return postJson("/quotes/create_for_charge_items_and_charges", jsonPayload); - } - - public QuoteCreateForChargeItemsAndChargesResponse createForChargeItemsAndCharges( - QuoteCreateForChargeItemsAndChargesParams params) throws Exception { - Response response = createForChargeItemsAndChargesRaw(params); - - return QuoteCreateForChargeItemsAndChargesResponse.fromJson( - response.getBodyAsString(), response); - } - - /** delete a quote (executes immediately) - returns raw Response. */ - Response deleteRaw(String quoteId) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/delete", "quote-id", quoteId); - - return post(path, null); - } - - /** delete a quote using immutable params (executes immediately) - returns raw Response. */ - Response deleteRaw(String quoteId, QuoteDeleteParams params) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/delete", "quote-id", quoteId); - return post(path, params.toFormData()); - } - - /** delete a quote using raw JSON payload (executes immediately) - returns raw Response. */ - Response deleteRaw(String quoteId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/quotes/{quote-id}/delete", "quote-id", quoteId); - return postJson(path, jsonPayload); - } - - public QuoteDeleteResponse delete(String quoteId, QuoteDeleteParams params) throws Exception { - Response response = deleteRaw(quoteId, params); - return QuoteDeleteResponse.fromJson(response.getBodyAsString(), response); - } - - /** editOneTimeQuote a quote (executes immediately) - returns raw Response. */ - Response editOneTimeQuoteRaw(String quoteId) throws Exception { - String path = - buildPathWithParams("/quotes/{quote-id}/edit_one_time_quote", "quote-id", quoteId); - - return post(path, null); - } - - /** - * editOneTimeQuote a quote using immutable params (executes immediately) - returns raw Response. - */ - Response editOneTimeQuoteRaw(String quoteId, QuoteEditOneTimeQuoteParams params) - throws Exception { - String path = - buildPathWithParams("/quotes/{quote-id}/edit_one_time_quote", "quote-id", quoteId); - return post(path, params.toFormData()); - } - - /** - * editOneTimeQuote a quote using raw JSON payload (executes immediately) - returns raw Response. - */ - Response editOneTimeQuoteRaw(String quoteId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/quotes/{quote-id}/edit_one_time_quote", "quote-id", quoteId); - return postJson(path, jsonPayload); - } - - public QuoteEditOneTimeQuoteResponse editOneTimeQuote( - String quoteId, QuoteEditOneTimeQuoteParams params) throws Exception { - Response response = editOneTimeQuoteRaw(quoteId, params); - return QuoteEditOneTimeQuoteResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * updateSubscriptionQuote a quote using immutable params (executes immediately) - returns raw - * Response. - */ - Response updateSubscriptionQuoteRaw(QuoteUpdateSubscriptionQuoteParams params) throws Exception { - - return post("/quotes/update_subscription_quote", params != null ? params.toFormData() : null); - } - - /** - * updateSubscriptionQuote a quote using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response updateSubscriptionQuoteRaw(String jsonPayload) throws Exception { - - return postJson("/quotes/update_subscription_quote", jsonPayload); - } - - public QuoteUpdateSubscriptionQuoteResponse updateSubscriptionQuote( - QuoteUpdateSubscriptionQuoteParams params) throws Exception { - Response response = updateSubscriptionQuoteRaw(params); - - return QuoteUpdateSubscriptionQuoteResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createForOnetimeCharges a quote using immutable params (executes immediately) - returns raw - * Response. - */ - Response createForOnetimeChargesRaw(QuoteCreateForOnetimeChargesParams params) throws Exception { - - return post("/quotes/create_for_onetime_charges", params != null ? params.toFormData() : null); - } - - /** - * createForOnetimeCharges a quote using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response createForOnetimeChargesRaw(String jsonPayload) throws Exception { - - return postJson("/quotes/create_for_onetime_charges", jsonPayload); - } - - public QuoteCreateForOnetimeChargesResponse createForOnetimeCharges( - QuoteCreateForOnetimeChargesParams params) throws Exception { - Response response = createForOnetimeChargesRaw(params); - - return QuoteCreateForOnetimeChargesResponse.fromJson(response.getBodyAsString(), response); - } - - /** createSubForCustomerQuote a quote (executes immediately) - returns raw Response. */ - Response createSubForCustomerQuoteRaw(String customerId) throws Exception { - String path = - buildPathWithParams( - "/customers/{customer-id}/create_subscription_quote", "customer-id", customerId); - - return post(path, null); - } - - /** - * createSubForCustomerQuote a quote using immutable params (executes immediately) - returns raw - * Response. - */ - Response createSubForCustomerQuoteRaw( - String customerId, QuoteCreateSubForCustomerQuoteParams params) throws Exception { - String path = - buildPathWithParams( - "/customers/{customer-id}/create_subscription_quote", "customer-id", customerId); - return post(path, params.toFormData()); - } - - /** - * createSubForCustomerQuote a quote using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response createSubForCustomerQuoteRaw(String customerId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/customers/{customer-id}/create_subscription_quote", "customer-id", customerId); - return postJson(path, jsonPayload); - } - - public QuoteCreateSubForCustomerQuoteResponse createSubForCustomerQuote( - String customerId, QuoteCreateSubForCustomerQuoteParams params) throws Exception { - Response response = createSubForCustomerQuoteRaw(customerId, params); - return QuoteCreateSubForCustomerQuoteResponse.fromJson(response.getBodyAsString(), response); - } - - /** editUpdateSubscriptionQuote a quote (executes immediately) - returns raw Response. */ - Response editUpdateSubscriptionQuoteRaw(String quoteId) throws Exception { - String path = - buildPathWithParams( - "/quotes/{quote-id}/edit_update_subscription_quote", "quote-id", quoteId); - - return post(path, null); - } - - /** - * editUpdateSubscriptionQuote a quote using immutable params (executes immediately) - returns raw - * Response. - */ - Response editUpdateSubscriptionQuoteRaw( - String quoteId, QuoteEditUpdateSubscriptionQuoteParams params) throws Exception { - String path = - buildPathWithParams( - "/quotes/{quote-id}/edit_update_subscription_quote", "quote-id", quoteId); - return post(path, params.toFormData()); - } - - /** - * editUpdateSubscriptionQuote a quote using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response editUpdateSubscriptionQuoteRaw(String quoteId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/quotes/{quote-id}/edit_update_subscription_quote", "quote-id", quoteId); - return postJson(path, jsonPayload); - } - - public QuoteEditUpdateSubscriptionQuoteResponse editUpdateSubscriptionQuote( - String quoteId, QuoteEditUpdateSubscriptionQuoteParams params) throws Exception { - Response response = editUpdateSubscriptionQuoteRaw(quoteId, params); - return QuoteEditUpdateSubscriptionQuoteResponse.fromJson(response.getBodyAsString(), response); - } - - /** editCreateSubForCustomerQuote a quote (executes immediately) - returns raw Response. */ - Response editCreateSubForCustomerQuoteRaw(String quoteId) throws Exception { - String path = - buildPathWithParams( - "/quotes/{quote-id}/edit_create_subscription_quote", "quote-id", quoteId); - - return post(path, null); - } - - /** - * editCreateSubForCustomerQuote a quote using immutable params (executes immediately) - returns - * raw Response. - */ - Response editCreateSubForCustomerQuoteRaw( - String quoteId, QuoteEditCreateSubForCustomerQuoteParams params) throws Exception { - String path = - buildPathWithParams( - "/quotes/{quote-id}/edit_create_subscription_quote", "quote-id", quoteId); - return post(path, params.toFormData()); - } - - /** - * editCreateSubForCustomerQuote a quote using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response editCreateSubForCustomerQuoteRaw(String quoteId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/quotes/{quote-id}/edit_create_subscription_quote", "quote-id", quoteId); - return postJson(path, jsonPayload); - } - - public QuoteEditCreateSubForCustomerQuoteResponse editCreateSubForCustomerQuote( - String quoteId, QuoteEditCreateSubForCustomerQuoteParams params) throws Exception { - Response response = editCreateSubForCustomerQuoteRaw(quoteId, params); - return QuoteEditCreateSubForCustomerQuoteResponse.fromJson( - response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/SubscriptionEntitlementService.java b/src/main/java/com/chargebee/v4/core/services/SubscriptionEntitlementService.java deleted file mode 100644 index 4507974b..00000000 --- a/src/main/java/com/chargebee/v4/core/services/SubscriptionEntitlementService.java +++ /dev/null @@ -1,171 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.subscriptionEntitlement.params.SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityParams; - -import com.chargebee.v4.core.models.subscriptionEntitlement.params.SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams; - -import com.chargebee.v4.core.responses.subscriptionEntitlement.SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse; - -import com.chargebee.v4.core.responses.subscriptionEntitlement.SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse; - -public final class SubscriptionEntitlementService - extends BaseService { - - private final ServiceConfig config; - - public SubscriptionEntitlementService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private SubscriptionEntitlementService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private SubscriptionEntitlementService( - ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - SubscriptionEntitlementService with(RequestOptions newOptions) { - return new SubscriptionEntitlementService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public SubscriptionEntitlementService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** - * setSubscriptionEntitlementAvailability a subscriptionEntitlement (executes immediately) - - * returns raw Response. - */ - Response setSubscriptionEntitlementAvailabilityRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/subscription_entitlements/set_availability", - "subscription-id", - subscriptionId); - - return post(path, null); - } - - /** - * setSubscriptionEntitlementAvailability a subscriptionEntitlement using immutable params - * (executes immediately) - returns raw Response. - */ - Response setSubscriptionEntitlementAvailabilityRaw( - String subscriptionId, - SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityParams params) - throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/subscription_entitlements/set_availability", - "subscription-id", - subscriptionId); - return post(path, params.toFormData()); - } - - /** - * setSubscriptionEntitlementAvailability a subscriptionEntitlement using raw JSON payload - * (executes immediately) - returns raw Response. - */ - Response setSubscriptionEntitlementAvailabilityRaw(String subscriptionId, String jsonPayload) - throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/subscription_entitlements/set_availability", - "subscription-id", - subscriptionId); - return postJson(path, jsonPayload); - } - - public SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse - setSubscriptionEntitlementAvailability( - String subscriptionId, - SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityParams params) - throws Exception { - Response response = setSubscriptionEntitlementAvailabilityRaw(subscriptionId, params); - return SubscriptionEntitlementSetSubscriptionEntitlementAvailabilityResponse.fromJson( - response.getBodyAsString(), response); - } - - /** - * subscriptionEntitlementsForSubscription a subscriptionEntitlement using immutable params - * (executes immediately) - returns raw Response. - */ - Response subscriptionEntitlementsForSubscriptionRaw( - String subscriptionId, - SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams params) - throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/subscription_entitlements", - "subscription-id", - subscriptionId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * subscriptionEntitlementsForSubscription a subscriptionEntitlement without params (executes - * immediately) - returns raw Response. - */ - Response subscriptionEntitlementsForSubscriptionRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/subscription_entitlements", - "subscription-id", - subscriptionId); - return get(path, null); - } - - /** - * subscriptionEntitlementsForSubscription a subscriptionEntitlement using raw JSON payload - * (executes immediately) - returns raw Response. - */ - Response subscriptionEntitlementsForSubscriptionRaw(String subscriptionId, String jsonPayload) - throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/subscription_entitlements", - "subscription-id", - subscriptionId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse - subscriptionEntitlementsForSubscription( - String subscriptionId, - SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionParams params) - throws Exception { - Response response = subscriptionEntitlementsForSubscriptionRaw(subscriptionId, params); - return SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse.fromJson( - response.getBodyAsString(), this, params, subscriptionId, response); - } - - public SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse - subscriptionEntitlementsForSubscription(String subscriptionId) throws Exception { - Response response = subscriptionEntitlementsForSubscriptionRaw(subscriptionId); - return SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionResponse.fromJson( - response.getBodyAsString(), this, null, subscriptionId, response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/ThirdPartyEntityMappingService.java b/src/main/java/com/chargebee/v4/core/services/ThirdPartyEntityMappingService.java deleted file mode 100644 index 9ea477da..00000000 --- a/src/main/java/com/chargebee/v4/core/services/ThirdPartyEntityMappingService.java +++ /dev/null @@ -1,185 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.thirdPartyEntityMapping.params.ThirdPartyEntityMappingRetrieveEntityParams; - -import com.chargebee.v4.core.models.thirdPartyEntityMapping.params.ThirdPartyEntityMappingListAllParams; - -import com.chargebee.v4.core.models.thirdPartyEntityMapping.params.ThirdPartyEntityMappingUpdateEntityParams; - -import com.chargebee.v4.core.models.thirdPartyEntityMapping.params.ThirdPartyEntityMappingListParams; - -import com.chargebee.v4.core.responses.thirdPartyEntityMapping.ThirdPartyEntityMappingRetrieveEntityResponse; - -import com.chargebee.v4.core.responses.thirdPartyEntityMapping.ThirdPartyEntityMappingListAllResponse; - -import com.chargebee.v4.core.responses.thirdPartyEntityMapping.ThirdPartyEntityMappingUpdateEntityResponse; - -import com.chargebee.v4.core.responses.thirdPartyEntityMapping.ThirdPartyEntityMappingListResponse; - -public final class ThirdPartyEntityMappingService - extends BaseService { - - private final ServiceConfig config; - - public ThirdPartyEntityMappingService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private ThirdPartyEntityMappingService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private ThirdPartyEntityMappingService( - ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - ThirdPartyEntityMappingService with(RequestOptions newOptions) { - return new ThirdPartyEntityMappingService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public ThirdPartyEntityMappingService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** - * retrieveEntity a thirdPartyEntityMapping using immutable params (executes immediately) - - * returns raw Response. - */ - Response retrieveEntityRaw(ThirdPartyEntityMappingRetrieveEntityParams params) throws Exception { - - return get( - "/third_party_entity_mappings/retrieve", params != null ? params.toQueryParams() : null); - } - - /** - * retrieveEntity a thirdPartyEntityMapping using raw JSON payload (executes immediately) - - * returns raw Response. - */ - Response retrieveEntityRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public ThirdPartyEntityMappingRetrieveEntityResponse retrieveEntity( - ThirdPartyEntityMappingRetrieveEntityParams params) throws Exception { - Response response = retrieveEntityRaw(params); - - return ThirdPartyEntityMappingRetrieveEntityResponse.fromJson( - response.getBodyAsString(), response); - } - - /** - * listAll a thirdPartyEntityMapping using immutable params (executes immediately) - returns raw - * Response. - */ - Response listAllRaw(ThirdPartyEntityMappingListAllParams params) throws Exception { - - return get( - "/third_party_entity_mappings/list_all", params != null ? params.toQueryParams() : null); - } - - /** - * listAll a thirdPartyEntityMapping using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response listAllRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public ThirdPartyEntityMappingListAllResponse listAll(ThirdPartyEntityMappingListAllParams params) - throws Exception { - Response response = listAllRaw(params); - - return ThirdPartyEntityMappingListAllResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * updateEntity a thirdPartyEntityMapping using immutable params (executes immediately) - returns - * raw Response. - */ - Response updateEntityRaw(ThirdPartyEntityMappingUpdateEntityParams params) throws Exception { - - return post( - "/third_party_entity_mappings/update_entity", params != null ? params.toFormData() : null); - } - - /** - * updateEntity a thirdPartyEntityMapping using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response updateEntityRaw(String jsonPayload) throws Exception { - - return postJson("/third_party_entity_mappings/update_entity", jsonPayload); - } - - public ThirdPartyEntityMappingUpdateEntityResponse updateEntity( - ThirdPartyEntityMappingUpdateEntityParams params) throws Exception { - Response response = updateEntityRaw(params); - - return ThirdPartyEntityMappingUpdateEntityResponse.fromJson( - response.getBodyAsString(), response); - } - - /** - * list a thirdPartyEntityMapping using immutable params (executes immediately) - returns raw - * Response. - */ - Response listRaw(ThirdPartyEntityMappingListParams params) throws Exception { - - return get("/third_party_entity_mappings", params != null ? params.toQueryParams() : null); - } - - /** - * list a thirdPartyEntityMapping without params (executes immediately) - returns raw Response. - */ - Response listRaw() throws Exception { - - return get("/third_party_entity_mappings", null); - } - - /** - * list a thirdPartyEntityMapping using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public ThirdPartyEntityMappingListResponse list(ThirdPartyEntityMappingListParams params) - throws Exception { - Response response = listRaw(params); - - return ThirdPartyEntityMappingListResponse.fromJson( - response.getBodyAsString(), this, params, response); - } - - public ThirdPartyEntityMappingListResponse list() throws Exception { - Response response = listRaw(); - return ThirdPartyEntityMappingListResponse.fromJson( - response.getBodyAsString(), this, null, response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/TpSiteUserService.java b/src/main/java/com/chargebee/v4/core/services/TpSiteUserService.java deleted file mode 100644 index 4c085d6a..00000000 --- a/src/main/java/com/chargebee/v4/core/services/TpSiteUserService.java +++ /dev/null @@ -1,178 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.tpSiteUser.params.TpSiteUserUsersForTpSiteUserParams; - -import com.chargebee.v4.core.models.tpSiteUser.params.TpSiteUserPayNowEnableLiveParams; - -import com.chargebee.v4.core.models.tpSiteUser.params.TpSiteUserGuestsForTpSiteUserParams; - -import com.chargebee.v4.core.responses.tpSiteUser.TpSiteUserUsersForTpSiteUserResponse; - -import com.chargebee.v4.core.responses.tpSiteUser.TpSiteUserPayNowEnableLiveResponse; - -import com.chargebee.v4.core.responses.tpSiteUser.TpSiteUserGuestsForTpSiteUserResponse; - -public final class TpSiteUserService extends BaseService { - - private final ServiceConfig config; - - public TpSiteUserService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private TpSiteUserService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private TpSiteUserService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - TpSiteUserService with(RequestOptions newOptions) { - return new TpSiteUserService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public TpSiteUserService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** - * usersForTpSiteUser a tpSiteUser using immutable params (executes immediately) - returns raw - * Response. - */ - Response usersForTpSiteUserRaw(String tpSiteUserDomain, TpSiteUserUsersForTpSiteUserParams params) - throws Exception { - String path = - buildPathWithParams( - "/tp_site_users/{tp-site-user-domain}/users", "tp-site-user-domain", tpSiteUserDomain); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * usersForTpSiteUser a tpSiteUser without params (executes immediately) - returns raw Response. - */ - Response usersForTpSiteUserRaw(String tpSiteUserDomain) throws Exception { - String path = - buildPathWithParams( - "/tp_site_users/{tp-site-user-domain}/users", "tp-site-user-domain", tpSiteUserDomain); - return get(path, null); - } - - /** - * usersForTpSiteUser a tpSiteUser using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response usersForTpSiteUserRaw(String tpSiteUserDomain, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/tp_site_users/{tp-site-user-domain}/users", "tp-site-user-domain", tpSiteUserDomain); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public TpSiteUserUsersForTpSiteUserResponse usersForTpSiteUser( - String tpSiteUserDomain, TpSiteUserUsersForTpSiteUserParams params) throws Exception { - Response response = usersForTpSiteUserRaw(tpSiteUserDomain, params); - return TpSiteUserUsersForTpSiteUserResponse.fromJson( - response.getBodyAsString(), this, params, tpSiteUserDomain, response); - } - - public TpSiteUserUsersForTpSiteUserResponse usersForTpSiteUser(String tpSiteUserDomain) - throws Exception { - Response response = usersForTpSiteUserRaw(tpSiteUserDomain); - return TpSiteUserUsersForTpSiteUserResponse.fromJson( - response.getBodyAsString(), this, null, tpSiteUserDomain, response); - } - - /** - * payNowEnableLive a tpSiteUser using immutable params (executes immediately) - returns raw - * Response. - */ - Response payNowEnableLiveRaw(TpSiteUserPayNowEnableLiveParams params) throws Exception { - - return post("/tp_site_users/pay_now_enable_live", params != null ? params.toFormData() : null); - } - - /** - * payNowEnableLive a tpSiteUser using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response payNowEnableLiveRaw(String jsonPayload) throws Exception { - - return postJson("/tp_site_users/pay_now_enable_live", jsonPayload); - } - - public TpSiteUserPayNowEnableLiveResponse payNowEnableLive( - TpSiteUserPayNowEnableLiveParams params) throws Exception { - Response response = payNowEnableLiveRaw(params); - - return TpSiteUserPayNowEnableLiveResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * guestsForTpSiteUser a tpSiteUser using immutable params (executes immediately) - returns raw - * Response. - */ - Response guestsForTpSiteUserRaw( - String tpSiteUserDomain, TpSiteUserGuestsForTpSiteUserParams params) throws Exception { - String path = - buildPathWithParams( - "/tp_site_users/{tp-site-user-domain}/guests", "tp-site-user-domain", tpSiteUserDomain); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * guestsForTpSiteUser a tpSiteUser without params (executes immediately) - returns raw Response. - */ - Response guestsForTpSiteUserRaw(String tpSiteUserDomain) throws Exception { - String path = - buildPathWithParams( - "/tp_site_users/{tp-site-user-domain}/guests", "tp-site-user-domain", tpSiteUserDomain); - return get(path, null); - } - - /** - * guestsForTpSiteUser a tpSiteUser using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response guestsForTpSiteUserRaw(String tpSiteUserDomain, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/tp_site_users/{tp-site-user-domain}/guests", "tp-site-user-domain", tpSiteUserDomain); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public TpSiteUserGuestsForTpSiteUserResponse guestsForTpSiteUser( - String tpSiteUserDomain, TpSiteUserGuestsForTpSiteUserParams params) throws Exception { - Response response = guestsForTpSiteUserRaw(tpSiteUserDomain, params); - return TpSiteUserGuestsForTpSiteUserResponse.fromJson( - response.getBodyAsString(), this, params, tpSiteUserDomain, response); - } - - public TpSiteUserGuestsForTpSiteUserResponse guestsForTpSiteUser(String tpSiteUserDomain) - throws Exception { - Response response = guestsForTpSiteUserRaw(tpSiteUserDomain); - return TpSiteUserGuestsForTpSiteUserResponse.fromJson( - response.getBodyAsString(), this, null, tpSiteUserDomain, response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/TransactionService.java b/src/main/java/com/chargebee/v4/core/services/TransactionService.java deleted file mode 100644 index 37fd494e..00000000 --- a/src/main/java/com/chargebee/v4/core/services/TransactionService.java +++ /dev/null @@ -1,466 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.transaction.params.TransactionListParams; - -import com.chargebee.v4.core.models.transaction.params.TransactionReconcileParams; - -import com.chargebee.v4.core.models.transaction.params.TransactionRefundParams; - -import com.chargebee.v4.core.models.transaction.params.TransactionTransactionsForCustomerParams; - -import com.chargebee.v4.core.models.transaction.params.TransactionRecordRefundParams; - -import com.chargebee.v4.core.models.transaction.params.TransactionTransactionsForSubscriptionParams; - -import com.chargebee.v4.core.models.transaction.params.TransactionCreateAuthorizationParams; - -import com.chargebee.v4.core.models.transaction.params.TransactionPaymentsForInvoiceParams; - -import com.chargebee.v4.core.models.transaction.params.TransactionDeleteOfflineTransactionParams; - -import com.chargebee.v4.core.responses.transaction.TransactionListResponse; - -import com.chargebee.v4.core.responses.transaction.TransactionReconcileResponse; - -import com.chargebee.v4.core.responses.transaction.TransactionRetrieveResponse; - -import com.chargebee.v4.core.responses.transaction.TransactionRefundResponse; - -import com.chargebee.v4.core.responses.transaction.TransactionTransactionsForCustomerResponse; - -import com.chargebee.v4.core.responses.transaction.TransactionRecordRefundResponse; - -import com.chargebee.v4.core.responses.transaction.TransactionTransactionsForSubscriptionResponse; - -import com.chargebee.v4.core.responses.transaction.TransactionVoidTransactionResponse; - -import com.chargebee.v4.core.responses.transaction.TransactionSyncTransactionResponse; - -import com.chargebee.v4.core.responses.transaction.TransactionCreateAuthorizationResponse; - -import com.chargebee.v4.core.responses.transaction.TransactionPaymentsForInvoiceResponse; - -import com.chargebee.v4.core.responses.transaction.TransactionDeleteOfflineTransactionResponse; - -public final class TransactionService extends BaseService { - - private final ServiceConfig config; - - public TransactionService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private TransactionService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private TransactionService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - TransactionService with(RequestOptions newOptions) { - return new TransactionService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public TransactionService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** list a transaction using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(TransactionListParams params) throws Exception { - - return get("/transactions", params != null ? params.toQueryParams() : null); - } - - /** list a transaction without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/transactions", null); - } - - /** list a transaction using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public TransactionListResponse list(TransactionListParams params) throws Exception { - Response response = listRaw(params); - - return TransactionListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public TransactionListResponse list() throws Exception { - Response response = listRaw(); - return TransactionListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** reconcile a transaction (executes immediately) - returns raw Response. */ - Response reconcileRaw(String transactionId) throws Exception { - String path = - buildPathWithParams( - "/transactions/{transaction-id}/reconcile", "transaction-id", transactionId); - - return post(path, null); - } - - /** - * reconcile a transaction using immutable params (executes immediately) - returns raw Response. - */ - Response reconcileRaw(String transactionId, TransactionReconcileParams params) throws Exception { - String path = - buildPathWithParams( - "/transactions/{transaction-id}/reconcile", "transaction-id", transactionId); - return post(path, params.toFormData()); - } - - /** - * reconcile a transaction using raw JSON payload (executes immediately) - returns raw Response. - */ - Response reconcileRaw(String transactionId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/transactions/{transaction-id}/reconcile", "transaction-id", transactionId); - return postJson(path, jsonPayload); - } - - public TransactionReconcileResponse reconcile( - String transactionId, TransactionReconcileParams params) throws Exception { - Response response = reconcileRaw(transactionId, params); - return TransactionReconcileResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a transaction (executes immediately) - returns raw Response. */ - Response retrieveRaw(String transactionId) throws Exception { - String path = - buildPathWithParams("/transactions/{transaction-id}", "transaction-id", transactionId); - - return get(path, null); - } - - public TransactionRetrieveResponse retrieve(String transactionId) throws Exception { - Response response = retrieveRaw(transactionId); - return TransactionRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** refund a transaction (executes immediately) - returns raw Response. */ - Response refundRaw(String transactionId) throws Exception { - String path = - buildPathWithParams( - "/transactions/{transaction-id}/refund", "transaction-id", transactionId); - - return post(path, null); - } - - /** refund a transaction using immutable params (executes immediately) - returns raw Response. */ - Response refundRaw(String transactionId, TransactionRefundParams params) throws Exception { - String path = - buildPathWithParams( - "/transactions/{transaction-id}/refund", "transaction-id", transactionId); - return post(path, params.toFormData()); - } - - /** refund a transaction using raw JSON payload (executes immediately) - returns raw Response. */ - Response refundRaw(String transactionId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/transactions/{transaction-id}/refund", "transaction-id", transactionId); - return postJson(path, jsonPayload); - } - - public TransactionRefundResponse refund(String transactionId, TransactionRefundParams params) - throws Exception { - Response response = refundRaw(transactionId, params); - return TransactionRefundResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * transactionsForCustomer a transaction using immutable params (executes immediately) - returns - * raw Response. - */ - Response transactionsForCustomerRaw( - String customerId, TransactionTransactionsForCustomerParams params) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/transactions", "customer-id", customerId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * transactionsForCustomer a transaction without params (executes immediately) - returns raw - * Response. - */ - Response transactionsForCustomerRaw(String customerId) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/transactions", "customer-id", customerId); - return get(path, null); - } - - /** - * transactionsForCustomer a transaction using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response transactionsForCustomerRaw(String customerId, String jsonPayload) throws Exception { - String path = - buildPathWithParams("/customers/{customer-id}/transactions", "customer-id", customerId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public TransactionTransactionsForCustomerResponse transactionsForCustomer( - String customerId, TransactionTransactionsForCustomerParams params) throws Exception { - Response response = transactionsForCustomerRaw(customerId, params); - return TransactionTransactionsForCustomerResponse.fromJson( - response.getBodyAsString(), this, params, customerId, response); - } - - public TransactionTransactionsForCustomerResponse transactionsForCustomer(String customerId) - throws Exception { - Response response = transactionsForCustomerRaw(customerId); - return TransactionTransactionsForCustomerResponse.fromJson( - response.getBodyAsString(), this, null, customerId, response); - } - - /** recordRefund a transaction (executes immediately) - returns raw Response. */ - Response recordRefundRaw(String transactionId) throws Exception { - String path = - buildPathWithParams( - "/transactions/{transaction-id}/record_refund", "transaction-id", transactionId); - - return post(path, null); - } - - /** - * recordRefund a transaction using immutable params (executes immediately) - returns raw - * Response. - */ - Response recordRefundRaw(String transactionId, TransactionRecordRefundParams params) - throws Exception { - String path = - buildPathWithParams( - "/transactions/{transaction-id}/record_refund", "transaction-id", transactionId); - return post(path, params.toFormData()); - } - - /** - * recordRefund a transaction using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response recordRefundRaw(String transactionId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/transactions/{transaction-id}/record_refund", "transaction-id", transactionId); - return postJson(path, jsonPayload); - } - - public TransactionRecordRefundResponse recordRefund( - String transactionId, TransactionRecordRefundParams params) throws Exception { - Response response = recordRefundRaw(transactionId, params); - return TransactionRecordRefundResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * transactionsForSubscription a transaction using immutable params (executes immediately) - - * returns raw Response. - */ - Response transactionsForSubscriptionRaw( - String subscriptionId, TransactionTransactionsForSubscriptionParams params) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/transactions", "subscription-id", subscriptionId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * transactionsForSubscription a transaction without params (executes immediately) - returns raw - * Response. - */ - Response transactionsForSubscriptionRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/transactions", "subscription-id", subscriptionId); - return get(path, null); - } - - /** - * transactionsForSubscription a transaction using raw JSON payload (executes immediately) - - * returns raw Response. - */ - Response transactionsForSubscriptionRaw(String subscriptionId, String jsonPayload) - throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/transactions", "subscription-id", subscriptionId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public TransactionTransactionsForSubscriptionResponse transactionsForSubscription( - String subscriptionId, TransactionTransactionsForSubscriptionParams params) throws Exception { - Response response = transactionsForSubscriptionRaw(subscriptionId, params); - return TransactionTransactionsForSubscriptionResponse.fromJson( - response.getBodyAsString(), this, params, subscriptionId, response); - } - - public TransactionTransactionsForSubscriptionResponse transactionsForSubscription( - String subscriptionId) throws Exception { - Response response = transactionsForSubscriptionRaw(subscriptionId); - return TransactionTransactionsForSubscriptionResponse.fromJson( - response.getBodyAsString(), this, null, subscriptionId, response); - } - - /** voidTransaction a transaction (executes immediately) - returns raw Response. */ - Response voidTransactionRaw(String transactionId) throws Exception { - String path = - buildPathWithParams("/transactions/{transaction-id}/void", "transaction-id", transactionId); - - return post(path, null); - } - - public TransactionVoidTransactionResponse voidTransaction(String transactionId) throws Exception { - Response response = voidTransactionRaw(transactionId); - return TransactionVoidTransactionResponse.fromJson(response.getBodyAsString(), response); - } - - /** syncTransaction a transaction (executes immediately) - returns raw Response. */ - Response syncTransactionRaw(String transactionId) throws Exception { - String path = - buildPathWithParams("/transactions/{transaction-id}/sync", "transaction-id", transactionId); - - return post(path, null); - } - - public TransactionSyncTransactionResponse syncTransaction(String transactionId) throws Exception { - Response response = syncTransactionRaw(transactionId); - return TransactionSyncTransactionResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createAuthorization a transaction using immutable params (executes immediately) - returns raw - * Response. - */ - Response createAuthorizationRaw(TransactionCreateAuthorizationParams params) throws Exception { - - return post("/transactions/create_authorization", params != null ? params.toFormData() : null); - } - - /** - * createAuthorization a transaction using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response createAuthorizationRaw(String jsonPayload) throws Exception { - - return postJson("/transactions/create_authorization", jsonPayload); - } - - public TransactionCreateAuthorizationResponse createAuthorization( - TransactionCreateAuthorizationParams params) throws Exception { - Response response = createAuthorizationRaw(params); - - return TransactionCreateAuthorizationResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * paymentsForInvoice a transaction using immutable params (executes immediately) - returns raw - * Response. - */ - Response paymentsForInvoiceRaw(String invoiceId, TransactionPaymentsForInvoiceParams params) - throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/payments", "invoice-id", invoiceId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * paymentsForInvoice a transaction without params (executes immediately) - returns raw Response. - */ - Response paymentsForInvoiceRaw(String invoiceId) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/payments", "invoice-id", invoiceId); - return get(path, null); - } - - /** - * paymentsForInvoice a transaction using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response paymentsForInvoiceRaw(String invoiceId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/invoices/{invoice-id}/payments", "invoice-id", invoiceId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public TransactionPaymentsForInvoiceResponse paymentsForInvoice( - String invoiceId, TransactionPaymentsForInvoiceParams params) throws Exception { - Response response = paymentsForInvoiceRaw(invoiceId, params); - return TransactionPaymentsForInvoiceResponse.fromJson( - response.getBodyAsString(), this, params, invoiceId, response); - } - - public TransactionPaymentsForInvoiceResponse paymentsForInvoice(String invoiceId) - throws Exception { - Response response = paymentsForInvoiceRaw(invoiceId); - return TransactionPaymentsForInvoiceResponse.fromJson( - response.getBodyAsString(), this, null, invoiceId, response); - } - - /** deleteOfflineTransaction a transaction (executes immediately) - returns raw Response. */ - Response deleteOfflineTransactionRaw(String transactionId) throws Exception { - String path = - buildPathWithParams( - "/transactions/{transaction-id}/delete_offline_transaction", - "transaction-id", - transactionId); - - return post(path, null); - } - - /** - * deleteOfflineTransaction a transaction using immutable params (executes immediately) - returns - * raw Response. - */ - Response deleteOfflineTransactionRaw( - String transactionId, TransactionDeleteOfflineTransactionParams params) throws Exception { - String path = - buildPathWithParams( - "/transactions/{transaction-id}/delete_offline_transaction", - "transaction-id", - transactionId); - return post(path, params.toFormData()); - } - - /** - * deleteOfflineTransaction a transaction using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response deleteOfflineTransactionRaw(String transactionId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/transactions/{transaction-id}/delete_offline_transaction", - "transaction-id", - transactionId); - return postJson(path, jsonPayload); - } - - public TransactionDeleteOfflineTransactionResponse deleteOfflineTransaction( - String transactionId, TransactionDeleteOfflineTransactionParams params) throws Exception { - Response response = deleteOfflineTransactionRaw(transactionId, params); - return TransactionDeleteOfflineTransactionResponse.fromJson( - response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/UnbilledChargeService.java b/src/main/java/com/chargebee/v4/core/services/UnbilledChargeService.java deleted file mode 100644 index 82ca8bfc..00000000 --- a/src/main/java/com/chargebee/v4/core/services/UnbilledChargeService.java +++ /dev/null @@ -1,218 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.unbilledCharge.params.UnbilledChargeInvoiceNowEstimateParams; - -import com.chargebee.v4.core.models.unbilledCharge.params.UnbilledChargeInvoiceUnbilledChargesParams; - -import com.chargebee.v4.core.models.unbilledCharge.params.UnbilledChargeListParams; - -import com.chargebee.v4.core.models.unbilledCharge.params.UnbilledChargeCreateParams; - -import com.chargebee.v4.core.models.unbilledCharge.params.UnbilledChargeCreateUnbilledChargeParams; - -import com.chargebee.v4.core.responses.unbilledCharge.UnbilledChargeDeleteResponse; - -import com.chargebee.v4.core.responses.unbilledCharge.UnbilledChargeInvoiceNowEstimateResponse; - -import com.chargebee.v4.core.responses.unbilledCharge.UnbilledChargeInvoiceUnbilledChargesResponse; - -import com.chargebee.v4.core.responses.unbilledCharge.UnbilledChargeListResponse; - -import com.chargebee.v4.core.responses.unbilledCharge.UnbilledChargeCreateResponse; - -import com.chargebee.v4.core.responses.unbilledCharge.UnbilledChargeCreateUnbilledChargeResponse; - -public final class UnbilledChargeService extends BaseService { - - private final ServiceConfig config; - - public UnbilledChargeService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private UnbilledChargeService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private UnbilledChargeService( - ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - UnbilledChargeService with(RequestOptions newOptions) { - return new UnbilledChargeService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public UnbilledChargeService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** delete a unbilledCharge (executes immediately) - returns raw Response. */ - Response deleteRaw(String unbilledChargeId) throws Exception { - String path = - buildPathWithParams( - "/unbilled_charges/{unbilled-charge-id}/delete", - "unbilled-charge-id", - unbilledChargeId); - - return post(path, null); - } - - public UnbilledChargeDeleteResponse delete(String unbilledChargeId) throws Exception { - Response response = deleteRaw(unbilledChargeId); - return UnbilledChargeDeleteResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * invoiceNowEstimate a unbilledCharge using immutable params (executes immediately) - returns raw - * Response. - */ - Response invoiceNowEstimateRaw(UnbilledChargeInvoiceNowEstimateParams params) throws Exception { - - return post( - "/unbilled_charges/invoice_now_estimate", params != null ? params.toFormData() : null); - } - - /** - * invoiceNowEstimate a unbilledCharge using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response invoiceNowEstimateRaw(String jsonPayload) throws Exception { - - return postJson("/unbilled_charges/invoice_now_estimate", jsonPayload); - } - - public UnbilledChargeInvoiceNowEstimateResponse invoiceNowEstimate( - UnbilledChargeInvoiceNowEstimateParams params) throws Exception { - Response response = invoiceNowEstimateRaw(params); - - return UnbilledChargeInvoiceNowEstimateResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * invoiceUnbilledCharges a unbilledCharge using immutable params (executes immediately) - returns - * raw Response. - */ - Response invoiceUnbilledChargesRaw(UnbilledChargeInvoiceUnbilledChargesParams params) - throws Exception { - - return post( - "/unbilled_charges/invoice_unbilled_charges", params != null ? params.toFormData() : null); - } - - /** - * invoiceUnbilledCharges a unbilledCharge using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response invoiceUnbilledChargesRaw(String jsonPayload) throws Exception { - - return postJson("/unbilled_charges/invoice_unbilled_charges", jsonPayload); - } - - public UnbilledChargeInvoiceUnbilledChargesResponse invoiceUnbilledCharges( - UnbilledChargeInvoiceUnbilledChargesParams params) throws Exception { - Response response = invoiceUnbilledChargesRaw(params); - - return UnbilledChargeInvoiceUnbilledChargesResponse.fromJson( - response.getBodyAsString(), response); - } - - /** list a unbilledCharge using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(UnbilledChargeListParams params) throws Exception { - - return get("/unbilled_charges", params != null ? params.toQueryParams() : null); - } - - /** list a unbilledCharge without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/unbilled_charges", null); - } - - /** list a unbilledCharge using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public UnbilledChargeListResponse list(UnbilledChargeListParams params) throws Exception { - Response response = listRaw(params); - - return UnbilledChargeListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public UnbilledChargeListResponse list() throws Exception { - Response response = listRaw(); - return UnbilledChargeListResponse.fromJson(response.getBodyAsString(), this, null, response); - } - - /** - * create a unbilledCharge using immutable params (executes immediately) - returns raw Response. - */ - Response createRaw(UnbilledChargeCreateParams params) throws Exception { - - return post("/unbilled_charges", params != null ? params.toFormData() : null); - } - - /** - * create a unbilledCharge using raw JSON payload (executes immediately) - returns raw Response. - */ - Response createRaw(String jsonPayload) throws Exception { - - return postJson("/unbilled_charges", jsonPayload); - } - - public UnbilledChargeCreateResponse create(UnbilledChargeCreateParams params) throws Exception { - Response response = createRaw(params); - - return UnbilledChargeCreateResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createUnbilledCharge a unbilledCharge using immutable params (executes immediately) - returns - * raw Response. - */ - Response createUnbilledChargeRaw(UnbilledChargeCreateUnbilledChargeParams params) - throws Exception { - - return post("/unbilled_charges/create", params != null ? params.toFormData() : null); - } - - /** - * createUnbilledCharge a unbilledCharge using raw JSON payload (executes immediately) - returns - * raw Response. - */ - Response createUnbilledChargeRaw(String jsonPayload) throws Exception { - - return postJson("/unbilled_charges/create", jsonPayload); - } - - public UnbilledChargeCreateUnbilledChargeResponse createUnbilledCharge( - UnbilledChargeCreateUnbilledChargeParams params) throws Exception { - Response response = createUnbilledChargeRaw(params); - - return UnbilledChargeCreateUnbilledChargeResponse.fromJson( - response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/UsageService.java b/src/main/java/com/chargebee/v4/core/services/UsageService.java deleted file mode 100644 index fbdbbcf7..00000000 --- a/src/main/java/com/chargebee/v4/core/services/UsageService.java +++ /dev/null @@ -1,188 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.usage.params.UsagePdfParams; - -import com.chargebee.v4.core.models.usage.params.UsageCreateParams; - -import com.chargebee.v4.core.models.usage.params.UsageDeleteParams; - -import com.chargebee.v4.core.models.usage.params.UsageListParams; - -import com.chargebee.v4.core.responses.usage.UsagePdfResponse; - -import com.chargebee.v4.core.responses.usage.UsageRetrieveResponse; - -import com.chargebee.v4.core.responses.usage.UsageCreateResponse; - -import com.chargebee.v4.core.responses.usage.UsageDeleteResponse; - -import com.chargebee.v4.core.responses.usage.UsageListResponse; - -public final class UsageService extends BaseService { - - private final ServiceConfig config; - - public UsageService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private UsageService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private UsageService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - UsageService with(RequestOptions newOptions) { - return new UsageService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public UsageService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** pdf a usage using immutable params (executes immediately) - returns raw Response. */ - Response pdfRaw(UsagePdfParams params) throws Exception { - - return post("/usages/pdf", params != null ? params.toFormData() : null); - } - - /** pdf a usage using raw JSON payload (executes immediately) - returns raw Response. */ - Response pdfRaw(String jsonPayload) throws Exception { - - return postJson("/usages/pdf", jsonPayload); - } - - public UsagePdfResponse pdf(UsagePdfParams params) throws Exception { - Response response = pdfRaw(params); - - return UsagePdfResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a usage (executes immediately) - returns raw Response. */ - Response retrieveRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/usages", "subscription-id", subscriptionId); - - return get(path, null); - } - - public UsageRetrieveResponse retrieve(String subscriptionId) throws Exception { - Response response = retrieveRaw(subscriptionId); - return UsageRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** create a usage (executes immediately) - returns raw Response. */ - Response createRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/usages", "subscription-id", subscriptionId); - - return post(path, null); - } - - /** create a usage using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(String subscriptionId, UsageCreateParams params) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/usages", "subscription-id", subscriptionId); - return post(path, params.toFormData()); - } - - /** create a usage using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String subscriptionId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/usages", "subscription-id", subscriptionId); - return postJson(path, jsonPayload); - } - - public UsageCreateResponse create(String subscriptionId, UsageCreateParams params) - throws Exception { - Response response = createRaw(subscriptionId, params); - return UsageCreateResponse.fromJson(response.getBodyAsString(), response); - } - - /** delete a usage (executes immediately) - returns raw Response. */ - Response deleteRaw(String subscriptionId) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/delete_usage", "subscription-id", subscriptionId); - - return post(path, null); - } - - /** delete a usage using immutable params (executes immediately) - returns raw Response. */ - Response deleteRaw(String subscriptionId, UsageDeleteParams params) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/delete_usage", "subscription-id", subscriptionId); - return post(path, params.toFormData()); - } - - /** delete a usage using raw JSON payload (executes immediately) - returns raw Response. */ - Response deleteRaw(String subscriptionId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/subscriptions/{subscription-id}/delete_usage", "subscription-id", subscriptionId); - return postJson(path, jsonPayload); - } - - public UsageDeleteResponse delete(String subscriptionId, UsageDeleteParams params) - throws Exception { - Response response = deleteRaw(subscriptionId, params); - return UsageDeleteResponse.fromJson(response.getBodyAsString(), response); - } - - /** list a usage using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(UsageListParams params) throws Exception { - - return get("/usages", params != null ? params.toQueryParams() : null); - } - - /** list a usage without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/usages", null); - } - - /** list a usage using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public UsageListResponse list(UsageListParams params) throws Exception { - Response response = listRaw(params); - - return UsageListResponse.fromJson(response.getBodyAsString(), this, params, response); - } - - public UsageListResponse list() throws Exception { - Response response = listRaw(); - return UsageListResponse.fromJson(response.getBodyAsString(), this, null, response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/VariantService.java b/src/main/java/com/chargebee/v4/core/services/VariantService.java deleted file mode 100644 index 6dc485e5..00000000 --- a/src/main/java/com/chargebee/v4/core/services/VariantService.java +++ /dev/null @@ -1,192 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.variant.params.VariantListProductVariantsParams; - -import com.chargebee.v4.core.models.variant.params.VariantCreateProductVariantParams; - -import com.chargebee.v4.core.models.variant.params.VariantUpdateParams; - -import com.chargebee.v4.core.responses.variant.VariantListProductVariantsResponse; - -import com.chargebee.v4.core.responses.variant.VariantCreateProductVariantResponse; - -import com.chargebee.v4.core.responses.variant.VariantRetrieveResponse; - -import com.chargebee.v4.core.responses.variant.VariantUpdateResponse; - -import com.chargebee.v4.core.responses.variant.VariantDeleteResponse; - -public final class VariantService extends BaseService { - - private final ServiceConfig config; - - public VariantService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private VariantService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private VariantService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - VariantService with(RequestOptions newOptions) { - return new VariantService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public VariantService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** - * listProductVariants a variant using immutable params (executes immediately) - returns raw - * Response. - */ - Response listProductVariantsRaw(String productId, VariantListProductVariantsParams params) - throws Exception { - String path = buildPathWithParams("/products/{product-id}/variants", "product-id", productId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** listProductVariants a variant without params (executes immediately) - returns raw Response. */ - Response listProductVariantsRaw(String productId) throws Exception { - String path = buildPathWithParams("/products/{product-id}/variants", "product-id", productId); - return get(path, null); - } - - /** - * listProductVariants a variant using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response listProductVariantsRaw(String productId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/products/{product-id}/variants", "product-id", productId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public VariantListProductVariantsResponse listProductVariants( - String productId, VariantListProductVariantsParams params) throws Exception { - Response response = listProductVariantsRaw(productId, params); - return VariantListProductVariantsResponse.fromJson( - response.getBodyAsString(), this, params, productId, response); - } - - public VariantListProductVariantsResponse listProductVariants(String productId) throws Exception { - Response response = listProductVariantsRaw(productId); - return VariantListProductVariantsResponse.fromJson( - response.getBodyAsString(), this, null, productId, response); - } - - /** createProductVariant a variant (executes immediately) - returns raw Response. */ - Response createProductVariantRaw(String productId) throws Exception { - String path = buildPathWithParams("/products/{product-id}/variants", "product-id", productId); - - return post(path, null); - } - - /** - * createProductVariant a variant using immutable params (executes immediately) - returns raw - * Response. - */ - Response createProductVariantRaw(String productId, VariantCreateProductVariantParams params) - throws Exception { - String path = buildPathWithParams("/products/{product-id}/variants", "product-id", productId); - return post(path, params.toFormData()); - } - - /** - * createProductVariant a variant using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response createProductVariantRaw(String productId, String jsonPayload) throws Exception { - String path = buildPathWithParams("/products/{product-id}/variants", "product-id", productId); - return postJson(path, jsonPayload); - } - - public VariantCreateProductVariantResponse createProductVariant( - String productId, VariantCreateProductVariantParams params) throws Exception { - Response response = createProductVariantRaw(productId, params); - return VariantCreateProductVariantResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a variant (executes immediately) - returns raw Response. */ - Response retrieveRaw(String productVariantId) throws Exception { - String path = - buildPathWithParams( - "/variants/{product-variant-id}", "product-variant-id", productVariantId); - - return get(path, null); - } - - public VariantRetrieveResponse retrieve(String productVariantId) throws Exception { - Response response = retrieveRaw(productVariantId); - return VariantRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** update a variant (executes immediately) - returns raw Response. */ - Response updateRaw(String productVariantId) throws Exception { - String path = - buildPathWithParams( - "/variants/{product-variant-id}", "product-variant-id", productVariantId); - - return post(path, null); - } - - /** update a variant using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String productVariantId, VariantUpdateParams params) throws Exception { - String path = - buildPathWithParams( - "/variants/{product-variant-id}", "product-variant-id", productVariantId); - return post(path, params.toFormData()); - } - - /** update a variant using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String productVariantId, String jsonPayload) throws Exception { - String path = - buildPathWithParams( - "/variants/{product-variant-id}", "product-variant-id", productVariantId); - return postJson(path, jsonPayload); - } - - public VariantUpdateResponse update(String productVariantId, VariantUpdateParams params) - throws Exception { - Response response = updateRaw(productVariantId, params); - return VariantUpdateResponse.fromJson(response.getBodyAsString(), response); - } - - /** delete a variant (executes immediately) - returns raw Response. */ - Response deleteRaw(String productVariantId) throws Exception { - String path = - buildPathWithParams( - "/variants/{product-variant-id}/delete", "product-variant-id", productVariantId); - - return post(path, null); - } - - public VariantDeleteResponse delete(String productVariantId) throws Exception { - Response response = deleteRaw(productVariantId); - return VariantDeleteResponse.fromJson(response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/core/services/VirtualBankAccountService.java b/src/main/java/com/chargebee/v4/core/services/VirtualBankAccountService.java deleted file mode 100644 index 3670039c..00000000 --- a/src/main/java/com/chargebee/v4/core/services/VirtualBankAccountService.java +++ /dev/null @@ -1,222 +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.core.services; - -import com.chargebee.v4.client.ChargebeeClient; -import com.chargebee.v4.client.request.RequestOptions; -import com.chargebee.v4.transport.Response; - -import com.chargebee.v4.core.models.virtualBankAccount.params.VirtualBankAccountListParams; - -import com.chargebee.v4.core.models.virtualBankAccount.params.VirtualBankAccountCreateParams; - -import com.chargebee.v4.core.models.virtualBankAccount.params.VirtualBankAccountCreateUsingPermanentTokenParams; - -import com.chargebee.v4.core.responses.virtualBankAccount.VirtualBankAccountDeleteLocalResponse; - -import com.chargebee.v4.core.responses.virtualBankAccount.VirtualBankAccountDeleteResponse; - -import com.chargebee.v4.core.responses.virtualBankAccount.VirtualBankAccountListResponse; - -import com.chargebee.v4.core.responses.virtualBankAccount.VirtualBankAccountCreateResponse; - -import com.chargebee.v4.core.responses.virtualBankAccount.VirtualBankAccountSyncFundResponse; - -import com.chargebee.v4.core.responses.virtualBankAccount.VirtualBankAccountRetrieveResponse; - -import com.chargebee.v4.core.responses.virtualBankAccount.VirtualBankAccountCreateUsingPermanentTokenResponse; - -public final class VirtualBankAccountService extends BaseService { - - private final ServiceConfig config; - - public VirtualBankAccountService(ChargebeeClient client) { - super(client); - this.config = ServiceConfig.defaultConfig(); - } - - private VirtualBankAccountService(ChargebeeClient client, RequestOptions options) { - super(client, options); - this.config = ServiceConfig.defaultConfig(); - } - - private VirtualBankAccountService( - ChargebeeClient client, RequestOptions options, ServiceConfig config) { - super(client, options); - this.config = config; - } - - @Override - VirtualBankAccountService with(RequestOptions newOptions) { - return new VirtualBankAccountService(client, newOptions, config); - } - - /** - * Apply per-request options for this service instance. Users can chain .withOptions or .options - * to set headers and other options. - */ - public VirtualBankAccountService withOptions(RequestOptions options) { - return with(options); - } - - // === Operations === - - /** deleteLocal a virtualBankAccount (executes immediately) - returns raw Response. */ - Response deleteLocalRaw(String virtualBankAccountId) throws Exception { - String path = - buildPathWithParams( - "/virtual_bank_accounts/{virtual-bank-account-id}/delete_local", - "virtual-bank-account-id", - virtualBankAccountId); - - return post(path, null); - } - - public VirtualBankAccountDeleteLocalResponse deleteLocal(String virtualBankAccountId) - throws Exception { - Response response = deleteLocalRaw(virtualBankAccountId); - return VirtualBankAccountDeleteLocalResponse.fromJson(response.getBodyAsString(), response); - } - - /** delete a virtualBankAccount (executes immediately) - returns raw Response. */ - Response deleteRaw(String virtualBankAccountId) throws Exception { - String path = - buildPathWithParams( - "/virtual_bank_accounts/{virtual-bank-account-id}/delete", - "virtual-bank-account-id", - virtualBankAccountId); - - return post(path, null); - } - - public VirtualBankAccountDeleteResponse delete(String virtualBankAccountId) throws Exception { - Response response = deleteRaw(virtualBankAccountId); - return VirtualBankAccountDeleteResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * list a virtualBankAccount using immutable params (executes immediately) - returns raw Response. - */ - Response listRaw(VirtualBankAccountListParams params) throws Exception { - - return get("/virtual_bank_accounts", params != null ? params.toQueryParams() : null); - } - - /** list a virtualBankAccount without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { - - return get("/virtual_bank_accounts", null); - } - - /** - * list a virtualBankAccount using raw JSON payload (executes immediately) - returns raw Response. - */ - Response listRaw(String jsonPayload) throws Exception { - - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public VirtualBankAccountListResponse list(VirtualBankAccountListParams params) throws Exception { - Response response = listRaw(params); - - return VirtualBankAccountListResponse.fromJson( - response.getBodyAsString(), this, params, response); - } - - public VirtualBankAccountListResponse list() throws Exception { - Response response = listRaw(); - return VirtualBankAccountListResponse.fromJson( - response.getBodyAsString(), this, null, response); - } - - /** - * create a virtualBankAccount using immutable params (executes immediately) - returns raw - * Response. - */ - Response createRaw(VirtualBankAccountCreateParams params) throws Exception { - - return post("/virtual_bank_accounts", params != null ? params.toFormData() : null); - } - - /** - * create a virtualBankAccount using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response createRaw(String jsonPayload) throws Exception { - - return postJson("/virtual_bank_accounts", jsonPayload); - } - - public VirtualBankAccountCreateResponse create(VirtualBankAccountCreateParams params) - throws Exception { - Response response = createRaw(params); - - return VirtualBankAccountCreateResponse.fromJson(response.getBodyAsString(), response); - } - - /** syncFund a virtualBankAccount (executes immediately) - returns raw Response. */ - Response syncFundRaw(String virtualBankAccountId) throws Exception { - String path = - buildPathWithParams( - "/virtual_bank_accounts/{virtual-bank-account-id}/sync_fund", - "virtual-bank-account-id", - virtualBankAccountId); - - return post(path, null); - } - - public VirtualBankAccountSyncFundResponse syncFund(String virtualBankAccountId) throws Exception { - Response response = syncFundRaw(virtualBankAccountId); - return VirtualBankAccountSyncFundResponse.fromJson(response.getBodyAsString(), response); - } - - /** retrieve a virtualBankAccount (executes immediately) - returns raw Response. */ - Response retrieveRaw(String virtualBankAccountId) throws Exception { - String path = - buildPathWithParams( - "/virtual_bank_accounts/{virtual-bank-account-id}", - "virtual-bank-account-id", - virtualBankAccountId); - - return get(path, null); - } - - public VirtualBankAccountRetrieveResponse retrieve(String virtualBankAccountId) throws Exception { - Response response = retrieveRaw(virtualBankAccountId); - return VirtualBankAccountRetrieveResponse.fromJson(response.getBodyAsString(), response); - } - - /** - * createUsingPermanentToken a virtualBankAccount using immutable params (executes immediately) - - * returns raw Response. - */ - Response createUsingPermanentTokenRaw(VirtualBankAccountCreateUsingPermanentTokenParams params) - throws Exception { - - return post( - "/virtual_bank_accounts/create_using_permanent_token", - params != null ? params.toFormData() : null); - } - - /** - * createUsingPermanentToken a virtualBankAccount using raw JSON payload (executes immediately) - - * returns raw Response. - */ - Response createUsingPermanentTokenRaw(String jsonPayload) throws Exception { - - return postJson("/virtual_bank_accounts/create_using_permanent_token", jsonPayload); - } - - public VirtualBankAccountCreateUsingPermanentTokenResponse createUsingPermanentToken( - VirtualBankAccountCreateUsingPermanentTokenParams params) throws Exception { - Response response = createUsingPermanentTokenRaw(params); - - return VirtualBankAccountCreateUsingPermanentTokenResponse.fromJson( - response.getBodyAsString(), response); - } -} diff --git a/src/main/java/com/chargebee/v4/exceptions/APIException.java b/src/main/java/com/chargebee/v4/exceptions/APIException.java index 43ee07da..7793ef97 100644 --- a/src/main/java/com/chargebee/v4/exceptions/APIException.java +++ b/src/main/java/com/chargebee/v4/exceptions/APIException.java @@ -1,96 +1,293 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + package com.chargebee.v4.exceptions; +import com.chargebee.v4.exceptions.codes.ApiErrorCode; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.transport.HttpException; +import com.chargebee.v4.transport.Request; import com.chargebee.v4.transport.Response; import java.util.ArrayList; import java.util.List; /** - * Base exception for Chargebee API errors. - * Contains parsed error information from the API response including type, message, and error parameters. + * Base exception for all Chargebee API errors. + * + *

Contains parsed error information from the API response with the following attributes: + * + *

    + *
  • message - Descriptive information about the error (for developer consumption) + *
  • type - Groups errors based on error handling routine (payment, invalid_request, + * operation_failed) + *
  • api_error_code - Specific code for handling specific errors + *
  • param - The parameter name if error is due to a specific parameter + *
  • error_cause_id - Chargebee-defined code for standardizing errors across gateway + * services + *
+ * + *

Use {@link #getErrorType()} for strongly-typed error type handling. + * + *

Example usage: + * + *

{@code
+ * try {
+ *     // API call
+ * } catch (InvalidRequestException e) {
+ *     ErrorType type = e.getErrorType();
+ *     ApiErrorCode errorCode = e.getApiErrorCode();
+ *     List invalidParams = e.getParams();
+ *     String causeId = e.getErrorCauseId();
+ *
+ *     // Type-safe error handling with enum
+ *     if (errorCode instanceof BadRequestApiErrorCode) {
+ *         BadRequestApiErrorCode code = (BadRequestApiErrorCode) errorCode;
+ *         if (code == BadRequestApiErrorCode.DUPLICATE_ENTRY) {
+ *             // Handle duplicate entry
+ *         }
+ *     }
+ * } catch (PaymentException e) {
+ *     // Check error_cause_id for gateway-specific error handling
+ *     if (e.getErrorCauseId() != null) {
+ *         System.out.println("Gateway error cause: " + e.getErrorCauseId());
+ *     }
+ * }
+ * }
*/ public class APIException extends HttpException { - private final String type; - private final String apiErrorCode; - private final String jsonResponse; - private final List params; - - public APIException(int statusCode, String type, String apiErrorCode, String message, - String jsonResponse, Response response) { - super(statusCode, message, response); - this.type = type; - this.apiErrorCode = apiErrorCode; - this.jsonResponse = jsonResponse; - this.params = extractParams(jsonResponse); - } - /** - * Get the error type from API response (e.g., "payment", "invalid_request", "operation_failed"). - */ - public String getType() { - return type; - } + /** + * The error type as a strongly-typed enum. Groups errors based on the error handling routine + * required. + */ + private final ErrorType errorType; - /** - * Get the API-specific error code (e.g., "card_declined", "invalid_parameter"). - */ - public String getApiErrorCode() { - return apiErrorCode; - } + /** + * The raw error type string as returned by the API. Values: "payment", "invalid_request", + * "operation_failed", or null. + */ + private final String type; - /** - * Get the full JSON response as string. - */ - public String getJsonResponse() { - return jsonResponse; - } + /** + * A more specific error code as a strongly-typed enum. Implements ApiErrorCode interface for + * type-safe error handling. + */ + private final ApiErrorCode apiErrorCode; - /** - * Get the parameter names that were invalid (for validation errors). - */ - public List getParams() { - return params; - } + /** + * The raw API error code string as returned by the API. Example: "duplicate_entry", + * "payment_processing_failed", "resource_not_found" + */ + private final String apiErrorCodeRaw; + + /** + * The parameter name(s) if the error is due to specific parameter(s). Empty list if error is not + * parameter-specific. + */ + private final List params; + + /** + * Chargebee-defined code for standardizing errors across different gateway services. Helps in + * consistent error handling across payment gateways. May be null if not applicable. + */ + private final String errorCauseId; + + /** The full JSON response for debugging or extracting additional details. */ + private final String jsonResponse; + + public APIException( + int statusCode, + String type, + ApiErrorCode apiErrorCode, + String message, + String jsonResponse, + Request request, + Response response) { + super(statusCode, message, request, response); + this.type = type; + this.errorType = ErrorType.fromString(type); + this.apiErrorCode = apiErrorCode; + this.apiErrorCodeRaw = apiErrorCode != null ? apiErrorCode.getValue() : null; + this.jsonResponse = jsonResponse; + this.params = extractParams(jsonResponse); + this.errorCauseId = extractErrorCauseId(jsonResponse); + } + + /** + * Get the error type as a strongly-typed enum. Use this for programmatic error handling with type + * safety. + * + *

The type groups errors based on the error handling routine required: + * + *

    + *
  • {@link ErrorType#PAYMENT} - Payment-related errors + *
  • {@link ErrorType#INVALID_REQUEST} - Validation and request errors + *
  • {@link ErrorType#OPERATION_FAILED} - Business logic errors + *
+ * + * @return the error type enum, or {@link ErrorType#_UNKNOWN} for unrecognized types + */ + public ErrorType getErrorType() { + return errorType; + } + + /** + * Get the raw error type string as returned by the API. Use this when you need the exact API + * value or for logging. + * + *

Possible values: "payment", "invalid_request", "operation_failed", or null + * + * @return the raw error type string, may be null + */ + public String getType() { + return type; + } + + /** + * Get the API error code as a strongly-typed enum. + * + *

The returned enum implements {@link ApiErrorCode} and can be cast to the specific enum type + * based on the HTTP status code: + * + *

{@code
+   * ApiErrorCode code = e.getApiErrorCode();
+   * if (code instanceof BadRequestApiErrorCode) {
+   *     BadRequestApiErrorCode badRequestCode = (BadRequestApiErrorCode) code;
+   *     if (badRequestCode == BadRequestApiErrorCode.DUPLICATE_ENTRY) {
+   *         // Handle duplicate
+   *     }
+   * }
+   * }
+ * + * @return the API error code as a typed enum + */ + public ApiErrorCode getApiErrorCode() { + return apiErrorCode; + } - /** - * Extract parameter names from error response. - */ - private List extractParams(String jsonResponse) { - List paramsList = new ArrayList<>(); - if (jsonResponse != null) { - // Try to extract single param string - String param = JsonUtil.getString(jsonResponse, "param"); - if (param != null) { - paramsList.add(param); - } else { - // Try to extract param array - String paramArray = JsonUtil.getArray(jsonResponse, "param"); - if (paramArray != null) { - paramsList.addAll(JsonUtil.parseArrayOfString(paramArray)); - } - } + /** + * Get the raw API error code string as returned by the API. Use this when you need the exact API + * value or for logging. + * + * @return the raw API error code string + */ + public String getApiErrorCodeRaw() { + return apiErrorCodeRaw; + } + + /** + * Get the parameter name(s) that caused the error. + * + *

This is provided when the error is due to a specific parameter. The parameter name matches + * the API documentation (cURL format). + * + *

Note: For URL path parameters like customer_id, if invalid, a resource_not_found error is + * thrown without the param attribute. + * + * @return list of parameter names that caused the error, empty if not parameter-specific + */ + public List getParams() { + return params; + } + + /** + * Get the first parameter name that caused the error. Convenience method when only one parameter + * is expected. + * + * @return the first parameter name, or null if no parameters + */ + public String getParam() { + return params.isEmpty() ? null : params.get(0); + } + + /** + * Get the error cause ID - a Chargebee-defined code for standardizing errors across different + * gateway services. + * + *

This helps in identifying and handling errors consistently across different payment + * gateways. + * + * @return the error cause ID, may be null if not applicable + */ + public String getErrorCauseId() { + return errorCauseId; + } + + /** + * Get the full JSON response as string. Useful for debugging or extracting additional error + * details not covered by the typed fields. + * + * @return the full JSON error response + */ + public String getJsonResponse() { + return jsonResponse; + } + + /** Extract parameter names from error response. */ + private List extractParams(String jsonResponse) { + List paramsList = new ArrayList<>(); + if (jsonResponse != null) { + String param = JsonUtil.getString(jsonResponse, "param"); + if (param != null) { + paramsList.add(param); + } else { + String paramArray = JsonUtil.getArray(jsonResponse, "param"); + if (paramArray != null) { + paramsList.addAll(JsonUtil.parseArrayOfString(paramArray)); } - return paramsList; + } } + return paramsList; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(getClass().getSimpleName()); - sb.append("{statusCode=").append(getStatusCode()); - if (type != null) { - sb.append(", type='").append(type).append("'"); - } - if (apiErrorCode != null) { - sb.append(", apiErrorCode='").append(apiErrorCode).append("'"); - } - sb.append(", message='").append(getMessage()).append("'"); - if (params != null && !params.isEmpty()) { - sb.append(", params=").append(params); - } - sb.append("}"); - return sb.toString(); + /** Extract error_cause_id from error response. */ + private String extractErrorCauseId(String jsonResponse) { + if (jsonResponse != null) { + return JsonUtil.getString(jsonResponse, "error_cause_id"); + } + return null; + } + + /** + * 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 + *
+ * + * @return true only for 429 or 5xx status codes + */ + @Override + public boolean isRetryable() { + int code = getStatusCode(); + // 429 Too Many Requests or 5xx server errors (except 501) + return code == 429 || (code >= 500 && code != 501); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append("{statusCode=").append(getStatusCode()); + if (type != null) { + sb.append(", type='").append(type).append("'"); + } + if (apiErrorCodeRaw != null) { + sb.append(", apiErrorCode='").append(apiErrorCodeRaw).append("'"); + } + sb.append(", message='").append(getMessage()).append("'"); + if (params != null && !params.isEmpty()) { + sb.append(", params=").append(params); + } + if (errorCauseId != null) { + sb.append(", errorCauseId='").append(errorCauseId).append("'"); } + sb.append("}"); + return sb.toString(); + } } diff --git a/src/main/java/com/chargebee/v4/exceptions/BatchAPIException.java b/src/main/java/com/chargebee/v4/exceptions/BatchAPIException.java index 7d4c6deb..5b0b0bbc 100644 --- a/src/main/java/com/chargebee/v4/exceptions/BatchAPIException.java +++ b/src/main/java/com/chargebee/v4/exceptions/BatchAPIException.java @@ -1,5 +1,7 @@ package com.chargebee.v4.exceptions; +import com.chargebee.v4.exceptions.codes.ApiErrorCode; +import com.chargebee.v4.transport.Request; import com.chargebee.v4.transport.Response; /** @@ -8,8 +10,8 @@ */ public class BatchAPIException extends APIException { - public BatchAPIException(int statusCode, String type, String apiErrorCode, String message, - String jsonResponse, Response response) { - super(statusCode, type, apiErrorCode, message, jsonResponse, response); + public BatchAPIException(int statusCode, String type, ApiErrorCode apiErrorCode, String message, + String jsonResponse, Request request, Response response) { + super(statusCode, type, apiErrorCode, message, jsonResponse, request, response); } } 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/ClientErrorException.java b/src/main/java/com/chargebee/v4/exceptions/ClientErrorException.java new file mode 100644 index 00000000..1d65707c --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/ClientErrorException.java @@ -0,0 +1,178 @@ +package com.chargebee.v4.exceptions; + +import com.chargebee.v4.transport.Request; +import com.chargebee.v4.transport.Response; + +/** + * Exception for 4xx HTTP status codes (client errors). + * + *

Client errors indicate issues with the request itself: + *

    + *
  • 400 Bad Request - Invalid request format or parameters
  • + *
  • 401 Unauthorized - Missing or invalid authentication
  • + *
  • 403 Forbidden - Valid auth but insufficient permissions
  • + *
  • 404 Not Found - Resource doesn't exist
  • + *
  • 409 Conflict - Resource state conflict
  • + *
  • 422 Unprocessable Entity - Validation errors
  • + *
  • 429 Too Many Requests - Rate limiting (retryable)
  • + *
+ * + *

Convenience methods for checking specific error types: + *

{@code
+ * try {
+ *     client.customers().retrieve("invalid_id");
+ * } catch (ClientErrorException e) {
+ *     if (e.isNotFound()) {
+ *         // Customer doesn't exist
+ *     } else if (e.isUnauthorized()) {
+ *         // Check API key
+ *     } else if (e.isTooManyRequests()) {
+ *         // Back off and retry
+ *         Thread.sleep(e.getRetryAfterMs());
+ *     }
+ * }
+ * }
+ */ +public class ClientErrorException extends HttpException { + + /** HTTP status code for rate limiting. */ + public static final int TOO_MANY_REQUESTS = 429; + + /** + * Creates a ClientErrorException. + * + * @param statusCode the HTTP status code (4xx) + * @param message descriptive error message + * @param request the original HTTP request + * @param response the HTTP response + */ + public ClientErrorException(int statusCode, String message, Request request, Response response) { + super(statusCode, message, request, response); + } + + /** + * Creates a ClientErrorException with cause. + * + * @param statusCode the HTTP status code (4xx) + * @param message descriptive error message + * @param request the original HTTP request + * @param response the HTTP response + * @param cause the underlying cause + */ + public ClientErrorException(int statusCode, String message, Request request, Response response, Throwable cause) { + super(statusCode, message, request, response, cause); + } + + /** + * Client errors are generally not retryable, except for 429 Too Many Requests. + * + * @return true only if status code is 429 (rate limiting) + */ + @Override + public boolean isRetryable() { + return getStatusCode() == TOO_MANY_REQUESTS; + } + + /** + * Check if this is a 400 Bad Request error. + * + * @return true if status code is 400 + */ + public boolean isBadRequest() { + return getStatusCode() == 400; + } + + /** + * Check if this is a 401 Unauthorized error. + * Usually indicates missing or invalid API key. + * + * @return true if status code is 401 + */ + public boolean isUnauthorized() { + return getStatusCode() == 401; + } + + /** + * Check if this is a 403 Forbidden error. + * Usually indicates valid auth but insufficient permissions. + * + * @return true if status code is 403 + */ + public boolean isForbidden() { + return getStatusCode() == 403; + } + + /** + * Check if this is a 404 Not Found error. + * + * @return true if status code is 404 + */ + public boolean isNotFound() { + return getStatusCode() == 404; + } + + /** + * Check if this is a 405 Method Not Allowed error. + * + * @return true if status code is 405 + */ + public boolean isMethodNotAllowed() { + return getStatusCode() == 405; + } + + /** + * Check if this is a 409 Conflict error. + * + * @return true if status code is 409 + */ + public boolean isConflict() { + return getStatusCode() == 409; + } + + /** + * Check if this is a 422 Unprocessable Entity error. + * Usually indicates validation errors. + * + * @return true if status code is 422 + */ + public boolean isUnprocessableEntity() { + return getStatusCode() == 422; + } + + /** + * Check if this is a 429 Too Many Requests error. + * This error is retryable after waiting for the rate limit to reset. + * + * @return true if status code is 429 + */ + public boolean isTooManyRequests() { + return getStatusCode() == TOO_MANY_REQUESTS; + } + + /** + * Get the retry-after delay in milliseconds from response headers. + * This is typically provided with 429 responses. + * + * @return the retry delay in milliseconds, or -1 if not available + */ + public long getRetryAfterMs() { + Response response = getResponse(); + if (response == null) { + return -1; + } + + String retryAfter = response.getHeader("Retry-After"); + if (retryAfter == null) { + return -1; + } + + try { + // Retry-After can be seconds + int seconds = Integer.parseInt(retryAfter.trim()); + return seconds * 1000L; + } catch (NumberFormatException e) { + // Could be HTTP-date format, return -1 for simplicity + return -1; + } + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/ConfigurationException.java b/src/main/java/com/chargebee/v4/exceptions/ConfigurationException.java new file mode 100644 index 00000000..4a75e378 --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/ConfigurationException.java @@ -0,0 +1,79 @@ +package com.chargebee.v4.exceptions; + +/** + * Exception thrown when there's an issue with SDK configuration. + * + *

This extends {@link ChargebeeException} to allow fluent builder usage + * without requiring try-catch blocks during client setup. + * + *

Common causes: + *

    + *
  • Missing required configuration (e.g., API key)
  • + *
  • Invalid configuration values
  • + *
  • Malformed URLs
  • + *
+ * + *

Example: + *

{@code
+ * try {
+ *     ChargebeeClient client = ChargebeeClient.builder()
+ *         .siteName("my-site")
+ *         // Missing apiKey!
+ *         .build();
+ * } catch (ConfigurationException e) {
+ *     System.err.println("Configuration error: " + e.getMessage());
+ * }
+ * }
+ * + *

Note: This exception is NOT retryable as it indicates a programming error + * that must be fixed in the code. + */ +public class ConfigurationException extends ChargebeeException { + + /** + * Creates a ConfigurationException with a message. + * + * @param message descriptive error message + */ + public ConfigurationException(String message) { + super(message); + } + + /** + * Creates a ConfigurationException with a message and cause. + * + * @param message descriptive error message + * @param cause the underlying cause + */ + public ConfigurationException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Configuration errors are never retryable as they indicate + * programming errors that must be fixed in the code. + * + * @return false always + */ + public boolean isRetryable() { + return false; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append("{message='").append(getMessage()).append("'"); + + Throwable cause = getCause(); + if (cause != null) { + sb.append(", cause=").append(cause.getClass().getSimpleName()); + if (cause.getMessage() != null) { + sb.append("('").append(cause.getMessage()).append("')"); + } + } + + sb.append("}"); + return sb.toString(); + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/ErrorType.java b/src/main/java/com/chargebee/v4/exceptions/ErrorType.java new file mode 100644 index 00000000..3bcac638 --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/ErrorType.java @@ -0,0 +1,71 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.exceptions; + +/** Types of errors returned by the Chargebee API */ +public enum ErrorType { + + /** API error code: invalid_request */ + INVALID_REQUEST("invalid_request"), + + /** API error code: untyped */ + UNTYPED("untyped"), + + /** API error code: payment */ + PAYMENT("payment"), + + /** API error code: operation_failed */ + OPERATION_FAILED("operation_failed"), + + /** + * Represents an unknown or unrecognized error code. This allows forward compatibility when new + * error codes are added. + */ + _UNKNOWN(null); + + private final String value; + + ErrorType(String value) { + this.value = value; + } + + /** + * Get the string value of this error code as returned by the API. + * + * @return the API string value, or null for _UNKNOWN + */ + public String getValue() { + return value; + } + + /** + * Convert an API string value to the corresponding enum constant. Returns _UNKNOWN for + * unrecognized values to ensure forward compatibility. + * + * @param value the API string value + * @return the corresponding enum constant, or _UNKNOWN if not recognized + */ + public static ErrorType fromString(String value) { + if (value == null) { + return _UNKNOWN; + } + for (ErrorType enumValue : ErrorType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + + /** + * Check if this error code is a known (non-unknown) value. + * + * @return true if this is a recognized error code + */ + public boolean isKnown() { + return this != _UNKNOWN; + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/HttpException.java b/src/main/java/com/chargebee/v4/exceptions/HttpException.java new file mode 100644 index 00000000..7db1e459 --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/HttpException.java @@ -0,0 +1,152 @@ +package com.chargebee.v4.exceptions; + +import com.chargebee.v4.transport.Request; +import com.chargebee.v4.transport.Response; + +/** + * Base exception for HTTP status code errors (4xx, 5xx). + * + *

This exception provides access to the full HTTP context: + *

    + *
  • {@link #getStatusCode()} - The HTTP status code
  • + *
  • {@link #getRequest()} - The original HTTP request
  • + *
  • {@link #getResponse()} - The HTTP response
  • + *
  • {@link #getResponseBody()} - The response body as string
  • + *
  • {@link #getUrl()} - Convenience method for request URL
  • + *
  • {@link #getHttpMethod()} - Convenience method for HTTP method
  • + *
+ * + *

Exception hierarchy: + *

+ * HttpException
+ * ├── ClientErrorException (4xx errors)
+ * ├── ServerErrorException (5xx errors)
+ * └── APIException         (Chargebee API errors with structured response)
+ * 
+ * + *

Example usage: + *

{@code
+ * try {
+ *     client.customers().retrieve("invalid_id");
+ * } catch (HttpException e) {
+ *     System.err.println("HTTP " + e.getStatusCode() + ": " + e.getMessage());
+ *     System.err.println("URL: " + e.getUrl());
+ *     System.err.println("Response: " + e.getResponseBody());
+ *     
+ *     if (e.isRetryable()) {
+ *         // Retry logic
+ *     }
+ * }
+ * }
+ */ +public class HttpException extends TransportException { + + private final int statusCode; + private final Response response; + + /** + * Creates an HttpException with full context. + * + * @param statusCode the HTTP status code + * @param message descriptive error message + * @param request the original HTTP request + * @param response the HTTP response + */ + public HttpException(int statusCode, String message, Request request, Response response) { + super(message, request); + this.statusCode = statusCode; + this.response = response; + } + + /** + * Creates an HttpException with full context and cause. + * + * @param statusCode the HTTP status code + * @param message descriptive error message + * @param request the original HTTP request + * @param response the HTTP response + * @param cause the underlying cause + */ + public HttpException(int statusCode, String message, Request request, Response response, Throwable cause) { + super(message, cause, request); + this.statusCode = statusCode; + this.response = response; + } + + /** + * Get the HTTP status code. + * + * @return the HTTP status code (e.g., 400, 404, 500) + */ + public int getStatusCode() { + return statusCode; + } + + /** + * Get the full HTTP response. + * + * @return the response object + */ + public Response getResponse() { + return response; + } + + /** + * Get the response body as string for error details. + * + * @return the response body, or null if response is not available + */ + public String getResponseBody() { + return response != null ? response.getBodyAsString() : null; + } + + /** + * Check if this HTTP error is retryable. + * + *

By default, HTTP errors are not retryable. Subclasses override this: + *

    + *
  • {@link ServerErrorException} - true for most 5xx (except 501)
  • + *
  • {@link ClientErrorException} - true only for 429 (rate limiting)
  • + *
+ * + * @return false by default + */ + @Override + public boolean isRetryable() { + return false; + } + + /** + * Check if this is a client error (4xx status code). + * + * @return true if status code is 4xx + */ + public boolean isClientError() { + return statusCode >= 400 && statusCode < 500; + } + + /** + * Check if this is a server error (5xx status code). + * + * @return true if status code is 5xx + */ + public boolean isServerError() { + return statusCode >= 500 && statusCode < 600; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append("{statusCode=").append(statusCode); + sb.append(", message='").append(getMessage()).append("'"); + + if (getRequest() != null) { + sb.append(", method='").append(getHttpMethod()).append("'"); + sb.append(", url='").append(getUrl()).append("'"); + } + + sb.append("}"); + return sb.toString(); + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/InvalidRequestException.java b/src/main/java/com/chargebee/v4/exceptions/InvalidRequestException.java index 6ff69d00..b9e14b51 100644 --- a/src/main/java/com/chargebee/v4/exceptions/InvalidRequestException.java +++ b/src/main/java/com/chargebee/v4/exceptions/InvalidRequestException.java @@ -1,15 +1,51 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + package com.chargebee.v4.exceptions; +import com.chargebee.v4.exceptions.codes.ApiErrorCode; +import com.chargebee.v4.transport.Request; import com.chargebee.v4.transport.Response; /** - * Exception thrown for invalid request errors (type: "invalid_request"). - * Examples include invalid parameters, missing required fields, validation errors, etc. + * Exception thrown for invalid request errors including validation failures. + * + *

This exception is thrown when the API returns an error with type: "invalid_request" + * + *

Example usage: + * + *

{@code
+ * try {
+ *     // API call
+ * } catch (InvalidRequestException e) {
+ *     System.out.println("Error code: " + e.getApiErrorCodeRaw());
+ *     System.out.println("Message: " + e.getMessage());
+ *     System.out.println("Params: " + e.getParams());
+ *     System.out.println("Request URL: " + e.getRequest().getUrl());
+ * }
+ * }
*/ public class InvalidRequestException extends APIException { - public InvalidRequestException(int statusCode, String type, String apiErrorCode, String message, - String jsonResponse, Response response) { - super(statusCode, type, apiErrorCode, message, jsonResponse, response); - } + public InvalidRequestException( + int statusCode, + String type, + ApiErrorCode apiErrorCode, + String message, + String jsonResponse, + Request request, + Response response) { + super(statusCode, type, apiErrorCode, message, jsonResponse, request, response); + } + + /** + * Get the error type value that this exception represents. + * + * @return the error type string "invalid_request" + */ + public static String getExpectedErrorType() { + return "invalid_request"; + } } diff --git a/src/main/java/com/chargebee/v4/exceptions/NetworkException.java b/src/main/java/com/chargebee/v4/exceptions/NetworkException.java new file mode 100644 index 00000000..3c868d24 --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/NetworkException.java @@ -0,0 +1,65 @@ +package com.chargebee.v4.exceptions; + +import com.chargebee.v4.transport.Request; + +/** + * Exception for network connectivity issues such as DNS failures, connection refused, + * or general I/O errors during HTTP communication. + * + *

This exception inherits request context from {@link TransportException}: + *

    + *
  • {@link #getUrl()} - The URL that was being accessed
  • + *
  • {@link #getHttpMethod()} - The HTTP method (GET, POST, etc.)
  • + *
  • {@link #getRequest()} - The full request object if needed
  • + *
+ * + *

Example usage: + *

{@code
+ * try {
+ *     client.customers().list();
+ * } catch (NetworkException e) {
+ *     System.err.println("Failed to connect to: " + e.getUrl());
+ *     System.err.println("Method: " + e.getHttpMethod());
+ *     System.err.println("Cause: " + e.getCause().getMessage());
+ *     
+ *     if (e.isRetryable()) {
+ *         // Implement retry logic
+ *     }
+ * }
+ * }
+ */ +public class NetworkException extends TransportException { + + /** + * Creates a NetworkException with request context. + * + * @param message descriptive error message + * @param cause the underlying cause (e.g., IOException) + * @param request the HTTP request that failed + */ + public NetworkException(String message, Throwable cause, Request request) { + super(message, cause, request); + } + + /** + * Creates a NetworkException without request context. + * Prefer {@link #NetworkException(String, Throwable, Request)} when request is available. + * + * @param message descriptive error message + * @param cause the underlying cause + */ + public NetworkException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Network errors are generally retryable as they may be transient + * (e.g., temporary DNS issues, network hiccups). + * + * @return true, indicating this error is typically retryable + */ + @Override + public boolean isRetryable() { + return true; + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/OperationFailedException.java b/src/main/java/com/chargebee/v4/exceptions/OperationFailedException.java index f219ccda..e8c5f249 100644 --- a/src/main/java/com/chargebee/v4/exceptions/OperationFailedException.java +++ b/src/main/java/com/chargebee/v4/exceptions/OperationFailedException.java @@ -1,15 +1,51 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + package com.chargebee.v4.exceptions; +import com.chargebee.v4.exceptions.codes.ApiErrorCode; +import com.chargebee.v4.transport.Request; import com.chargebee.v4.transport.Response; /** - * Exception thrown when an operation fails (type: "operation_failed"). - * Examples include business logic violations, state conflicts, etc. + * Exception thrown when an operation fails due to business logic constraints. + * + *

This exception is thrown when the API returns an error with type: "operation_failed" + * + *

Example usage: + * + *

{@code
+ * try {
+ *     // API call
+ * } catch (OperationFailedException e) {
+ *     System.out.println("Error code: " + e.getApiErrorCodeRaw());
+ *     System.out.println("Message: " + e.getMessage());
+ *     System.out.println("Params: " + e.getParams());
+ *     System.out.println("Request URL: " + e.getRequest().getUrl());
+ * }
+ * }
*/ public class OperationFailedException extends APIException { - public OperationFailedException(int statusCode, String type, String apiErrorCode, String message, - String jsonResponse, Response response) { - super(statusCode, type, apiErrorCode, message, jsonResponse, response); - } + public OperationFailedException( + int statusCode, + String type, + ApiErrorCode apiErrorCode, + String message, + String jsonResponse, + Request request, + Response response) { + super(statusCode, type, apiErrorCode, message, jsonResponse, request, response); + } + + /** + * Get the error type value that this exception represents. + * + * @return the error type string "operation_failed" + */ + public static String getExpectedErrorType() { + return "operation_failed"; + } } diff --git a/src/main/java/com/chargebee/v4/exceptions/PaymentException.java b/src/main/java/com/chargebee/v4/exceptions/PaymentException.java index 8256a7ed..76cda1fc 100644 --- a/src/main/java/com/chargebee/v4/exceptions/PaymentException.java +++ b/src/main/java/com/chargebee/v4/exceptions/PaymentException.java @@ -1,15 +1,51 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + package com.chargebee.v4.exceptions; +import com.chargebee.v4.exceptions.codes.ApiErrorCode; +import com.chargebee.v4.transport.Request; import com.chargebee.v4.transport.Response; /** - * Exception thrown for payment-related errors (type: "payment"). - * Examples include card declined, insufficient funds, etc. + * Exception thrown for payment-related errors. + * + *

This exception is thrown when the API returns an error with type: "payment" + * + *

Example usage: + * + *

{@code
+ * try {
+ *     // API call
+ * } catch (PaymentException e) {
+ *     System.out.println("Error code: " + e.getApiErrorCodeRaw());
+ *     System.out.println("Message: " + e.getMessage());
+ *     System.out.println("Params: " + e.getParams());
+ *     System.out.println("Request URL: " + e.getRequest().getUrl());
+ * }
+ * }
*/ public class PaymentException extends APIException { - public PaymentException(int statusCode, String type, String apiErrorCode, String message, - String jsonResponse, Response response) { - super(statusCode, type, apiErrorCode, message, jsonResponse, response); - } + public PaymentException( + int statusCode, + String type, + ApiErrorCode apiErrorCode, + String message, + String jsonResponse, + Request request, + Response response) { + super(statusCode, type, apiErrorCode, message, jsonResponse, request, response); + } + + /** + * Get the error type value that this exception represents. + * + * @return the error type string "payment" + */ + public static String getExpectedErrorType() { + return "payment"; + } } diff --git a/src/main/java/com/chargebee/v4/exceptions/ServerErrorException.java b/src/main/java/com/chargebee/v4/exceptions/ServerErrorException.java new file mode 100644 index 00000000..a2626c3c --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/ServerErrorException.java @@ -0,0 +1,122 @@ +package com.chargebee.v4.exceptions; + +import com.chargebee.v4.transport.Request; +import com.chargebee.v4.transport.Response; + +/** + * Exception for 5xx HTTP status codes (server errors). + * + *

Server errors indicate issues on the server side that may be temporary: + *

    + *
  • 500 Internal Server Error - Unexpected server error
  • + *
  • 501 Not Implemented - Feature not supported (not retryable)
  • + *
  • 502 Bad Gateway - Gateway/proxy error
  • + *
  • 503 Service Unavailable - Server overloaded or maintenance
  • + *
  • 504 Gateway Timeout - Gateway/proxy timeout
  • + *
+ * + *

Most 5xx errors are retryable (except 501): + *

{@code
+ * try {
+ *     client.customers().list();
+ * } catch (ServerErrorException e) {
+ *     if (e.isRetryable()) {
+ *         // Exponential backoff retry
+ *     } else if (e.isNotImplemented()) {
+ *         // Feature not available
+ *     }
+ * }
+ * }
+ */ +public class ServerErrorException extends HttpException { + + /** + * Creates a ServerErrorException. + * + * @param statusCode the HTTP status code (5xx) + * @param message descriptive error message + * @param request the original HTTP request + * @param response the HTTP response + */ + public ServerErrorException(int statusCode, String message, Request request, Response response) { + super(statusCode, message, request, response); + } + + /** + * Creates a ServerErrorException with cause. + * + * @param statusCode the HTTP status code (5xx) + * @param message descriptive error message + * @param request the original HTTP request + * @param response the HTTP response + * @param cause the underlying cause + */ + public ServerErrorException(int statusCode, String message, Request request, Response response, Throwable cause) { + super(statusCode, message, request, response, cause); + } + + /** + * Check if this is a 500 Internal Server Error. + * + * @return true if status code is 500 + */ + public boolean isInternalServerError() { + return getStatusCode() == 500; + } + + /** + * Check if this is a 501 Not Implemented error. + * This error is NOT retryable as the feature is not supported. + * + * @return true if status code is 501 + */ + public boolean isNotImplemented() { + return getStatusCode() == 501; + } + + /** + * Check if this is a 502 Bad Gateway error. + * + * @return true if status code is 502 + */ + public boolean isBadGateway() { + return getStatusCode() == 502; + } + + /** + * Check if this is a 503 Service Unavailable error. + * + * @return true if status code is 503 + */ + public boolean isServiceUnavailable() { + return getStatusCode() == 503; + } + + /** + * Check if this is a 504 Gateway Timeout error. + * + * @return true if status code is 504 + */ + public boolean isGatewayTimeout() { + return getStatusCode() == 504; + } + + /** + * Server errors are generally retryable, except 501 (Not Implemented). + * + *

Retryable server errors (temporary issues): + *

    + *
  • 500 Internal Server Error
  • + *
  • 502 Bad Gateway
  • + *
  • 503 Service Unavailable
  • + *
  • 504 Gateway Timeout
  • + *
+ * + * @return true for all 5xx except 501 + */ + @Override + public boolean isRetryable() { + int code = getStatusCode(); + return code >= 500 && code != 501; + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/TimeoutException.java b/src/main/java/com/chargebee/v4/exceptions/TimeoutException.java new file mode 100644 index 00000000..308e2b1a --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/TimeoutException.java @@ -0,0 +1,132 @@ +package com.chargebee.v4.exceptions; + +import com.chargebee.v4.transport.Request; + +/** + * Exception for connection or read timeouts during HTTP communication. + * + *

This exception inherits request context from {@link TransportException} and adds: + *

    + *
  • {@link #getTimeoutType()} - Whether it was a "connect" or "read" timeout
  • + *
  • {@link #isConnectTimeout()} / {@link #isReadTimeout()} - Convenient type checks
  • + *
+ * + *

Inherited from base class: + *

    + *
  • {@link #getUrl()} - The URL that was being accessed
  • + *
  • {@link #getHttpMethod()} - The HTTP method (GET, POST, etc.)
  • + *
  • {@link #getRequest()} - The full request object if needed
  • + *
+ * + *

Example usage: + *

{@code
+ * try {
+ *     client.customers().list();
+ * } catch (TimeoutException e) {
+ *     System.err.println("Timeout type: " + e.getTimeoutType());
+ *     System.err.println("Failed URL: " + e.getUrl());
+ *     
+ *     if (e.isConnectTimeout()) {
+ *         // Server might be down or unreachable
+ *     } else if (e.isReadTimeout()) {
+ *         // Server is slow to respond, consider increasing timeout
+ *     }
+ *     
+ *     if (e.isRetryable()) {
+ *         // Implement retry logic
+ *     }
+ * }
+ * }
+ */ +public class TimeoutException extends TransportException { + + /** Timeout type for connection timeouts. */ + public static final String CONNECT = "connect"; + + /** Timeout type for read timeouts. */ + public static final String READ = "read"; + + private final String timeoutType; + + /** + * Creates a TimeoutException with request context. + * + * @param timeoutType the type of timeout ("connect" or "read") + * @param message descriptive error message + * @param cause the underlying cause + * @param request the HTTP request that timed out + */ + public TimeoutException(String timeoutType, String message, Throwable cause, Request request) { + super(message, cause, request); + this.timeoutType = timeoutType; + } + + /** + * Creates a TimeoutException without request context. + * Prefer {@link #TimeoutException(String, String, Throwable, Request)} when request is available. + * + * @param timeoutType the type of timeout ("connect" or "read") + * @param message descriptive error message + * @param cause the underlying cause + */ + public TimeoutException(String timeoutType, String message, Throwable cause) { + super(message, cause); + this.timeoutType = timeoutType; + } + + /** + * Get the type of timeout that occurred. + * + * @return "connect" for connection timeouts, "read" for read timeouts + */ + public String getTimeoutType() { + return timeoutType; + } + + /** + * Check if this was a connection timeout. + * Connection timeouts occur when the server cannot be reached within the connect timeout period. + * + * @return true if this is a connection timeout + */ + public boolean isConnectTimeout() { + return CONNECT.equals(timeoutType); + } + + /** + * Check if this was a read timeout. + * Read timeouts occur when the server doesn't respond within the read timeout period. + * + * @return true if this is a read timeout + */ + public boolean isReadTimeout() { + return READ.equals(timeoutType); + } + + /** + * Timeouts are generally retryable as they may be transient + * (e.g., temporary server load, network congestion). + * + * @return true, indicating this error is typically retryable + */ + @Override + public boolean isRetryable() { + return true; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append("{timeoutType='").append(timeoutType).append("'"); + sb.append(", message='").append(getMessage()).append("'"); + + if (getRequest() != null) { + sb.append(", method='").append(getHttpMethod()).append("'"); + sb.append(", url='").append(getUrl()).append("'"); + } + + sb.append("}"); + return sb.toString(); + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/TransportException.java b/src/main/java/com/chargebee/v4/exceptions/TransportException.java new file mode 100644 index 00000000..644e05be --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/TransportException.java @@ -0,0 +1,147 @@ +package com.chargebee.v4.exceptions; + +import com.chargebee.v4.transport.Request; + +/** + * Base exception for all transport-layer failures in the Chargebee SDK. + * + *

Transport exceptions represent infrastructure-level issues that occur before + * or during HTTP communication, such as network errors, timeouts, and HTTP status + * code errors. + * + *

This base class provides common functionality for all transport exceptions: + *

    + *
  • {@link #getRequest()} - Access to the HTTP request that failed
  • + *
  • {@link #getUrl()} - Convenience method for the request URL
  • + *
  • {@link #getHttpMethod()} - Convenience method for the HTTP method
  • + *
  • {@link #isRetryable()} - Whether this error is typically retryable
  • + *
+ * + *

Exception hierarchy: + *

+ * 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 ChargebeeException { + + private final Request request; + + /** + * Creates a TransportException with a message only. + * + * @param message descriptive error message + */ + public TransportException(String message) { + super(message); + this.request = null; + } + + /** + * Creates a TransportException with a message and cause. + * + * @param message descriptive error message + * @param cause the underlying cause + */ + public TransportException(String message, Throwable cause) { + super(message, cause); + this.request = null; + } + + /** + * Creates a TransportException with full context. + * + * @param message descriptive error message + * @param cause the underlying cause (may be null) + * @param request the HTTP request that failed (may be null) + */ + public TransportException(String message, Throwable cause, Request request) { + super(message, cause); + this.request = request; + } + + /** + * Creates a TransportException with message and request context. + * + * @param message descriptive error message + * @param request the HTTP request that failed + */ + public TransportException(String message, Request request) { + super(message); + this.request = request; + } + + /** + * Get the HTTP request that failed. + * Useful for detailed debugging and logging. + * + * @return the request object, or null if not available + */ + public Request getRequest() { + return request; + } + + /** + * Get the URL that was being accessed when the error occurred. + * + * @return the request URL, or null if request is not available + */ + public String getUrl() { + return request != null ? request.getUrl() : null; + } + + /** + * Get the HTTP method used for the failed request. + * + * @return the HTTP method (GET, POST, etc.), or null if request is not available + */ + public String getHttpMethod() { + return request != null ? request.getMethod() : null; + } + + /** + * Check if this error is typically retryable. + * + *

Subclasses override this to provide appropriate retry guidance: + *

    + *
  • {@link NetworkException} - returns true (transient network issues)
  • + *
  • {@link TimeoutException} - returns true (temporary overload)
  • + *
  • {@link ServerErrorException} - returns true for most 5xx (except 501)
  • + *
  • {@link ClientErrorException} - returns true only for 429 (rate limiting)
  • + *
+ * + * @return true if retrying the request might succeed, false otherwise + */ + public boolean isRetryable() { + return false; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append("{message='").append(getMessage()).append("'"); + + if (request != null) { + sb.append(", method='").append(request.getMethod()).append("'"); + sb.append(", url='").append(request.getUrl()).append("'"); + } + + Throwable cause = getCause(); + if (cause != null) { + sb.append(", cause=").append(cause.getClass().getSimpleName()); + if (cause.getMessage() != null) { + sb.append("('").append(cause.getMessage()).append("')"); + } + } + + sb.append("}"); + return sb.toString(); + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/UbbBatchIngestionInvalidRequestException.java b/src/main/java/com/chargebee/v4/exceptions/UbbBatchIngestionInvalidRequestException.java index 90cfedb3..ab940d8e 100644 --- a/src/main/java/com/chargebee/v4/exceptions/UbbBatchIngestionInvalidRequestException.java +++ b/src/main/java/com/chargebee/v4/exceptions/UbbBatchIngestionInvalidRequestException.java @@ -1,5 +1,7 @@ package com.chargebee.v4.exceptions; +import com.chargebee.v4.exceptions.codes.ApiErrorCode; +import com.chargebee.v4.transport.Request; import com.chargebee.v4.transport.Response; /** @@ -8,8 +10,8 @@ */ public class UbbBatchIngestionInvalidRequestException extends APIException { - public UbbBatchIngestionInvalidRequestException(int statusCode, String type, String apiErrorCode, - String message, String jsonResponse, Response response) { - super(statusCode, type, apiErrorCode, message, jsonResponse, response); + public UbbBatchIngestionInvalidRequestException(int statusCode, String type, ApiErrorCode apiErrorCode, + String message, String jsonResponse, Request request, Response response) { + super(statusCode, type, apiErrorCode, message, jsonResponse, request, response); } } diff --git a/src/main/java/com/chargebee/v4/exceptions/codes/ApiErrorCode.java b/src/main/java/com/chargebee/v4/exceptions/codes/ApiErrorCode.java new file mode 100644 index 00000000..7469f64d --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/codes/ApiErrorCode.java @@ -0,0 +1,46 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.exceptions.codes; + +/** + * Common interface for all API error code enums. + * + *

Each HTTP status code has its own enum implementing this interface: + * + *

    + *
  • {@link BadRequestApiErrorCode} - 400 errors + *
  • {@link UnauthorizedApiErrorCode} - 401 errors + *
  • {@link ForbiddenApiErrorCode} - 403 errors + *
  • {@link NotFoundApiErrorCode} - 404 errors + *
  • etc. + *
+ * + *

Use this interface when you need to handle error codes generically, or use the specific enum + * class for type-safe handling of status-specific codes. + */ +public interface ApiErrorCode { + + /** + * Get the string value of this error code as returned by the API. + * + * @return the API string value, or null for unknown codes + */ + String getValue(); + + /** + * Check if this error code is a known (non-unknown) value. + * + * @return true if this is a recognized error code + */ + boolean isKnown(); + + /** + * Get the enum name (e.g., "DUPLICATE_ENTRY", "PAYMENT_PROCESSING_FAILED"). + * + * @return the enum constant name + */ + String name(); +} diff --git a/src/main/java/com/chargebee/v4/exceptions/codes/BadRequestApiErrorCode.java b/src/main/java/com/chargebee/v4/exceptions/codes/BadRequestApiErrorCode.java new file mode 100644 index 00000000..104e06df --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/codes/BadRequestApiErrorCode.java @@ -0,0 +1,97 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.exceptions.codes; + +/** API error codes for HTTP 400 responses */ +public enum BadRequestApiErrorCode implements ApiErrorCode { + + /** API error code: payment_intent_invalid_amount */ + PAYMENT_INTENT_INVALID_AMOUNT("payment_intent_invalid_amount"), + + /** API error code: configuration_incompatible */ + CONFIGURATION_INCOMPATIBLE("configuration_incompatible"), + + /** API error code: payment_intent_invalid */ + PAYMENT_INTENT_INVALID("payment_intent_invalid"), + + /** API error code: invalid_request */ + INVALID_REQUEST("invalid_request"), + + /** API error code: payment_method_verification_failed */ + PAYMENT_METHOD_VERIFICATION_FAILED("payment_method_verification_failed"), + + /** API error code: payment_processing_failed */ + PAYMENT_PROCESSING_FAILED("payment_processing_failed"), + + /** API error code: resource_limit_exhausted */ + RESOURCE_LIMIT_EXHAUSTED("resource_limit_exhausted"), + + /** API error code: duplicate_entry */ + DUPLICATE_ENTRY("duplicate_entry"), + + /** API error code: param_wrong_value */ + PARAM_WRONG_VALUE("param_wrong_value"), + + /** API error code: payment_method_not_present */ + PAYMENT_METHOD_NOT_PRESENT("payment_method_not_present"), + + /** API error code: resource_limit_exceeded */ + RESOURCE_LIMIT_EXCEEDED("resource_limit_exceeded"), + + /** API error code: payment_gateway_currency_incompatible */ + PAYMENT_GATEWAY_CURRENCY_INCOMPATIBLE("payment_gateway_currency_incompatible"), + + /** + * Represents an unknown or unrecognized error code. This allows forward compatibility when new + * error codes are added. + */ + _UNKNOWN(null); + + private final String value; + + BadRequestApiErrorCode(String value) { + this.value = value; + } + + /** + * Get the string value of this error code as returned by the API. + * + * @return the API string value, or null for _UNKNOWN + */ + @Override + public String getValue() { + return value; + } + + /** + * Convert an API string value to the corresponding enum constant. Returns _UNKNOWN for + * unrecognized values to ensure forward compatibility. + * + * @param value the API string value + * @return the corresponding enum constant, or _UNKNOWN if not recognized + */ + public static BadRequestApiErrorCode fromString(String value) { + if (value == null) { + return _UNKNOWN; + } + for (BadRequestApiErrorCode enumValue : BadRequestApiErrorCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + + /** + * Check if this error code is a known (non-unknown) value. + * + * @return true if this is a recognized error code + */ + @Override + public boolean isKnown() { + return this != _UNKNOWN; + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/codes/ConflictApiErrorCode.java b/src/main/java/com/chargebee/v4/exceptions/codes/ConflictApiErrorCode.java new file mode 100644 index 00000000..cd8504ed --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/codes/ConflictApiErrorCode.java @@ -0,0 +1,64 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.exceptions.codes; + +/** API error codes for HTTP 409 responses */ +public enum ConflictApiErrorCode implements ApiErrorCode { + + /** API error code: invalid_state_for_request */ + INVALID_STATE_FOR_REQUEST("invalid_state_for_request"), + + /** + * Represents an unknown or unrecognized error code. This allows forward compatibility when new + * error codes are added. + */ + _UNKNOWN(null); + + private final String value; + + ConflictApiErrorCode(String value) { + this.value = value; + } + + /** + * Get the string value of this error code as returned by the API. + * + * @return the API string value, or null for _UNKNOWN + */ + @Override + public String getValue() { + return value; + } + + /** + * Convert an API string value to the corresponding enum constant. Returns _UNKNOWN for + * unrecognized values to ensure forward compatibility. + * + * @param value the API string value + * @return the corresponding enum constant, or _UNKNOWN if not recognized + */ + public static ConflictApiErrorCode fromString(String value) { + if (value == null) { + return _UNKNOWN; + } + for (ConflictApiErrorCode enumValue : ConflictApiErrorCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + + /** + * Check if this error code is a known (non-unknown) value. + * + * @return true if this is a recognized error code + */ + @Override + public boolean isKnown() { + return this != _UNKNOWN; + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/codes/ForbiddenApiErrorCode.java b/src/main/java/com/chargebee/v4/exceptions/codes/ForbiddenApiErrorCode.java new file mode 100644 index 00000000..9d9d425c --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/codes/ForbiddenApiErrorCode.java @@ -0,0 +1,67 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.exceptions.codes; + +/** API error codes for HTTP 403 responses */ +public enum ForbiddenApiErrorCode implements ApiErrorCode { + + /** API error code: request_blocked */ + REQUEST_BLOCKED("request_blocked"), + + /** API error code: api_authorization_failed */ + API_AUTHORIZATION_FAILED("api_authorization_failed"), + + /** + * Represents an unknown or unrecognized error code. This allows forward compatibility when new + * error codes are added. + */ + _UNKNOWN(null); + + private final String value; + + ForbiddenApiErrorCode(String value) { + this.value = value; + } + + /** + * Get the string value of this error code as returned by the API. + * + * @return the API string value, or null for _UNKNOWN + */ + @Override + public String getValue() { + return value; + } + + /** + * Convert an API string value to the corresponding enum constant. Returns _UNKNOWN for + * unrecognized values to ensure forward compatibility. + * + * @param value the API string value + * @return the corresponding enum constant, or _UNKNOWN if not recognized + */ + public static ForbiddenApiErrorCode fromString(String value) { + if (value == null) { + return _UNKNOWN; + } + for (ForbiddenApiErrorCode enumValue : ForbiddenApiErrorCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + + /** + * Check if this error code is a known (non-unknown) value. + * + * @return true if this is a recognized error code + */ + @Override + public boolean isKnown() { + return this != _UNKNOWN; + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/codes/InternalServerErrorApiErrorCode.java b/src/main/java/com/chargebee/v4/exceptions/codes/InternalServerErrorApiErrorCode.java new file mode 100644 index 00000000..d15bc01c --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/codes/InternalServerErrorApiErrorCode.java @@ -0,0 +1,64 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.exceptions.codes; + +/** API error codes for HTTP 500 responses */ +public enum InternalServerErrorApiErrorCode implements ApiErrorCode { + + /** API error code: internal_error */ + INTERNAL_ERROR("internal_error"), + + /** + * Represents an unknown or unrecognized error code. This allows forward compatibility when new + * error codes are added. + */ + _UNKNOWN(null); + + private final String value; + + InternalServerErrorApiErrorCode(String value) { + this.value = value; + } + + /** + * Get the string value of this error code as returned by the API. + * + * @return the API string value, or null for _UNKNOWN + */ + @Override + public String getValue() { + return value; + } + + /** + * Convert an API string value to the corresponding enum constant. Returns _UNKNOWN for + * unrecognized values to ensure forward compatibility. + * + * @param value the API string value + * @return the corresponding enum constant, or _UNKNOWN if not recognized + */ + public static InternalServerErrorApiErrorCode fromString(String value) { + if (value == null) { + return _UNKNOWN; + } + for (InternalServerErrorApiErrorCode enumValue : InternalServerErrorApiErrorCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + + /** + * Check if this error code is a known (non-unknown) value. + * + * @return true if this is a recognized error code + */ + @Override + public boolean isKnown() { + return this != _UNKNOWN; + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/codes/MethodNotAllowedApiErrorCode.java b/src/main/java/com/chargebee/v4/exceptions/codes/MethodNotAllowedApiErrorCode.java new file mode 100644 index 00000000..17ead7f9 --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/codes/MethodNotAllowedApiErrorCode.java @@ -0,0 +1,64 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.exceptions.codes; + +/** API error codes for HTTP 405 responses */ +public enum MethodNotAllowedApiErrorCode implements ApiErrorCode { + + /** API error code: http_method_not_supported */ + HTTP_METHOD_NOT_SUPPORTED("http_method_not_supported"), + + /** + * Represents an unknown or unrecognized error code. This allows forward compatibility when new + * error codes are added. + */ + _UNKNOWN(null); + + private final String value; + + MethodNotAllowedApiErrorCode(String value) { + this.value = value; + } + + /** + * Get the string value of this error code as returned by the API. + * + * @return the API string value, or null for _UNKNOWN + */ + @Override + public String getValue() { + return value; + } + + /** + * Convert an API string value to the corresponding enum constant. Returns _UNKNOWN for + * unrecognized values to ensure forward compatibility. + * + * @param value the API string value + * @return the corresponding enum constant, or _UNKNOWN if not recognized + */ + public static MethodNotAllowedApiErrorCode fromString(String value) { + if (value == null) { + return _UNKNOWN; + } + for (MethodNotAllowedApiErrorCode enumValue : MethodNotAllowedApiErrorCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + + /** + * Check if this error code is a known (non-unknown) value. + * + * @return true if this is a recognized error code + */ + @Override + public boolean isKnown() { + return this != _UNKNOWN; + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/codes/NotFoundApiErrorCode.java b/src/main/java/com/chargebee/v4/exceptions/codes/NotFoundApiErrorCode.java new file mode 100644 index 00000000..1818b277 --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/codes/NotFoundApiErrorCode.java @@ -0,0 +1,67 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.exceptions.codes; + +/** API error codes for HTTP 404 responses */ +public enum NotFoundApiErrorCode implements ApiErrorCode { + + /** API error code: resource_not_found */ + RESOURCE_NOT_FOUND("resource_not_found"), + + /** API error code: site_not_found */ + SITE_NOT_FOUND("site_not_found"), + + /** + * Represents an unknown or unrecognized error code. This allows forward compatibility when new + * error codes are added. + */ + _UNKNOWN(null); + + private final String value; + + NotFoundApiErrorCode(String value) { + this.value = value; + } + + /** + * Get the string value of this error code as returned by the API. + * + * @return the API string value, or null for _UNKNOWN + */ + @Override + public String getValue() { + return value; + } + + /** + * Convert an API string value to the corresponding enum constant. Returns _UNKNOWN for + * unrecognized values to ensure forward compatibility. + * + * @param value the API string value + * @return the corresponding enum constant, or _UNKNOWN if not recognized + */ + public static NotFoundApiErrorCode fromString(String value) { + if (value == null) { + return _UNKNOWN; + } + for (NotFoundApiErrorCode enumValue : NotFoundApiErrorCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + + /** + * Check if this error code is a known (non-unknown) value. + * + * @return true if this is a recognized error code + */ + @Override + public boolean isKnown() { + return this != _UNKNOWN; + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/codes/ServiceUnavailableApiErrorCode.java b/src/main/java/com/chargebee/v4/exceptions/codes/ServiceUnavailableApiErrorCode.java new file mode 100644 index 00000000..6e1b4121 --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/codes/ServiceUnavailableApiErrorCode.java @@ -0,0 +1,73 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.exceptions.codes; + +/** API error codes for HTTP 503 responses */ +public enum ServiceUnavailableApiErrorCode implements ApiErrorCode { + + /** API error code: db_connection_failure */ + DB_CONNECTION_FAILURE("db_connection_failure"), + + /** API error code: site_read_only_mode */ + SITE_READ_ONLY_MODE("site_read_only_mode"), + + /** API error code: site_not_ready */ + SITE_NOT_READY("site_not_ready"), + + /** API error code: internal_temporary_error */ + INTERNAL_TEMPORARY_ERROR("internal_temporary_error"), + + /** + * Represents an unknown or unrecognized error code. This allows forward compatibility when new + * error codes are added. + */ + _UNKNOWN(null); + + private final String value; + + ServiceUnavailableApiErrorCode(String value) { + this.value = value; + } + + /** + * Get the string value of this error code as returned by the API. + * + * @return the API string value, or null for _UNKNOWN + */ + @Override + public String getValue() { + return value; + } + + /** + * Convert an API string value to the corresponding enum constant. Returns _UNKNOWN for + * unrecognized values to ensure forward compatibility. + * + * @param value the API string value + * @return the corresponding enum constant, or _UNKNOWN if not recognized + */ + public static ServiceUnavailableApiErrorCode fromString(String value) { + if (value == null) { + return _UNKNOWN; + } + for (ServiceUnavailableApiErrorCode enumValue : ServiceUnavailableApiErrorCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + + /** + * Check if this error code is a known (non-unknown) value. + * + * @return true if this is a recognized error code + */ + @Override + public boolean isKnown() { + return this != _UNKNOWN; + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/codes/TooManyRequestsApiErrorCode.java b/src/main/java/com/chargebee/v4/exceptions/codes/TooManyRequestsApiErrorCode.java new file mode 100644 index 00000000..27c6bfef --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/codes/TooManyRequestsApiErrorCode.java @@ -0,0 +1,70 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.exceptions.codes; + +/** API error codes for HTTP 429 responses */ +public enum TooManyRequestsApiErrorCode implements ApiErrorCode { + + /** API error code: third_party_api_request_limit_exceeded */ + THIRD_PARTY_API_REQUEST_LIMIT_EXCEEDED("third_party_api_request_limit_exceeded"), + + /** API error code: api_request_limit_exceeded */ + API_REQUEST_LIMIT_EXCEEDED("api_request_limit_exceeded"), + + /** API error code: lock_timeout */ + LOCK_TIMEOUT("lock_timeout"), + + /** + * Represents an unknown or unrecognized error code. This allows forward compatibility when new + * error codes are added. + */ + _UNKNOWN(null); + + private final String value; + + TooManyRequestsApiErrorCode(String value) { + this.value = value; + } + + /** + * Get the string value of this error code as returned by the API. + * + * @return the API string value, or null for _UNKNOWN + */ + @Override + public String getValue() { + return value; + } + + /** + * Convert an API string value to the corresponding enum constant. Returns _UNKNOWN for + * unrecognized values to ensure forward compatibility. + * + * @param value the API string value + * @return the corresponding enum constant, or _UNKNOWN if not recognized + */ + public static TooManyRequestsApiErrorCode fromString(String value) { + if (value == null) { + return _UNKNOWN; + } + for (TooManyRequestsApiErrorCode enumValue : TooManyRequestsApiErrorCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + + /** + * Check if this error code is a known (non-unknown) value. + * + * @return true if this is a recognized error code + */ + @Override + public boolean isKnown() { + return this != _UNKNOWN; + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/codes/UnauthorizedApiErrorCode.java b/src/main/java/com/chargebee/v4/exceptions/codes/UnauthorizedApiErrorCode.java new file mode 100644 index 00000000..192e5ddc --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/codes/UnauthorizedApiErrorCode.java @@ -0,0 +1,67 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.exceptions.codes; + +/** API error codes for HTTP 401 responses */ +public enum UnauthorizedApiErrorCode implements ApiErrorCode { + + /** API error code: api_authentication_failed */ + API_AUTHENTICATION_FAILED("api_authentication_failed"), + + /** API error code: basic_authentication_failed */ + BASIC_AUTHENTICATION_FAILED("basic_authentication_failed"), + + /** + * Represents an unknown or unrecognized error code. This allows forward compatibility when new + * error codes are added. + */ + _UNKNOWN(null); + + private final String value; + + UnauthorizedApiErrorCode(String value) { + this.value = value; + } + + /** + * Get the string value of this error code as returned by the API. + * + * @return the API string value, or null for _UNKNOWN + */ + @Override + public String getValue() { + return value; + } + + /** + * Convert an API string value to the corresponding enum constant. Returns _UNKNOWN for + * unrecognized values to ensure forward compatibility. + * + * @param value the API string value + * @return the corresponding enum constant, or _UNKNOWN if not recognized + */ + public static UnauthorizedApiErrorCode fromString(String value) { + if (value == null) { + return _UNKNOWN; + } + for (UnauthorizedApiErrorCode enumValue : UnauthorizedApiErrorCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + + /** + * Check if this error code is a known (non-unknown) value. + * + * @return true if this is a recognized error code + */ + @Override + public boolean isKnown() { + return this != _UNKNOWN; + } +} diff --git a/src/main/java/com/chargebee/v4/exceptions/codes/UnprocessableEntityApiErrorCode.java b/src/main/java/com/chargebee/v4/exceptions/codes/UnprocessableEntityApiErrorCode.java new file mode 100644 index 00000000..6ebf73e2 --- /dev/null +++ b/src/main/java/com/chargebee/v4/exceptions/codes/UnprocessableEntityApiErrorCode.java @@ -0,0 +1,64 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.exceptions.codes; + +/** API error codes for HTTP 422 responses */ +public enum UnprocessableEntityApiErrorCode implements ApiErrorCode { + + /** API error code: unable_to_process_request */ + UNABLE_TO_PROCESS_REQUEST("unable_to_process_request"), + + /** + * Represents an unknown or unrecognized error code. This allows forward compatibility when new + * error codes are added. + */ + _UNKNOWN(null); + + private final String value; + + UnprocessableEntityApiErrorCode(String value) { + this.value = value; + } + + /** + * Get the string value of this error code as returned by the API. + * + * @return the API string value, or null for _UNKNOWN + */ + @Override + public String getValue() { + return value; + } + + /** + * Convert an API string value to the corresponding enum constant. Returns _UNKNOWN for + * unrecognized values to ensure forward compatibility. + * + * @param value the API string value + * @return the corresponding enum constant, or _UNKNOWN if not recognized + */ + public static UnprocessableEntityApiErrorCode fromString(String value) { + if (value == null) { + return _UNKNOWN; + } + for (UnprocessableEntityApiErrorCode enumValue : UnprocessableEntityApiErrorCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + + /** + * Check if this error code is a known (non-unknown) value. + * + * @return true if this is a recognized error code + */ + @Override + public boolean isKnown() { + return this != _UNKNOWN; + } +} diff --git a/src/main/java/com/chargebee/v4/internal/JsonUtil.java b/src/main/java/com/chargebee/v4/internal/JsonUtil.java index f8b46a98..d1e54b7c 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,15 +426,11 @@ 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; } /** @@ -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/core/responses/BaseResponse.java b/src/main/java/com/chargebee/v4/models/BaseResponse.java similarity index 75% rename from src/main/java/com/chargebee/v4/core/responses/BaseResponse.java rename to src/main/java/com/chargebee/v4/models/BaseResponse.java index b99d74b3..9d70190e 100644 --- a/src/main/java/com/chargebee/v4/core/responses/BaseResponse.java +++ b/src/main/java/com/chargebee/v4/models/BaseResponse.java @@ -1,4 +1,4 @@ -package com.chargebee.v4.core.responses; +package com.chargebee.v4.models; import com.chargebee.v4.transport.Response; import java.util.List; @@ -6,8 +6,8 @@ import java.util.Collections; /** - * Base class for all response objects. - * Provides common functionality for accessing HTTP response metadata. + * Base class for all response objects. Provides common functionality for accessing HTTP response + * metadata. */ public abstract class BaseResponse { private final Response httpResponse; @@ -16,30 +16,22 @@ protected BaseResponse(Response httpResponse) { this.httpResponse = httpResponse; } - /** - * Get the raw response payload as JSON string. - */ + /** Get the raw response payload as JSON string. */ public String responsePayload() { return httpResponse != null ? httpResponse.getBodyAsString() : null; } - /** - * Get the HTTP status code. - */ + /** Get the HTTP status code. */ public int httpStatus() { return httpResponse != null ? httpResponse.getStatusCode() : 0; } - /** - * Get response headers. - */ + /** Get response headers. */ public Map> headers() { return httpResponse != null ? httpResponse.getHeaders() : Collections.emptyMap(); } - /** - * Get a specific header value. - */ + /** Get a specific header value. */ public List header(String name) { if (httpResponse == null) return null; return httpResponse.getHeaders().entrySet().stream() @@ -50,8 +42,8 @@ public List header(String name) { } /** - * Check if this response is an idempotency replay. - * Returns true if the chargebee-idempotency-replayed header is set to "true". + * Check if this response is an idempotency replay. Returns true if the + * chargebee-idempotency-replayed header is set to "true". * * @return true if this is a replayed idempotent request, false otherwise */ diff --git a/src/main/java/com/chargebee/v4/core/models/additionalBillingLogiq/params/AdditionalBillingLogiqRetrieveParams.java b/src/main/java/com/chargebee/v4/models/additionalBillingLogiq/params/AdditionalBillingLogiqRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/additionalBillingLogiq/params/AdditionalBillingLogiqRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/additionalBillingLogiq/params/AdditionalBillingLogiqRetrieveParams.java index 27280cda..5c268182 100644 --- a/src/main/java/com/chargebee/v4/core/models/additionalBillingLogiq/params/AdditionalBillingLogiqRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/additionalBillingLogiq/params/AdditionalBillingLogiqRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.additionalBillingLogiq.params; +package com.chargebee.v4.models.additionalBillingLogiq.params; import com.chargebee.v4.internal.Recommended; 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/core/models/addon/Addon.java b/src/main/java/com/chargebee/v4/models/addon/Addon.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/addon/Addon.java rename to src/main/java/com/chargebee/v4/models/addon/Addon.java index 83340cb2..e60f7f04 100644 --- a/src/main/java/com/chargebee/v4/core/models/addon/Addon.java +++ b/src/main/java/com/chargebee/v4/models/addon/Addon.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.addon; +package com.chargebee.v4.models.addon; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; @@ -58,7 +58,7 @@ public class Addon { private List tiers; private List taxProvidersFields; - private java.util.Map customFields = new java.util.HashMap<>(); + private java.util.Map customFields = new java.util.HashMap<>(); public String getId() { return id; @@ -243,7 +243,7 @@ public List getTaxProvidersFields() { * * @return map containing all custom fields */ - public java.util.Map getCustomFields() { + public java.util.Map getCustomFields() { return customFields; } @@ -253,7 +253,7 @@ public java.util.Map getCustomFields() { * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") * @return the value of the custom field, or null if not present */ - public Object getCustomField(String fieldName) { + public String getCustomField(String fieldName) { return customFields.get(fieldName); } @@ -547,7 +547,7 @@ public static ProrationType fromString(String value) { public static Addon fromJson(String json) { Addon obj = new Addon(); - // Parse JSON to extract all keys + // Parse JSON to extract all keys for custom field extraction java.util.Set knownFields = new java.util.HashSet<>(); knownFields.add("id"); @@ -752,9 +752,9 @@ public static Addon fromJson(String json) { * @param knownFields set of known field names * @return map of custom fields */ - private static java.util.Map extractCustomFields( + private static java.util.Map extractCustomFields( String json, java.util.Set knownFields) { - java.util.Map customFields = new java.util.HashMap<>(); + java.util.Map customFields = new java.util.HashMap<>(); try { // Parse the entire JSON as a map java.util.Map allFields = JsonUtil.parseJsonObjectToMap(json); @@ -763,7 +763,8 @@ private static java.util.Map extractCustomFields( String key = entry.getKey(); // Include fields that start with "cf_" and are not in knownFields if (key != null && key.startsWith("cf_") && !knownFields.contains(key)) { - customFields.put(key, entry.getValue()); + customFields.put( + key, entry.getValue() != null ? String.valueOf(entry.getValue()) : null); } } } diff --git a/src/main/java/com/chargebee/v4/models/addon/params/AddonCopyParams.java b/src/main/java/com/chargebee/v4/models/addon/params/AddonCopyParams.java new file mode 100644 index 00000000..f3b1c9a5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/addon/params/AddonCopyParams.java @@ -0,0 +1,120 @@ +/* + * 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 AddonCopyParams { + + private final String fromSite; + + private final String idAtFromSite; + + private final String id; + + private final Boolean forSiteMerging; + + private AddonCopyParams(AddonCopyBuilder builder) { + + this.fromSite = builder.fromSite; + + this.idAtFromSite = builder.idAtFromSite; + + this.id = builder.id; + + this.forSiteMerging = builder.forSiteMerging; + } + + public String getFromSite() { + return fromSite; + } + + public String getIdAtFromSite() { + return idAtFromSite; + } + + public String getId() { + return id; + } + + public Boolean getForSiteMerging() { + return forSiteMerging; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.fromSite != null) { + + formData.put("from_site", this.fromSite); + } + + if (this.idAtFromSite != null) { + + formData.put("id_at_from_site", this.idAtFromSite); + } + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.forSiteMerging != null) { + + formData.put("for_site_merging", this.forSiteMerging); + } + + return formData; + } + + /** Create a new builder for AddonCopyParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonCopyBuilder builder() { + return new AddonCopyBuilder(); + } + + public static final class AddonCopyBuilder { + + private String fromSite; + + private String idAtFromSite; + + private String id; + + private Boolean forSiteMerging; + + private AddonCopyBuilder() {} + + public AddonCopyBuilder fromSite(String value) { + this.fromSite = value; + return this; + } + + public AddonCopyBuilder idAtFromSite(String value) { + this.idAtFromSite = value; + return this; + } + + public AddonCopyBuilder id(String value) { + this.id = value; + return this; + } + + public AddonCopyBuilder forSiteMerging(Boolean value) { + this.forSiteMerging = value; + return this; + } + + public AddonCopyParams build() { + return new AddonCopyParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/addon/params/AddonCreateParams.java b/src/main/java/com/chargebee/v4/models/addon/params/AddonCreateParams.java new file mode 100644 index 00000000..7846400b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/addon/params/AddonCreateParams.java @@ -0,0 +1,1406 @@ +/* + * 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 com.chargebee.v4.internal.JsonUtil; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class AddonCreateParams { + + private final String id; + + private final String name; + + private final String invoiceName; + + private final String description; + + private final ChargeType chargeType; + + private final Long price; + + private final String currencyCode; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final PricingModel pricingModel; + + private final Type type; + + private final String unit; + + private final Boolean enabledInPortal; + + private final Boolean taxable; + + private final String taxProfileId; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final String taxCode; + + private final String hsnCode; + + private final String taxjarProductCode; + + private final String invoiceNotes; + + private final java.util.Map metaData; + + private final String sku; + + private final String accountingCode; + + private final String accountingCategory1; + + private final String accountingCategory2; + + private final String accountingCategory3; + + private final String accountingCategory4; + + private final Boolean isShippable; + + private final Integer shippingFrequencyPeriod; + + private final ShippingFrequencyPeriodUnit shippingFrequencyPeriodUnit; + + private final Boolean includedInMrr; + + private final Boolean showDescriptionInInvoices; + + private final Boolean showDescriptionInQuotes; + + private final String priceInDecimal; + + private final ProrationType prorationType; + + private final Status status; + + private final List tiers; + + private final List taxProvidersFields; + + private final Map customFields; + + private AddonCreateParams(AddonCreateBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.invoiceName = builder.invoiceName; + + this.description = builder.description; + + this.chargeType = builder.chargeType; + + this.price = builder.price; + + this.currencyCode = builder.currencyCode; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.pricingModel = builder.pricingModel; + + this.type = builder.type; + + this.unit = builder.unit; + + this.enabledInPortal = builder.enabledInPortal; + + this.taxable = builder.taxable; + + this.taxProfileId = builder.taxProfileId; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.taxCode = builder.taxCode; + + this.hsnCode = builder.hsnCode; + + this.taxjarProductCode = builder.taxjarProductCode; + + this.invoiceNotes = builder.invoiceNotes; + + this.metaData = builder.metaData; + + this.sku = builder.sku; + + this.accountingCode = builder.accountingCode; + + this.accountingCategory1 = builder.accountingCategory1; + + this.accountingCategory2 = builder.accountingCategory2; + + this.accountingCategory3 = builder.accountingCategory3; + + this.accountingCategory4 = builder.accountingCategory4; + + this.isShippable = builder.isShippable; + + this.shippingFrequencyPeriod = builder.shippingFrequencyPeriod; + + this.shippingFrequencyPeriodUnit = builder.shippingFrequencyPeriodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.showDescriptionInInvoices = builder.showDescriptionInInvoices; + + this.showDescriptionInQuotes = builder.showDescriptionInQuotes; + + this.priceInDecimal = builder.priceInDecimal; + + this.prorationType = builder.prorationType; + + this.status = builder.status; + + this.tiers = builder.tiers; + + this.taxProvidersFields = builder.taxProvidersFields; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getInvoiceName() { + return invoiceName; + } + + public String getDescription() { + return description; + } + + public ChargeType getChargeType() { + return chargeType; + } + + public Long getPrice() { + return price; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public PricingModel getPricingModel() { + return pricingModel; + } + + public Type getType() { + return type; + } + + public String getUnit() { + return unit; + } + + public Boolean getEnabledInPortal() { + return enabledInPortal; + } + + public Boolean getTaxable() { + return taxable; + } + + public String getTaxProfileId() { + return taxProfileId; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public String getTaxCode() { + return taxCode; + } + + public String getHsnCode() { + return hsnCode; + } + + public String getTaxjarProductCode() { + return taxjarProductCode; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public java.util.Map getMetaData() { + return metaData; + } + + public String getSku() { + return sku; + } + + public String getAccountingCode() { + return accountingCode; + } + + public String getAccountingCategory1() { + return accountingCategory1; + } + + public String getAccountingCategory2() { + return accountingCategory2; + } + + public String getAccountingCategory3() { + return accountingCategory3; + } + + public String getAccountingCategory4() { + return accountingCategory4; + } + + public Boolean getIsShippable() { + return isShippable; + } + + public Integer getShippingFrequencyPeriod() { + return shippingFrequencyPeriod; + } + + public ShippingFrequencyPeriodUnit getShippingFrequencyPeriodUnit() { + return shippingFrequencyPeriodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public Boolean getShowDescriptionInInvoices() { + return showDescriptionInInvoices; + } + + public Boolean getShowDescriptionInQuotes() { + return showDescriptionInQuotes; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public ProrationType getProrationType() { + return prorationType; + } + + public Status getStatus() { + return status; + } + + public List getTiers() { + return tiers; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.invoiceName != null) { + + formData.put("invoice_name", this.invoiceName); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.chargeType != null) { + + formData.put("charge_type", this.chargeType); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.pricingModel != null) { + + formData.put("pricing_model", this.pricingModel); + } + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.unit != null) { + + formData.put("unit", this.unit); + } + + if (this.enabledInPortal != null) { + + formData.put("enabled_in_portal", this.enabledInPortal); + } + + if (this.taxable != null) { + + formData.put("taxable", this.taxable); + } + + if (this.taxProfileId != null) { + + formData.put("tax_profile_id", this.taxProfileId); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.taxCode != null) { + + formData.put("tax_code", this.taxCode); + } + + if (this.hsnCode != null) { + + formData.put("hsn_code", this.hsnCode); + } + + if (this.taxjarProductCode != null) { + + formData.put("taxjar_product_code", this.taxjarProductCode); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + if (this.sku != null) { + + formData.put("sku", this.sku); + } + + if (this.accountingCode != null) { + + formData.put("accounting_code", this.accountingCode); + } + + if (this.accountingCategory1 != null) { + + formData.put("accounting_category1", this.accountingCategory1); + } + + if (this.accountingCategory2 != null) { + + formData.put("accounting_category2", this.accountingCategory2); + } + + if (this.accountingCategory3 != null) { + + formData.put("accounting_category3", this.accountingCategory3); + } + + if (this.accountingCategory4 != null) { + + formData.put("accounting_category4", this.accountingCategory4); + } + + if (this.isShippable != null) { + + formData.put("is_shippable", this.isShippable); + } + + if (this.shippingFrequencyPeriod != null) { + + formData.put("shipping_frequency_period", this.shippingFrequencyPeriod); + } + + if (this.shippingFrequencyPeriodUnit != null) { + + formData.put("shipping_frequency_period_unit", this.shippingFrequencyPeriodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.showDescriptionInInvoices != null) { + + formData.put("show_description_in_invoices", this.showDescriptionInInvoices); + } + + if (this.showDescriptionInQuotes != null) { + + formData.put("show_description_in_quotes", this.showDescriptionInQuotes); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.prorationType != null) { + + formData.put("proration_type", this.prorationType); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.tiers != null) { + + // List of objects + for (int i = 0; i < this.tiers.size(); i++) { + TiersParams item = this.tiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for AddonCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonCreateBuilder builder() { + return new AddonCreateBuilder(); + } + + public static final class AddonCreateBuilder { + + private String id; + + private String name; + + private String invoiceName; + + private String description; + + private ChargeType chargeType; + + private Long price; + + private String currencyCode; + + private Integer period; + + private PeriodUnit periodUnit; + + private PricingModel pricingModel; + + private Type type; + + private String unit; + + private Boolean enabledInPortal; + + private Boolean taxable; + + private String taxProfileId; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private String taxCode; + + private String hsnCode; + + private String taxjarProductCode; + + private String invoiceNotes; + + private java.util.Map metaData; + + private String sku; + + private String accountingCode; + + private String accountingCategory1; + + private String accountingCategory2; + + private String accountingCategory3; + + private String accountingCategory4; + + private Boolean isShippable; + + private Integer shippingFrequencyPeriod; + + private ShippingFrequencyPeriodUnit shippingFrequencyPeriodUnit; + + private Boolean includedInMrr; + + private Boolean showDescriptionInInvoices; + + private Boolean showDescriptionInQuotes; + + private String priceInDecimal; + + private ProrationType prorationType; + + private Status status; + + private List tiers; + + private List taxProvidersFields; + + private Map customFields = new LinkedHashMap<>(); + + private AddonCreateBuilder() {} + + public AddonCreateBuilder id(String value) { + this.id = value; + return this; + } + + public AddonCreateBuilder name(String value) { + this.name = value; + return this; + } + + public AddonCreateBuilder invoiceName(String value) { + this.invoiceName = value; + return this; + } + + public AddonCreateBuilder description(String value) { + this.description = value; + return this; + } + + public AddonCreateBuilder chargeType(ChargeType value) { + this.chargeType = value; + return this; + } + + public AddonCreateBuilder price(Long value) { + this.price = value; + return this; + } + + public AddonCreateBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public AddonCreateBuilder period(Integer value) { + this.period = value; + return this; + } + + public AddonCreateBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public AddonCreateBuilder pricingModel(PricingModel value) { + this.pricingModel = value; + return this; + } + + @Deprecated + public AddonCreateBuilder type(Type value) { + this.type = value; + return this; + } + + public AddonCreateBuilder unit(String value) { + this.unit = value; + return this; + } + + public AddonCreateBuilder enabledInPortal(Boolean value) { + this.enabledInPortal = value; + return this; + } + + public AddonCreateBuilder taxable(Boolean value) { + this.taxable = value; + return this; + } + + public AddonCreateBuilder taxProfileId(String value) { + this.taxProfileId = value; + return this; + } + + public AddonCreateBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public AddonCreateBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public AddonCreateBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public AddonCreateBuilder taxCode(String value) { + this.taxCode = value; + return this; + } + + public AddonCreateBuilder hsnCode(String value) { + this.hsnCode = value; + return this; + } + + public AddonCreateBuilder taxjarProductCode(String value) { + this.taxjarProductCode = value; + return this; + } + + public AddonCreateBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public AddonCreateBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public AddonCreateBuilder sku(String value) { + this.sku = value; + return this; + } + + public AddonCreateBuilder accountingCode(String value) { + this.accountingCode = value; + return this; + } + + public AddonCreateBuilder accountingCategory1(String value) { + this.accountingCategory1 = value; + return this; + } + + public AddonCreateBuilder accountingCategory2(String value) { + this.accountingCategory2 = value; + return this; + } + + public AddonCreateBuilder accountingCategory3(String value) { + this.accountingCategory3 = value; + return this; + } + + public AddonCreateBuilder accountingCategory4(String value) { + this.accountingCategory4 = value; + return this; + } + + public AddonCreateBuilder isShippable(Boolean value) { + this.isShippable = value; + return this; + } + + public AddonCreateBuilder shippingFrequencyPeriod(Integer value) { + this.shippingFrequencyPeriod = value; + return this; + } + + public AddonCreateBuilder shippingFrequencyPeriodUnit(ShippingFrequencyPeriodUnit value) { + this.shippingFrequencyPeriodUnit = value; + return this; + } + + public AddonCreateBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public AddonCreateBuilder showDescriptionInInvoices(Boolean value) { + this.showDescriptionInInvoices = value; + return this; + } + + public AddonCreateBuilder showDescriptionInQuotes(Boolean value) { + this.showDescriptionInQuotes = value; + return this; + } + + public AddonCreateBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public AddonCreateBuilder prorationType(ProrationType value) { + this.prorationType = value; + return this; + } + + public AddonCreateBuilder status(Status value) { + this.status = value; + return this; + } + + public AddonCreateBuilder tiers(List value) { + this.tiers = value; + return this; + } + + public AddonCreateBuilder taxProvidersFields(List value) { + this.taxProvidersFields = 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 AddonCreateBuilder 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 AddonCreateBuilder 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 AddonCreateParams build() { + return new AddonCreateParams(this); + } + } + + public enum ChargeType { + RECURRING("recurring"), + + NON_RECURRING("non_recurring"), + + /** An enum member indicating that ChargeType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeType enumValue : ChargeType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + NOT_APPLICABLE("not_applicable"), + + /** 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 enum PricingModel { + FLAT_FEE("flat_fee"), + + PER_UNIT("per_unit"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** An enum member indicating that PricingModel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingModel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingModel fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingModel enumValue : PricingModel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Type { + ON_OFF("on_off"), + + QUANTITY("quantity"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** 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 AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ShippingFrequencyPeriodUnit { + YEAR("year"), + + MONTH("month"), + + WEEK("week"), + + DAY("day"), + + /** + * An enum member indicating that ShippingFrequencyPeriodUnit was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + ShippingFrequencyPeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ShippingFrequencyPeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (ShippingFrequencyPeriodUnit enumValue : ShippingFrequencyPeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ProrationType { + SITE_DEFAULT("site_default"), + + PARTIAL_TERM("partial_term"), + + FULL_TERM("full_term"), + + /** An enum member indicating that ProrationType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationType enumValue : ProrationType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + ACTIVE("active"), + + ARCHIVED("archived"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class TiersParams { + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private TiersParams(TiersBuilder builder) { + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + return formData; + } + + /** Create a new builder for TiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TiersBuilder builder() { + return new TiersBuilder(); + } + + public static final class TiersBuilder { + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private TiersBuilder() {} + + public TiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public TiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public TiersBuilder price(Long value) { + this.price = value; + return this; + } + + public TiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public TiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public TiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public TiersParams build() { + return new TiersParams(this); + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} 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/core/models/addon/params/AddonListParams.java b/src/main/java/com/chargebee/v4/models/addon/params/AddonListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/addon/params/AddonListParams.java rename to src/main/java/com/chargebee/v4/models/addon/params/AddonListParams.java index 28696ad7..069af1d0 100644 --- a/src/main/java/com/chargebee/v4/core/models/addon/params/AddonListParams.java +++ b/src/main/java/com/chargebee/v4/models/addon/params/AddonListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.addon.params; +package com.chargebee.v4.models.addon.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/addon/params/AddonRetrieveParams.java b/src/main/java/com/chargebee/v4/models/addon/params/AddonRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/addon/params/AddonRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/addon/params/AddonRetrieveParams.java index e9cdc07f..d5d502c4 100644 --- a/src/main/java/com/chargebee/v4/core/models/addon/params/AddonRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/addon/params/AddonRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.addon.params; +package com.chargebee.v4.models.addon.params; import com.chargebee.v4.internal.Recommended; 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/AddonUpdateParams.java b/src/main/java/com/chargebee/v4/models/addon/params/AddonUpdateParams.java new file mode 100644 index 00000000..79e443dc --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/addon/params/AddonUpdateParams.java @@ -0,0 +1,1338 @@ +/* + * 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 com.chargebee.v4.internal.JsonUtil; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class AddonUpdateParams { + + private final String name; + + private final String invoiceName; + + private final String description; + + private final ChargeType chargeType; + + private final Long price; + + private final String currencyCode; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final PricingModel pricingModel; + + private final Type type; + + private final String unit; + + private final Boolean enabledInPortal; + + private final Boolean taxable; + + private final String taxProfileId; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final String taxCode; + + private final String hsnCode; + + private final String taxjarProductCode; + + private final String invoiceNotes; + + private final java.util.Map metaData; + + private final String sku; + + private final String accountingCode; + + private final String accountingCategory1; + + private final String accountingCategory2; + + private final String accountingCategory3; + + private final String accountingCategory4; + + private final Boolean isShippable; + + private final Integer shippingFrequencyPeriod; + + private final ShippingFrequencyPeriodUnit shippingFrequencyPeriodUnit; + + private final Boolean includedInMrr; + + private final Boolean showDescriptionInInvoices; + + private final Boolean showDescriptionInQuotes; + + private final String priceInDecimal; + + private final ProrationType prorationType; + + private final List tiers; + + private final List taxProvidersFields; + + private final Map customFields; + + private AddonUpdateParams(AddonUpdateBuilder builder) { + + this.name = builder.name; + + this.invoiceName = builder.invoiceName; + + this.description = builder.description; + + this.chargeType = builder.chargeType; + + this.price = builder.price; + + this.currencyCode = builder.currencyCode; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.pricingModel = builder.pricingModel; + + this.type = builder.type; + + this.unit = builder.unit; + + this.enabledInPortal = builder.enabledInPortal; + + this.taxable = builder.taxable; + + this.taxProfileId = builder.taxProfileId; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.taxCode = builder.taxCode; + + this.hsnCode = builder.hsnCode; + + this.taxjarProductCode = builder.taxjarProductCode; + + this.invoiceNotes = builder.invoiceNotes; + + this.metaData = builder.metaData; + + this.sku = builder.sku; + + this.accountingCode = builder.accountingCode; + + this.accountingCategory1 = builder.accountingCategory1; + + this.accountingCategory2 = builder.accountingCategory2; + + this.accountingCategory3 = builder.accountingCategory3; + + this.accountingCategory4 = builder.accountingCategory4; + + this.isShippable = builder.isShippable; + + this.shippingFrequencyPeriod = builder.shippingFrequencyPeriod; + + this.shippingFrequencyPeriodUnit = builder.shippingFrequencyPeriodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.showDescriptionInInvoices = builder.showDescriptionInInvoices; + + this.showDescriptionInQuotes = builder.showDescriptionInQuotes; + + this.priceInDecimal = builder.priceInDecimal; + + this.prorationType = builder.prorationType; + + this.tiers = builder.tiers; + + this.taxProvidersFields = builder.taxProvidersFields; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getName() { + return name; + } + + public String getInvoiceName() { + return invoiceName; + } + + public String getDescription() { + return description; + } + + public ChargeType getChargeType() { + return chargeType; + } + + public Long getPrice() { + return price; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public PricingModel getPricingModel() { + return pricingModel; + } + + public Type getType() { + return type; + } + + public String getUnit() { + return unit; + } + + public Boolean getEnabledInPortal() { + return enabledInPortal; + } + + public Boolean getTaxable() { + return taxable; + } + + public String getTaxProfileId() { + return taxProfileId; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public String getTaxCode() { + return taxCode; + } + + public String getHsnCode() { + return hsnCode; + } + + public String getTaxjarProductCode() { + return taxjarProductCode; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public java.util.Map getMetaData() { + return metaData; + } + + public String getSku() { + return sku; + } + + public String getAccountingCode() { + return accountingCode; + } + + public String getAccountingCategory1() { + return accountingCategory1; + } + + public String getAccountingCategory2() { + return accountingCategory2; + } + + public String getAccountingCategory3() { + return accountingCategory3; + } + + public String getAccountingCategory4() { + return accountingCategory4; + } + + public Boolean getIsShippable() { + return isShippable; + } + + public Integer getShippingFrequencyPeriod() { + return shippingFrequencyPeriod; + } + + public ShippingFrequencyPeriodUnit getShippingFrequencyPeriodUnit() { + return shippingFrequencyPeriodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public Boolean getShowDescriptionInInvoices() { + return showDescriptionInInvoices; + } + + public Boolean getShowDescriptionInQuotes() { + return showDescriptionInQuotes; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public ProrationType getProrationType() { + return prorationType; + } + + public List getTiers() { + return tiers; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + 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.description != null) { + + formData.put("description", this.description); + } + + if (this.chargeType != null) { + + formData.put("charge_type", this.chargeType); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.pricingModel != null) { + + formData.put("pricing_model", this.pricingModel); + } + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.unit != null) { + + formData.put("unit", this.unit); + } + + if (this.enabledInPortal != null) { + + formData.put("enabled_in_portal", this.enabledInPortal); + } + + if (this.taxable != null) { + + formData.put("taxable", this.taxable); + } + + if (this.taxProfileId != null) { + + formData.put("tax_profile_id", this.taxProfileId); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.taxCode != null) { + + formData.put("tax_code", this.taxCode); + } + + if (this.hsnCode != null) { + + formData.put("hsn_code", this.hsnCode); + } + + if (this.taxjarProductCode != null) { + + formData.put("taxjar_product_code", this.taxjarProductCode); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + if (this.sku != null) { + + formData.put("sku", this.sku); + } + + if (this.accountingCode != null) { + + formData.put("accounting_code", this.accountingCode); + } + + if (this.accountingCategory1 != null) { + + formData.put("accounting_category1", this.accountingCategory1); + } + + if (this.accountingCategory2 != null) { + + formData.put("accounting_category2", this.accountingCategory2); + } + + if (this.accountingCategory3 != null) { + + formData.put("accounting_category3", this.accountingCategory3); + } + + if (this.accountingCategory4 != null) { + + formData.put("accounting_category4", this.accountingCategory4); + } + + if (this.isShippable != null) { + + formData.put("is_shippable", this.isShippable); + } + + if (this.shippingFrequencyPeriod != null) { + + formData.put("shipping_frequency_period", this.shippingFrequencyPeriod); + } + + if (this.shippingFrequencyPeriodUnit != null) { + + formData.put("shipping_frequency_period_unit", this.shippingFrequencyPeriodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.showDescriptionInInvoices != null) { + + formData.put("show_description_in_invoices", this.showDescriptionInInvoices); + } + + if (this.showDescriptionInQuotes != null) { + + formData.put("show_description_in_quotes", this.showDescriptionInQuotes); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.prorationType != null) { + + formData.put("proration_type", this.prorationType); + } + + if (this.tiers != null) { + + // List of objects + for (int i = 0; i < this.tiers.size(); i++) { + TiersParams item = this.tiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for AddonUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonUpdateBuilder builder() { + return new AddonUpdateBuilder(); + } + + public static final class AddonUpdateBuilder { + + private String name; + + private String invoiceName; + + private String description; + + private ChargeType chargeType; + + private Long price; + + private String currencyCode; + + private Integer period; + + private PeriodUnit periodUnit; + + private PricingModel pricingModel; + + private Type type; + + private String unit; + + private Boolean enabledInPortal; + + private Boolean taxable; + + private String taxProfileId; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private String taxCode; + + private String hsnCode; + + private String taxjarProductCode; + + private String invoiceNotes; + + private java.util.Map metaData; + + private String sku; + + private String accountingCode; + + private String accountingCategory1; + + private String accountingCategory2; + + private String accountingCategory3; + + private String accountingCategory4; + + private Boolean isShippable; + + private Integer shippingFrequencyPeriod; + + private ShippingFrequencyPeriodUnit shippingFrequencyPeriodUnit; + + private Boolean includedInMrr; + + private Boolean showDescriptionInInvoices; + + private Boolean showDescriptionInQuotes; + + private String priceInDecimal; + + private ProrationType prorationType; + + private List tiers; + + private List taxProvidersFields; + + private Map customFields = new LinkedHashMap<>(); + + private AddonUpdateBuilder() {} + + public AddonUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public AddonUpdateBuilder invoiceName(String value) { + this.invoiceName = value; + return this; + } + + public AddonUpdateBuilder description(String value) { + this.description = value; + return this; + } + + public AddonUpdateBuilder chargeType(ChargeType value) { + this.chargeType = value; + return this; + } + + public AddonUpdateBuilder price(Long value) { + this.price = value; + return this; + } + + public AddonUpdateBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public AddonUpdateBuilder period(Integer value) { + this.period = value; + return this; + } + + public AddonUpdateBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public AddonUpdateBuilder pricingModel(PricingModel value) { + this.pricingModel = value; + return this; + } + + @Deprecated + public AddonUpdateBuilder type(Type value) { + this.type = value; + return this; + } + + public AddonUpdateBuilder unit(String value) { + this.unit = value; + return this; + } + + public AddonUpdateBuilder enabledInPortal(Boolean value) { + this.enabledInPortal = value; + return this; + } + + public AddonUpdateBuilder taxable(Boolean value) { + this.taxable = value; + return this; + } + + public AddonUpdateBuilder taxProfileId(String value) { + this.taxProfileId = value; + return this; + } + + public AddonUpdateBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public AddonUpdateBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public AddonUpdateBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public AddonUpdateBuilder taxCode(String value) { + this.taxCode = value; + return this; + } + + public AddonUpdateBuilder hsnCode(String value) { + this.hsnCode = value; + return this; + } + + public AddonUpdateBuilder taxjarProductCode(String value) { + this.taxjarProductCode = value; + return this; + } + + public AddonUpdateBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public AddonUpdateBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public AddonUpdateBuilder sku(String value) { + this.sku = value; + return this; + } + + public AddonUpdateBuilder accountingCode(String value) { + this.accountingCode = value; + return this; + } + + public AddonUpdateBuilder accountingCategory1(String value) { + this.accountingCategory1 = value; + return this; + } + + public AddonUpdateBuilder accountingCategory2(String value) { + this.accountingCategory2 = value; + return this; + } + + public AddonUpdateBuilder accountingCategory3(String value) { + this.accountingCategory3 = value; + return this; + } + + public AddonUpdateBuilder accountingCategory4(String value) { + this.accountingCategory4 = value; + return this; + } + + public AddonUpdateBuilder isShippable(Boolean value) { + this.isShippable = value; + return this; + } + + public AddonUpdateBuilder shippingFrequencyPeriod(Integer value) { + this.shippingFrequencyPeriod = value; + return this; + } + + public AddonUpdateBuilder shippingFrequencyPeriodUnit(ShippingFrequencyPeriodUnit value) { + this.shippingFrequencyPeriodUnit = value; + return this; + } + + public AddonUpdateBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public AddonUpdateBuilder showDescriptionInInvoices(Boolean value) { + this.showDescriptionInInvoices = value; + return this; + } + + public AddonUpdateBuilder showDescriptionInQuotes(Boolean value) { + this.showDescriptionInQuotes = value; + return this; + } + + public AddonUpdateBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public AddonUpdateBuilder prorationType(ProrationType value) { + this.prorationType = value; + return this; + } + + public AddonUpdateBuilder tiers(List value) { + this.tiers = value; + return this; + } + + public AddonUpdateBuilder taxProvidersFields(List value) { + this.taxProvidersFields = 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 AddonUpdateBuilder 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 AddonUpdateBuilder 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 AddonUpdateParams build() { + return new AddonUpdateParams(this); + } + } + + public enum ChargeType { + RECURRING("recurring"), + + NON_RECURRING("non_recurring"), + + /** An enum member indicating that ChargeType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeType enumValue : ChargeType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + NOT_APPLICABLE("not_applicable"), + + /** 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 enum PricingModel { + FLAT_FEE("flat_fee"), + + PER_UNIT("per_unit"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** An enum member indicating that PricingModel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingModel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingModel fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingModel enumValue : PricingModel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Type { + ON_OFF("on_off"), + + QUANTITY("quantity"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** 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 AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ShippingFrequencyPeriodUnit { + YEAR("year"), + + MONTH("month"), + + WEEK("week"), + + DAY("day"), + + /** + * An enum member indicating that ShippingFrequencyPeriodUnit was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + ShippingFrequencyPeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ShippingFrequencyPeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (ShippingFrequencyPeriodUnit enumValue : ShippingFrequencyPeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ProrationType { + SITE_DEFAULT("site_default"), + + PARTIAL_TERM("partial_term"), + + FULL_TERM("full_term"), + + /** An enum member indicating that ProrationType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationType enumValue : ProrationType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class TiersParams { + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private TiersParams(TiersBuilder builder) { + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + return formData; + } + + /** Create a new builder for TiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TiersBuilder builder() { + return new TiersBuilder(); + } + + public static final class TiersBuilder { + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private TiersBuilder() {} + + public TiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public TiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public TiersBuilder price(Long value) { + this.price = value; + return this; + } + + public TiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public TiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public TiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public TiersParams build() { + return new TiersParams(this); + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/addon/AddonCopyResponse.java b/src/main/java/com/chargebee/v4/models/addon/responses/AddonCopyResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/addon/AddonCopyResponse.java rename to src/main/java/com/chargebee/v4/models/addon/responses/AddonCopyResponse.java index d04353f3..c4fb53f4 100644 --- a/src/main/java/com/chargebee/v4/core/responses/addon/AddonCopyResponse.java +++ b/src/main/java/com/chargebee/v4/models/addon/responses/AddonCopyResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.addon; +package com.chargebee.v4.models.addon.responses; -import com.chargebee.v4.core.models.addon.Addon; +import com.chargebee.v4.models.addon.Addon; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/addon/AddonCreateResponse.java b/src/main/java/com/chargebee/v4/models/addon/responses/AddonCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/addon/AddonCreateResponse.java rename to src/main/java/com/chargebee/v4/models/addon/responses/AddonCreateResponse.java index b6ac791d..9ad58dfc 100644 --- a/src/main/java/com/chargebee/v4/core/responses/addon/AddonCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/addon/responses/AddonCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.addon; +package com.chargebee.v4.models.addon.responses; -import com.chargebee.v4.core.models.addon.Addon; +import com.chargebee.v4.models.addon.Addon; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/addon/AddonDeleteResponse.java b/src/main/java/com/chargebee/v4/models/addon/responses/AddonDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/addon/AddonDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/addon/responses/AddonDeleteResponse.java index 1bbf0876..9cfb740a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/addon/AddonDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/addon/responses/AddonDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.addon; +package com.chargebee.v4.models.addon.responses; -import com.chargebee.v4.core.models.addon.Addon; +import com.chargebee.v4.models.addon.Addon; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/addon/AddonListResponse.java b/src/main/java/com/chargebee/v4/models/addon/responses/AddonListResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/addon/AddonListResponse.java rename to src/main/java/com/chargebee/v4/models/addon/responses/AddonListResponse.java index 63f8b43e..8274e03d 100644 --- a/src/main/java/com/chargebee/v4/core/responses/addon/AddonListResponse.java +++ b/src/main/java/com/chargebee/v4/models/addon/responses/AddonListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.addon; +package com.chargebee.v4.models.addon.responses; import java.util.List; -import com.chargebee.v4.core.models.addon.Addon; +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.core.services.AddonService; -import com.chargebee.v4.core.models.addon.params.AddonListParams; +import com.chargebee.v4.services.AddonService; +import com.chargebee.v4.models.addon.params.AddonListParams; /** Immutable response object for AddonList operation. Contains paginated list data. */ public final class AddonListResponse { @@ -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/AddonRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/addon/responses/AddonRetrieveResponse.java new file mode 100644 index 00000000..57b79333 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/addon/responses/AddonRetrieveResponse.java @@ -0,0 +1,77 @@ +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 AddonRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class AddonRetrieveResponse extends BaseResponse { + private final Addon addon; + + private AddonRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.addon = builder.addon; + } + + /** Parse JSON response into AddonRetrieveResponse object. */ + public static AddonRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into AddonRetrieveResponse object with HTTP response. */ + public static AddonRetrieveResponse 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 AddonRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for AddonRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for AddonRetrieveResponse. */ + 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 AddonRetrieveResponse build() { + return new AddonRetrieveResponse(this); + } + } + + /** Get the addon from the response. */ + public Addon getAddon() { + return addon; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/addon/AddonUnarchiveResponse.java b/src/main/java/com/chargebee/v4/models/addon/responses/AddonUnarchiveResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/addon/AddonUnarchiveResponse.java rename to src/main/java/com/chargebee/v4/models/addon/responses/AddonUnarchiveResponse.java index c71c9efc..9437a21f 100644 --- a/src/main/java/com/chargebee/v4/core/responses/addon/AddonUnarchiveResponse.java +++ b/src/main/java/com/chargebee/v4/models/addon/responses/AddonUnarchiveResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.addon; +package com.chargebee.v4.models.addon.responses; -import com.chargebee.v4.core.models.addon.Addon; +import com.chargebee.v4.models.addon.Addon; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/addon/AddonUpdateResponse.java b/src/main/java/com/chargebee/v4/models/addon/responses/AddonUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/addon/AddonUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/addon/responses/AddonUpdateResponse.java index 4ee2ac87..6fac75cf 100644 --- a/src/main/java/com/chargebee/v4/core/responses/addon/AddonUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/addon/responses/AddonUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.addon; +package com.chargebee.v4.models.addon.responses; -import com.chargebee.v4.core.models.addon.Addon; +import com.chargebee.v4.models.addon.Addon; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/address/Address.java b/src/main/java/com/chargebee/v4/models/address/Address.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/address/Address.java rename to src/main/java/com/chargebee/v4/models/address/Address.java index 502d8ab8..5a17d781 100644 --- a/src/main/java/com/chargebee/v4/core/models/address/Address.java +++ b/src/main/java/com/chargebee/v4/models/address/Address.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.address; +package com.chargebee.v4.models.address; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/core/models/address/params/AddressRetrieveParams.java b/src/main/java/com/chargebee/v4/models/address/params/AddressRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/address/params/AddressRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/address/params/AddressRetrieveParams.java index f4a096f8..f4bd43bf 100644 --- a/src/main/java/com/chargebee/v4/core/models/address/params/AddressRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/address/params/AddressRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.address.params; +package com.chargebee.v4.models.address.params; import com.chargebee.v4.internal.Recommended; 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/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/core/responses/address/AddressUpdateResponse.java b/src/main/java/com/chargebee/v4/models/address/responses/AddressUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/address/AddressUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/address/responses/AddressUpdateResponse.java index 78ccf838..e4dc4635 100644 --- a/src/main/java/com/chargebee/v4/core/responses/address/AddressUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/address/responses/AddressUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.address; +package com.chargebee.v4.models.address.responses; -import com.chargebee.v4.core.models.address.Address; +import com.chargebee.v4.models.address.Address; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/advanceInvoiceSchedule/AdvanceInvoiceSchedule.java b/src/main/java/com/chargebee/v4/models/advanceInvoiceSchedule/AdvanceInvoiceSchedule.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/advanceInvoiceSchedule/AdvanceInvoiceSchedule.java rename to src/main/java/com/chargebee/v4/models/advanceInvoiceSchedule/AdvanceInvoiceSchedule.java index 32d5faa5..f5b413fa 100644 --- a/src/main/java/com/chargebee/v4/core/models/advanceInvoiceSchedule/AdvanceInvoiceSchedule.java +++ b/src/main/java/com/chargebee/v4/models/advanceInvoiceSchedule/AdvanceInvoiceSchedule.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.advanceInvoiceSchedule; +package com.chargebee.v4.models.advanceInvoiceSchedule; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/attachedItem/AttachedItem.java b/src/main/java/com/chargebee/v4/models/attachedItem/AttachedItem.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/attachedItem/AttachedItem.java rename to src/main/java/com/chargebee/v4/models/attachedItem/AttachedItem.java index f4f47168..3ba27aa4 100644 --- a/src/main/java/com/chargebee/v4/core/models/attachedItem/AttachedItem.java +++ b/src/main/java/com/chargebee/v4/models/attachedItem/AttachedItem.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.attachedItem; +package com.chargebee.v4.models.attachedItem; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; 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/core/models/attachedItem/params/AttachedItemListParams.java b/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/attachedItem/params/AttachedItemListParams.java rename to src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemListParams.java index 9b450125..e2cbd5b2 100644 --- a/src/main/java/com/chargebee/v4/core/models/attachedItem/params/AttachedItemListParams.java +++ b/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.attachedItem.params; +package com.chargebee.v4.models.attachedItem.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/attachedItem/params/AttachedItemRetrieveParams.java b/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/attachedItem/params/AttachedItemRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemRetrieveParams.java index 816ec80d..6d8c758e 100644 --- a/src/main/java/com/chargebee/v4/core/models/attachedItem/params/AttachedItemRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.attachedItem.params; +package com.chargebee.v4.models.attachedItem.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemUpdateParams.java b/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemUpdateParams.java new file mode 100644 index 00000000..fe0c986f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemUpdateParams.java @@ -0,0 +1,246 @@ +/* + * 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 AttachedItemUpdateParams { + + private final String parentItemId; + + 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 AttachedItemUpdateParams(AttachedItemUpdateBuilder builder) { + + this.parentItemId = builder.parentItemId; + + this.type = builder.type; + + this.billingCycles = builder.billingCycles; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + } + + public String getParentItemId() { + return parentItemId; + } + + 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; + } + + /** 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); + } + + 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); + } + + return formData; + } + + /** Create a new builder for AttachedItemUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AttachedItemUpdateBuilder builder() { + return new AttachedItemUpdateBuilder(); + } + + public static final class AttachedItemUpdateBuilder { + + private String parentItemId; + + private Type type; + + private Integer billingCycles; + + private Integer quantity; + + private String quantityInDecimal; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private AttachedItemUpdateBuilder() {} + + public AttachedItemUpdateBuilder parentItemId(String value) { + this.parentItemId = value; + return this; + } + + public AttachedItemUpdateBuilder type(Type value) { + this.type = value; + return this; + } + + public AttachedItemUpdateBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AttachedItemUpdateBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AttachedItemUpdateBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AttachedItemUpdateBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public AttachedItemUpdateBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public AttachedItemUpdateParams build() { + return new AttachedItemUpdateParams(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/core/responses/attachedItem/AttachedItemCreateResponse.java b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/attachedItem/AttachedItemCreateResponse.java rename to src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemCreateResponse.java index d928c483..917e8274 100644 --- a/src/main/java/com/chargebee/v4/core/responses/attachedItem/AttachedItemCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.attachedItem; +package com.chargebee.v4.models.attachedItem.responses; -import com.chargebee.v4.core.models.attachedItem.AttachedItem; +import com.chargebee.v4.models.attachedItem.AttachedItem; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/attachedItem/AttachedItemDeleteResponse.java b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/attachedItem/AttachedItemDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemDeleteResponse.java index 7ab66eb9..7b3c9e64 100644 --- a/src/main/java/com/chargebee/v4/core/responses/attachedItem/AttachedItemDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.attachedItem; +package com.chargebee.v4.models.attachedItem.responses; -import com.chargebee.v4.core.models.attachedItem.AttachedItem; +import com.chargebee.v4.models.attachedItem.AttachedItem; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/attachedItem/AttachedItemListResponse.java b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/attachedItem/AttachedItemListResponse.java rename to src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemListResponse.java index fd574919..fd34422a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/attachedItem/AttachedItemListResponse.java +++ b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.attachedItem; +package com.chargebee.v4.models.attachedItem.responses; import java.util.List; -import com.chargebee.v4.core.models.attachedItem.AttachedItem; +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.core.services.AttachedItemService; -import com.chargebee.v4.core.models.attachedItem.params.AttachedItemListParams; +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 { @@ -105,9 +106,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 AttachedItemListResponse nextPage() throws Exception { + public AttachedItemListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemRetrieveResponse.java new file mode 100644 index 00000000..7f6e4d3a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemRetrieveResponse.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 AttachedItemRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class AttachedItemRetrieveResponse extends BaseResponse { + private final AttachedItem attachedItem; + + private AttachedItemRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.attachedItem = builder.attachedItem; + } + + /** Parse JSON response into AttachedItemRetrieveResponse object. */ + public static AttachedItemRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into AttachedItemRetrieveResponse object with HTTP response. */ + public static AttachedItemRetrieveResponse 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 AttachedItemRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for AttachedItemRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for AttachedItemRetrieveResponse. */ + 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 AttachedItemRetrieveResponse build() { + return new AttachedItemRetrieveResponse(this); + } + } + + /** Get the attachedItem from the response. */ + public AttachedItem getAttachedItem() { + return attachedItem; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/attachedItem/AttachedItemUpdateResponse.java b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/attachedItem/AttachedItemUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemUpdateResponse.java index 595cced6..bc37ecae 100644 --- a/src/main/java/com/chargebee/v4/core/responses/attachedItem/AttachedItemUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.attachedItem; +package com.chargebee.v4.models.attachedItem.responses; -import com.chargebee.v4.core.models.attachedItem.AttachedItem; +import com.chargebee.v4.models.attachedItem.AttachedItem; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/attribute/Attribute.java b/src/main/java/com/chargebee/v4/models/attribute/Attribute.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/attribute/Attribute.java rename to src/main/java/com/chargebee/v4/models/attribute/Attribute.java index 650533e8..9edca57d 100644 --- a/src/main/java/com/chargebee/v4/core/models/attribute/Attribute.java +++ b/src/main/java/com/chargebee/v4/models/attribute/Attribute.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.attribute; +package com.chargebee.v4.models.attribute; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/core/models/billingConfiguration/BillingConfiguration.java b/src/main/java/com/chargebee/v4/models/billingConfiguration/BillingConfiguration.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/billingConfiguration/BillingConfiguration.java rename to src/main/java/com/chargebee/v4/models/billingConfiguration/BillingConfiguration.java index 1632f6dc..3531f9ad 100644 --- a/src/main/java/com/chargebee/v4/core/models/billingConfiguration/BillingConfiguration.java +++ b/src/main/java/com/chargebee/v4/models/billingConfiguration/BillingConfiguration.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.billingConfiguration; +package com.chargebee.v4.models.billingConfiguration; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/brand/Brand.java b/src/main/java/com/chargebee/v4/models/brand/Brand.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/brand/Brand.java rename to src/main/java/com/chargebee/v4/models/brand/Brand.java index 95794ca8..c518a870 100644 --- a/src/main/java/com/chargebee/v4/core/models/brand/Brand.java +++ b/src/main/java/com/chargebee/v4/models/brand/Brand.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.brand; +package com.chargebee.v4.models.brand; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/core/models/brandConfiguration/params/BrandConfigurationRetrieveParams.java b/src/main/java/com/chargebee/v4/models/brandConfiguration/params/BrandConfigurationRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/brandConfiguration/params/BrandConfigurationRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/brandConfiguration/params/BrandConfigurationRetrieveParams.java index 881d02c6..dfeeec97 100644 --- a/src/main/java/com/chargebee/v4/core/models/brandConfiguration/params/BrandConfigurationRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/brandConfiguration/params/BrandConfigurationRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.brandConfiguration.params; +package com.chargebee.v4.models.brandConfiguration.params; import com.chargebee.v4.internal.Recommended; 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/core/models/businessEntity/BusinessEntity.java b/src/main/java/com/chargebee/v4/models/businessEntity/BusinessEntity.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/businessEntity/BusinessEntity.java rename to src/main/java/com/chargebee/v4/models/businessEntity/BusinessEntity.java index 5f4c0f59..5c2346b9 100644 --- a/src/main/java/com/chargebee/v4/core/models/businessEntity/BusinessEntity.java +++ b/src/main/java/com/chargebee/v4/models/businessEntity/BusinessEntity.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.businessEntity; +package com.chargebee.v4.models.businessEntity; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; 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/core/models/businessEntity/params/BusinessEntityGetTransfersParams.java b/src/main/java/com/chargebee/v4/models/businessEntity/params/BusinessEntityGetTransfersParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/businessEntity/params/BusinessEntityGetTransfersParams.java rename to src/main/java/com/chargebee/v4/models/businessEntity/params/BusinessEntityGetTransfersParams.java index 247f1bdc..7d0fad79 100644 --- a/src/main/java/com/chargebee/v4/core/models/businessEntity/params/BusinessEntityGetTransfersParams.java +++ b/src/main/java/com/chargebee/v4/models/businessEntity/params/BusinessEntityGetTransfersParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.businessEntity.params; +package com.chargebee.v4.models.businessEntity.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/responses/businessEntity/BusinessEntityCreateTransfersResponse.java b/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityCreateTransfersResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/businessEntity/BusinessEntityCreateTransfersResponse.java rename to src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityCreateTransfersResponse.java index 817f1a0f..470bc95d 100644 --- a/src/main/java/com/chargebee/v4/core/responses/businessEntity/BusinessEntityCreateTransfersResponse.java +++ b/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityCreateTransfersResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.businessEntity; +package com.chargebee.v4.models.businessEntity.responses; -import com.chargebee.v4.core.models.businessEntityTransfer.BusinessEntityTransfer; +import com.chargebee.v4.models.businessEntityTransfer.BusinessEntityTransfer; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/businessEntity/BusinessEntityGetTransfersResponse.java b/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityGetTransfersResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/businessEntity/BusinessEntityGetTransfersResponse.java rename to src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityGetTransfersResponse.java index a4997665..7a748ecc 100644 --- a/src/main/java/com/chargebee/v4/core/responses/businessEntity/BusinessEntityGetTransfersResponse.java +++ b/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityGetTransfersResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.businessEntity; +package com.chargebee.v4.models.businessEntity.responses; import java.util.List; -import com.chargebee.v4.core.models.businessEntityTransfer.BusinessEntityTransfer; +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.core.services.BusinessEntityService; -import com.chargebee.v4.core.models.businessEntity.params.BusinessEntityGetTransfersParams; +import com.chargebee.v4.services.BusinessEntityService; +import com.chargebee.v4.models.businessEntity.params.BusinessEntityGetTransfersParams; /** * Immutable response object for BusinessEntityGetTransfers operation. Contains paginated list data. @@ -101,9 +102,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 BusinessEntityGetTransfersResponse nextPage() throws Exception { + public BusinessEntityGetTransfersResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/models/businessEntityTransfer/BusinessEntityTransfer.java b/src/main/java/com/chargebee/v4/models/businessEntityTransfer/BusinessEntityTransfer.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/businessEntityTransfer/BusinessEntityTransfer.java rename to src/main/java/com/chargebee/v4/models/businessEntityTransfer/BusinessEntityTransfer.java index 96a46129..88f8b785 100644 --- a/src/main/java/com/chargebee/v4/core/models/businessEntityTransfer/BusinessEntityTransfer.java +++ b/src/main/java/com/chargebee/v4/models/businessEntityTransfer/BusinessEntityTransfer.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.businessEntityTransfer; +package com.chargebee.v4.models.businessEntityTransfer; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/businessProfile/params/BusinessProfileRetrieveParams.java b/src/main/java/com/chargebee/v4/models/businessProfile/params/BusinessProfileRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/businessProfile/params/BusinessProfileRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/businessProfile/params/BusinessProfileRetrieveParams.java index d0829ddb..2b576bdb 100644 --- a/src/main/java/com/chargebee/v4/core/models/businessProfile/params/BusinessProfileRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/businessProfile/params/BusinessProfileRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.businessProfile.params; +package com.chargebee.v4.models.businessProfile.params; import com.chargebee.v4.internal.Recommended; 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/core/models/card/Card.java b/src/main/java/com/chargebee/v4/models/card/Card.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/card/Card.java rename to src/main/java/com/chargebee/v4/models/card/Card.java index 1c70a3f3..73f56b4c 100644 --- a/src/main/java/com/chargebee/v4/core/models/card/Card.java +++ b/src/main/java/com/chargebee/v4/models/card/Card.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.card; +package com.chargebee.v4.models.card; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; @@ -294,6 +294,8 @@ public enum Gateway { DEUTSCHE_BANK("deutsche_bank"), + EZIDEBIT("ezidebit"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/core/models/card/params/CardRetrieveParams.java b/src/main/java/com/chargebee/v4/models/card/params/CardRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/card/params/CardRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/card/params/CardRetrieveParams.java index 866e7a46..3bd0b2e5 100644 --- a/src/main/java/com/chargebee/v4/core/models/card/params/CardRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/card/params/CardRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.card.params; +package com.chargebee.v4.models.card.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/card/params/CardSwitchGatewayForCustomerParams.java b/src/main/java/com/chargebee/v4/models/card/params/CardSwitchGatewayForCustomerParams.java similarity index 81% rename from src/main/java/com/chargebee/v4/core/models/card/params/CardSwitchGatewayForCustomerParams.java rename to src/main/java/com/chargebee/v4/models/card/params/CardSwitchGatewayForCustomerParams.java index d0d13167..66ffffe6 100644 --- a/src/main/java/com/chargebee/v4/core/models/card/params/CardSwitchGatewayForCustomerParams.java +++ b/src/main/java/com/chargebee/v4/models/card/params/CardSwitchGatewayForCustomerParams.java @@ -4,24 +4,48 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.card.params; +package com.chargebee.v4.models.card.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class CardSwitchGatewayForCustomerParams { - private final Map formData; + private final Gateway gateway; + + private final String gatewayAccountId; private CardSwitchGatewayForCustomerParams(CardSwitchGatewayForCustomerBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; } /** 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); + } + return formData; } @@ -32,22 +56,21 @@ public static CardSwitchGatewayForCustomerBuilder builder() { } public static final class CardSwitchGatewayForCustomerBuilder { - private final Map formData = new LinkedHashMap<>(); + + private Gateway gateway; + + private String gatewayAccountId; private CardSwitchGatewayForCustomerBuilder() {} @Deprecated public CardSwitchGatewayForCustomerBuilder gateway(Gateway value) { - - formData.put("gateway", value); - + this.gateway = value; return this; } public CardSwitchGatewayForCustomerBuilder gatewayAccountId(String value) { - - formData.put("gateway_account_id", value); - + this.gatewayAccountId = value; return this; } @@ -155,6 +178,8 @@ public enum Gateway { DEUTSCHE_BANK("deutsche_bank"), + EZIDEBIT("ezidebit"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/card/params/CopyCardForCustomerParams.java b/src/main/java/com/chargebee/v4/models/card/params/CopyCardForCustomerParams.java new file mode 100644 index 00000000..f7f4e8dc --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/card/params/CopyCardForCustomerParams.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.card.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CopyCardForCustomerParams { + + private final String gatewayAccountId; + + private CopyCardForCustomerParams(CopyCardForCustomerBuilder builder) { + + this.gatewayAccountId = builder.gatewayAccountId; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + return formData; + } + + /** Create a new builder for CopyCardForCustomerParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CopyCardForCustomerBuilder builder() { + return new CopyCardForCustomerBuilder(); + } + + public static final class CopyCardForCustomerBuilder { + + private String gatewayAccountId; + + private CopyCardForCustomerBuilder() {} + + public CopyCardForCustomerBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public CopyCardForCustomerParams build() { + return new CopyCardForCustomerParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/card/params/DeleteCardForCustomerParams.java b/src/main/java/com/chargebee/v4/models/card/params/DeleteCardForCustomerParams.java new file mode 100644 index 00000000..a438d4e6 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/card/params/DeleteCardForCustomerParams.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.card.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class DeleteCardForCustomerParams { + + private DeleteCardForCustomerParams(DeleteCardForCustomerBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for DeleteCardForCustomerParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DeleteCardForCustomerBuilder builder() { + return new DeleteCardForCustomerBuilder(); + } + + public static final class DeleteCardForCustomerBuilder { + + private DeleteCardForCustomerBuilder() {} + + public DeleteCardForCustomerParams build() { + return new DeleteCardForCustomerParams(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/CardRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/card/responses/CardRetrieveResponse.java new file mode 100644 index 00000000..aa8d6f65 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/card/responses/CardRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.card.responses; + +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 CardRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class CardRetrieveResponse extends BaseResponse { + private final Card card; + + private CardRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.card = builder.card; + } + + /** Parse JSON response into CardRetrieveResponse object. */ + public static CardRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CardRetrieveResponse object with HTTP response. */ + public static CardRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + 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 CardRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for CardRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CardRetrieveResponse. */ + public static class Builder { + + private Card card; + + private Response httpResponse; + + private Builder() {} + + public Builder card(Card card) { + this.card = card; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CardRetrieveResponse build() { + return new CardRetrieveResponse(this); + } + } + + /** Get the card from the response. */ + public Card getCard() { + return card; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/card/CardSwitchGatewayForCustomerResponse.java b/src/main/java/com/chargebee/v4/models/card/responses/CardSwitchGatewayForCustomerResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/card/CardSwitchGatewayForCustomerResponse.java rename to src/main/java/com/chargebee/v4/models/card/responses/CardSwitchGatewayForCustomerResponse.java index b8ee2da7..0d1a4006 100644 --- a/src/main/java/com/chargebee/v4/core/responses/card/CardSwitchGatewayForCustomerResponse.java +++ b/src/main/java/com/chargebee/v4/models/card/responses/CardSwitchGatewayForCustomerResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.card; +package com.chargebee.v4.models.card.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/card/responses/CopyCardForCustomerResponse.java b/src/main/java/com/chargebee/v4/models/card/responses/CopyCardForCustomerResponse.java new file mode 100644 index 00000000..d4f243e6 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/card/responses/CopyCardForCustomerResponse.java @@ -0,0 +1,78 @@ +package com.chargebee.v4.models.card.responses; + +import com.chargebee.v4.models.thirdPartyPaymentMethod.ThirdPartyPaymentMethod; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CopyCardForCustomer operation. Contains the response data from the + * API. + */ +public final class CopyCardForCustomerResponse extends BaseResponse { + private final ThirdPartyPaymentMethod thirdPartyPaymentMethod; + + private CopyCardForCustomerResponse(Builder builder) { + super(builder.httpResponse); + + this.thirdPartyPaymentMethod = builder.thirdPartyPaymentMethod; + } + + /** Parse JSON response into CopyCardForCustomerResponse object. */ + public static CopyCardForCustomerResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CopyCardForCustomerResponse object with HTTP response. */ + public static CopyCardForCustomerResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __thirdPartyPaymentMethodJson = JsonUtil.getObject(json, "third_party_payment_method"); + if (__thirdPartyPaymentMethodJson != null) { + builder.thirdPartyPaymentMethod( + ThirdPartyPaymentMethod.fromJson(__thirdPartyPaymentMethodJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CopyCardForCustomerResponse from JSON", e); + } + } + + /** Create a new builder for CopyCardForCustomerResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CopyCardForCustomerResponse. */ + public static class Builder { + + private ThirdPartyPaymentMethod thirdPartyPaymentMethod; + + private Response httpResponse; + + private Builder() {} + + public Builder thirdPartyPaymentMethod(ThirdPartyPaymentMethod thirdPartyPaymentMethod) { + this.thirdPartyPaymentMethod = thirdPartyPaymentMethod; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CopyCardForCustomerResponse build() { + return new CopyCardForCustomerResponse(this); + } + } + + /** Get the thirdPartyPaymentMethod from the response. */ + public ThirdPartyPaymentMethod getThirdPartyPaymentMethod() { + return thirdPartyPaymentMethod; + } +} diff --git a/src/main/java/com/chargebee/v4/models/card/responses/DeleteCardForCustomerResponse.java b/src/main/java/com/chargebee/v4/models/card/responses/DeleteCardForCustomerResponse.java new file mode 100644 index 00000000..b13c0fa3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/card/responses/DeleteCardForCustomerResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.card.responses; + +import com.chargebee.v4.models.customer.Customer; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for DeleteCardForCustomer operation. Contains the response data from + * the API. + */ +public final class DeleteCardForCustomerResponse extends BaseResponse { + private final Customer customer; + + private DeleteCardForCustomerResponse(Builder builder) { + super(builder.httpResponse); + + this.customer = builder.customer; + } + + /** Parse JSON response into DeleteCardForCustomerResponse object. */ + public static DeleteCardForCustomerResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into DeleteCardForCustomerResponse object with HTTP response. */ + public static DeleteCardForCustomerResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __customerJson = JsonUtil.getObject(json, "customer"); + if (__customerJson != null) { + builder.customer(Customer.fromJson(__customerJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse DeleteCardForCustomerResponse from JSON", e); + } + } + + /** Create a new builder for DeleteCardForCustomerResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for DeleteCardForCustomerResponse. */ + public static class Builder { + + private Customer customer; + + private Response httpResponse; + + private Builder() {} + + public Builder customer(Customer customer) { + this.customer = customer; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public DeleteCardForCustomerResponse build() { + return new DeleteCardForCustomerResponse(this); + } + } + + /** Get the customer from the response. */ + public Customer getCustomer() { + return customer; + } +} 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/core/models/comment/Comment.java b/src/main/java/com/chargebee/v4/models/comment/Comment.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/comment/Comment.java rename to src/main/java/com/chargebee/v4/models/comment/Comment.java index 1b68ea97..46f1ded4 100644 --- a/src/main/java/com/chargebee/v4/core/models/comment/Comment.java +++ b/src/main/java/com/chargebee/v4/models/comment/Comment.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.comment; +package com.chargebee.v4.models.comment; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/comment/params/CommentCreateParams.java b/src/main/java/com/chargebee/v4/models/comment/params/CommentCreateParams.java new file mode 100644 index 00000000..d3edc856 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/comment/params/CommentCreateParams.java @@ -0,0 +1,174 @@ +/* + * 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 CommentCreateParams { + + private final EntityType entityType; + + private final String entityId; + + private final String notes; + + private final String addedBy; + + private CommentCreateParams(CommentCreateBuilder builder) { + + this.entityType = builder.entityType; + + this.entityId = builder.entityId; + + this.notes = builder.notes; + + this.addedBy = builder.addedBy; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + + public String getNotes() { + return notes; + } + + public String getAddedBy() { + return addedBy; + } + + /** 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.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + if (this.notes != null) { + + formData.put("notes", this.notes); + } + + if (this.addedBy != null) { + + formData.put("added_by", this.addedBy); + } + + return formData; + } + + /** Create a new builder for CommentCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CommentCreateBuilder builder() { + return new CommentCreateBuilder(); + } + + public static final class CommentCreateBuilder { + + private EntityType entityType; + + private String entityId; + + private String notes; + + private String addedBy; + + private CommentCreateBuilder() {} + + public CommentCreateBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public CommentCreateBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public CommentCreateBuilder notes(String value) { + this.notes = value; + return this; + } + + public CommentCreateBuilder addedBy(String value) { + this.addedBy = value; + return this; + } + + public CommentCreateParams build() { + return new CommentCreateParams(this); + } + } + + public enum EntityType { + CUSTOMER("customer"), + + SUBSCRIPTION("subscription"), + + INVOICE("invoice"), + + QUOTE("quote"), + + CREDIT_NOTE("credit_note"), + + TRANSACTION("transaction"), + + PLAN("plan"), + + ADDON("addon"), + + COUPON("coupon"), + + ORDER("order"), + + BUSINESS_ENTITY("business_entity"), + + ITEM_FAMILY("item_family"), + + ITEM("item"), + + ITEM_PRICE("item_price"), + + PRICE_VARIANT("price_variant"), + + /** 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; + } + } +} 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/core/models/comment/params/CommentListParams.java b/src/main/java/com/chargebee/v4/models/comment/params/CommentListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/comment/params/CommentListParams.java rename to src/main/java/com/chargebee/v4/models/comment/params/CommentListParams.java index 3094fdc6..06261a3e 100644 --- a/src/main/java/com/chargebee/v4/core/models/comment/params/CommentListParams.java +++ b/src/main/java/com/chargebee/v4/models/comment/params/CommentListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.comment.params; +package com.chargebee.v4.models.comment.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/comment/params/CommentRetrieveParams.java b/src/main/java/com/chargebee/v4/models/comment/params/CommentRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/comment/params/CommentRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/comment/params/CommentRetrieveParams.java index 2fc52107..92572cd1 100644 --- a/src/main/java/com/chargebee/v4/core/models/comment/params/CommentRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/comment/params/CommentRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.comment.params; +package com.chargebee.v4.models.comment.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/responses/comment/CommentCreateResponse.java b/src/main/java/com/chargebee/v4/models/comment/responses/CommentCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/comment/CommentCreateResponse.java rename to src/main/java/com/chargebee/v4/models/comment/responses/CommentCreateResponse.java index 8ceabd36..229d3245 100644 --- a/src/main/java/com/chargebee/v4/core/responses/comment/CommentCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/comment/responses/CommentCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.comment; +package com.chargebee.v4.models.comment.responses; -import com.chargebee.v4.core.models.comment.Comment; +import com.chargebee.v4.models.comment.Comment; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/comment/CommentDeleteResponse.java b/src/main/java/com/chargebee/v4/models/comment/responses/CommentDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/comment/CommentDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/comment/responses/CommentDeleteResponse.java index 428d669c..1a3692d3 100644 --- a/src/main/java/com/chargebee/v4/core/responses/comment/CommentDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/comment/responses/CommentDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.comment; +package com.chargebee.v4.models.comment.responses; -import com.chargebee.v4.core.models.comment.Comment; +import com.chargebee.v4.models.comment.Comment; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/comment/CommentListResponse.java b/src/main/java/com/chargebee/v4/models/comment/responses/CommentListResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/comment/CommentListResponse.java rename to src/main/java/com/chargebee/v4/models/comment/responses/CommentListResponse.java index f3d616e9..2df463d7 100644 --- a/src/main/java/com/chargebee/v4/core/responses/comment/CommentListResponse.java +++ b/src/main/java/com/chargebee/v4/models/comment/responses/CommentListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.comment; +package com.chargebee.v4.models.comment.responses; import java.util.List; -import com.chargebee.v4.core.models.comment.Comment; +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.core.services.CommentService; -import com.chargebee.v4.core.models.comment.params.CommentListParams; +import com.chargebee.v4.services.CommentService; +import com.chargebee.v4.models.comment.params.CommentListParams; /** Immutable response object for CommentList operation. Contains paginated list data. */ public final class CommentListResponse { @@ -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/CommentRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/comment/responses/CommentRetrieveResponse.java new file mode 100644 index 00000000..b9a0df8d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/comment/responses/CommentRetrieveResponse.java @@ -0,0 +1,77 @@ +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 CommentRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class CommentRetrieveResponse extends BaseResponse { + private final Comment comment; + + private CommentRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.comment = builder.comment; + } + + /** Parse JSON response into CommentRetrieveResponse object. */ + public static CommentRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CommentRetrieveResponse object with HTTP response. */ + public static CommentRetrieveResponse 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 CommentRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for CommentRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CommentRetrieveResponse. */ + 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 CommentRetrieveResponse build() { + return new CommentRetrieveResponse(this); + } + } + + /** Get the comment from the response. */ + public Comment getComment() { + return comment; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/configuration/Configuration.java b/src/main/java/com/chargebee/v4/models/configuration/Configuration.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/configuration/Configuration.java rename to src/main/java/com/chargebee/v4/models/configuration/Configuration.java index b3ba1a85..98e0b22d 100644 --- a/src/main/java/com/chargebee/v4/core/models/configuration/Configuration.java +++ b/src/main/java/com/chargebee/v4/models/configuration/Configuration.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.configuration; +package com.chargebee.v4.models.configuration; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/core/models/configuration/params/ConfigurationListParams.java b/src/main/java/com/chargebee/v4/models/configuration/params/ConfigurationListParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/configuration/params/ConfigurationListParams.java rename to src/main/java/com/chargebee/v4/models/configuration/params/ConfigurationListParams.java index 6f923a10..a036accc 100644 --- a/src/main/java/com/chargebee/v4/core/models/configuration/params/ConfigurationListParams.java +++ b/src/main/java/com/chargebee/v4/models/configuration/params/ConfigurationListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.configuration.params; +package com.chargebee.v4.models.configuration.params; import com.chargebee.v4.internal.Recommended; 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/core/models/contact/Contact.java b/src/main/java/com/chargebee/v4/models/contact/Contact.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/contact/Contact.java rename to src/main/java/com/chargebee/v4/models/contact/Contact.java index 714fedea..ab1102f8 100644 --- a/src/main/java/com/chargebee/v4/core/models/contact/Contact.java +++ b/src/main/java/com/chargebee/v4/models/contact/Contact.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.contact; +package com.chargebee.v4.models.contact; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/core/models/contractTerm/ContractTerm.java b/src/main/java/com/chargebee/v4/models/contractTerm/ContractTerm.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/contractTerm/ContractTerm.java rename to src/main/java/com/chargebee/v4/models/contractTerm/ContractTerm.java index 06b70024..34d08fde 100644 --- a/src/main/java/com/chargebee/v4/core/models/contractTerm/ContractTerm.java +++ b/src/main/java/com/chargebee/v4/models/contractTerm/ContractTerm.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.contractTerm; +package com.chargebee.v4.models.contractTerm; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/coupon/Coupon.java b/src/main/java/com/chargebee/v4/models/coupon/Coupon.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/coupon/Coupon.java rename to src/main/java/com/chargebee/v4/models/coupon/Coupon.java index b04e82fa..a1304717 100644 --- a/src/main/java/com/chargebee/v4/core/models/coupon/Coupon.java +++ b/src/main/java/com/chargebee/v4/models/coupon/Coupon.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.coupon; +package com.chargebee.v4.models.coupon; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; @@ -48,7 +48,7 @@ public class Coupon { private Boolean includedInMrr; private List addonIds; - private java.util.Map customFields = new java.util.HashMap<>(); + private java.util.Map customFields = new java.util.HashMap<>(); public String getId() { return id; @@ -194,7 +194,7 @@ public List getAddonIds() { * * @return map containing all custom fields */ - public java.util.Map getCustomFields() { + public java.util.Map getCustomFields() { return customFields; } @@ -204,7 +204,7 @@ public java.util.Map getCustomFields() { * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") * @return the value of the custom field, or null if not present */ - public Object getCustomField(String fieldName) { + public String getCustomField(String fieldName) { return customFields.get(fieldName); } @@ -465,7 +465,7 @@ public static PlanConstraint fromString(String value) { public static Coupon fromJson(String json) { Coupon obj = new Coupon(); - // Parse JSON to extract all keys + // Parse JSON to extract all keys for custom field extraction java.util.Set knownFields = new java.util.HashSet<>(); knownFields.add("id"); @@ -631,9 +631,9 @@ public static Coupon fromJson(String json) { * @param knownFields set of known field names * @return map of custom fields */ - private static java.util.Map extractCustomFields( + private static java.util.Map extractCustomFields( String json, java.util.Set knownFields) { - java.util.Map customFields = new java.util.HashMap<>(); + java.util.Map customFields = new java.util.HashMap<>(); try { // Parse the entire JSON as a map java.util.Map allFields = JsonUtil.parseJsonObjectToMap(json); @@ -642,7 +642,8 @@ private static java.util.Map extractCustomFields( String key = entry.getKey(); // Include fields that start with "cf_" and are not in knownFields if (key != null && key.startsWith("cf_") && !knownFields.contains(key)) { - customFields.put(key, entry.getValue()); + customFields.put( + key, entry.getValue() != null ? String.valueOf(entry.getValue()) : null); } } } diff --git a/src/main/java/com/chargebee/v4/models/coupon/params/CouponCopyParams.java b/src/main/java/com/chargebee/v4/models/coupon/params/CouponCopyParams.java new file mode 100644 index 00000000..90eb5f6e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/coupon/params/CouponCopyParams.java @@ -0,0 +1,120 @@ +/* + * 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 CouponCopyParams { + + private final String fromSite; + + private final String idAtFromSite; + + private final String id; + + private final Boolean forSiteMerging; + + private CouponCopyParams(CouponCopyBuilder builder) { + + this.fromSite = builder.fromSite; + + this.idAtFromSite = builder.idAtFromSite; + + this.id = builder.id; + + this.forSiteMerging = builder.forSiteMerging; + } + + public String getFromSite() { + return fromSite; + } + + public String getIdAtFromSite() { + return idAtFromSite; + } + + public String getId() { + return id; + } + + public Boolean getForSiteMerging() { + return forSiteMerging; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.fromSite != null) { + + formData.put("from_site", this.fromSite); + } + + if (this.idAtFromSite != null) { + + formData.put("id_at_from_site", this.idAtFromSite); + } + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.forSiteMerging != null) { + + formData.put("for_site_merging", this.forSiteMerging); + } + + return formData; + } + + /** Create a new builder for CouponCopyParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponCopyBuilder builder() { + return new CouponCopyBuilder(); + } + + public static final class CouponCopyBuilder { + + private String fromSite; + + private String idAtFromSite; + + private String id; + + private Boolean forSiteMerging; + + private CouponCopyBuilder() {} + + public CouponCopyBuilder fromSite(String value) { + this.fromSite = value; + return this; + } + + public CouponCopyBuilder idAtFromSite(String value) { + this.idAtFromSite = value; + return this; + } + + public CouponCopyBuilder id(String value) { + this.id = value; + return this; + } + + public CouponCopyBuilder forSiteMerging(Boolean value) { + this.forSiteMerging = value; + return this; + } + + public CouponCopyParams build() { + return new CouponCopyParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/coupon/params/CouponCreateForItemsParams.java b/src/main/java/com/chargebee/v4/models/coupon/params/CouponCreateForItemsParams.java new file mode 100644 index 00000000..f3bf1963 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/coupon/params/CouponCreateForItemsParams.java @@ -0,0 +1,1172 @@ +/* + * 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 CouponCreateForItemsParams { + + private final String id; + + 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 Status status; + + private final List itemConstraints; + + private final List itemConstraintCriteria; + + private final List couponConstraints; + + private final Map customFields; + + private CouponCreateForItemsParams(CouponCreateForItemsBuilder builder) { + + this.id = builder.id; + + 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.status = builder.status; + + 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 getId() { + return id; + } + + 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 Status getStatus() { + return status; + } + + 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.id != null) { + + formData.put("id", this.id); + } + + 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.status != null) { + + formData.put("status", this.status); + } + + 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 CouponCreateForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponCreateForItemsBuilder builder() { + return new CouponCreateForItemsBuilder(); + } + + public static final class CouponCreateForItemsBuilder { + + private String id; + + 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 Status status; + + private List itemConstraints; + + private List itemConstraintCriteria; + + private List couponConstraints; + + private Map customFields = new LinkedHashMap<>(); + + private CouponCreateForItemsBuilder() {} + + public CouponCreateForItemsBuilder id(String value) { + this.id = value; + return this; + } + + public CouponCreateForItemsBuilder name(String value) { + this.name = value; + return this; + } + + public CouponCreateForItemsBuilder invoiceName(String value) { + this.invoiceName = value; + return this; + } + + public CouponCreateForItemsBuilder discountType(DiscountType value) { + this.discountType = value; + return this; + } + + public CouponCreateForItemsBuilder discountAmount(Long value) { + this.discountAmount = value; + return this; + } + + public CouponCreateForItemsBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public CouponCreateForItemsBuilder discountPercentage(Number value) { + this.discountPercentage = value; + return this; + } + + public CouponCreateForItemsBuilder discountQuantity(Integer value) { + this.discountQuantity = value; + return this; + } + + public CouponCreateForItemsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public CouponCreateForItemsBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public CouponCreateForItemsBuilder durationMonth(Integer value) { + this.durationMonth = value; + return this; + } + + public CouponCreateForItemsBuilder validFrom(Timestamp value) { + this.validFrom = value; + return this; + } + + public CouponCreateForItemsBuilder validTill(Timestamp value) { + this.validTill = value; + return this; + } + + public CouponCreateForItemsBuilder maxRedemptions(Integer value) { + this.maxRedemptions = value; + return this; + } + + public CouponCreateForItemsBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public CouponCreateForItemsBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public CouponCreateForItemsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public CouponCreateForItemsBuilder period(Integer value) { + this.period = value; + return this; + } + + public CouponCreateForItemsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public CouponCreateForItemsBuilder status(Status value) { + this.status = value; + return this; + } + + public CouponCreateForItemsBuilder itemConstraints(List value) { + this.itemConstraints = value; + return this; + } + + public CouponCreateForItemsBuilder itemConstraintCriteria( + List value) { + this.itemConstraintCriteria = value; + return this; + } + + public CouponCreateForItemsBuilder 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 CouponCreateForItemsBuilder 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 CouponCreateForItemsBuilder 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 CouponCreateForItemsParams build() { + return new CouponCreateForItemsParams(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 enum Status { + ACTIVE("active"), + + ARCHIVED("archived"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.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/CouponCreateParams.java b/src/main/java/com/chargebee/v4/models/coupon/params/CouponCreateParams.java new file mode 100644 index 00000000..8ef6bb0a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/coupon/params/CouponCreateParams.java @@ -0,0 +1,715 @@ +/* + * 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.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class CouponCreateParams { + + private final String id; + + 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 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 PlanConstraint planConstraint; + + private final AddonConstraint addonConstraint; + + private final List planIds; + + private final List addonIds; + + private final Status status; + + private CouponCreateParams(CouponCreateBuilder builder) { + + this.id = builder.id; + + 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.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.planConstraint = builder.planConstraint; + + this.addonConstraint = builder.addonConstraint; + + this.planIds = builder.planIds; + + this.addonIds = builder.addonIds; + + this.status = builder.status; + } + + public String getId() { + return id; + } + + 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 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 PlanConstraint getPlanConstraint() { + return planConstraint; + } + + public AddonConstraint getAddonConstraint() { + return addonConstraint; + } + + public List getPlanIds() { + return planIds; + } + + public List getAddonIds() { + return addonIds; + } + + public Status getStatus() { + return status; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + 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.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.planConstraint != null) { + + formData.put("plan_constraint", this.planConstraint); + } + + if (this.addonConstraint != null) { + + formData.put("addon_constraint", this.addonConstraint); + } + + if (this.planIds != null) { + + formData.put("plan_ids", this.planIds); + } + + if (this.addonIds != null) { + + formData.put("addon_ids", this.addonIds); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + return formData; + } + + /** Create a new builder for CouponCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponCreateBuilder builder() { + return new CouponCreateBuilder(); + } + + public static final class CouponCreateBuilder { + + private String id; + + 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 validTill; + + private Integer maxRedemptions; + + private String invoiceNotes; + + private java.util.Map metaData; + + private Boolean includedInMrr; + + private Integer period; + + private PeriodUnit periodUnit; + + private PlanConstraint planConstraint; + + private AddonConstraint addonConstraint; + + private List planIds; + + private List addonIds; + + private Status status; + + private CouponCreateBuilder() {} + + public CouponCreateBuilder id(String value) { + this.id = value; + return this; + } + + public CouponCreateBuilder name(String value) { + this.name = value; + return this; + } + + public CouponCreateBuilder invoiceName(String value) { + this.invoiceName = value; + return this; + } + + public CouponCreateBuilder discountType(DiscountType value) { + this.discountType = value; + return this; + } + + public CouponCreateBuilder discountAmount(Long value) { + this.discountAmount = value; + return this; + } + + public CouponCreateBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public CouponCreateBuilder discountPercentage(Number value) { + this.discountPercentage = value; + return this; + } + + public CouponCreateBuilder discountQuantity(Integer value) { + this.discountQuantity = value; + return this; + } + + public CouponCreateBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public CouponCreateBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public CouponCreateBuilder durationMonth(Integer value) { + this.durationMonth = value; + return this; + } + + public CouponCreateBuilder validTill(Timestamp value) { + this.validTill = value; + return this; + } + + public CouponCreateBuilder maxRedemptions(Integer value) { + this.maxRedemptions = value; + return this; + } + + public CouponCreateBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public CouponCreateBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public CouponCreateBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public CouponCreateBuilder period(Integer value) { + this.period = value; + return this; + } + + public CouponCreateBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public CouponCreateBuilder planConstraint(PlanConstraint value) { + this.planConstraint = value; + return this; + } + + public CouponCreateBuilder addonConstraint(AddonConstraint value) { + this.addonConstraint = value; + return this; + } + + public CouponCreateBuilder planIds(List value) { + this.planIds = value; + return this; + } + + public CouponCreateBuilder addonIds(List value) { + this.addonIds = value; + return this; + } + + public CouponCreateBuilder status(Status value) { + this.status = value; + return this; + } + + public CouponCreateParams build() { + return new CouponCreateParams(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 enum PlanConstraint { + NONE("none"), + + ALL("all"), + + SPECIFIC("specific"), + + /** An enum member indicating that PlanConstraint was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PlanConstraint(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PlanConstraint fromString(String value) { + if (value == null) return _UNKNOWN; + for (PlanConstraint enumValue : PlanConstraint.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AddonConstraint { + NONE("none"), + + ALL("all"), + + SPECIFIC("specific"), + + /** An enum member indicating that AddonConstraint was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AddonConstraint(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AddonConstraint fromString(String value) { + if (value == null) return _UNKNOWN; + for (AddonConstraint enumValue : AddonConstraint.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + ACTIVE("active"), + + ARCHIVED("archived"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.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/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/core/models/coupon/params/CouponListParams.java b/src/main/java/com/chargebee/v4/models/coupon/params/CouponListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/coupon/params/CouponListParams.java rename to src/main/java/com/chargebee/v4/models/coupon/params/CouponListParams.java index 5865da85..0fa17b94 100644 --- a/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponListParams.java +++ b/src/main/java/com/chargebee/v4/models/coupon/params/CouponListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.coupon.params; +package com.chargebee.v4.models.coupon.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponRetrieveParams.java b/src/main/java/com/chargebee/v4/models/coupon/params/CouponRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/coupon/params/CouponRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/coupon/params/CouponRetrieveParams.java index 3637801d..06356d58 100644 --- a/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/coupon/params/CouponRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.coupon.params; +package com.chargebee.v4.models.coupon.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponUnarchiveParams.java b/src/main/java/com/chargebee/v4/models/coupon/params/CouponUnarchiveParams.java similarity index 77% rename from src/main/java/com/chargebee/v4/core/models/coupon/params/CouponUnarchiveParams.java rename to src/main/java/com/chargebee/v4/models/coupon/params/CouponUnarchiveParams.java index 05560859..9a7586ab 100644 --- a/src/main/java/com/chargebee/v4/core/models/coupon/params/CouponUnarchiveParams.java +++ b/src/main/java/com/chargebee/v4/models/coupon/params/CouponUnarchiveParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.coupon.params; +package com.chargebee.v4.models.coupon.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class CouponUnarchiveParams { - private final Map formData; - - private CouponUnarchiveParams(CouponUnarchiveBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private CouponUnarchiveParams(CouponUnarchiveBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static CouponUnarchiveBuilder builder() { } public static final class CouponUnarchiveBuilder { - private final Map formData = new LinkedHashMap<>(); private CouponUnarchiveBuilder() {} 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/CouponUpdateParams.java b/src/main/java/com/chargebee/v4/models/coupon/params/CouponUpdateParams.java new file mode 100644 index 00000000..ca180d7b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/coupon/params/CouponUpdateParams.java @@ -0,0 +1,647 @@ +/* + * 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.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class CouponUpdateParams { + + 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 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 PlanConstraint planConstraint; + + private final AddonConstraint addonConstraint; + + private final List planIds; + + private final List addonIds; + + private CouponUpdateParams(CouponUpdateBuilder 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.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.planConstraint = builder.planConstraint; + + this.addonConstraint = builder.addonConstraint; + + this.planIds = builder.planIds; + + this.addonIds = builder.addonIds; + } + + 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 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 PlanConstraint getPlanConstraint() { + return planConstraint; + } + + public AddonConstraint getAddonConstraint() { + return addonConstraint; + } + + public List getPlanIds() { + return planIds; + } + + public List getAddonIds() { + return addonIds; + } + + /** 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.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.planConstraint != null) { + + formData.put("plan_constraint", this.planConstraint); + } + + if (this.addonConstraint != null) { + + formData.put("addon_constraint", this.addonConstraint); + } + + if (this.planIds != null) { + + formData.put("plan_ids", this.planIds); + } + + if (this.addonIds != null) { + + formData.put("addon_ids", this.addonIds); + } + + return formData; + } + + /** Create a new builder for CouponUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponUpdateBuilder builder() { + return new CouponUpdateBuilder(); + } + + public static final class CouponUpdateBuilder { + + 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 validTill; + + private Integer maxRedemptions; + + private String invoiceNotes; + + private java.util.Map metaData; + + private Boolean includedInMrr; + + private Integer period; + + private PeriodUnit periodUnit; + + private PlanConstraint planConstraint; + + private AddonConstraint addonConstraint; + + private List planIds; + + private List addonIds; + + private CouponUpdateBuilder() {} + + public CouponUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public CouponUpdateBuilder invoiceName(String value) { + this.invoiceName = value; + return this; + } + + public CouponUpdateBuilder discountType(DiscountType value) { + this.discountType = value; + return this; + } + + public CouponUpdateBuilder discountAmount(Long value) { + this.discountAmount = value; + return this; + } + + public CouponUpdateBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public CouponUpdateBuilder discountPercentage(Number value) { + this.discountPercentage = value; + return this; + } + + public CouponUpdateBuilder discountQuantity(Integer value) { + this.discountQuantity = value; + return this; + } + + public CouponUpdateBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public CouponUpdateBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public CouponUpdateBuilder durationMonth(Integer value) { + this.durationMonth = value; + return this; + } + + public CouponUpdateBuilder validTill(Timestamp value) { + this.validTill = value; + return this; + } + + public CouponUpdateBuilder maxRedemptions(Integer value) { + this.maxRedemptions = value; + return this; + } + + public CouponUpdateBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public CouponUpdateBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public CouponUpdateBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public CouponUpdateBuilder period(Integer value) { + this.period = value; + return this; + } + + public CouponUpdateBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public CouponUpdateBuilder planConstraint(PlanConstraint value) { + this.planConstraint = value; + return this; + } + + public CouponUpdateBuilder addonConstraint(AddonConstraint value) { + this.addonConstraint = value; + return this; + } + + public CouponUpdateBuilder planIds(List value) { + this.planIds = value; + return this; + } + + public CouponUpdateBuilder addonIds(List value) { + this.addonIds = value; + return this; + } + + public CouponUpdateParams build() { + return new CouponUpdateParams(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 enum PlanConstraint { + NONE("none"), + + ALL("all"), + + SPECIFIC("specific"), + + /** An enum member indicating that PlanConstraint was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PlanConstraint(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PlanConstraint fromString(String value) { + if (value == null) return _UNKNOWN; + for (PlanConstraint enumValue : PlanConstraint.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AddonConstraint { + NONE("none"), + + ALL("all"), + + SPECIFIC("specific"), + + /** An enum member indicating that AddonConstraint was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AddonConstraint(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AddonConstraint fromString(String value) { + if (value == null) return _UNKNOWN; + for (AddonConstraint enumValue : AddonConstraint.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponCopyResponse.java b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponCopyResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/coupon/CouponCopyResponse.java rename to src/main/java/com/chargebee/v4/models/coupon/responses/CouponCopyResponse.java index 5e37bc7a..8d26480a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponCopyResponse.java +++ b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponCopyResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.coupon; +package com.chargebee.v4.models.coupon.responses; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.coupon.Coupon; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponCreateForItemsResponse.java b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponCreateForItemsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/coupon/CouponCreateForItemsResponse.java rename to src/main/java/com/chargebee/v4/models/coupon/responses/CouponCreateForItemsResponse.java index dd7d106e..05b8310c 100644 --- a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponCreateForItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponCreateForItemsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.coupon; +package com.chargebee.v4.models.coupon.responses; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.coupon.Coupon; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponCreateResponse.java b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/coupon/CouponCreateResponse.java rename to src/main/java/com/chargebee/v4/models/coupon/responses/CouponCreateResponse.java index c0015b25..35524225 100644 --- a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.coupon; +package com.chargebee.v4.models.coupon.responses; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.coupon.Coupon; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponDeleteResponse.java b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/coupon/CouponDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/coupon/responses/CouponDeleteResponse.java index b8838859..28aa79b5 100644 --- a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.coupon; +package com.chargebee.v4.models.coupon.responses; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.coupon.Coupon; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponListResponse.java b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponListResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/coupon/CouponListResponse.java rename to src/main/java/com/chargebee/v4/models/coupon/responses/CouponListResponse.java index 27c2345b..afc11db0 100644 --- a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponListResponse.java +++ b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.coupon; +package com.chargebee.v4.models.coupon.responses; import java.util.List; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.coupon.Coupon; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.CouponService; -import com.chargebee.v4.core.models.coupon.params.CouponListParams; +import com.chargebee.v4.services.CouponService; +import com.chargebee.v4.models.coupon.params.CouponListParams; /** Immutable response object for CouponList operation. Contains paginated list data. */ public final class CouponListResponse { @@ -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 CouponListResponse nextPage() throws Exception { + public CouponListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/coupon/responses/CouponRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponRetrieveResponse.java new file mode 100644 index 00000000..bc613eb1 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.coupon.responses; + +import com.chargebee.v4.models.coupon.Coupon; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CouponRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class CouponRetrieveResponse extends BaseResponse { + private final Coupon coupon; + + private CouponRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.coupon = builder.coupon; + } + + /** Parse JSON response into CouponRetrieveResponse object. */ + public static CouponRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CouponRetrieveResponse object with HTTP response. */ + public static CouponRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __couponJson = JsonUtil.getObject(json, "coupon"); + if (__couponJson != null) { + builder.coupon(Coupon.fromJson(__couponJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CouponRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for CouponRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CouponRetrieveResponse. */ + public static class Builder { + + private Coupon coupon; + + private Response httpResponse; + + private Builder() {} + + public Builder coupon(Coupon coupon) { + this.coupon = coupon; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CouponRetrieveResponse build() { + return new CouponRetrieveResponse(this); + } + } + + /** Get the coupon from the response. */ + public Coupon getCoupon() { + return coupon; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponUnarchiveResponse.java b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponUnarchiveResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/coupon/CouponUnarchiveResponse.java rename to src/main/java/com/chargebee/v4/models/coupon/responses/CouponUnarchiveResponse.java index 61e15737..33890d4a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponUnarchiveResponse.java +++ b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponUnarchiveResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.coupon; +package com.chargebee.v4.models.coupon.responses; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.coupon.Coupon; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponUpdateForItemsResponse.java b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponUpdateForItemsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/coupon/CouponUpdateForItemsResponse.java rename to src/main/java/com/chargebee/v4/models/coupon/responses/CouponUpdateForItemsResponse.java index bc1e70fc..06d37a99 100644 --- a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponUpdateForItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponUpdateForItemsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.coupon; +package com.chargebee.v4.models.coupon.responses; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.coupon.Coupon; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponUpdateResponse.java b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/coupon/CouponUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/coupon/responses/CouponUpdateResponse.java index 95ca598f..9d695499 100644 --- a/src/main/java/com/chargebee/v4/core/responses/coupon/CouponUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/coupon/responses/CouponUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.coupon; +package com.chargebee.v4.models.coupon.responses; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.coupon.Coupon; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/couponCode/CouponCode.java b/src/main/java/com/chargebee/v4/models/couponCode/CouponCode.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/couponCode/CouponCode.java rename to src/main/java/com/chargebee/v4/models/couponCode/CouponCode.java index 41ca9c06..494039e4 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponCode/CouponCode.java +++ b/src/main/java/com/chargebee/v4/models/couponCode/CouponCode.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponCode; +package com.chargebee.v4.models.couponCode; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/core/models/couponCode/params/CouponCodeArchiveParams.java b/src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeArchiveParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/couponCode/params/CouponCodeArchiveParams.java rename to src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeArchiveParams.java index c08485ea..c64fbd46 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponCode/params/CouponCodeArchiveParams.java +++ b/src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeArchiveParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponCode.params; +package com.chargebee.v4.models.couponCode.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class CouponCodeArchiveParams { - private final Map formData; - - private CouponCodeArchiveParams(CouponCodeArchiveBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private CouponCodeArchiveParams(CouponCodeArchiveBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static CouponCodeArchiveBuilder builder() { } public static final class CouponCodeArchiveBuilder { - private final Map formData = new LinkedHashMap<>(); private CouponCodeArchiveBuilder() {} diff --git a/src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeCreateParams.java b/src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeCreateParams.java new file mode 100644 index 00000000..73963faa --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeCreateParams.java @@ -0,0 +1,100 @@ +/* + * 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.couponCode.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CouponCodeCreateParams { + + private final String couponId; + + private final String couponSetName; + + private final String code; + + private CouponCodeCreateParams(CouponCodeCreateBuilder builder) { + + this.couponId = builder.couponId; + + this.couponSetName = builder.couponSetName; + + this.code = builder.code; + } + + public String getCouponId() { + return couponId; + } + + public String getCouponSetName() { + return couponSetName; + } + + public String getCode() { + return code; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.couponId != null) { + + formData.put("coupon_id", this.couponId); + } + + if (this.couponSetName != null) { + + formData.put("coupon_set_name", this.couponSetName); + } + + if (this.code != null) { + + formData.put("code", this.code); + } + + return formData; + } + + /** Create a new builder for CouponCodeCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponCodeCreateBuilder builder() { + return new CouponCodeCreateBuilder(); + } + + public static final class CouponCodeCreateBuilder { + + private String couponId; + + private String couponSetName; + + private String code; + + private CouponCodeCreateBuilder() {} + + public CouponCodeCreateBuilder couponId(String value) { + this.couponId = value; + return this; + } + + public CouponCodeCreateBuilder couponSetName(String value) { + this.couponSetName = value; + return this; + } + + public CouponCodeCreateBuilder code(String value) { + this.code = value; + return this; + } + + public CouponCodeCreateParams build() { + return new CouponCodeCreateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/couponCode/params/CouponCodeListParams.java b/src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/couponCode/params/CouponCodeListParams.java rename to src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeListParams.java index 3f858a75..96be749a 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponCode/params/CouponCodeListParams.java +++ b/src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponCode.params; +package com.chargebee.v4.models.couponCode.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/couponCode/params/CouponCodeRetrieveParams.java b/src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/couponCode/params/CouponCodeRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeRetrieveParams.java index a8c55d72..69a31afc 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponCode/params/CouponCodeRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponCode.params; +package com.chargebee.v4.models.couponCode.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/responses/couponCode/CouponCodeArchiveResponse.java b/src/main/java/com/chargebee/v4/models/couponCode/responses/CouponCodeArchiveResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/couponCode/CouponCodeArchiveResponse.java rename to src/main/java/com/chargebee/v4/models/couponCode/responses/CouponCodeArchiveResponse.java index b50ae736..de47aa1c 100644 --- a/src/main/java/com/chargebee/v4/core/responses/couponCode/CouponCodeArchiveResponse.java +++ b/src/main/java/com/chargebee/v4/models/couponCode/responses/CouponCodeArchiveResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.couponCode; +package com.chargebee.v4.models.couponCode.responses; -import com.chargebee.v4.core.models.couponCode.CouponCode; +import com.chargebee.v4.models.couponCode.CouponCode; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/couponCode/CouponCodeCreateResponse.java b/src/main/java/com/chargebee/v4/models/couponCode/responses/CouponCodeCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/couponCode/CouponCodeCreateResponse.java rename to src/main/java/com/chargebee/v4/models/couponCode/responses/CouponCodeCreateResponse.java index 460c87b5..6d921400 100644 --- a/src/main/java/com/chargebee/v4/core/responses/couponCode/CouponCodeCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/couponCode/responses/CouponCodeCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.couponCode; +package com.chargebee.v4.models.couponCode.responses; -import com.chargebee.v4.core.models.couponCode.CouponCode; +import com.chargebee.v4.models.couponCode.CouponCode; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/couponCode/CouponCodeListResponse.java b/src/main/java/com/chargebee/v4/models/couponCode/responses/CouponCodeListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/couponCode/CouponCodeListResponse.java rename to src/main/java/com/chargebee/v4/models/couponCode/responses/CouponCodeListResponse.java index 37466ef3..23ee2c5e 100644 --- a/src/main/java/com/chargebee/v4/core/responses/couponCode/CouponCodeListResponse.java +++ b/src/main/java/com/chargebee/v4/models/couponCode/responses/CouponCodeListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.couponCode; +package com.chargebee.v4.models.couponCode.responses; import java.util.List; -import com.chargebee.v4.core.models.couponCode.CouponCode; +import com.chargebee.v4.models.couponCode.CouponCode; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.CouponCodeService; -import com.chargebee.v4.core.models.couponCode.params.CouponCodeListParams; +import com.chargebee.v4.services.CouponCodeService; +import com.chargebee.v4.models.couponCode.params.CouponCodeListParams; /** Immutable response object for CouponCodeList operation. Contains paginated list data. */ public final class CouponCodeListResponse { @@ -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 CouponCodeListResponse nextPage() throws Exception { + public CouponCodeListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/couponCode/responses/CouponCodeRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/couponCode/responses/CouponCodeRetrieveResponse.java new file mode 100644 index 00000000..511f72d5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/couponCode/responses/CouponCodeRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.couponCode.responses; + +import com.chargebee.v4.models.couponCode.CouponCode; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CouponCodeRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class CouponCodeRetrieveResponse extends BaseResponse { + private final CouponCode couponCode; + + private CouponCodeRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.couponCode = builder.couponCode; + } + + /** Parse JSON response into CouponCodeRetrieveResponse object. */ + public static CouponCodeRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CouponCodeRetrieveResponse object with HTTP response. */ + public static CouponCodeRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __couponCodeJson = JsonUtil.getObject(json, "coupon_code"); + if (__couponCodeJson != null) { + builder.couponCode(CouponCode.fromJson(__couponCodeJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CouponCodeRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for CouponCodeRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CouponCodeRetrieveResponse. */ + public static class Builder { + + private CouponCode couponCode; + + private Response httpResponse; + + private Builder() {} + + public Builder couponCode(CouponCode couponCode) { + this.couponCode = couponCode; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CouponCodeRetrieveResponse build() { + return new CouponCodeRetrieveResponse(this); + } + } + + /** Get the couponCode from the response. */ + public CouponCode getCouponCode() { + return couponCode; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/couponSet/CouponSet.java b/src/main/java/com/chargebee/v4/models/couponSet/CouponSet.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/couponSet/CouponSet.java rename to src/main/java/com/chargebee/v4/models/couponSet/CouponSet.java index e50673ce..fe03f80a 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponSet/CouponSet.java +++ b/src/main/java/com/chargebee/v4/models/couponSet/CouponSet.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponSet; +package com.chargebee.v4.models.couponSet; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetAddCouponCodesParams.java b/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetAddCouponCodesParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetAddCouponCodesParams.java rename to src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetAddCouponCodesParams.java index a12d0cff..15936fcf 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetAddCouponCodesParams.java +++ b/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetAddCouponCodesParams.java @@ -4,25 +4,36 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponSet.params; +package com.chargebee.v4.models.couponSet.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; import java.util.List; public final class CouponSetAddCouponCodesParams { - private final Map formData; + private final List code; private CouponSetAddCouponCodesParams(CouponSetAddCouponCodesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); + + this.code = builder.code; + } + + public List getCode() { + return code; } /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.code != null) { + + formData.put("code", this.code); + } + return formData; } @@ -33,14 +44,13 @@ public static CouponSetAddCouponCodesBuilder builder() { } public static final class CouponSetAddCouponCodesBuilder { - private final Map formData = new LinkedHashMap<>(); + + private List code; private CouponSetAddCouponCodesBuilder() {} public CouponSetAddCouponCodesBuilder code(List value) { - - formData.put("code", value); - + this.code = value; return this; } diff --git a/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetCreateParams.java b/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetCreateParams.java new file mode 100644 index 00000000..7210d629 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetCreateParams.java @@ -0,0 +1,121 @@ +/* + * 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.couponSet.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CouponSetCreateParams { + + private final String couponId; + + private final String name; + + private final String id; + + private final java.util.Map metaData; + + private CouponSetCreateParams(CouponSetCreateBuilder builder) { + + this.couponId = builder.couponId; + + this.name = builder.name; + + this.id = builder.id; + + this.metaData = builder.metaData; + } + + public String getCouponId() { + return couponId; + } + + public String getName() { + return name; + } + + public String getId() { + return id; + } + + public java.util.Map getMetaData() { + return metaData; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.couponId != null) { + + formData.put("coupon_id", this.couponId); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + return formData; + } + + /** Create a new builder for CouponSetCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponSetCreateBuilder builder() { + return new CouponSetCreateBuilder(); + } + + public static final class CouponSetCreateBuilder { + + private String couponId; + + private String name; + + private String id; + + private java.util.Map metaData; + + private CouponSetCreateBuilder() {} + + public CouponSetCreateBuilder couponId(String value) { + this.couponId = value; + return this; + } + + public CouponSetCreateBuilder name(String value) { + this.name = value; + return this; + } + + public CouponSetCreateBuilder id(String value) { + this.id = value; + return this; + } + + public CouponSetCreateBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public CouponSetCreateParams build() { + return new CouponSetCreateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetDeleteParams.java b/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetDeleteParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetDeleteParams.java rename to src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetDeleteParams.java index e524a029..031d8ebe 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetDeleteParams.java +++ b/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetDeleteParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponSet.params; +package com.chargebee.v4.models.couponSet.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class CouponSetDeleteParams { - private final Map formData; - - private CouponSetDeleteParams(CouponSetDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private CouponSetDeleteParams(CouponSetDeleteBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static CouponSetDeleteBuilder builder() { } public static final class CouponSetDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); private CouponSetDeleteBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetDeleteUnusedCouponCodesParams.java b/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetDeleteUnusedCouponCodesParams.java similarity index 77% rename from src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetDeleteUnusedCouponCodesParams.java rename to src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetDeleteUnusedCouponCodesParams.java index 1bb7350b..222707c9 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetDeleteUnusedCouponCodesParams.java +++ b/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetDeleteUnusedCouponCodesParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponSet.params; +package com.chargebee.v4.models.couponSet.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class CouponSetDeleteUnusedCouponCodesParams { - private final Map formData; - - private CouponSetDeleteUnusedCouponCodesParams(CouponSetDeleteUnusedCouponCodesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private CouponSetDeleteUnusedCouponCodesParams(CouponSetDeleteUnusedCouponCodesBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static CouponSetDeleteUnusedCouponCodesBuilder builder() { } public static final class CouponSetDeleteUnusedCouponCodesBuilder { - private final Map formData = new LinkedHashMap<>(); private CouponSetDeleteUnusedCouponCodesBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetListParams.java b/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetListParams.java rename to src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetListParams.java index c8ad4578..042d346e 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetListParams.java +++ b/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponSet.params; +package com.chargebee.v4.models.couponSet.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetRetrieveParams.java b/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetRetrieveParams.java index c2540621..8bde6362 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponSet/params/CouponSetRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponSet.params; +package com.chargebee.v4.models.couponSet.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetUpdateParams.java b/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetUpdateParams.java new file mode 100644 index 00000000..bfbb5c04 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/couponSet/params/CouponSetUpdateParams.java @@ -0,0 +1,81 @@ +/* + * 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.couponSet.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CouponSetUpdateParams { + + private final String name; + + private final java.util.Map metaData; + + private CouponSetUpdateParams(CouponSetUpdateBuilder builder) { + + this.name = builder.name; + + this.metaData = builder.metaData; + } + + public String getName() { + return name; + } + + public java.util.Map getMetaData() { + return metaData; + } + + /** 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.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + return formData; + } + + /** Create a new builder for CouponSetUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponSetUpdateBuilder builder() { + return new CouponSetUpdateBuilder(); + } + + public static final class CouponSetUpdateBuilder { + + private String name; + + private java.util.Map metaData; + + private CouponSetUpdateBuilder() {} + + public CouponSetUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public CouponSetUpdateBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public CouponSetUpdateParams build() { + return new CouponSetUpdateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetAddCouponCodesResponse.java b/src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetAddCouponCodesResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetAddCouponCodesResponse.java rename to src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetAddCouponCodesResponse.java index 0a665a56..4c833f88 100644 --- a/src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetAddCouponCodesResponse.java +++ b/src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetAddCouponCodesResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.couponSet; +package com.chargebee.v4.models.couponSet.responses; -import com.chargebee.v4.core.models.couponSet.CouponSet; +import com.chargebee.v4.models.couponSet.CouponSet; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetCreateResponse.java b/src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetCreateResponse.java rename to src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetCreateResponse.java index 4de1e977..9a763e2f 100644 --- a/src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.couponSet; +package com.chargebee.v4.models.couponSet.responses; -import com.chargebee.v4.core.models.couponSet.CouponSet; +import com.chargebee.v4.models.couponSet.CouponSet; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetDeleteResponse.java b/src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetDeleteResponse.java index 70025657..b164aa89 100644 --- a/src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.couponSet; +package com.chargebee.v4.models.couponSet.responses; -import com.chargebee.v4.core.models.couponSet.CouponSet; +import com.chargebee.v4.models.couponSet.CouponSet; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetDeleteUnusedCouponCodesResponse.java b/src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetDeleteUnusedCouponCodesResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetDeleteUnusedCouponCodesResponse.java rename to src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetDeleteUnusedCouponCodesResponse.java index b0a78244..93f6fb6c 100644 --- a/src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetDeleteUnusedCouponCodesResponse.java +++ b/src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetDeleteUnusedCouponCodesResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.couponSet; +package com.chargebee.v4.models.couponSet.responses; -import com.chargebee.v4.core.models.couponSet.CouponSet; +import com.chargebee.v4.models.couponSet.CouponSet; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetListResponse.java b/src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetListResponse.java rename to src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetListResponse.java index 6f589c7b..fb7e79b8 100644 --- a/src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetListResponse.java +++ b/src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.couponSet; +package com.chargebee.v4.models.couponSet.responses; import java.util.List; -import com.chargebee.v4.core.models.couponSet.CouponSet; +import com.chargebee.v4.models.couponSet.CouponSet; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.CouponSetService; -import com.chargebee.v4.core.models.couponSet.params.CouponSetListParams; +import com.chargebee.v4.services.CouponSetService; +import com.chargebee.v4.models.couponSet.params.CouponSetListParams; /** Immutable response object for CouponSetList operation. Contains paginated list data. */ public final class CouponSetListResponse { @@ -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 CouponSetListResponse nextPage() throws Exception { + public CouponSetListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetRetrieveResponse.java new file mode 100644 index 00000000..b1a2861a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.couponSet.responses; + +import com.chargebee.v4.models.couponSet.CouponSet; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CouponSetRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class CouponSetRetrieveResponse extends BaseResponse { + private final CouponSet couponSet; + + private CouponSetRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.couponSet = builder.couponSet; + } + + /** Parse JSON response into CouponSetRetrieveResponse object. */ + public static CouponSetRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CouponSetRetrieveResponse object with HTTP response. */ + public static CouponSetRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __couponSetJson = JsonUtil.getObject(json, "coupon_set"); + if (__couponSetJson != null) { + builder.couponSet(CouponSet.fromJson(__couponSetJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CouponSetRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for CouponSetRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CouponSetRetrieveResponse. */ + public static class Builder { + + private CouponSet couponSet; + + private Response httpResponse; + + private Builder() {} + + public Builder couponSet(CouponSet couponSet) { + this.couponSet = couponSet; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CouponSetRetrieveResponse build() { + return new CouponSetRetrieveResponse(this); + } + } + + /** Get the couponSet from the response. */ + public CouponSet getCouponSet() { + return couponSet; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetUpdateResponse.java b/src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetUpdateResponse.java index e4e703fc..dd7b16eb 100644 --- a/src/main/java/com/chargebee/v4/core/responses/couponSet/CouponSetUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/couponSet/responses/CouponSetUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.couponSet; +package com.chargebee.v4.models.couponSet.responses; -import com.chargebee.v4.core.models.couponSet.CouponSet; +import com.chargebee.v4.models.couponSet.CouponSet; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/creditNote/CreditNote.java b/src/main/java/com/chargebee/v4/models/creditNote/CreditNote.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/creditNote/CreditNote.java rename to src/main/java/com/chargebee/v4/models/creditNote/CreditNote.java index e8b53a50..c9aada49 100644 --- a/src/main/java/com/chargebee/v4/core/models/creditNote/CreditNote.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/CreditNote.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.creditNote; +package com.chargebee.v4.models.creditNote; import com.chargebee.v4.internal.JsonUtil; import java.math.BigDecimal; @@ -35,6 +35,7 @@ public class CreditNote { private Long resourceVersion; private Timestamp updatedAt; private Channel channel; + private String lineItemsNextOffset; private Long subTotal; private Long subTotalInLocalCurrency; private Long totalInLocalCurrency; @@ -62,7 +63,7 @@ public class CreditNote { private Einvoice einvoice; private SiteDetailsAtCreation siteDetailsAtCreation; - private java.util.Map customFields = new java.util.HashMap<>(); + private java.util.Map customFields = new java.util.HashMap<>(); public String getId() { return id; @@ -148,6 +149,10 @@ public Channel getChannel() { return channel; } + public String getLineItemsNextOffset() { + return lineItemsNextOffset; + } + public Long getSubTotal() { return subTotal; } @@ -258,7 +263,7 @@ public SiteDetailsAtCreation getSiteDetailsAtCreation() { * * @return map containing all custom fields */ - public java.util.Map getCustomFields() { + public java.util.Map getCustomFields() { return customFields; } @@ -268,7 +273,7 @@ public java.util.Map getCustomFields() { * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") * @return the value of the custom field, or null if not present */ - public Object getCustomField(String fieldName) { + public String getCustomField(String fieldName) { return customFields.get(fieldName); } @@ -443,7 +448,7 @@ public static Channel fromString(String value) { public static CreditNote fromJson(String json) { CreditNote obj = new CreditNote(); - // Parse JSON to extract all keys + // Parse JSON to extract all keys for custom field extraction java.util.Set knownFields = new java.util.HashSet<>(); knownFields.add("id"); @@ -488,6 +493,8 @@ public static CreditNote fromJson(String json) { knownFields.add("channel"); + knownFields.add("line_items_next_offset"); + knownFields.add("sub_total"); knownFields.add("sub_total_in_local_currency"); @@ -582,6 +589,8 @@ public static CreditNote fromJson(String json) { obj.channel = Channel.fromString(JsonUtil.getString(json, "channel")); + obj.lineItemsNextOffset = JsonUtil.getString(json, "line_items_next_offset"); + obj.subTotal = JsonUtil.getLong(json, "sub_total"); obj.subTotalInLocalCurrency = JsonUtil.getLong(json, "sub_total_in_local_currency"); @@ -690,9 +699,9 @@ public static CreditNote fromJson(String json) { * @param knownFields set of known field names * @return map of custom fields */ - private static java.util.Map extractCustomFields( + private static java.util.Map extractCustomFields( String json, java.util.Set knownFields) { - java.util.Map customFields = new java.util.HashMap<>(); + java.util.Map customFields = new java.util.HashMap<>(); try { // Parse the entire JSON as a map java.util.Map allFields = JsonUtil.parseJsonObjectToMap(json); @@ -701,7 +710,8 @@ private static java.util.Map extractCustomFields( String key = entry.getKey(); // Include fields that start with "cf_" and are not in knownFields if (key != null && key.startsWith("cf_") && !knownFields.contains(key)) { - customFields.put(key, entry.getValue()); + customFields.put( + key, entry.getValue() != null ? String.valueOf(entry.getValue()) : null); } } } @@ -1518,6 +1528,7 @@ public static class Discounts { private Long amount; private String description; + private String lineItemId; private EntityType entityType; private DiscountType discountType; private String entityId; @@ -1531,6 +1542,10 @@ public String getDescription() { return description; } + public String getLineItemId() { + return lineItemId; + } + public EntityType getEntityType() { return entityType; } @@ -1618,6 +1633,8 @@ public static Discounts fromJson(String json) { obj.description = JsonUtil.getString(json, "description"); + obj.lineItemId = JsonUtil.getString(json, "line_item_id"); + obj.entityType = EntityType.fromString(JsonUtil.getString(json, "entity_type")); obj.discountType = DiscountType.fromString(JsonUtil.getString(json, "discount_type")); diff --git a/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteCreateParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteCreateParams.java new file mode 100644 index 00000000..9dffd6c4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteCreateParams.java @@ -0,0 +1,674 @@ +/* + * 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.creditNote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class CreditNoteCreateParams { + + private final String referenceInvoiceId; + + private final String customerId; + + private final Long total; + + private final Type type; + + private final ReasonCode reasonCode; + + private final String createReasonCode; + + private final Timestamp date; + + private final String customerNotes; + + private final String currencyCode; + + private final String comment; + + private final List lineItems; + + private final Map customFields; + + private CreditNoteCreateParams(CreditNoteCreateBuilder builder) { + + this.referenceInvoiceId = builder.referenceInvoiceId; + + this.customerId = builder.customerId; + + this.total = builder.total; + + this.type = builder.type; + + this.reasonCode = builder.reasonCode; + + this.createReasonCode = builder.createReasonCode; + + this.date = builder.date; + + this.customerNotes = builder.customerNotes; + + this.currencyCode = builder.currencyCode; + + this.comment = builder.comment; + + this.lineItems = builder.lineItems; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getReferenceInvoiceId() { + return referenceInvoiceId; + } + + public String getCustomerId() { + return customerId; + } + + public Long getTotal() { + return total; + } + + public Type getType() { + return type; + } + + public ReasonCode getReasonCode() { + return reasonCode; + } + + public String getCreateReasonCode() { + return createReasonCode; + } + + public Timestamp getDate() { + return date; + } + + public String getCustomerNotes() { + return customerNotes; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getComment() { + return comment; + } + + public List getLineItems() { + return lineItems; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.referenceInvoiceId != null) { + + formData.put("reference_invoice_id", this.referenceInvoiceId); + } + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.total != null) { + + formData.put("total", this.total); + } + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.reasonCode != null) { + + formData.put("reason_code", this.reasonCode); + } + + if (this.createReasonCode != null) { + + formData.put("create_reason_code", this.createReasonCode); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + if (this.customerNotes != null) { + + formData.put("customer_notes", this.customerNotes); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.lineItems != null) { + + // List of objects + for (int i = 0; i < this.lineItems.size(); i++) { + LineItemsParams item = this.lineItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "line_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for CreditNoteCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNoteCreateBuilder builder() { + return new CreditNoteCreateBuilder(); + } + + public static final class CreditNoteCreateBuilder { + + private String referenceInvoiceId; + + private String customerId; + + private Long total; + + private Type type; + + private ReasonCode reasonCode; + + private String createReasonCode; + + private Timestamp date; + + private String customerNotes; + + private String currencyCode; + + private String comment; + + private List lineItems; + + private Map customFields = new LinkedHashMap<>(); + + private CreditNoteCreateBuilder() {} + + public CreditNoteCreateBuilder referenceInvoiceId(String value) { + this.referenceInvoiceId = value; + return this; + } + + public CreditNoteCreateBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public CreditNoteCreateBuilder total(Long value) { + this.total = value; + return this; + } + + public CreditNoteCreateBuilder type(Type value) { + this.type = value; + return this; + } + + public CreditNoteCreateBuilder reasonCode(ReasonCode value) { + this.reasonCode = value; + return this; + } + + public CreditNoteCreateBuilder createReasonCode(String value) { + this.createReasonCode = value; + return this; + } + + public CreditNoteCreateBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public CreditNoteCreateBuilder customerNotes(String value) { + this.customerNotes = value; + return this; + } + + public CreditNoteCreateBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public CreditNoteCreateBuilder comment(String value) { + this.comment = value; + return this; + } + + public CreditNoteCreateBuilder lineItems(List value) { + this.lineItems = 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 CreditNoteCreateBuilder 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 CreditNoteCreateBuilder 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 CreditNoteCreateParams build() { + return new CreditNoteCreateParams(this); + } + } + + public enum Type { + ADJUSTMENT("adjustment"), + + REFUNDABLE("refundable"), + + STORE("store"), + + /** 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 ReasonCode { + PRODUCT_UNSATISFACTORY("product_unsatisfactory"), + + SERVICE_UNSATISFACTORY("service_unsatisfactory"), + + ORDER_CHANGE("order_change"), + + ORDER_CANCELLATION("order_cancellation"), + + WAIVER("waiver"), + + OTHER("other"), + + /** An enum member indicating that ReasonCode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ReasonCode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ReasonCode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ReasonCode enumValue : ReasonCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class LineItemsParams { + + private final String referenceLineItemId; + + private final Long unitAmount; + + private final String unitAmountInDecimal; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long amount; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private final String description; + + private final EntityType entityType; + + private final String entityId; + + private LineItemsParams(LineItemsBuilder builder) { + + this.referenceLineItemId = builder.referenceLineItemId; + + this.unitAmount = builder.unitAmount; + + this.unitAmountInDecimal = builder.unitAmountInDecimal; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.amount = builder.amount; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + + this.description = builder.description; + + this.entityType = builder.entityType; + + this.entityId = builder.entityId; + } + + public String getReferenceLineItemId() { + return referenceLineItemId; + } + + public Long getUnitAmount() { + return unitAmount; + } + + public String getUnitAmountInDecimal() { + return unitAmountInDecimal; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getAmount() { + return amount; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + public String getDescription() { + return description; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.referenceLineItemId != null) { + + formData.put("reference_line_item_id", this.referenceLineItemId); + } + + if (this.unitAmount != null) { + + formData.put("unit_amount", this.unitAmount); + } + + if (this.unitAmountInDecimal != null) { + + formData.put("unit_amount_in_decimal", this.unitAmountInDecimal); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.entityType != null) { + + formData.put("entity_type", this.entityType); + } + + if (this.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + return formData; + } + + /** Create a new builder for LineItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static LineItemsBuilder builder() { + return new LineItemsBuilder(); + } + + public static final class LineItemsBuilder { + + private String referenceLineItemId; + + private Long unitAmount; + + private String unitAmountInDecimal; + + private Integer quantity; + + private String quantityInDecimal; + + private Long amount; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private String description; + + private EntityType entityType; + + private String entityId; + + private LineItemsBuilder() {} + + public LineItemsBuilder referenceLineItemId(String value) { + this.referenceLineItemId = value; + return this; + } + + public LineItemsBuilder unitAmount(Long value) { + this.unitAmount = value; + return this; + } + + public LineItemsBuilder unitAmountInDecimal(String value) { + this.unitAmountInDecimal = value; + return this; + } + + public LineItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public LineItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public LineItemsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public LineItemsBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public LineItemsBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public LineItemsBuilder description(String value) { + this.description = value; + return this; + } + + public LineItemsBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public LineItemsBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public LineItemsParams build() { + return new LineItemsParams(this); + } + } + + public enum EntityType { + ADHOC("adhoc"), + + PLAN_ITEM_PRICE("plan_item_price"), + + ADDON_ITEM_PRICE("addon_item_price"), + + CHARGE_ITEM_PRICE("charge_item_price"), + + PLAN("plan"), + + ADDON("addon"), + + /** 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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteDeleteParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteDeleteParams.java new file mode 100644 index 00000000..1fabd136 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteDeleteParams.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.creditNote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CreditNoteDeleteParams { + + private final String comment; + + private CreditNoteDeleteParams(CreditNoteDeleteBuilder builder) { + + this.comment = builder.comment; + } + + public String getComment() { + return comment; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + return formData; + } + + /** Create a new builder for CreditNoteDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNoteDeleteBuilder builder() { + return new CreditNoteDeleteBuilder(); + } + + public static final class CreditNoteDeleteBuilder { + + private String comment; + + private CreditNoteDeleteBuilder() {} + + public CreditNoteDeleteBuilder comment(String value) { + this.comment = value; + return this; + } + + public CreditNoteDeleteParams build() { + return new CreditNoteDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteDownloadEinvoiceParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteDownloadEinvoiceParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteDownloadEinvoiceParams.java rename to src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteDownloadEinvoiceParams.java index a0503d45..b12611a8 100644 --- a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteDownloadEinvoiceParams.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteDownloadEinvoiceParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.creditNote.params; +package com.chargebee.v4.models.creditNote.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteListParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteListParams.java rename to src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteListParams.java index 91e25607..acb1288a 100644 --- a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteListParams.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.creditNote.params; +package com.chargebee.v4.models.creditNote.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNotePdfParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNotePdfParams.java similarity index 78% rename from src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNotePdfParams.java rename to src/main/java/com/chargebee/v4/models/creditNote/params/CreditNotePdfParams.java index 6131dbde..b0add7a7 100644 --- a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNotePdfParams.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNotePdfParams.java @@ -4,24 +4,35 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.creditNote.params; +package com.chargebee.v4.models.creditNote.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class CreditNotePdfParams { - private final Map formData; + private final DispositionType dispositionType; private CreditNotePdfParams(CreditNotePdfBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); + + this.dispositionType = builder.dispositionType; + } + + public DispositionType getDispositionType() { + return dispositionType; } /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.dispositionType != null) { + + formData.put("disposition_type", this.dispositionType); + } + return formData; } @@ -32,14 +43,13 @@ public static CreditNotePdfBuilder builder() { } public static final class CreditNotePdfBuilder { - private final Map formData = new LinkedHashMap<>(); + + private DispositionType dispositionType; private CreditNotePdfBuilder() {} public CreditNotePdfBuilder dispositionType(DispositionType value) { - - formData.put("disposition_type", value); - + this.dispositionType = value; return this; } diff --git a/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRecordRefundParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRecordRefundParams.java new file mode 100644 index 00000000..11735d89 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRecordRefundParams.java @@ -0,0 +1,294 @@ +/* + * 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.creditNote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class CreditNoteRecordRefundParams { + + private final String refundReasonCode; + + private final String comment; + + private final TransactionParams transaction; + + private CreditNoteRecordRefundParams(CreditNoteRecordRefundBuilder builder) { + + this.refundReasonCode = builder.refundReasonCode; + + this.comment = builder.comment; + + this.transaction = builder.transaction; + } + + public String getRefundReasonCode() { + return refundReasonCode; + } + + public String getComment() { + return comment; + } + + public TransactionParams getTransaction() { + return transaction; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.refundReasonCode != null) { + + formData.put("refund_reason_code", this.refundReasonCode); + } + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.transaction != null) { + + // Single object + Map nestedData = this.transaction.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "transaction[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for CreditNoteRecordRefundParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNoteRecordRefundBuilder builder() { + return new CreditNoteRecordRefundBuilder(); + } + + public static final class CreditNoteRecordRefundBuilder { + + private String refundReasonCode; + + private String comment; + + private TransactionParams transaction; + + private CreditNoteRecordRefundBuilder() {} + + public CreditNoteRecordRefundBuilder refundReasonCode(String value) { + this.refundReasonCode = value; + return this; + } + + public CreditNoteRecordRefundBuilder comment(String value) { + this.comment = value; + return this; + } + + public CreditNoteRecordRefundBuilder transaction(TransactionParams value) { + this.transaction = value; + return this; + } + + public CreditNoteRecordRefundParams build() { + return new CreditNoteRecordRefundParams(this); + } + } + + public static final class TransactionParams { + + private final String id; + + private final Long amount; + + private final PaymentMethod paymentMethod; + + private final String referenceNumber; + + private final String customPaymentMethodId; + + private final Timestamp date; + + private TransactionParams(TransactionBuilder builder) { + + this.id = builder.id; + + this.amount = builder.amount; + + this.paymentMethod = builder.paymentMethod; + + this.referenceNumber = builder.referenceNumber; + + this.customPaymentMethodId = builder.customPaymentMethodId; + + this.date = builder.date; + } + + public String getId() { + return id; + } + + public Long getAmount() { + return amount; + } + + public PaymentMethod getPaymentMethod() { + return paymentMethod; + } + + public String getReferenceNumber() { + return referenceNumber; + } + + public String getCustomPaymentMethodId() { + return customPaymentMethodId; + } + + public Timestamp getDate() { + return date; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.paymentMethod != null) { + + formData.put("payment_method", this.paymentMethod); + } + + if (this.referenceNumber != null) { + + formData.put("reference_number", this.referenceNumber); + } + + if (this.customPaymentMethodId != null) { + + formData.put("custom_payment_method_id", this.customPaymentMethodId); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + return formData; + } + + /** Create a new builder for TransactionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionBuilder builder() { + return new TransactionBuilder(); + } + + public static final class TransactionBuilder { + + private String id; + + private Long amount; + + private PaymentMethod paymentMethod; + + private String referenceNumber; + + private String customPaymentMethodId; + + private Timestamp date; + + private TransactionBuilder() {} + + public TransactionBuilder id(String value) { + this.id = value; + return this; + } + + public TransactionBuilder amount(Long value) { + this.amount = value; + return this; + } + + public TransactionBuilder paymentMethod(PaymentMethod value) { + this.paymentMethod = value; + return this; + } + + public TransactionBuilder referenceNumber(String value) { + this.referenceNumber = value; + return this; + } + + public TransactionBuilder customPaymentMethodId(String value) { + this.customPaymentMethodId = value; + return this; + } + + public TransactionBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public TransactionParams build() { + return new TransactionParams(this); + } + } + + public enum PaymentMethod { + CASH("cash"), + + CHECK("check"), + + CHARGEBACK("chargeback"), + + BANK_TRANSFER("bank_transfer"), + + OTHER("other"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + CUSTOM("custom"), + + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethod enumValue : PaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRefundParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRefundParams.java new file mode 100644 index 00000000..f14f8f0c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRefundParams.java @@ -0,0 +1,100 @@ +/* + * 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.creditNote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CreditNoteRefundParams { + + private final Long refundAmount; + + private final String customerNotes; + + private final String refundReasonCode; + + private CreditNoteRefundParams(CreditNoteRefundBuilder builder) { + + this.refundAmount = builder.refundAmount; + + this.customerNotes = builder.customerNotes; + + this.refundReasonCode = builder.refundReasonCode; + } + + public Long getRefundAmount() { + return refundAmount; + } + + public String getCustomerNotes() { + return customerNotes; + } + + public String getRefundReasonCode() { + return refundReasonCode; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.refundAmount != null) { + + formData.put("refund_amount", this.refundAmount); + } + + if (this.customerNotes != null) { + + formData.put("customer_notes", this.customerNotes); + } + + if (this.refundReasonCode != null) { + + formData.put("refund_reason_code", this.refundReasonCode); + } + + return formData; + } + + /** Create a new builder for CreditNoteRefundParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNoteRefundBuilder builder() { + return new CreditNoteRefundBuilder(); + } + + public static final class CreditNoteRefundBuilder { + + private Long refundAmount; + + private String customerNotes; + + private String refundReasonCode; + + private CreditNoteRefundBuilder() {} + + public CreditNoteRefundBuilder refundAmount(Long value) { + this.refundAmount = value; + return this; + } + + public CreditNoteRefundBuilder customerNotes(String value) { + this.customerNotes = value; + return this; + } + + public CreditNoteRefundBuilder refundReasonCode(String value) { + this.refundReasonCode = value; + return this; + } + + public CreditNoteRefundParams build() { + return new CreditNoteRefundParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRemoveTaxWithheldRefundParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRemoveTaxWithheldRefundParams.java new file mode 100644 index 00000000..636e0e20 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRemoveTaxWithheldRefundParams.java @@ -0,0 +1,114 @@ +/* + * 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.creditNote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CreditNoteRemoveTaxWithheldRefundParams { + + private final TaxWithheldParams taxWithheld; + + private CreditNoteRemoveTaxWithheldRefundParams( + CreditNoteRemoveTaxWithheldRefundBuilder builder) { + + this.taxWithheld = builder.taxWithheld; + } + + public TaxWithheldParams getTaxWithheld() { + return taxWithheld; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.taxWithheld != null) { + + // Single object + Map nestedData = this.taxWithheld.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "tax_withheld[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for CreditNoteRemoveTaxWithheldRefundParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNoteRemoveTaxWithheldRefundBuilder builder() { + return new CreditNoteRemoveTaxWithheldRefundBuilder(); + } + + public static final class CreditNoteRemoveTaxWithheldRefundBuilder { + + private TaxWithheldParams taxWithheld; + + private CreditNoteRemoveTaxWithheldRefundBuilder() {} + + public CreditNoteRemoveTaxWithheldRefundBuilder taxWithheld(TaxWithheldParams value) { + this.taxWithheld = value; + return this; + } + + public CreditNoteRemoveTaxWithheldRefundParams build() { + return new CreditNoteRemoveTaxWithheldRefundParams(this); + } + } + + public static final class TaxWithheldParams { + + private final String id; + + private TaxWithheldParams(TaxWithheldBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for TaxWithheldParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxWithheldBuilder builder() { + return new TaxWithheldBuilder(); + } + + public static final class TaxWithheldBuilder { + + private String id; + + private TaxWithheldBuilder() {} + + public TaxWithheldBuilder id(String value) { + this.id = value; + return this; + } + + public TaxWithheldParams build() { + return new TaxWithheldParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteResendEinvoiceParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteResendEinvoiceParams.java similarity index 77% rename from src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteResendEinvoiceParams.java rename to src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteResendEinvoiceParams.java index 4fa0a29a..78b0473a 100644 --- a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteResendEinvoiceParams.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteResendEinvoiceParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.creditNote.params; +package com.chargebee.v4.models.creditNote.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class CreditNoteResendEinvoiceParams { - private final Map formData; - - private CreditNoteResendEinvoiceParams(CreditNoteResendEinvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private CreditNoteResendEinvoiceParams(CreditNoteResendEinvoiceBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static CreditNoteResendEinvoiceBuilder builder() { } public static final class CreditNoteResendEinvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); private CreditNoteResendEinvoiceBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteRetrieveParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRetrieveParams.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRetrieveParams.java index e04fb538..dccaffdb 100644 --- a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.creditNote.params; +package com.chargebee.v4.models.creditNote.params; import com.chargebee.v4.internal.Recommended; @@ -43,6 +43,16 @@ public static final class CreditNoteRetrieveBuilder { private CreditNoteRetrieveBuilder() {} + public CreditNoteRetrieveBuilder lineItemsLimit(Integer value) { + queryParams.put("line_items_limit", value); + return this; + } + + public CreditNoteRetrieveBuilder lineItemsOffset(String value) { + queryParams.put("line_items_offset", value); + return this; + } + @Deprecated public CreditNoteRetrieveBuilder lineItem(LineItemParams value) { queryParams.put("line_item", value); diff --git a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteSendEinvoiceParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteSendEinvoiceParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteSendEinvoiceParams.java rename to src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteSendEinvoiceParams.java index a7d247f6..51f6718f 100644 --- a/src/main/java/com/chargebee/v4/core/models/creditNote/params/CreditNoteSendEinvoiceParams.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteSendEinvoiceParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.creditNote.params; +package com.chargebee.v4.models.creditNote.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class CreditNoteSendEinvoiceParams { - private final Map formData; - - private CreditNoteSendEinvoiceParams(CreditNoteSendEinvoiceBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private CreditNoteSendEinvoiceParams(CreditNoteSendEinvoiceBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static CreditNoteSendEinvoiceBuilder builder() { } public static final class CreditNoteSendEinvoiceBuilder { - private final Map formData = new LinkedHashMap<>(); private CreditNoteSendEinvoiceBuilder() {} diff --git a/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNotesForCustomerParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNotesForCustomerParams.java new file mode 100644 index 00000000..59254da9 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNotesForCustomerParams.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.creditNote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CreditNotesForCustomerParams { + + private final Map queryParams; + + private CreditNotesForCustomerParams(CreditNotesForCustomerBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public CreditNotesForCustomerBuilder toBuilder() { + CreditNotesForCustomerBuilder builder = new CreditNotesForCustomerBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for CreditNotesForCustomerParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNotesForCustomerBuilder builder() { + return new CreditNotesForCustomerBuilder(); + } + + public static final class CreditNotesForCustomerBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private CreditNotesForCustomerBuilder() {} + + public CreditNotesForCustomerBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public CreditNotesForCustomerBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public CreditNotesForCustomerParams build() { + return new CreditNotesForCustomerParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/creditNote/params/ImportCreditNoteParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/ImportCreditNoteParams.java new file mode 100644 index 00000000..fb4674d0 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/ImportCreditNoteParams.java @@ -0,0 +1,2314 @@ +/* + * 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.creditNote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class ImportCreditNoteParams { + + private final String id; + + private final String customerId; + + private final String subscriptionId; + + private final String referenceInvoiceId; + + private final Type type; + + private final String currencyCode; + + private final String createReasonCode; + + private final Timestamp date; + + private final Status status; + + private final Long total; + + private final Timestamp refundedAt; + + private final Timestamp voidedAt; + + private final Long subTotal; + + private final Long roundOffAmount; + + private final Long fractionalCorrection; + + private final String vatNumberPrefix; + + private final List lineItems; + + private final List lineItemTiers; + + private final List discounts; + + private final List taxes; + + private final List allocations; + + private final List linkedRefunds; + + private final Map customFields; + + private ImportCreditNoteParams(ImportCreditNoteBuilder builder) { + + this.id = builder.id; + + this.customerId = builder.customerId; + + this.subscriptionId = builder.subscriptionId; + + this.referenceInvoiceId = builder.referenceInvoiceId; + + this.type = builder.type; + + this.currencyCode = builder.currencyCode; + + this.createReasonCode = builder.createReasonCode; + + this.date = builder.date; + + this.status = builder.status; + + this.total = builder.total; + + this.refundedAt = builder.refundedAt; + + this.voidedAt = builder.voidedAt; + + this.subTotal = builder.subTotal; + + this.roundOffAmount = builder.roundOffAmount; + + this.fractionalCorrection = builder.fractionalCorrection; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.lineItems = builder.lineItems; + + this.lineItemTiers = builder.lineItemTiers; + + this.discounts = builder.discounts; + + this.taxes = builder.taxes; + + this.allocations = builder.allocations; + + this.linkedRefunds = builder.linkedRefunds; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getId() { + return id; + } + + public String getCustomerId() { + return customerId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getReferenceInvoiceId() { + return referenceInvoiceId; + } + + public Type getType() { + return type; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getCreateReasonCode() { + return createReasonCode; + } + + public Timestamp getDate() { + return date; + } + + public Status getStatus() { + return status; + } + + public Long getTotal() { + return total; + } + + public Timestamp getRefundedAt() { + return refundedAt; + } + + public Timestamp getVoidedAt() { + return voidedAt; + } + + public Long getSubTotal() { + return subTotal; + } + + public Long getRoundOffAmount() { + return roundOffAmount; + } + + public Long getFractionalCorrection() { + return fractionalCorrection; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public List getLineItems() { + return lineItems; + } + + public List getLineItemTiers() { + return lineItemTiers; + } + + public List getDiscounts() { + return discounts; + } + + public List getTaxes() { + return taxes; + } + + public List getAllocations() { + return allocations; + } + + public List getLinkedRefunds() { + return linkedRefunds; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.referenceInvoiceId != null) { + + formData.put("reference_invoice_id", this.referenceInvoiceId); + } + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.createReasonCode != null) { + + formData.put("create_reason_code", this.createReasonCode); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.total != null) { + + formData.put("total", this.total); + } + + if (this.refundedAt != null) { + + formData.put("refunded_at", this.refundedAt); + } + + if (this.voidedAt != null) { + + formData.put("voided_at", this.voidedAt); + } + + if (this.subTotal != null) { + + formData.put("sub_total", this.subTotal); + } + + if (this.roundOffAmount != null) { + + formData.put("round_off_amount", this.roundOffAmount); + } + + if (this.fractionalCorrection != null) { + + formData.put("fractional_correction", this.fractionalCorrection); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.lineItems != null) { + + // List of objects + for (int i = 0; i < this.lineItems.size(); i++) { + LineItemsParams item = this.lineItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "line_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.lineItemTiers != null) { + + // List of objects + for (int i = 0; i < this.lineItemTiers.size(); i++) { + LineItemTiersParams item = this.lineItemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "line_item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxes != null) { + + // List of objects + for (int i = 0; i < this.taxes.size(); i++) { + TaxesParams item = this.taxes.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "taxes[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.allocations != null) { + + // List of objects + for (int i = 0; i < this.allocations.size(); i++) { + AllocationsParams item = this.allocations.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "allocations[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.linkedRefunds != null) { + + // List of objects + for (int i = 0; i < this.linkedRefunds.size(); i++) { + LinkedRefundsParams item = this.linkedRefunds.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "linked_refunds[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for ImportCreditNoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ImportCreditNoteBuilder builder() { + return new ImportCreditNoteBuilder(); + } + + public static final class ImportCreditNoteBuilder { + + private String id; + + private String customerId; + + private String subscriptionId; + + private String referenceInvoiceId; + + private Type type; + + private String currencyCode; + + private String createReasonCode; + + private Timestamp date; + + private Status status; + + private Long total; + + private Timestamp refundedAt; + + private Timestamp voidedAt; + + private Long subTotal; + + private Long roundOffAmount; + + private Long fractionalCorrection; + + private String vatNumberPrefix; + + private List lineItems; + + private List lineItemTiers; + + private List discounts; + + private List taxes; + + private List allocations; + + private List linkedRefunds; + + private Map customFields = new LinkedHashMap<>(); + + private ImportCreditNoteBuilder() {} + + public ImportCreditNoteBuilder id(String value) { + this.id = value; + return this; + } + + public ImportCreditNoteBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public ImportCreditNoteBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public ImportCreditNoteBuilder referenceInvoiceId(String value) { + this.referenceInvoiceId = value; + return this; + } + + public ImportCreditNoteBuilder type(Type value) { + this.type = value; + return this; + } + + public ImportCreditNoteBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public ImportCreditNoteBuilder createReasonCode(String value) { + this.createReasonCode = value; + return this; + } + + public ImportCreditNoteBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public ImportCreditNoteBuilder status(Status value) { + this.status = value; + return this; + } + + public ImportCreditNoteBuilder total(Long value) { + this.total = value; + return this; + } + + public ImportCreditNoteBuilder refundedAt(Timestamp value) { + this.refundedAt = value; + return this; + } + + public ImportCreditNoteBuilder voidedAt(Timestamp value) { + this.voidedAt = value; + return this; + } + + public ImportCreditNoteBuilder subTotal(Long value) { + this.subTotal = value; + return this; + } + + public ImportCreditNoteBuilder roundOffAmount(Long value) { + this.roundOffAmount = value; + return this; + } + + public ImportCreditNoteBuilder fractionalCorrection(Long value) { + this.fractionalCorrection = value; + return this; + } + + public ImportCreditNoteBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public ImportCreditNoteBuilder lineItems(List value) { + this.lineItems = value; + return this; + } + + public ImportCreditNoteBuilder lineItemTiers(List value) { + this.lineItemTiers = value; + return this; + } + + public ImportCreditNoteBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public ImportCreditNoteBuilder taxes(List value) { + this.taxes = value; + return this; + } + + public ImportCreditNoteBuilder allocations(List value) { + this.allocations = value; + return this; + } + + public ImportCreditNoteBuilder linkedRefunds(List value) { + this.linkedRefunds = 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 ImportCreditNoteBuilder 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 ImportCreditNoteBuilder 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 ImportCreditNoteParams build() { + return new ImportCreditNoteParams(this); + } + } + + public enum Type { + ADJUSTMENT("adjustment"), + + REFUNDABLE("refundable"), + + STORE("store"), + + /** 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 Status { + ADJUSTED("adjusted"), + + REFUNDED("refunded"), + + REFUND_DUE("refund_due"), + + VOIDED("voided"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class LineItemsParams { + + private final String referenceLineItemId; + + private final String id; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private final String subscriptionId; + + private final String description; + + private final Long unitAmount; + + private final Integer quantity; + + private final Long amount; + + private final String unitAmountInDecimal; + + private final String quantityInDecimal; + + private final String amountInDecimal; + + private final EntityType entityType; + + private final String entityId; + + private final String itemLevelDiscount1EntityId; + + private final Long itemLevelDiscount1Amount; + + private final String itemLevelDiscount2EntityId; + + private final Long itemLevelDiscount2Amount; + + private final String tax1Name; + + private final Long tax1Amount; + + private final String tax2Name; + + private final Long tax2Amount; + + private final String tax3Name; + + private final Long tax3Amount; + + private final String tax4Name; + + private final Long tax4Amount; + + private final String tax5Name; + + private final Long tax5Amount; + + private final String tax6Name; + + private final Long tax6Amount; + + private final String tax7Name; + + private final Long tax7Amount; + + private final String tax8Name; + + private final Long tax8Amount; + + private final String tax9Name; + + private final Long tax9Amount; + + private final String tax10Name; + + private final Long tax10Amount; + + private LineItemsParams(LineItemsBuilder builder) { + + this.referenceLineItemId = builder.referenceLineItemId; + + this.id = builder.id; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + + this.subscriptionId = builder.subscriptionId; + + this.description = builder.description; + + this.unitAmount = builder.unitAmount; + + this.quantity = builder.quantity; + + this.amount = builder.amount; + + this.unitAmountInDecimal = builder.unitAmountInDecimal; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.amountInDecimal = builder.amountInDecimal; + + this.entityType = builder.entityType; + + this.entityId = builder.entityId; + + this.itemLevelDiscount1EntityId = builder.itemLevelDiscount1EntityId; + + this.itemLevelDiscount1Amount = builder.itemLevelDiscount1Amount; + + this.itemLevelDiscount2EntityId = builder.itemLevelDiscount2EntityId; + + this.itemLevelDiscount2Amount = builder.itemLevelDiscount2Amount; + + this.tax1Name = builder.tax1Name; + + this.tax1Amount = builder.tax1Amount; + + this.tax2Name = builder.tax2Name; + + this.tax2Amount = builder.tax2Amount; + + this.tax3Name = builder.tax3Name; + + this.tax3Amount = builder.tax3Amount; + + this.tax4Name = builder.tax4Name; + + this.tax4Amount = builder.tax4Amount; + + this.tax5Name = builder.tax5Name; + + this.tax5Amount = builder.tax5Amount; + + this.tax6Name = builder.tax6Name; + + this.tax6Amount = builder.tax6Amount; + + this.tax7Name = builder.tax7Name; + + this.tax7Amount = builder.tax7Amount; + + this.tax8Name = builder.tax8Name; + + this.tax8Amount = builder.tax8Amount; + + this.tax9Name = builder.tax9Name; + + this.tax9Amount = builder.tax9Amount; + + this.tax10Name = builder.tax10Name; + + this.tax10Amount = builder.tax10Amount; + } + + public String getReferenceLineItemId() { + return referenceLineItemId; + } + + public String getId() { + return id; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getDescription() { + return description; + } + + public Long getUnitAmount() { + return unitAmount; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getAmount() { + return amount; + } + + public String getUnitAmountInDecimal() { + return unitAmountInDecimal; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + + public String getItemLevelDiscount1EntityId() { + return itemLevelDiscount1EntityId; + } + + public Long getItemLevelDiscount1Amount() { + return itemLevelDiscount1Amount; + } + + public String getItemLevelDiscount2EntityId() { + return itemLevelDiscount2EntityId; + } + + public Long getItemLevelDiscount2Amount() { + return itemLevelDiscount2Amount; + } + + public String getTax1Name() { + return tax1Name; + } + + public Long getTax1Amount() { + return tax1Amount; + } + + public String getTax2Name() { + return tax2Name; + } + + public Long getTax2Amount() { + return tax2Amount; + } + + public String getTax3Name() { + return tax3Name; + } + + public Long getTax3Amount() { + return tax3Amount; + } + + public String getTax4Name() { + return tax4Name; + } + + public Long getTax4Amount() { + return tax4Amount; + } + + public String getTax5Name() { + return tax5Name; + } + + public Long getTax5Amount() { + return tax5Amount; + } + + public String getTax6Name() { + return tax6Name; + } + + public Long getTax6Amount() { + return tax6Amount; + } + + public String getTax7Name() { + return tax7Name; + } + + public Long getTax7Amount() { + return tax7Amount; + } + + public String getTax8Name() { + return tax8Name; + } + + public Long getTax8Amount() { + return tax8Amount; + } + + public String getTax9Name() { + return tax9Name; + } + + public Long getTax9Amount() { + return tax9Amount; + } + + public String getTax10Name() { + return tax10Name; + } + + public Long getTax10Amount() { + return tax10Amount; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.referenceLineItemId != null) { + + formData.put("reference_line_item_id", this.referenceLineItemId); + } + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.unitAmount != null) { + + formData.put("unit_amount", this.unitAmount); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.unitAmountInDecimal != null) { + + formData.put("unit_amount_in_decimal", this.unitAmountInDecimal); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.entityType != null) { + + formData.put("entity_type", this.entityType); + } + + if (this.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + if (this.itemLevelDiscount1EntityId != null) { + + formData.put("item_level_discount1_entity_id", this.itemLevelDiscount1EntityId); + } + + if (this.itemLevelDiscount1Amount != null) { + + formData.put("item_level_discount1_amount", this.itemLevelDiscount1Amount); + } + + if (this.itemLevelDiscount2EntityId != null) { + + formData.put("item_level_discount2_entity_id", this.itemLevelDiscount2EntityId); + } + + if (this.itemLevelDiscount2Amount != null) { + + formData.put("item_level_discount2_amount", this.itemLevelDiscount2Amount); + } + + if (this.tax1Name != null) { + + formData.put("tax1_name", this.tax1Name); + } + + if (this.tax1Amount != null) { + + formData.put("tax1_amount", this.tax1Amount); + } + + if (this.tax2Name != null) { + + formData.put("tax2_name", this.tax2Name); + } + + if (this.tax2Amount != null) { + + formData.put("tax2_amount", this.tax2Amount); + } + + if (this.tax3Name != null) { + + formData.put("tax3_name", this.tax3Name); + } + + if (this.tax3Amount != null) { + + formData.put("tax3_amount", this.tax3Amount); + } + + if (this.tax4Name != null) { + + formData.put("tax4_name", this.tax4Name); + } + + if (this.tax4Amount != null) { + + formData.put("tax4_amount", this.tax4Amount); + } + + if (this.tax5Name != null) { + + formData.put("tax5_name", this.tax5Name); + } + + if (this.tax5Amount != null) { + + formData.put("tax5_amount", this.tax5Amount); + } + + if (this.tax6Name != null) { + + formData.put("tax6_name", this.tax6Name); + } + + if (this.tax6Amount != null) { + + formData.put("tax6_amount", this.tax6Amount); + } + + if (this.tax7Name != null) { + + formData.put("tax7_name", this.tax7Name); + } + + if (this.tax7Amount != null) { + + formData.put("tax7_amount", this.tax7Amount); + } + + if (this.tax8Name != null) { + + formData.put("tax8_name", this.tax8Name); + } + + if (this.tax8Amount != null) { + + formData.put("tax8_amount", this.tax8Amount); + } + + if (this.tax9Name != null) { + + formData.put("tax9_name", this.tax9Name); + } + + if (this.tax9Amount != null) { + + formData.put("tax9_amount", this.tax9Amount); + } + + if (this.tax10Name != null) { + + formData.put("tax10_name", this.tax10Name); + } + + if (this.tax10Amount != null) { + + formData.put("tax10_amount", this.tax10Amount); + } + + return formData; + } + + /** Create a new builder for LineItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static LineItemsBuilder builder() { + return new LineItemsBuilder(); + } + + public static final class LineItemsBuilder { + + private String referenceLineItemId; + + private String id; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private String subscriptionId; + + private String description; + + private Long unitAmount; + + private Integer quantity; + + private Long amount; + + private String unitAmountInDecimal; + + private String quantityInDecimal; + + private String amountInDecimal; + + private EntityType entityType; + + private String entityId; + + private String itemLevelDiscount1EntityId; + + private Long itemLevelDiscount1Amount; + + private String itemLevelDiscount2EntityId; + + private Long itemLevelDiscount2Amount; + + private String tax1Name; + + private Long tax1Amount; + + private String tax2Name; + + private Long tax2Amount; + + private String tax3Name; + + private Long tax3Amount; + + private String tax4Name; + + private Long tax4Amount; + + private String tax5Name; + + private Long tax5Amount; + + private String tax6Name; + + private Long tax6Amount; + + private String tax7Name; + + private Long tax7Amount; + + private String tax8Name; + + private Long tax8Amount; + + private String tax9Name; + + private Long tax9Amount; + + private String tax10Name; + + private Long tax10Amount; + + private LineItemsBuilder() {} + + public LineItemsBuilder referenceLineItemId(String value) { + this.referenceLineItemId = value; + return this; + } + + public LineItemsBuilder id(String value) { + this.id = value; + return this; + } + + public LineItemsBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public LineItemsBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public LineItemsBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public LineItemsBuilder description(String value) { + this.description = value; + return this; + } + + public LineItemsBuilder unitAmount(Long value) { + this.unitAmount = value; + return this; + } + + public LineItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public LineItemsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public LineItemsBuilder unitAmountInDecimal(String value) { + this.unitAmountInDecimal = value; + return this; + } + + public LineItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public LineItemsBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public LineItemsBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public LineItemsBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public LineItemsBuilder itemLevelDiscount1EntityId(String value) { + this.itemLevelDiscount1EntityId = value; + return this; + } + + public LineItemsBuilder itemLevelDiscount1Amount(Long value) { + this.itemLevelDiscount1Amount = value; + return this; + } + + public LineItemsBuilder itemLevelDiscount2EntityId(String value) { + this.itemLevelDiscount2EntityId = value; + return this; + } + + public LineItemsBuilder itemLevelDiscount2Amount(Long value) { + this.itemLevelDiscount2Amount = value; + return this; + } + + public LineItemsBuilder tax1Name(String value) { + this.tax1Name = value; + return this; + } + + public LineItemsBuilder tax1Amount(Long value) { + this.tax1Amount = value; + return this; + } + + public LineItemsBuilder tax2Name(String value) { + this.tax2Name = value; + return this; + } + + public LineItemsBuilder tax2Amount(Long value) { + this.tax2Amount = value; + return this; + } + + public LineItemsBuilder tax3Name(String value) { + this.tax3Name = value; + return this; + } + + public LineItemsBuilder tax3Amount(Long value) { + this.tax3Amount = value; + return this; + } + + public LineItemsBuilder tax4Name(String value) { + this.tax4Name = value; + return this; + } + + public LineItemsBuilder tax4Amount(Long value) { + this.tax4Amount = value; + return this; + } + + public LineItemsBuilder tax5Name(String value) { + this.tax5Name = value; + return this; + } + + public LineItemsBuilder tax5Amount(Long value) { + this.tax5Amount = value; + return this; + } + + public LineItemsBuilder tax6Name(String value) { + this.tax6Name = value; + return this; + } + + public LineItemsBuilder tax6Amount(Long value) { + this.tax6Amount = value; + return this; + } + + public LineItemsBuilder tax7Name(String value) { + this.tax7Name = value; + return this; + } + + public LineItemsBuilder tax7Amount(Long value) { + this.tax7Amount = value; + return this; + } + + public LineItemsBuilder tax8Name(String value) { + this.tax8Name = value; + return this; + } + + public LineItemsBuilder tax8Amount(Long value) { + this.tax8Amount = value; + return this; + } + + public LineItemsBuilder tax9Name(String value) { + this.tax9Name = value; + return this; + } + + public LineItemsBuilder tax9Amount(Long value) { + this.tax9Amount = value; + return this; + } + + public LineItemsBuilder tax10Name(String value) { + this.tax10Name = value; + return this; + } + + public LineItemsBuilder tax10Amount(Long value) { + this.tax10Amount = value; + return this; + } + + public LineItemsParams build() { + return new LineItemsParams(this); + } + } + + public enum EntityType { + ADHOC("adhoc"), + + PLAN_ITEM_PRICE("plan_item_price"), + + ADDON_ITEM_PRICE("addon_item_price"), + + CHARGE_ITEM_PRICE("charge_item_price"), + + PLAN_SETUP("plan_setup"), + + PLAN("plan"), + + ADDON("addon"), + + /** 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 static final class LineItemTiersParams { + + private final String lineItemId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Integer quantityUsed; + + private final Long unitAmount; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String quantityUsedInDecimal; + + private final String unitAmountInDecimal; + + private LineItemTiersParams(LineItemTiersBuilder builder) { + + this.lineItemId = builder.lineItemId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.quantityUsed = builder.quantityUsed; + + this.unitAmount = builder.unitAmount; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.quantityUsedInDecimal = builder.quantityUsedInDecimal; + + this.unitAmountInDecimal = builder.unitAmountInDecimal; + } + + public String getLineItemId() { + return lineItemId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Integer getQuantityUsed() { + return quantityUsed; + } + + public Long getUnitAmount() { + return unitAmount; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getQuantityUsedInDecimal() { + return quantityUsedInDecimal; + } + + public String getUnitAmountInDecimal() { + return unitAmountInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.lineItemId != null) { + + formData.put("line_item_id", this.lineItemId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.quantityUsed != null) { + + formData.put("quantity_used", this.quantityUsed); + } + + if (this.unitAmount != null) { + + formData.put("unit_amount", this.unitAmount); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.quantityUsedInDecimal != null) { + + formData.put("quantity_used_in_decimal", this.quantityUsedInDecimal); + } + + if (this.unitAmountInDecimal != null) { + + formData.put("unit_amount_in_decimal", this.unitAmountInDecimal); + } + + return formData; + } + + /** Create a new builder for LineItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static LineItemTiersBuilder builder() { + return new LineItemTiersBuilder(); + } + + public static final class LineItemTiersBuilder { + + private String lineItemId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Integer quantityUsed; + + private Long unitAmount; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String quantityUsedInDecimal; + + private String unitAmountInDecimal; + + private LineItemTiersBuilder() {} + + public LineItemTiersBuilder lineItemId(String value) { + this.lineItemId = value; + return this; + } + + public LineItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public LineItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public LineItemTiersBuilder quantityUsed(Integer value) { + this.quantityUsed = value; + return this; + } + + public LineItemTiersBuilder unitAmount(Long value) { + this.unitAmount = value; + return this; + } + + public LineItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public LineItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public LineItemTiersBuilder quantityUsedInDecimal(String value) { + this.quantityUsedInDecimal = value; + return this; + } + + public LineItemTiersBuilder unitAmountInDecimal(String value) { + this.unitAmountInDecimal = value; + return this; + } + + public LineItemTiersParams build() { + return new LineItemTiersParams(this); + } + } + } + + public static final class DiscountsParams { + + private final String lineItemId; + + private final EntityType entityType; + + private final String entityId; + + private final String description; + + private final Long amount; + + private DiscountsParams(DiscountsBuilder builder) { + + this.lineItemId = builder.lineItemId; + + this.entityType = builder.entityType; + + this.entityId = builder.entityId; + + this.description = builder.description; + + this.amount = builder.amount; + } + + public String getLineItemId() { + return lineItemId; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + + public String getDescription() { + return description; + } + + public Long getAmount() { + return amount; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.lineItemId != null) { + + formData.put("line_item_id", this.lineItemId); + } + + if (this.entityType != null) { + + formData.put("entity_type", this.entityType); + } + + if (this.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private String lineItemId; + + private EntityType entityType; + + private String entityId; + + private String description; + + private Long amount; + + private DiscountsBuilder() {} + + public DiscountsBuilder lineItemId(String value) { + this.lineItemId = value; + return this; + } + + public DiscountsBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public DiscountsBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public DiscountsBuilder description(String value) { + this.description = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum EntityType { + ITEM_LEVEL_COUPON("item_level_coupon"), + + DOCUMENT_LEVEL_COUPON("document_level_coupon"), + + PROMOTIONAL_CREDITS("promotional_credits"), + + ITEM_LEVEL_DISCOUNT("item_level_discount"), + + DOCUMENT_LEVEL_DISCOUNT("document_level_discount"), + + /** 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 static final class TaxesParams { + + private final String name; + + private final Number rate; + + private final Long amount; + + private final String description; + + private final JurisType jurisType; + + private final String jurisName; + + private final String jurisCode; + + private TaxesParams(TaxesBuilder builder) { + + this.name = builder.name; + + this.rate = builder.rate; + + this.amount = builder.amount; + + this.description = builder.description; + + this.jurisType = builder.jurisType; + + this.jurisName = builder.jurisName; + + this.jurisCode = builder.jurisCode; + } + + public String getName() { + return name; + } + + public Number getRate() { + return rate; + } + + public Long getAmount() { + return amount; + } + + public String getDescription() { + return description; + } + + public JurisType getJurisType() { + return jurisType; + } + + public String getJurisName() { + return jurisName; + } + + public String getJurisCode() { + return jurisCode; + } + + /** 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.rate != null) { + + formData.put("rate", this.rate); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.jurisType != null) { + + formData.put("juris_type", this.jurisType); + } + + if (this.jurisName != null) { + + formData.put("juris_name", this.jurisName); + } + + if (this.jurisCode != null) { + + formData.put("juris_code", this.jurisCode); + } + + return formData; + } + + /** Create a new builder for TaxesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxesBuilder builder() { + return new TaxesBuilder(); + } + + public static final class TaxesBuilder { + + private String name; + + private Number rate; + + private Long amount; + + private String description; + + private JurisType jurisType; + + private String jurisName; + + private String jurisCode; + + private TaxesBuilder() {} + + public TaxesBuilder name(String value) { + this.name = value; + return this; + } + + public TaxesBuilder rate(Number value) { + this.rate = value; + return this; + } + + public TaxesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public TaxesBuilder description(String value) { + this.description = value; + return this; + } + + public TaxesBuilder jurisType(JurisType value) { + this.jurisType = value; + return this; + } + + public TaxesBuilder jurisName(String value) { + this.jurisName = value; + return this; + } + + public TaxesBuilder jurisCode(String value) { + this.jurisCode = value; + return this; + } + + public TaxesParams build() { + return new TaxesParams(this); + } + } + + public enum JurisType { + COUNTRY("country"), + + FEDERAL("federal"), + + STATE("state"), + + COUNTY("county"), + + CITY("city"), + + SPECIAL("special"), + + UNINCORPORATED("unincorporated"), + + OTHER("other"), + + /** An enum member indicating that JurisType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + JurisType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static JurisType fromString(String value) { + if (value == null) return _UNKNOWN; + for (JurisType enumValue : JurisType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AllocationsParams { + + private final String invoiceId; + + private final Long allocatedAmount; + + private final Timestamp allocatedAt; + + private AllocationsParams(AllocationsBuilder builder) { + + this.invoiceId = builder.invoiceId; + + this.allocatedAmount = builder.allocatedAmount; + + this.allocatedAt = builder.allocatedAt; + } + + public String getInvoiceId() { + return invoiceId; + } + + public Long getAllocatedAmount() { + return allocatedAmount; + } + + public Timestamp getAllocatedAt() { + return allocatedAt; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.invoiceId != null) { + + formData.put("invoice_id", this.invoiceId); + } + + if (this.allocatedAmount != null) { + + formData.put("allocated_amount", this.allocatedAmount); + } + + if (this.allocatedAt != null) { + + formData.put("allocated_at", this.allocatedAt); + } + + return formData; + } + + /** Create a new builder for AllocationsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AllocationsBuilder builder() { + return new AllocationsBuilder(); + } + + public static final class AllocationsBuilder { + + private String invoiceId; + + private Long allocatedAmount; + + private Timestamp allocatedAt; + + private AllocationsBuilder() {} + + public AllocationsBuilder invoiceId(String value) { + this.invoiceId = value; + return this; + } + + public AllocationsBuilder allocatedAmount(Long value) { + this.allocatedAmount = value; + return this; + } + + public AllocationsBuilder allocatedAt(Timestamp value) { + this.allocatedAt = value; + return this; + } + + public AllocationsParams build() { + return new AllocationsParams(this); + } + } + } + + public static final class LinkedRefundsParams { + + private final String id; + + private final Long amount; + + private final PaymentMethod paymentMethod; + + private final Timestamp date; + + private final String referenceNumber; + + private LinkedRefundsParams(LinkedRefundsBuilder builder) { + + this.id = builder.id; + + this.amount = builder.amount; + + this.paymentMethod = builder.paymentMethod; + + this.date = builder.date; + + this.referenceNumber = builder.referenceNumber; + } + + public String getId() { + return id; + } + + public Long getAmount() { + return amount; + } + + public PaymentMethod getPaymentMethod() { + return paymentMethod; + } + + public Timestamp getDate() { + return date; + } + + public String getReferenceNumber() { + return referenceNumber; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.paymentMethod != null) { + + formData.put("payment_method", this.paymentMethod); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + if (this.referenceNumber != null) { + + formData.put("reference_number", this.referenceNumber); + } + + return formData; + } + + /** Create a new builder for LinkedRefundsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static LinkedRefundsBuilder builder() { + return new LinkedRefundsBuilder(); + } + + public static final class LinkedRefundsBuilder { + + private String id; + + private Long amount; + + private PaymentMethod paymentMethod; + + private Timestamp date; + + private String referenceNumber; + + private LinkedRefundsBuilder() {} + + public LinkedRefundsBuilder id(String value) { + this.id = value; + return this; + } + + public LinkedRefundsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public LinkedRefundsBuilder paymentMethod(PaymentMethod value) { + this.paymentMethod = value; + return this; + } + + public LinkedRefundsBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public LinkedRefundsBuilder referenceNumber(String value) { + this.referenceNumber = value; + return this; + } + + public LinkedRefundsParams build() { + return new LinkedRefundsParams(this); + } + } + + public enum PaymentMethod { + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + OTHER("other"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + CUSTOM("custom"), + + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethod enumValue : PaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/creditNote/params/VoidCreditNoteParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/VoidCreditNoteParams.java new file mode 100644 index 00000000..aa5cfd4a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/VoidCreditNoteParams.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.creditNote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class VoidCreditNoteParams { + + private final String comment; + + private VoidCreditNoteParams(VoidCreditNoteBuilder builder) { + + this.comment = builder.comment; + } + + public String getComment() { + return comment; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + return formData; + } + + /** Create a new builder for VoidCreditNoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static VoidCreditNoteBuilder builder() { + return new VoidCreditNoteBuilder(); + } + + public static final class VoidCreditNoteBuilder { + + private String comment; + + private VoidCreditNoteBuilder() {} + + public VoidCreditNoteBuilder comment(String value) { + this.comment = value; + return this; + } + + public VoidCreditNoteParams build() { + return new VoidCreditNoteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteCreateResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteCreateResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteCreateResponse.java rename to src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteCreateResponse.java index fdca7659..7949b68e 100644 --- a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteCreateResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.creditNote; +package com.chargebee.v4.models.creditNote.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteDeleteResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteDeleteResponse.java index f296cc0c..0705443b 100644 --- a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.creditNote; +package com.chargebee.v4.models.creditNote.responses; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteDownloadEinvoiceResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteDownloadEinvoiceResponse.java new file mode 100644 index 00000000..a1d48950 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteDownloadEinvoiceResponse.java @@ -0,0 +1,81 @@ +package com.chargebee.v4.models.creditNote.responses; + +import com.chargebee.v4.models.download.Download; + +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 CreditNoteDownloadEinvoice operation. Contains the response data + * from a single resource get operation. + */ +public final class CreditNoteDownloadEinvoiceResponse extends BaseResponse { + private final List downloads; + + private CreditNoteDownloadEinvoiceResponse(Builder builder) { + super(builder.httpResponse); + + this.downloads = builder.downloads; + } + + /** Parse JSON response into CreditNoteDownloadEinvoiceResponse object. */ + public static CreditNoteDownloadEinvoiceResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CreditNoteDownloadEinvoiceResponse object with HTTP response. */ + public static CreditNoteDownloadEinvoiceResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __downloadsJson = JsonUtil.getArray(json, "downloads"); + if (__downloadsJson != null) { + builder.downloads( + JsonUtil.parseObjectArray(__downloadsJson).stream() + .map(Download::fromJson) + .collect(java.util.stream.Collectors.toList())); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CreditNoteDownloadEinvoiceResponse from JSON", e); + } + } + + /** Create a new builder for CreditNoteDownloadEinvoiceResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CreditNoteDownloadEinvoiceResponse. */ + public static class Builder { + + private List downloads; + + private Response httpResponse; + + private Builder() {} + + public Builder downloads(List downloads) { + this.downloads = downloads; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CreditNoteDownloadEinvoiceResponse build() { + return new CreditNoteDownloadEinvoiceResponse(this); + } + } + + /** Get the downloads from the response. */ + public List getDownloads() { + return downloads; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteListResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteListResponse.java rename to src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteListResponse.java index aba68f41..ab551b5e 100644 --- a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteListResponse.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.creditNote; +package com.chargebee.v4.models.creditNote.responses; import java.util.List; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.CreditNoteService; -import com.chargebee.v4.core.models.creditNote.params.CreditNoteListParams; +import com.chargebee.v4.services.CreditNoteService; +import com.chargebee.v4.models.creditNote.params.CreditNoteListParams; /** Immutable response object for CreditNoteList operation. Contains paginated list data. */ public final class CreditNoteListResponse { @@ -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 CreditNoteListResponse nextPage() throws Exception { + public CreditNoteListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNotePdfResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNotePdfResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNotePdfResponse.java rename to src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNotePdfResponse.java index a4df5cb1..92f0b245 100644 --- a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNotePdfResponse.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNotePdfResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.creditNote; +package com.chargebee.v4.models.creditNote.responses; -import com.chargebee.v4.core.models.download.Download; +import com.chargebee.v4.models.download.Download; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteRecordRefundResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteRecordRefundResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteRecordRefundResponse.java rename to src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteRecordRefundResponse.java index 938d1c03..aeedefe4 100644 --- a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteRecordRefundResponse.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteRecordRefundResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.creditNote; +package com.chargebee.v4.models.creditNote.responses; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteRefundResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteRefundResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteRefundResponse.java rename to src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteRefundResponse.java index 3a2b00ac..0e0bc07b 100644 --- a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteRefundResponse.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteRefundResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.creditNote; +package com.chargebee.v4.models.creditNote.responses; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteRemoveTaxWithheldRefundResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteRemoveTaxWithheldRefundResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteRemoveTaxWithheldRefundResponse.java rename to src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteRemoveTaxWithheldRefundResponse.java index 3125a0bc..bf969c87 100644 --- a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteRemoveTaxWithheldRefundResponse.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteRemoveTaxWithheldRefundResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.creditNote; +package com.chargebee.v4.models.creditNote.responses; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteResendEinvoiceResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteResendEinvoiceResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteResendEinvoiceResponse.java rename to src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteResendEinvoiceResponse.java index a0462871..2816ac78 100644 --- a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteResendEinvoiceResponse.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteResendEinvoiceResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.creditNote; +package com.chargebee.v4.models.creditNote.responses; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteRetrieveResponse.java new file mode 100644 index 00000000..85b8635a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.creditNote.responses; + +import com.chargebee.v4.models.creditNote.CreditNote; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CreditNoteRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class CreditNoteRetrieveResponse extends BaseResponse { + private final CreditNote creditNote; + + private CreditNoteRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.creditNote = builder.creditNote; + } + + /** Parse JSON response into CreditNoteRetrieveResponse object. */ + public static CreditNoteRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CreditNoteRetrieveResponse object with HTTP response. */ + public static CreditNoteRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __creditNoteJson = JsonUtil.getObject(json, "credit_note"); + if (__creditNoteJson != null) { + builder.creditNote(CreditNote.fromJson(__creditNoteJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CreditNoteRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for CreditNoteRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CreditNoteRetrieveResponse. */ + public static class Builder { + + private CreditNote creditNote; + + private Response httpResponse; + + private Builder() {} + + public Builder creditNote(CreditNote creditNote) { + this.creditNote = creditNote; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CreditNoteRetrieveResponse build() { + return new CreditNoteRetrieveResponse(this); + } + } + + /** Get the creditNote from the response. */ + public CreditNote getCreditNote() { + return creditNote; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteSendEinvoiceResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteSendEinvoiceResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteSendEinvoiceResponse.java rename to src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteSendEinvoiceResponse.java index 2b6c7cc9..6027f5f7 100644 --- a/src/main/java/com/chargebee/v4/core/responses/creditNote/CreditNoteSendEinvoiceResponse.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteSendEinvoiceResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.creditNote; +package com.chargebee.v4.models.creditNote.responses; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNotesForCustomerResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNotesForCustomerResponse.java new file mode 100644 index 00000000..cc363915 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNotesForCustomerResponse.java @@ -0,0 +1,174 @@ +package com.chargebee.v4.models.creditNote.responses; + +import java.util.List; + +import com.chargebee.v4.models.creditNote.CreditNote; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.CreditNoteService; +import com.chargebee.v4.models.creditNote.params.CreditNotesForCustomerParams; + +/** Immutable response object for CreditNotesForCustomer operation. Contains paginated list data. */ +public final class CreditNotesForCustomerResponse { + + private final List list; + + private final String nextOffset; + + private final String customerId; + + private final CreditNoteService service; + private final CreditNotesForCustomerParams originalParams; + private final Response httpResponse; + + private CreditNotesForCustomerResponse( + List list, + String nextOffset, + String customerId, + CreditNoteService service, + CreditNotesForCustomerParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.customerId = customerId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into CreditNotesForCustomerResponse object (no service context). Use this + * when you only need to read a single page (no nextPage()). + */ + public static CreditNotesForCustomerResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(CreditNoteCreditNotesForCustomerItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new CreditNotesForCustomerResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CreditNotesForCustomerResponse from JSON", e); + } + } + + /** + * Parse JSON response into CreditNotesForCustomerResponse object with service context for + * pagination (enables nextPage()). + */ + public static CreditNotesForCustomerResponse fromJson( + String json, + CreditNoteService service, + CreditNotesForCustomerParams originalParams, + String customerId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(CreditNoteCreditNotesForCustomerItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new CreditNotesForCustomerResponse( + list, nextOffset, customerId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CreditNotesForCustomerResponse 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 CreditNotesForCustomerResponse 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)."); + } + + CreditNotesForCustomerParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : CreditNotesForCustomerParams.builder()) + .offset(nextOffset) + .build(); + + return service.creditNotesForCustomer(customerId, 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 CreditNoteCreditNotesForCustomerItem { + + private CreditNote creditNote; + + public CreditNote getCreditNote() { + return creditNote; + } + + public static CreditNoteCreditNotesForCustomerItem fromJson(String json) { + CreditNoteCreditNotesForCustomerItem item = new CreditNoteCreditNotesForCustomerItem(); + + String __creditNoteJson = JsonUtil.getObject(json, "credit_note"); + if (__creditNoteJson != null) { + item.creditNote = CreditNote.fromJson(__creditNoteJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/creditNote/responses/ImportCreditNoteResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/ImportCreditNoteResponse.java new file mode 100644 index 00000000..e88f4033 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/ImportCreditNoteResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.creditNote.responses; + +import com.chargebee.v4.models.creditNote.CreditNote; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ImportCreditNote operation. Contains the response data from the + * API. + */ +public final class ImportCreditNoteResponse extends BaseResponse { + private final CreditNote creditNote; + + private ImportCreditNoteResponse(Builder builder) { + super(builder.httpResponse); + + this.creditNote = builder.creditNote; + } + + /** Parse JSON response into ImportCreditNoteResponse object. */ + public static ImportCreditNoteResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ImportCreditNoteResponse object with HTTP response. */ + public static ImportCreditNoteResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __creditNoteJson = JsonUtil.getObject(json, "credit_note"); + if (__creditNoteJson != null) { + builder.creditNote(CreditNote.fromJson(__creditNoteJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ImportCreditNoteResponse from JSON", e); + } + } + + /** Create a new builder for ImportCreditNoteResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ImportCreditNoteResponse. */ + public static class Builder { + + private CreditNote creditNote; + + private Response httpResponse; + + private Builder() {} + + public Builder creditNote(CreditNote creditNote) { + this.creditNote = creditNote; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ImportCreditNoteResponse build() { + return new ImportCreditNoteResponse(this); + } + } + + /** Get the creditNote from the response. */ + public CreditNote getCreditNote() { + return creditNote; + } +} diff --git a/src/main/java/com/chargebee/v4/models/creditNote/responses/VoidCreditNoteResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/VoidCreditNoteResponse.java new file mode 100644 index 00000000..90ebfe42 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/VoidCreditNoteResponse.java @@ -0,0 +1,76 @@ +package com.chargebee.v4.models.creditNote.responses; + +import com.chargebee.v4.models.creditNote.CreditNote; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for VoidCreditNote operation. Contains the response data from the API. + */ +public final class VoidCreditNoteResponse extends BaseResponse { + private final CreditNote creditNote; + + private VoidCreditNoteResponse(Builder builder) { + super(builder.httpResponse); + + this.creditNote = builder.creditNote; + } + + /** Parse JSON response into VoidCreditNoteResponse object. */ + public static VoidCreditNoteResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into VoidCreditNoteResponse object with HTTP response. */ + public static VoidCreditNoteResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __creditNoteJson = JsonUtil.getObject(json, "credit_note"); + if (__creditNoteJson != null) { + builder.creditNote(CreditNote.fromJson(__creditNoteJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse VoidCreditNoteResponse from JSON", e); + } + } + + /** Create a new builder for VoidCreditNoteResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for VoidCreditNoteResponse. */ + public static class Builder { + + private CreditNote creditNote; + + private Response httpResponse; + + private Builder() {} + + public Builder creditNote(CreditNote creditNote) { + this.creditNote = creditNote; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public VoidCreditNoteResponse build() { + return new VoidCreditNoteResponse(this); + } + } + + /** Get the creditNote from the response. */ + public CreditNote getCreditNote() { + return creditNote; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/creditNoteEstimate/CreditNoteEstimate.java b/src/main/java/com/chargebee/v4/models/creditNoteEstimate/CreditNoteEstimate.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/creditNoteEstimate/CreditNoteEstimate.java rename to src/main/java/com/chargebee/v4/models/creditNoteEstimate/CreditNoteEstimate.java index 3b3f7e3d..41f1acce 100644 --- a/src/main/java/com/chargebee/v4/core/models/creditNoteEstimate/CreditNoteEstimate.java +++ b/src/main/java/com/chargebee/v4/models/creditNoteEstimate/CreditNoteEstimate.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.creditNoteEstimate; +package com.chargebee.v4.models.creditNoteEstimate; import com.chargebee.v4.internal.JsonUtil; import java.math.BigDecimal; @@ -868,6 +868,7 @@ public static class Discounts { private Long amount; private String description; + private String lineItemId; private EntityType entityType; private DiscountType discountType; private String entityId; @@ -881,6 +882,10 @@ public String getDescription() { return description; } + public String getLineItemId() { + return lineItemId; + } + public EntityType getEntityType() { return entityType; } @@ -968,6 +973,8 @@ public static Discounts fromJson(String json) { obj.description = JsonUtil.getString(json, "description"); + obj.lineItemId = JsonUtil.getString(json, "line_item_id"); + obj.entityType = EntityType.fromString(JsonUtil.getString(json, "entity_type")); obj.discountType = DiscountType.fromString(JsonUtil.getString(json, "discount_type")); diff --git a/src/main/java/com/chargebee/v4/models/csvTaxRule/params/CsvTaxRuleCreateParams.java b/src/main/java/com/chargebee/v4/models/csvTaxRule/params/CsvTaxRuleCreateParams.java new file mode 100644 index 00000000..1a061da1 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/csvTaxRule/params/CsvTaxRuleCreateParams.java @@ -0,0 +1,851 @@ +/* + * 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.csvTaxRule.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class CsvTaxRuleCreateParams { + + private final String taxProfileName; + + private final String country; + + private final String state; + + private final String zipCode; + + private final Integer zipCodeStart; + + private final Integer zipCodeEnd; + + private final String tax1Name; + + private final Number tax1Rate; + + private final Tax1JurisType tax1JurisType; + + private final String tax1JurisName; + + private final String tax1JurisCode; + + private final String tax2Name; + + private final Number tax2Rate; + + private final Tax2JurisType tax2JurisType; + + private final String tax2JurisName; + + private final String tax2JurisCode; + + private final String tax3Name; + + private final Number tax3Rate; + + private final Tax3JurisType tax3JurisType; + + private final String tax3JurisName; + + private final String tax3JurisCode; + + private final String tax4Name; + + private final Number tax4Rate; + + private final Tax4JurisType tax4JurisType; + + private final String tax4JurisName; + + private final String tax4JurisCode; + + private final ServiceType serviceType; + + private final String timeZone; + + private final Timestamp validFrom; + + private final Timestamp validTill; + + private final Boolean overwrite; + + private CsvTaxRuleCreateParams(CsvTaxRuleCreateBuilder builder) { + + this.taxProfileName = builder.taxProfileName; + + this.country = builder.country; + + this.state = builder.state; + + this.zipCode = builder.zipCode; + + this.zipCodeStart = builder.zipCodeStart; + + this.zipCodeEnd = builder.zipCodeEnd; + + this.tax1Name = builder.tax1Name; + + this.tax1Rate = builder.tax1Rate; + + this.tax1JurisType = builder.tax1JurisType; + + this.tax1JurisName = builder.tax1JurisName; + + this.tax1JurisCode = builder.tax1JurisCode; + + this.tax2Name = builder.tax2Name; + + this.tax2Rate = builder.tax2Rate; + + this.tax2JurisType = builder.tax2JurisType; + + this.tax2JurisName = builder.tax2JurisName; + + this.tax2JurisCode = builder.tax2JurisCode; + + this.tax3Name = builder.tax3Name; + + this.tax3Rate = builder.tax3Rate; + + this.tax3JurisType = builder.tax3JurisType; + + this.tax3JurisName = builder.tax3JurisName; + + this.tax3JurisCode = builder.tax3JurisCode; + + this.tax4Name = builder.tax4Name; + + this.tax4Rate = builder.tax4Rate; + + this.tax4JurisType = builder.tax4JurisType; + + this.tax4JurisName = builder.tax4JurisName; + + this.tax4JurisCode = builder.tax4JurisCode; + + this.serviceType = builder.serviceType; + + this.timeZone = builder.timeZone; + + this.validFrom = builder.validFrom; + + this.validTill = builder.validTill; + + this.overwrite = builder.overwrite; + } + + public String getTaxProfileName() { + return taxProfileName; + } + + public String getCountry() { + return country; + } + + public String getState() { + return state; + } + + public String getZipCode() { + return zipCode; + } + + public Integer getZipCodeStart() { + return zipCodeStart; + } + + public Integer getZipCodeEnd() { + return zipCodeEnd; + } + + public String getTax1Name() { + return tax1Name; + } + + public Number getTax1Rate() { + return tax1Rate; + } + + public Tax1JurisType getTax1JurisType() { + return tax1JurisType; + } + + public String getTax1JurisName() { + return tax1JurisName; + } + + public String getTax1JurisCode() { + return tax1JurisCode; + } + + public String getTax2Name() { + return tax2Name; + } + + public Number getTax2Rate() { + return tax2Rate; + } + + public Tax2JurisType getTax2JurisType() { + return tax2JurisType; + } + + public String getTax2JurisName() { + return tax2JurisName; + } + + public String getTax2JurisCode() { + return tax2JurisCode; + } + + public String getTax3Name() { + return tax3Name; + } + + public Number getTax3Rate() { + return tax3Rate; + } + + public Tax3JurisType getTax3JurisType() { + return tax3JurisType; + } + + public String getTax3JurisName() { + return tax3JurisName; + } + + public String getTax3JurisCode() { + return tax3JurisCode; + } + + public String getTax4Name() { + return tax4Name; + } + + public Number getTax4Rate() { + return tax4Rate; + } + + public Tax4JurisType getTax4JurisType() { + return tax4JurisType; + } + + public String getTax4JurisName() { + return tax4JurisName; + } + + public String getTax4JurisCode() { + return tax4JurisCode; + } + + public ServiceType getServiceType() { + return serviceType; + } + + public String getTimeZone() { + return timeZone; + } + + public Timestamp getValidFrom() { + return validFrom; + } + + public Timestamp getValidTill() { + return validTill; + } + + public Boolean getOverwrite() { + return overwrite; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.taxProfileName != null) { + + formData.put("tax_profile_name", this.taxProfileName); + } + + if (this.country != null) { + + formData.put("country", this.country); + } + + if (this.state != null) { + + formData.put("state", this.state); + } + + if (this.zipCode != null) { + + formData.put("zip_code", this.zipCode); + } + + if (this.zipCodeStart != null) { + + formData.put("zip_code_start", this.zipCodeStart); + } + + if (this.zipCodeEnd != null) { + + formData.put("zip_code_end", this.zipCodeEnd); + } + + if (this.tax1Name != null) { + + formData.put("tax1_name", this.tax1Name); + } + + if (this.tax1Rate != null) { + + formData.put("tax1_rate", this.tax1Rate); + } + + if (this.tax1JurisType != null) { + + formData.put("tax1_juris_type", this.tax1JurisType); + } + + if (this.tax1JurisName != null) { + + formData.put("tax1_juris_name", this.tax1JurisName); + } + + if (this.tax1JurisCode != null) { + + formData.put("tax1_juris_code", this.tax1JurisCode); + } + + if (this.tax2Name != null) { + + formData.put("tax2_name", this.tax2Name); + } + + if (this.tax2Rate != null) { + + formData.put("tax2_rate", this.tax2Rate); + } + + if (this.tax2JurisType != null) { + + formData.put("tax2_juris_type", this.tax2JurisType); + } + + if (this.tax2JurisName != null) { + + formData.put("tax2_juris_name", this.tax2JurisName); + } + + if (this.tax2JurisCode != null) { + + formData.put("tax2_juris_code", this.tax2JurisCode); + } + + if (this.tax3Name != null) { + + formData.put("tax3_name", this.tax3Name); + } + + if (this.tax3Rate != null) { + + formData.put("tax3_rate", this.tax3Rate); + } + + if (this.tax3JurisType != null) { + + formData.put("tax3_juris_type", this.tax3JurisType); + } + + if (this.tax3JurisName != null) { + + formData.put("tax3_juris_name", this.tax3JurisName); + } + + if (this.tax3JurisCode != null) { + + formData.put("tax3_juris_code", this.tax3JurisCode); + } + + if (this.tax4Name != null) { + + formData.put("tax4_name", this.tax4Name); + } + + if (this.tax4Rate != null) { + + formData.put("tax4_rate", this.tax4Rate); + } + + if (this.tax4JurisType != null) { + + formData.put("tax4_juris_type", this.tax4JurisType); + } + + if (this.tax4JurisName != null) { + + formData.put("tax4_juris_name", this.tax4JurisName); + } + + if (this.tax4JurisCode != null) { + + formData.put("tax4_juris_code", this.tax4JurisCode); + } + + if (this.serviceType != null) { + + formData.put("service_type", this.serviceType); + } + + if (this.timeZone != null) { + + formData.put("time_zone", this.timeZone); + } + + if (this.validFrom != null) { + + formData.put("valid_from", this.validFrom); + } + + if (this.validTill != null) { + + formData.put("valid_till", this.validTill); + } + + if (this.overwrite != null) { + + formData.put("overwrite", this.overwrite); + } + + return formData; + } + + /** Create a new builder for CsvTaxRuleCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CsvTaxRuleCreateBuilder builder() { + return new CsvTaxRuleCreateBuilder(); + } + + public static final class CsvTaxRuleCreateBuilder { + + private String taxProfileName; + + private String country; + + private String state; + + private String zipCode; + + private Integer zipCodeStart; + + private Integer zipCodeEnd; + + private String tax1Name; + + private Number tax1Rate; + + private Tax1JurisType tax1JurisType; + + private String tax1JurisName; + + private String tax1JurisCode; + + private String tax2Name; + + private Number tax2Rate; + + private Tax2JurisType tax2JurisType; + + private String tax2JurisName; + + private String tax2JurisCode; + + private String tax3Name; + + private Number tax3Rate; + + private Tax3JurisType tax3JurisType; + + private String tax3JurisName; + + private String tax3JurisCode; + + private String tax4Name; + + private Number tax4Rate; + + private Tax4JurisType tax4JurisType; + + private String tax4JurisName; + + private String tax4JurisCode; + + private ServiceType serviceType; + + private String timeZone; + + private Timestamp validFrom; + + private Timestamp validTill; + + private Boolean overwrite; + + private CsvTaxRuleCreateBuilder() {} + + public CsvTaxRuleCreateBuilder taxProfileName(String value) { + this.taxProfileName = value; + return this; + } + + public CsvTaxRuleCreateBuilder country(String value) { + this.country = value; + return this; + } + + public CsvTaxRuleCreateBuilder state(String value) { + this.state = value; + return this; + } + + public CsvTaxRuleCreateBuilder zipCode(String value) { + this.zipCode = value; + return this; + } + + public CsvTaxRuleCreateBuilder zipCodeStart(Integer value) { + this.zipCodeStart = value; + return this; + } + + public CsvTaxRuleCreateBuilder zipCodeEnd(Integer value) { + this.zipCodeEnd = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax1Name(String value) { + this.tax1Name = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax1Rate(Number value) { + this.tax1Rate = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax1JurisType(Tax1JurisType value) { + this.tax1JurisType = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax1JurisName(String value) { + this.tax1JurisName = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax1JurisCode(String value) { + this.tax1JurisCode = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax2Name(String value) { + this.tax2Name = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax2Rate(Number value) { + this.tax2Rate = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax2JurisType(Tax2JurisType value) { + this.tax2JurisType = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax2JurisName(String value) { + this.tax2JurisName = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax2JurisCode(String value) { + this.tax2JurisCode = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax3Name(String value) { + this.tax3Name = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax3Rate(Number value) { + this.tax3Rate = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax3JurisType(Tax3JurisType value) { + this.tax3JurisType = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax3JurisName(String value) { + this.tax3JurisName = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax3JurisCode(String value) { + this.tax3JurisCode = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax4Name(String value) { + this.tax4Name = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax4Rate(Number value) { + this.tax4Rate = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax4JurisType(Tax4JurisType value) { + this.tax4JurisType = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax4JurisName(String value) { + this.tax4JurisName = value; + return this; + } + + public CsvTaxRuleCreateBuilder tax4JurisCode(String value) { + this.tax4JurisCode = value; + return this; + } + + public CsvTaxRuleCreateBuilder serviceType(ServiceType value) { + this.serviceType = value; + return this; + } + + public CsvTaxRuleCreateBuilder timeZone(String value) { + this.timeZone = value; + return this; + } + + public CsvTaxRuleCreateBuilder validFrom(Timestamp value) { + this.validFrom = value; + return this; + } + + public CsvTaxRuleCreateBuilder validTill(Timestamp value) { + this.validTill = value; + return this; + } + + public CsvTaxRuleCreateBuilder overwrite(Boolean value) { + this.overwrite = value; + return this; + } + + public CsvTaxRuleCreateParams build() { + return new CsvTaxRuleCreateParams(this); + } + } + + public enum Tax1JurisType { + COUNTRY("country"), + + FEDERAL("federal"), + + STATE("state"), + + COUNTY("county"), + + CITY("city"), + + SPECIAL("special"), + + UNINCORPORATED("unincorporated"), + + OTHER("other"), + + /** An enum member indicating that Tax1JurisType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Tax1JurisType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Tax1JurisType fromString(String value) { + if (value == null) return _UNKNOWN; + for (Tax1JurisType enumValue : Tax1JurisType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Tax2JurisType { + COUNTRY("country"), + + FEDERAL("federal"), + + STATE("state"), + + COUNTY("county"), + + CITY("city"), + + SPECIAL("special"), + + UNINCORPORATED("unincorporated"), + + OTHER("other"), + + /** An enum member indicating that Tax2JurisType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Tax2JurisType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Tax2JurisType fromString(String value) { + if (value == null) return _UNKNOWN; + for (Tax2JurisType enumValue : Tax2JurisType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Tax3JurisType { + COUNTRY("country"), + + FEDERAL("federal"), + + STATE("state"), + + COUNTY("county"), + + CITY("city"), + + SPECIAL("special"), + + UNINCORPORATED("unincorporated"), + + OTHER("other"), + + /** An enum member indicating that Tax3JurisType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Tax3JurisType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Tax3JurisType fromString(String value) { + if (value == null) return _UNKNOWN; + for (Tax3JurisType enumValue : Tax3JurisType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Tax4JurisType { + COUNTRY("country"), + + FEDERAL("federal"), + + STATE("state"), + + COUNTY("county"), + + CITY("city"), + + SPECIAL("special"), + + UNINCORPORATED("unincorporated"), + + OTHER("other"), + + /** An enum member indicating that Tax4JurisType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Tax4JurisType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Tax4JurisType fromString(String value) { + if (value == null) return _UNKNOWN; + for (Tax4JurisType enumValue : Tax4JurisType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ServiceType { + DIGITAL("digital"), + + OTHER("other"), + + NOT_APPLICABLE("not_applicable"), + + /** An enum member indicating that ServiceType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ServiceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ServiceType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ServiceType enumValue : ServiceType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/csvTaxRule/CsvTaxRuleCreateResponse.java b/src/main/java/com/chargebee/v4/models/csvTaxRule/responses/CsvTaxRuleCreateResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/csvTaxRule/CsvTaxRuleCreateResponse.java rename to src/main/java/com/chargebee/v4/models/csvTaxRule/responses/CsvTaxRuleCreateResponse.java index e1eeabdc..fa3db5ab 100644 --- a/src/main/java/com/chargebee/v4/core/responses/csvTaxRule/CsvTaxRuleCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/csvTaxRule/responses/CsvTaxRuleCreateResponse.java @@ -1,6 +1,6 @@ -package com.chargebee.v4.core.responses.csvTaxRule; +package com.chargebee.v4.models.csvTaxRule.responses; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.transport.Response; /** diff --git a/src/main/java/com/chargebee/v4/core/models/currency/Currency.java b/src/main/java/com/chargebee/v4/models/currency/Currency.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/currency/Currency.java rename to src/main/java/com/chargebee/v4/models/currency/Currency.java index b46a0329..62b3c6a0 100644 --- a/src/main/java/com/chargebee/v4/core/models/currency/Currency.java +++ b/src/main/java/com/chargebee/v4/models/currency/Currency.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.currency; +package com.chargebee.v4.models.currency; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/models/currency/params/CurrencyAddScheduleParams.java b/src/main/java/com/chargebee/v4/models/currency/params/CurrencyAddScheduleParams.java new file mode 100644 index 00000000..c8c38fb8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/currency/params/CurrencyAddScheduleParams.java @@ -0,0 +1,81 @@ +/* + * 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.currency.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class CurrencyAddScheduleParams { + + private final String manualExchangeRate; + + private final Timestamp scheduleAt; + + private CurrencyAddScheduleParams(CurrencyAddScheduleBuilder builder) { + + this.manualExchangeRate = builder.manualExchangeRate; + + this.scheduleAt = builder.scheduleAt; + } + + public String getManualExchangeRate() { + return manualExchangeRate; + } + + public Timestamp getScheduleAt() { + return scheduleAt; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.manualExchangeRate != null) { + + formData.put("manual_exchange_rate", this.manualExchangeRate); + } + + if (this.scheduleAt != null) { + + formData.put("schedule_at", this.scheduleAt); + } + + return formData; + } + + /** Create a new builder for CurrencyAddScheduleParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CurrencyAddScheduleBuilder builder() { + return new CurrencyAddScheduleBuilder(); + } + + public static final class CurrencyAddScheduleBuilder { + + private String manualExchangeRate; + + private Timestamp scheduleAt; + + private CurrencyAddScheduleBuilder() {} + + public CurrencyAddScheduleBuilder manualExchangeRate(String value) { + this.manualExchangeRate = value; + return this; + } + + public CurrencyAddScheduleBuilder scheduleAt(Timestamp value) { + this.scheduleAt = value; + return this; + } + + public CurrencyAddScheduleParams build() { + return new CurrencyAddScheduleParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/currency/params/CurrencyCreateParams.java b/src/main/java/com/chargebee/v4/models/currency/params/CurrencyCreateParams.java new file mode 100644 index 00000000..0a81480d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/currency/params/CurrencyCreateParams.java @@ -0,0 +1,128 @@ +/* + * 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.currency.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CurrencyCreateParams { + + private final String currencyCode; + + private final ForexType forexType; + + private final String manualExchangeRate; + + private CurrencyCreateParams(CurrencyCreateBuilder builder) { + + this.currencyCode = builder.currencyCode; + + this.forexType = builder.forexType; + + this.manualExchangeRate = builder.manualExchangeRate; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public ForexType getForexType() { + return forexType; + } + + public String getManualExchangeRate() { + return manualExchangeRate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.forexType != null) { + + formData.put("forex_type", this.forexType); + } + + if (this.manualExchangeRate != null) { + + formData.put("manual_exchange_rate", this.manualExchangeRate); + } + + return formData; + } + + /** Create a new builder for CurrencyCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CurrencyCreateBuilder builder() { + return new CurrencyCreateBuilder(); + } + + public static final class CurrencyCreateBuilder { + + private String currencyCode; + + private ForexType forexType; + + private String manualExchangeRate; + + private CurrencyCreateBuilder() {} + + public CurrencyCreateBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public CurrencyCreateBuilder forexType(ForexType value) { + this.forexType = value; + return this; + } + + public CurrencyCreateBuilder manualExchangeRate(String value) { + this.manualExchangeRate = value; + return this; + } + + public CurrencyCreateParams build() { + return new CurrencyCreateParams(this); + } + } + + public enum ForexType { + MANUAL("manual"), + + AUTO("auto"), + + /** An enum member indicating that ForexType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ForexType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ForexType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ForexType enumValue : ForexType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyListParams.java b/src/main/java/com/chargebee/v4/models/currency/params/CurrencyListParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyListParams.java rename to src/main/java/com/chargebee/v4/models/currency/params/CurrencyListParams.java index f5f3518c..588602e1 100644 --- a/src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyListParams.java +++ b/src/main/java/com/chargebee/v4/models/currency/params/CurrencyListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.currency.params; +package com.chargebee.v4.models.currency.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyRemoveScheduleParams.java b/src/main/java/com/chargebee/v4/models/currency/params/CurrencyRemoveScheduleParams.java similarity index 77% rename from src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyRemoveScheduleParams.java rename to src/main/java/com/chargebee/v4/models/currency/params/CurrencyRemoveScheduleParams.java index 4145005c..68d773b5 100644 --- a/src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyRemoveScheduleParams.java +++ b/src/main/java/com/chargebee/v4/models/currency/params/CurrencyRemoveScheduleParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.currency.params; +package com.chargebee.v4.models.currency.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class CurrencyRemoveScheduleParams { - private final Map formData; - - private CurrencyRemoveScheduleParams(CurrencyRemoveScheduleBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private CurrencyRemoveScheduleParams(CurrencyRemoveScheduleBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static CurrencyRemoveScheduleBuilder builder() { } public static final class CurrencyRemoveScheduleBuilder { - private final Map formData = new LinkedHashMap<>(); private CurrencyRemoveScheduleBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyRetrieveParams.java b/src/main/java/com/chargebee/v4/models/currency/params/CurrencyRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/currency/params/CurrencyRetrieveParams.java index 87c5d1db..e0d001c0 100644 --- a/src/main/java/com/chargebee/v4/core/models/currency/params/CurrencyRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/currency/params/CurrencyRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.currency.params; +package com.chargebee.v4.models.currency.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/currency/params/CurrencyUpdateParams.java b/src/main/java/com/chargebee/v4/models/currency/params/CurrencyUpdateParams.java new file mode 100644 index 00000000..6c89589c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/currency/params/CurrencyUpdateParams.java @@ -0,0 +1,108 @@ +/* + * 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.currency.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CurrencyUpdateParams { + + private final ForexType forexType; + + private final String manualExchangeRate; + + private CurrencyUpdateParams(CurrencyUpdateBuilder builder) { + + this.forexType = builder.forexType; + + this.manualExchangeRate = builder.manualExchangeRate; + } + + public ForexType getForexType() { + return forexType; + } + + public String getManualExchangeRate() { + return manualExchangeRate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.forexType != null) { + + formData.put("forex_type", this.forexType); + } + + if (this.manualExchangeRate != null) { + + formData.put("manual_exchange_rate", this.manualExchangeRate); + } + + return formData; + } + + /** Create a new builder for CurrencyUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CurrencyUpdateBuilder builder() { + return new CurrencyUpdateBuilder(); + } + + public static final class CurrencyUpdateBuilder { + + private ForexType forexType; + + private String manualExchangeRate; + + private CurrencyUpdateBuilder() {} + + public CurrencyUpdateBuilder forexType(ForexType value) { + this.forexType = value; + return this; + } + + public CurrencyUpdateBuilder manualExchangeRate(String value) { + this.manualExchangeRate = value; + return this; + } + + public CurrencyUpdateParams build() { + return new CurrencyUpdateParams(this); + } + } + + public enum ForexType { + MANUAL("manual"), + + AUTO("auto"), + + /** An enum member indicating that ForexType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ForexType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ForexType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ForexType enumValue : ForexType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/currency/CurrencyAddScheduleResponse.java b/src/main/java/com/chargebee/v4/models/currency/responses/CurrencyAddScheduleResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/currency/CurrencyAddScheduleResponse.java rename to src/main/java/com/chargebee/v4/models/currency/responses/CurrencyAddScheduleResponse.java index 1842be33..3e0b1c2f 100644 --- a/src/main/java/com/chargebee/v4/core/responses/currency/CurrencyAddScheduleResponse.java +++ b/src/main/java/com/chargebee/v4/models/currency/responses/CurrencyAddScheduleResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.currency; +package com.chargebee.v4.models.currency.responses; -import com.chargebee.v4.core.models.currency.Currency; +import com.chargebee.v4.models.currency.Currency; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/responses/currency/CurrencyCreateResponse.java b/src/main/java/com/chargebee/v4/models/currency/responses/CurrencyCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/currency/CurrencyCreateResponse.java rename to src/main/java/com/chargebee/v4/models/currency/responses/CurrencyCreateResponse.java index 87509f2a..527592cc 100644 --- a/src/main/java/com/chargebee/v4/core/responses/currency/CurrencyCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/currency/responses/CurrencyCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.currency; +package com.chargebee.v4.models.currency.responses; -import com.chargebee.v4.core.models.currency.Currency; +import com.chargebee.v4.models.currency.Currency; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/currency/CurrencyListResponse.java b/src/main/java/com/chargebee/v4/models/currency/responses/CurrencyListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/currency/CurrencyListResponse.java rename to src/main/java/com/chargebee/v4/models/currency/responses/CurrencyListResponse.java index 6a1ca5b8..d85a13af 100644 --- a/src/main/java/com/chargebee/v4/core/responses/currency/CurrencyListResponse.java +++ b/src/main/java/com/chargebee/v4/models/currency/responses/CurrencyListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.currency; +package com.chargebee.v4.models.currency.responses; import java.util.List; -import com.chargebee.v4.core.models.currency.Currency; +import com.chargebee.v4.models.currency.Currency; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.CurrencyService; -import com.chargebee.v4.core.models.currency.params.CurrencyListParams; +import com.chargebee.v4.services.CurrencyService; +import com.chargebee.v4.models.currency.params.CurrencyListParams; /** Immutable response object for CurrencyList operation. Contains paginated list data. */ public final class CurrencyListResponse { @@ -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 CurrencyListResponse nextPage() throws Exception { + public CurrencyListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/currency/CurrencyRemoveScheduleResponse.java b/src/main/java/com/chargebee/v4/models/currency/responses/CurrencyRemoveScheduleResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/currency/CurrencyRemoveScheduleResponse.java rename to src/main/java/com/chargebee/v4/models/currency/responses/CurrencyRemoveScheduleResponse.java index c7c7c5cd..1d740b01 100644 --- a/src/main/java/com/chargebee/v4/core/responses/currency/CurrencyRemoveScheduleResponse.java +++ b/src/main/java/com/chargebee/v4/models/currency/responses/CurrencyRemoveScheduleResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.currency; +package com.chargebee.v4.models.currency.responses; -import com.chargebee.v4.core.models.currency.Currency; +import com.chargebee.v4.models.currency.Currency; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/currency/responses/CurrencyRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/currency/responses/CurrencyRetrieveResponse.java new file mode 100644 index 00000000..36cf0f31 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/currency/responses/CurrencyRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.currency.responses; + +import com.chargebee.v4.models.currency.Currency; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CurrencyRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class CurrencyRetrieveResponse extends BaseResponse { + private final Currency currency; + + private CurrencyRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.currency = builder.currency; + } + + /** Parse JSON response into CurrencyRetrieveResponse object. */ + public static CurrencyRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CurrencyRetrieveResponse object with HTTP response. */ + public static CurrencyRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __currencyJson = JsonUtil.getObject(json, "currency"); + if (__currencyJson != null) { + builder.currency(Currency.fromJson(__currencyJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CurrencyRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for CurrencyRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CurrencyRetrieveResponse. */ + public static class Builder { + + private Currency currency; + + private Response httpResponse; + + private Builder() {} + + public Builder currency(Currency currency) { + this.currency = currency; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CurrencyRetrieveResponse build() { + return new CurrencyRetrieveResponse(this); + } + } + + /** Get the currency from the response. */ + public Currency getCurrency() { + return currency; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/currency/CurrencyUpdateResponse.java b/src/main/java/com/chargebee/v4/models/currency/responses/CurrencyUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/currency/CurrencyUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/currency/responses/CurrencyUpdateResponse.java index 59a889f9..8564b823 100644 --- a/src/main/java/com/chargebee/v4/core/responses/currency/CurrencyUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/currency/responses/CurrencyUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.currency; +package com.chargebee.v4.models.currency.responses; -import com.chargebee.v4.core.models.currency.Currency; +import com.chargebee.v4.models.currency.Currency; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/customer/Customer.java b/src/main/java/com/chargebee/v4/models/customer/Customer.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/customer/Customer.java rename to src/main/java/com/chargebee/v4/models/customer/Customer.java index 9d0bcfea..60533e35 100644 --- a/src/main/java/com/chargebee/v4/core/models/customer/Customer.java +++ b/src/main/java/com/chargebee/v4/models/customer/Customer.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customer; +package com.chargebee.v4.models.customer; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; @@ -80,7 +80,9 @@ public class Customer { private ParentAccountAccess parentAccountAccess; private ChildAccountAccess childAccountAccess; - private java.util.Map customFields = new java.util.HashMap<>(); + private java.util.Map customFields = new java.util.HashMap<>(); + + private java.util.Map consentFields = new java.util.HashMap<>(); public String getId() { return id; @@ -353,7 +355,7 @@ public ChildAccountAccess getChildAccountAccess() { * * @return map containing all custom fields */ - public java.util.Map getCustomFields() { + public java.util.Map getCustomFields() { return customFields; } @@ -363,10 +365,44 @@ public java.util.Map getCustomFields() { * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") * @return the value of the custom field, or null if not present */ - public Object getCustomField(String fieldName) { + public String getCustomField(String fieldName) { return customFields.get(fieldName); } + /** + * Returns a map of consent fields. Consent fields are dynamic boolean/option properties that + * follow the pattern cs_* (e.g., cs_marketing_consent). + * + * @return map containing all consent fields + */ + public java.util.Map getConsentFields() { + return consentFields; + } + + /** + * Returns the value of a specific consent field. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @return the value of the consent field, or null if not present + */ + public Object getConsentField(String fieldName) { + return consentFields.get(fieldName); + } + + /** + * Returns the boolean value of a specific consent field. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @return the boolean value of the consent field, or null if not present or not a boolean + */ + public Boolean getConsentFieldAsBoolean(String fieldName) { + Object value = consentFields.get(fieldName); + if (value instanceof Boolean) { + return (Boolean) value; + } + return null; + } + public enum AutoCollection { ON("on"), @@ -856,7 +892,7 @@ public static CustomerType fromString(String value) { public static Customer fromJson(String json) { Customer obj = new Customer(); - // Parse JSON to extract all keys + // Parse JSON to extract all keys for custom field extraction java.util.Set knownFields = new java.util.HashSet<>(); knownFields.add("id"); @@ -1171,6 +1207,9 @@ public static Customer fromJson(String json) { // Extract custom fields (fields starting with cf_) obj.customFields = extractCustomFields(json, knownFields); + // Extract consent fields (fields starting with cs_) + obj.consentFields = extractConsentFields(json, knownFields); + return obj; } @@ -1182,9 +1221,9 @@ public static Customer fromJson(String json) { * @param knownFields set of known field names * @return map of custom fields */ - private static java.util.Map extractCustomFields( + private static java.util.Map extractCustomFields( String json, java.util.Set knownFields) { - java.util.Map customFields = new java.util.HashMap<>(); + java.util.Map customFields = new java.util.HashMap<>(); try { // Parse the entire JSON as a map java.util.Map allFields = JsonUtil.parseJsonObjectToMap(json); @@ -1193,7 +1232,8 @@ private static java.util.Map extractCustomFields( String key = entry.getKey(); // Include fields that start with "cf_" and are not in knownFields if (key != null && key.startsWith("cf_") && !knownFields.contains(key)) { - customFields.put(key, entry.getValue()); + customFields.put( + key, entry.getValue() != null ? String.valueOf(entry.getValue()) : null); } } } @@ -1203,6 +1243,35 @@ private static java.util.Map extractCustomFields( return customFields; } + /** + * Helper method to extract consent fields from JSON. Consent fields are fields that start with + * "cs_" and are not in the known fields set. They typically contain boolean values or options. + * + * @param json JSON string to parse + * @param knownFields set of known field names + * @return map of consent fields + */ + private static java.util.Map extractConsentFields( + String json, java.util.Set knownFields) { + java.util.Map consentFields = new java.util.HashMap<>(); + try { + // Parse the entire JSON as a map + java.util.Map allFields = JsonUtil.parseJsonObjectToMap(json); + if (allFields != null) { + for (java.util.Map.Entry entry : allFields.entrySet()) { + String key = entry.getKey(); + // Include fields that start with "cs_" and are not in knownFields + if (key != null && key.startsWith("cs_") && !knownFields.contains(key)) { + consentFields.put(key, entry.getValue()); + } + } + } + } catch (Exception e) { + // If parsing fails, return empty map + } + return consentFields; + } + public static class BillingAddress { private String firstName; @@ -1592,6 +1661,16 @@ public enum Type { PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1726,6 +1805,8 @@ public enum Gateway { DEUTSCHE_BANK("deutsche_bank"), + EZIDEBIT("ezidebit"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/customer/params/ContactsForCustomerParams.java b/src/main/java/com/chargebee/v4/models/customer/params/ContactsForCustomerParams.java new file mode 100644 index 00000000..ad4aaf20 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/ContactsForCustomerParams.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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ContactsForCustomerParams { + + private final Map queryParams; + + private ContactsForCustomerParams(ContactsForCustomerBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public ContactsForCustomerBuilder toBuilder() { + ContactsForCustomerBuilder builder = new ContactsForCustomerBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for ContactsForCustomerParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContactsForCustomerBuilder builder() { + return new ContactsForCustomerBuilder(); + } + + public static final class ContactsForCustomerBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private ContactsForCustomerBuilder() {} + + public ContactsForCustomerBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public ContactsForCustomerBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public ContactsForCustomerParams build() { + return new ContactsForCustomerParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerAddContactParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerAddContactParams.java new file mode 100644 index 00000000..ea3cb495 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerAddContactParams.java @@ -0,0 +1,342 @@ +/* + * 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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CustomerAddContactParams { + + private final ContactParams contact; + + private final Map consentFields; + + private CustomerAddContactParams(CustomerAddContactBuilder builder) { + + this.contact = builder.contact; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public ContactParams getContact() { + return contact; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.contact != null) { + + // Single object + Map nestedData = this.contact.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contact[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerAddContactParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerAddContactBuilder builder() { + return new CustomerAddContactBuilder(); + } + + public static final class CustomerAddContactBuilder { + + private ContactParams contact; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerAddContactBuilder() {} + + public CustomerAddContactBuilder contact(ContactParams value) { + this.contact = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerAddContactBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerAddContactBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerAddContactBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerAddContactParams build() { + return new CustomerAddContactParams(this); + } + } + + public static final class ContactParams { + + private final String id; + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String phone; + + private final String label; + + private final Boolean enabled; + + private final Boolean sendBillingEmail; + + private final Boolean sendAccountEmail; + + private ContactParams(ContactBuilder builder) { + + this.id = builder.id; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.phone = builder.phone; + + this.label = builder.label; + + this.enabled = builder.enabled; + + this.sendBillingEmail = builder.sendBillingEmail; + + this.sendAccountEmail = builder.sendAccountEmail; + } + + public String getId() { + return id; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getEmail() { + return email; + } + + public String getPhone() { + return phone; + } + + public String getLabel() { + return label; + } + + public Boolean getEnabled() { + return enabled; + } + + public Boolean getSendBillingEmail() { + return sendBillingEmail; + } + + public Boolean getSendAccountEmail() { + return sendAccountEmail; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + 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.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.label != null) { + + formData.put("label", this.label); + } + + if (this.enabled != null) { + + formData.put("enabled", this.enabled); + } + + if (this.sendBillingEmail != null) { + + formData.put("send_billing_email", this.sendBillingEmail); + } + + if (this.sendAccountEmail != null) { + + formData.put("send_account_email", this.sendAccountEmail); + } + + return formData; + } + + /** Create a new builder for ContactParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContactBuilder builder() { + return new ContactBuilder(); + } + + public static final class ContactBuilder { + + private String id; + + private String firstName; + + private String lastName; + + private String email; + + private String phone; + + private String label; + + private Boolean enabled; + + private Boolean sendBillingEmail; + + private Boolean sendAccountEmail; + + private ContactBuilder() {} + + public ContactBuilder id(String value) { + this.id = value; + return this; + } + + public ContactBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ContactBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ContactBuilder email(String value) { + this.email = value; + return this; + } + + public ContactBuilder phone(String value) { + this.phone = value; + return this; + } + + public ContactBuilder label(String value) { + this.label = value; + return this; + } + + public ContactBuilder enabled(Boolean value) { + this.enabled = value; + return this; + } + + public ContactBuilder sendBillingEmail(Boolean value) { + this.sendBillingEmail = value; + return this; + } + + public ContactBuilder sendAccountEmail(Boolean value) { + this.sendAccountEmail = value; + return this; + } + + public ContactParams build() { + return new ContactParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerAddPromotionalCreditsParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerAddPromotionalCreditsParams.java new file mode 100644 index 00000000..ad00bd35 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerAddPromotionalCreditsParams.java @@ -0,0 +1,239 @@ +/* + * 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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CustomerAddPromotionalCreditsParams { + + private final Long amount; + + private final String currencyCode; + + private final String description; + + private final CreditType creditType; + + private final String reference; + + private final Map consentFields; + + private CustomerAddPromotionalCreditsParams(CustomerAddPromotionalCreditsBuilder builder) { + + this.amount = builder.amount; + + this.currencyCode = builder.currencyCode; + + this.description = builder.description; + + this.creditType = builder.creditType; + + this.reference = builder.reference; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public Long getAmount() { + return amount; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getDescription() { + return description; + } + + public CreditType getCreditType() { + return creditType; + } + + public String getReference() { + return reference; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.creditType != null) { + + formData.put("credit_type", this.creditType); + } + + if (this.reference != null) { + + formData.put("reference", this.reference); + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerAddPromotionalCreditsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerAddPromotionalCreditsBuilder builder() { + return new CustomerAddPromotionalCreditsBuilder(); + } + + public static final class CustomerAddPromotionalCreditsBuilder { + + private Long amount; + + private String currencyCode; + + private String description; + + private CreditType creditType; + + private String reference; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerAddPromotionalCreditsBuilder() {} + + public CustomerAddPromotionalCreditsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public CustomerAddPromotionalCreditsBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public CustomerAddPromotionalCreditsBuilder description(String value) { + this.description = value; + return this; + } + + public CustomerAddPromotionalCreditsBuilder creditType(CreditType value) { + this.creditType = value; + return this; + } + + public CustomerAddPromotionalCreditsBuilder reference(String value) { + this.reference = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerAddPromotionalCreditsBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerAddPromotionalCreditsBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerAddPromotionalCreditsBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerAddPromotionalCreditsParams build() { + return new CustomerAddPromotionalCreditsParams(this); + } + } + + public enum CreditType { + LOYALTY_CREDITS("loyalty_credits"), + + REFERRAL_REWARDS("referral_rewards"), + + GENERAL("general"), + + /** An enum member indicating that CreditType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CreditType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CreditType fromString(String value) { + if (value == null) return _UNKNOWN; + for (CreditType enumValue : CreditType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerAssignPaymentRoleParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerAssignPaymentRoleParams.java new file mode 100644 index 00000000..d60ad25a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerAssignPaymentRoleParams.java @@ -0,0 +1,179 @@ +/* + * 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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CustomerAssignPaymentRoleParams { + + private final String paymentSourceId; + + private final Role role; + + private final Map consentFields; + + private CustomerAssignPaymentRoleParams(CustomerAssignPaymentRoleBuilder builder) { + + this.paymentSourceId = builder.paymentSourceId; + + this.role = builder.role; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public Role getRole() { + return role; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.role != null) { + + formData.put("role", this.role); + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerAssignPaymentRoleParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerAssignPaymentRoleBuilder builder() { + return new CustomerAssignPaymentRoleBuilder(); + } + + public static final class CustomerAssignPaymentRoleBuilder { + + private String paymentSourceId; + + private Role role; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerAssignPaymentRoleBuilder() {} + + public CustomerAssignPaymentRoleBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public CustomerAssignPaymentRoleBuilder role(Role value) { + this.role = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerAssignPaymentRoleBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerAssignPaymentRoleBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerAssignPaymentRoleBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerAssignPaymentRoleParams build() { + return new CustomerAssignPaymentRoleParams(this); + } + } + + public enum Role { + PRIMARY("primary"), + + BACKUP("backup"), + + NONE("none"), + + /** An enum member indicating that Role was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Role(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Role fromString(String value) { + if (value == null) return _UNKNOWN; + for (Role enumValue : Role.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerChangeBillingDateParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerChangeBillingDateParams.java new file mode 100644 index 00000000..b779903a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerChangeBillingDateParams.java @@ -0,0 +1,305 @@ +/* + * 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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CustomerChangeBillingDateParams { + + private final Integer billingDate; + + private final Integer billingMonth; + + private final BillingDateMode billingDateMode; + + private final BillingDayOfWeek billingDayOfWeek; + + private final BillingDayOfWeekMode billingDayOfWeekMode; + + private final Map consentFields; + + private CustomerChangeBillingDateParams(CustomerChangeBillingDateBuilder builder) { + + this.billingDate = builder.billingDate; + + this.billingMonth = builder.billingMonth; + + this.billingDateMode = builder.billingDateMode; + + this.billingDayOfWeek = builder.billingDayOfWeek; + + this.billingDayOfWeekMode = builder.billingDayOfWeekMode; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public Integer getBillingDate() { + return billingDate; + } + + public Integer getBillingMonth() { + return billingMonth; + } + + public BillingDateMode getBillingDateMode() { + return billingDateMode; + } + + public BillingDayOfWeek getBillingDayOfWeek() { + return billingDayOfWeek; + } + + public BillingDayOfWeekMode getBillingDayOfWeekMode() { + return billingDayOfWeekMode; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.billingDate != null) { + + formData.put("billing_date", this.billingDate); + } + + if (this.billingMonth != null) { + + formData.put("billing_month", this.billingMonth); + } + + if (this.billingDateMode != null) { + + formData.put("billing_date_mode", this.billingDateMode); + } + + if (this.billingDayOfWeek != null) { + + formData.put("billing_day_of_week", this.billingDayOfWeek); + } + + if (this.billingDayOfWeekMode != null) { + + formData.put("billing_day_of_week_mode", this.billingDayOfWeekMode); + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerChangeBillingDateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerChangeBillingDateBuilder builder() { + return new CustomerChangeBillingDateBuilder(); + } + + public static final class CustomerChangeBillingDateBuilder { + + private Integer billingDate; + + private Integer billingMonth; + + private BillingDateMode billingDateMode; + + private BillingDayOfWeek billingDayOfWeek; + + private BillingDayOfWeekMode billingDayOfWeekMode; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerChangeBillingDateBuilder() {} + + public CustomerChangeBillingDateBuilder billingDate(Integer value) { + this.billingDate = value; + return this; + } + + public CustomerChangeBillingDateBuilder billingMonth(Integer value) { + this.billingMonth = value; + return this; + } + + public CustomerChangeBillingDateBuilder billingDateMode(BillingDateMode value) { + this.billingDateMode = value; + return this; + } + + public CustomerChangeBillingDateBuilder billingDayOfWeek(BillingDayOfWeek value) { + this.billingDayOfWeek = value; + return this; + } + + public CustomerChangeBillingDateBuilder billingDayOfWeekMode(BillingDayOfWeekMode value) { + this.billingDayOfWeekMode = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerChangeBillingDateBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerChangeBillingDateBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerChangeBillingDateBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerChangeBillingDateParams build() { + return new CustomerChangeBillingDateParams(this); + } + } + + public enum BillingDateMode { + USING_DEFAULTS("using_defaults"), + + MANUALLY_SET("manually_set"), + + /** An enum member indicating that BillingDateMode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + BillingDateMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingDateMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingDateMode enumValue : BillingDateMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum BillingDayOfWeek { + SUNDAY("sunday"), + + MONDAY("monday"), + + TUESDAY("tuesday"), + + WEDNESDAY("wednesday"), + + THURSDAY("thursday"), + + FRIDAY("friday"), + + SATURDAY("saturday"), + + /** An enum member indicating that BillingDayOfWeek was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + BillingDayOfWeek(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingDayOfWeek fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingDayOfWeek enumValue : BillingDayOfWeek.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum BillingDayOfWeekMode { + USING_DEFAULTS("using_defaults"), + + MANUALLY_SET("manually_set"), + + /** + * An enum member indicating that BillingDayOfWeekMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingDayOfWeekMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingDayOfWeekMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingDayOfWeekMode enumValue : BillingDayOfWeekMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerClearPersonalDataParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerClearPersonalDataParams.java similarity index 77% rename from src/main/java/com/chargebee/v4/core/models/customer/params/CustomerClearPersonalDataParams.java rename to src/main/java/com/chargebee/v4/models/customer/params/CustomerClearPersonalDataParams.java index 1f1c1ea5..6db1f848 100644 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerClearPersonalDataParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerClearPersonalDataParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customer.params; +package com.chargebee.v4.models.customer.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class CustomerClearPersonalDataParams { - private final Map formData; - - private CustomerClearPersonalDataParams(CustomerClearPersonalDataBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private CustomerClearPersonalDataParams(CustomerClearPersonalDataBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static CustomerClearPersonalDataBuilder builder() { } public static final class CustomerClearPersonalDataBuilder { - private final Map formData = new LinkedHashMap<>(); private CustomerClearPersonalDataBuilder() {} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerCollectPaymentParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerCollectPaymentParams.java new file mode 100644 index 00000000..5f83ccbe --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerCollectPaymentParams.java @@ -0,0 +1,1269 @@ +/* + * 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.customer.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; + +public final class CustomerCollectPaymentParams { + + private final Long amount; + + private final String paymentSourceId; + + private final String tokenId; + + private final Boolean replacePrimaryPaymentSource; + + private final Boolean retainPaymentSource; + + private final PaymentInitiator paymentInitiator; + + private final PaymentMethodParams paymentMethod; + + private final CardParams card; + + private final PaymentIntentParams paymentIntent; + + private final List invoiceAllocations; + + private final Map consentFields; + + private CustomerCollectPaymentParams(CustomerCollectPaymentBuilder builder) { + + this.amount = builder.amount; + + this.paymentSourceId = builder.paymentSourceId; + + this.tokenId = builder.tokenId; + + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; + + this.retainPaymentSource = builder.retainPaymentSource; + + this.paymentInitiator = builder.paymentInitiator; + + this.paymentMethod = builder.paymentMethod; + + this.card = builder.card; + + this.paymentIntent = builder.paymentIntent; + + this.invoiceAllocations = builder.invoiceAllocations; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public Long getAmount() { + return amount; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public String getTokenId() { + return tokenId; + } + + public Boolean getReplacePrimaryPaymentSource() { + return replacePrimaryPaymentSource; + } + + public Boolean getRetainPaymentSource() { + return retainPaymentSource; + } + + public PaymentInitiator getPaymentInitiator() { + return paymentInitiator; + } + + public PaymentMethodParams getPaymentMethod() { + return paymentMethod; + } + + public CardParams getCard() { + return card; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + public List getInvoiceAllocations() { + return invoiceAllocations; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.tokenId != null) { + + formData.put("token_id", this.tokenId); + } + + if (this.replacePrimaryPaymentSource != null) { + + formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); + } + + if (this.retainPaymentSource != null) { + + formData.put("retain_payment_source", this.retainPaymentSource); + } + + if (this.paymentInitiator != null) { + + formData.put("payment_initiator", this.paymentInitiator); + } + + if (this.paymentMethod != null) { + + // Single object + Map nestedData = this.paymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.invoiceAllocations != null) { + + // List of objects + for (int i = 0; i < this.invoiceAllocations.size(); i++) { + InvoiceAllocationsParams item = this.invoiceAllocations.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "invoice_allocations[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerCollectPaymentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerCollectPaymentBuilder builder() { + return new CustomerCollectPaymentBuilder(); + } + + public static final class CustomerCollectPaymentBuilder { + + private Long amount; + + private String paymentSourceId; + + private String tokenId; + + private Boolean replacePrimaryPaymentSource; + + private Boolean retainPaymentSource; + + private PaymentInitiator paymentInitiator; + + private PaymentMethodParams paymentMethod; + + private CardParams card; + + private PaymentIntentParams paymentIntent; + + private List invoiceAllocations; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerCollectPaymentBuilder() {} + + public CustomerCollectPaymentBuilder amount(Long value) { + this.amount = value; + return this; + } + + public CustomerCollectPaymentBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public CustomerCollectPaymentBuilder tokenId(String value) { + this.tokenId = value; + return this; + } + + public CustomerCollectPaymentBuilder replacePrimaryPaymentSource(Boolean value) { + this.replacePrimaryPaymentSource = value; + return this; + } + + public CustomerCollectPaymentBuilder retainPaymentSource(Boolean value) { + this.retainPaymentSource = value; + return this; + } + + public CustomerCollectPaymentBuilder paymentInitiator(PaymentInitiator value) { + this.paymentInitiator = value; + return this; + } + + public CustomerCollectPaymentBuilder paymentMethod(PaymentMethodParams value) { + this.paymentMethod = value; + return this; + } + + public CustomerCollectPaymentBuilder card(CardParams value) { + this.card = value; + return this; + } + + public CustomerCollectPaymentBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public CustomerCollectPaymentBuilder invoiceAllocations(List value) { + this.invoiceAllocations = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerCollectPaymentBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerCollectPaymentBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerCollectPaymentBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerCollectPaymentParams build() { + return new CustomerCollectPaymentParams(this); + } + } + + public enum PaymentInitiator { + CUSTOMER("customer"), + + MERCHANT("merchant"), + + /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentInitiator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentInitiator fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentInitiator enumValue : PaymentInitiator.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class PaymentMethodParams { + + private final Type type; + + private final String gatewayAccountId; + + private final String referenceId; + + private final String tmpToken; + + private final java.util.Map additionalInformation; + + private PaymentMethodParams(PaymentMethodBuilder builder) { + + this.type = builder.type; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.referenceId = builder.referenceId; + + this.tmpToken = builder.tmpToken; + + this.additionalInformation = builder.additionalInformation; + } + + public Type getType() { + return type; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getReferenceId() { + return referenceId; + } + + public String getTmpToken() { + return tmpToken; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.tmpToken != null) { + + formData.put("tmp_token", this.tmpToken); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentMethodBuilder builder() { + return new PaymentMethodBuilder(); + } + + public static final class PaymentMethodBuilder { + + private Type type; + + private String gatewayAccountId; + + private String referenceId; + + private String tmpToken; + + private java.util.Map additionalInformation; + + private PaymentMethodBuilder() {} + + public PaymentMethodBuilder type(Type value) { + this.type = value; + return this; + } + + public PaymentMethodBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentMethodBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public PaymentMethodBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public PaymentMethodBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentMethodParams build() { + return new PaymentMethodParams(this); + } + } + + public enum Type { + CARD("card"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + AMAZON_PAYMENTS("amazon_payments"), + + DIRECT_DEBIT("direct_debit"), + + GENERIC("generic"), + + ALIPAY("alipay"), + + UNIONPAY("unionpay"), + + APPLE_PAY("apple_pay"), + + WECHAT_PAY("wechat_pay"), + + IDEAL("ideal"), + + GOOGLE_PAY("google_pay"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GIROPAY("giropay"), + + DOTPAY("dotpay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + VENMO("venmo"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** 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 static final class CardParams { + + private final String gatewayAccountId; + + 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 java.util.Map additionalInformation; + + private CardParams(CardBuilder builder) { + + this.gatewayAccountId = builder.gatewayAccountId; + + 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.additionalInformation = builder.additionalInformation; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + 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 java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + 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.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + private String gatewayAccountId; + + 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 java.util.Map additionalInformation; + + private CardBuilder() {} + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public CardBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CardBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CardBuilder number(String value) { + this.number = value; + return this; + } + + public CardBuilder expiryMonth(Integer value) { + this.expiryMonth = value; + return this; + } + + public CardBuilder expiryYear(Integer value) { + this.expiryYear = value; + return this; + } + + public CardBuilder cvv(String value) { + this.cvv = value; + return this; + } + + public CardBuilder preferredScheme(PreferredScheme value) { + this.preferredScheme = value; + return this; + } + + public CardBuilder billingAddr1(String value) { + this.billingAddr1 = value; + return this; + } + + public CardBuilder billingAddr2(String value) { + this.billingAddr2 = value; + return this; + } + + public CardBuilder billingCity(String value) { + this.billingCity = value; + return this; + } + + public CardBuilder billingStateCode(String value) { + this.billingStateCode = value; + return this; + } + + public CardBuilder billingState(String value) { + this.billingState = value; + return this; + } + + public CardBuilder billingZip(String value) { + this.billingZip = value; + return this; + } + + public CardBuilder billingCountry(String value) { + this.billingCountry = value; + return this; + } + + public CardBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public CardParams build() { + return new CardParams(this); + } + } + + 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 PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String gwPaymentMethodId; + + private final String referenceId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.referenceId = builder.referenceId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public String getReferenceId() { + return referenceId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String gwPaymentMethodId; + + private String referenceId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class InvoiceAllocationsParams { + + private final String invoiceId; + + private final Long allocationAmount; + + private InvoiceAllocationsParams(InvoiceAllocationsBuilder builder) { + + this.invoiceId = builder.invoiceId; + + this.allocationAmount = builder.allocationAmount; + } + + public String getInvoiceId() { + return invoiceId; + } + + public Long getAllocationAmount() { + return allocationAmount; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.invoiceId != null) { + + formData.put("invoice_id", this.invoiceId); + } + + if (this.allocationAmount != null) { + + formData.put("allocation_amount", this.allocationAmount); + } + + return formData; + } + + /** Create a new builder for InvoiceAllocationsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceAllocationsBuilder builder() { + return new InvoiceAllocationsBuilder(); + } + + public static final class InvoiceAllocationsBuilder { + + private String invoiceId; + + private Long allocationAmount; + + private InvoiceAllocationsBuilder() {} + + public InvoiceAllocationsBuilder invoiceId(String value) { + this.invoiceId = value; + return this; + } + + public InvoiceAllocationsBuilder allocationAmount(Long value) { + this.allocationAmount = value; + return this; + } + + public InvoiceAllocationsParams build() { + return new InvoiceAllocationsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerCreateParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerCreateParams.java new file mode 100644 index 00000000..49b7f90e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerCreateParams.java @@ -0,0 +1,3498 @@ +/* + * 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.customer.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; + +public final class CustomerCreateParams { + + private final String id; + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String preferredCurrencyCode; + + private final String phone; + + private final String company; + + private final AutoCollection autoCollection; + + private final Integer netTermDays; + + private final Boolean allowDirectDebit; + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final String entityIdentifierScheme; + + private final String entityIdentifierStandard; + + private final Boolean registeredForGst; + + private final Boolean isEinvoiceEnabled; + + private final EinvoicingMethod einvoicingMethod; + + private final Taxability taxability; + + private final List exemptionDetails; + + private final CustomerType customerType; + + private final String clientProfileId; + + private final TaxjarExemptionCategory taxjarExemptionCategory; + + private final Boolean businessCustomerWithoutVatNumber; + + private final String locale; + + private final EntityCode entityCode; + + private final String exemptNumber; + + private final java.util.Map metaData; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final Boolean autoCloseInvoices; + + private final Boolean consolidatedInvoicing; + + private final String tokenId; + + private final String businessEntityId; + + private final String createdFromIp; + + private final String invoiceNotes; + + private final CardParams card; + + private final BankAccountParams bankAccount; + + private final PaymentMethodParams paymentMethod; + + private final PaymentIntentParams paymentIntent; + + private final BillingAddressParams billingAddress; + + private final List entityIdentifiers; + + private final List taxProvidersFields; + + private final Map customFields; + + private final Map consentFields; + + private CustomerCreateParams(CustomerCreateBuilder builder) { + + this.id = builder.id; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.preferredCurrencyCode = builder.preferredCurrencyCode; + + this.phone = builder.phone; + + this.company = builder.company; + + this.autoCollection = builder.autoCollection; + + this.netTermDays = builder.netTermDays; + + this.allowDirectDebit = builder.allowDirectDebit; + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.entityIdentifierScheme = builder.entityIdentifierScheme; + + this.entityIdentifierStandard = builder.entityIdentifierStandard; + + this.registeredForGst = builder.registeredForGst; + + this.isEinvoiceEnabled = builder.isEinvoiceEnabled; + + this.einvoicingMethod = builder.einvoicingMethod; + + this.taxability = builder.taxability; + + this.exemptionDetails = builder.exemptionDetails; + + this.customerType = builder.customerType; + + this.clientProfileId = builder.clientProfileId; + + this.taxjarExemptionCategory = builder.taxjarExemptionCategory; + + this.businessCustomerWithoutVatNumber = builder.businessCustomerWithoutVatNumber; + + this.locale = builder.locale; + + this.entityCode = builder.entityCode; + + this.exemptNumber = builder.exemptNumber; + + this.metaData = builder.metaData; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.autoCloseInvoices = builder.autoCloseInvoices; + + this.consolidatedInvoicing = builder.consolidatedInvoicing; + + this.tokenId = builder.tokenId; + + this.businessEntityId = builder.businessEntityId; + + this.createdFromIp = builder.createdFromIp; + + this.invoiceNotes = builder.invoiceNotes; + + this.card = builder.card; + + this.bankAccount = builder.bankAccount; + + this.paymentMethod = builder.paymentMethod; + + this.paymentIntent = builder.paymentIntent; + + this.billingAddress = builder.billingAddress; + + this.entityIdentifiers = builder.entityIdentifiers; + + this.taxProvidersFields = builder.taxProvidersFields; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public String getId() { + return id; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getEmail() { + return email; + } + + public String getPreferredCurrencyCode() { + return preferredCurrencyCode; + } + + public String getPhone() { + return phone; + } + + public String getCompany() { + return company; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public Integer getNetTermDays() { + return netTermDays; + } + + public Boolean getAllowDirectDebit() { + return allowDirectDebit; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public String getEntityIdentifierScheme() { + return entityIdentifierScheme; + } + + public String getEntityIdentifierStandard() { + return entityIdentifierStandard; + } + + public Boolean getRegisteredForGst() { + return registeredForGst; + } + + public Boolean getIsEinvoiceEnabled() { + return isEinvoiceEnabled; + } + + public EinvoicingMethod getEinvoicingMethod() { + return einvoicingMethod; + } + + public Taxability getTaxability() { + return taxability; + } + + public List getExemptionDetails() { + return exemptionDetails; + } + + public CustomerType getCustomerType() { + return customerType; + } + + public String getClientProfileId() { + return clientProfileId; + } + + public TaxjarExemptionCategory getTaxjarExemptionCategory() { + return taxjarExemptionCategory; + } + + public Boolean getBusinessCustomerWithoutVatNumber() { + return businessCustomerWithoutVatNumber; + } + + public String getLocale() { + return locale; + } + + public EntityCode getEntityCode() { + return entityCode; + } + + public String getExemptNumber() { + return exemptNumber; + } + + public java.util.Map getMetaData() { + return metaData; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public Boolean getAutoCloseInvoices() { + return autoCloseInvoices; + } + + public Boolean getConsolidatedInvoicing() { + return consolidatedInvoicing; + } + + public String getTokenId() { + return tokenId; + } + + public String getBusinessEntityId() { + return businessEntityId; + } + + public String getCreatedFromIp() { + return createdFromIp; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public CardParams getCard() { + return card; + } + + public BankAccountParams getBankAccount() { + return bankAccount; + } + + public PaymentMethodParams getPaymentMethod() { + return paymentMethod; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public List getEntityIdentifiers() { + return entityIdentifiers; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + public Map customFields() { + return customFields; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + 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.preferredCurrencyCode != null) { + + formData.put("preferred_currency_code", this.preferredCurrencyCode); + } + + if (this.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.company != null) { + + formData.put("company", this.company); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.netTermDays != null) { + + formData.put("net_term_days", this.netTermDays); + } + + if (this.allowDirectDebit != null) { + + formData.put("allow_direct_debit", this.allowDirectDebit); + } + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.entityIdentifierScheme != null) { + + formData.put("entity_identifier_scheme", this.entityIdentifierScheme); + } + + if (this.entityIdentifierStandard != null) { + + formData.put("entity_identifier_standard", this.entityIdentifierStandard); + } + + if (this.registeredForGst != null) { + + formData.put("registered_for_gst", this.registeredForGst); + } + + if (this.isEinvoiceEnabled != null) { + + formData.put("is_einvoice_enabled", this.isEinvoiceEnabled); + } + + if (this.einvoicingMethod != null) { + + formData.put("einvoicing_method", this.einvoicingMethod); + } + + if (this.taxability != null) { + + formData.put("taxability", this.taxability); + } + + if (this.exemptionDetails != null) { + + formData.put("exemption_details", JsonUtil.toJson(this.exemptionDetails)); + } + + if (this.customerType != null) { + + formData.put("customer_type", this.customerType); + } + + if (this.clientProfileId != null) { + + formData.put("client_profile_id", this.clientProfileId); + } + + if (this.taxjarExemptionCategory != null) { + + formData.put("taxjar_exemption_category", this.taxjarExemptionCategory); + } + + if (this.businessCustomerWithoutVatNumber != null) { + + formData.put("business_customer_without_vat_number", this.businessCustomerWithoutVatNumber); + } + + if (this.locale != null) { + + formData.put("locale", this.locale); + } + + if (this.entityCode != null) { + + formData.put("entity_code", this.entityCode); + } + + if (this.exemptNumber != null) { + + formData.put("exempt_number", this.exemptNumber); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.autoCloseInvoices != null) { + + formData.put("auto_close_invoices", this.autoCloseInvoices); + } + + if (this.consolidatedInvoicing != null) { + + formData.put("consolidated_invoicing", this.consolidatedInvoicing); + } + + if (this.tokenId != null) { + + formData.put("token_id", this.tokenId); + } + + if (this.businessEntityId != null) { + + formData.put("business_entity_id", this.businessEntityId); + } + + if (this.createdFromIp != null) { + + formData.put("created_from_ip", this.createdFromIp); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.bankAccount != null) { + + // Single object + Map nestedData = this.bankAccount.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "bank_account[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentMethod != null) { + + // Single object + Map nestedData = this.paymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.entityIdentifiers != null) { + + // List of objects + for (int i = 0; i < this.entityIdentifiers.size(); i++) { + EntityIdentifiersParams item = this.entityIdentifiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "entity_identifiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerCreateBuilder builder() { + return new CustomerCreateBuilder(); + } + + public static final class CustomerCreateBuilder { + + private String id; + + private String firstName; + + private String lastName; + + private String email; + + private String preferredCurrencyCode; + + private String phone; + + private String company; + + private AutoCollection autoCollection; + + private Integer netTermDays; + + private Boolean allowDirectDebit; + + private String vatNumber; + + private String vatNumberPrefix; + + private String entityIdentifierScheme; + + private String entityIdentifierStandard; + + private Boolean registeredForGst; + + private Boolean isEinvoiceEnabled; + + private EinvoicingMethod einvoicingMethod; + + private Taxability taxability; + + private List exemptionDetails; + + private CustomerType customerType; + + private String clientProfileId; + + private TaxjarExemptionCategory taxjarExemptionCategory; + + private Boolean businessCustomerWithoutVatNumber; + + private String locale; + + private EntityCode entityCode; + + private String exemptNumber; + + private java.util.Map metaData; + + private OfflinePaymentMethod offlinePaymentMethod; + + private Boolean autoCloseInvoices; + + private Boolean consolidatedInvoicing; + + private String tokenId; + + private String businessEntityId; + + private String createdFromIp; + + private String invoiceNotes; + + private CardParams card; + + private BankAccountParams bankAccount; + + private PaymentMethodParams paymentMethod; + + private PaymentIntentParams paymentIntent; + + private BillingAddressParams billingAddress; + + private List entityIdentifiers; + + private List taxProvidersFields; + + private Map customFields = new LinkedHashMap<>(); + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerCreateBuilder() {} + + public CustomerCreateBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerCreateBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CustomerCreateBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CustomerCreateBuilder email(String value) { + this.email = value; + return this; + } + + public CustomerCreateBuilder preferredCurrencyCode(String value) { + this.preferredCurrencyCode = value; + return this; + } + + public CustomerCreateBuilder phone(String value) { + this.phone = value; + return this; + } + + public CustomerCreateBuilder company(String value) { + this.company = value; + return this; + } + + public CustomerCreateBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public CustomerCreateBuilder netTermDays(Integer value) { + this.netTermDays = value; + return this; + } + + public CustomerCreateBuilder allowDirectDebit(Boolean value) { + this.allowDirectDebit = value; + return this; + } + + public CustomerCreateBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerCreateBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerCreateBuilder entityIdentifierScheme(String value) { + this.entityIdentifierScheme = value; + return this; + } + + public CustomerCreateBuilder entityIdentifierStandard(String value) { + this.entityIdentifierStandard = value; + return this; + } + + public CustomerCreateBuilder registeredForGst(Boolean value) { + this.registeredForGst = value; + return this; + } + + public CustomerCreateBuilder isEinvoiceEnabled(Boolean value) { + this.isEinvoiceEnabled = value; + return this; + } + + public CustomerCreateBuilder einvoicingMethod(EinvoicingMethod value) { + this.einvoicingMethod = value; + return this; + } + + public CustomerCreateBuilder taxability(Taxability value) { + this.taxability = value; + return this; + } + + public CustomerCreateBuilder exemptionDetails(List value) { + this.exemptionDetails = value; + return this; + } + + public CustomerCreateBuilder customerType(CustomerType value) { + this.customerType = value; + return this; + } + + public CustomerCreateBuilder clientProfileId(String value) { + this.clientProfileId = value; + return this; + } + + public CustomerCreateBuilder taxjarExemptionCategory(TaxjarExemptionCategory value) { + this.taxjarExemptionCategory = value; + return this; + } + + public CustomerCreateBuilder businessCustomerWithoutVatNumber(Boolean value) { + this.businessCustomerWithoutVatNumber = value; + return this; + } + + public CustomerCreateBuilder locale(String value) { + this.locale = value; + return this; + } + + public CustomerCreateBuilder entityCode(EntityCode value) { + this.entityCode = value; + return this; + } + + public CustomerCreateBuilder exemptNumber(String value) { + this.exemptNumber = value; + return this; + } + + public CustomerCreateBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public CustomerCreateBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public CustomerCreateBuilder autoCloseInvoices(Boolean value) { + this.autoCloseInvoices = value; + return this; + } + + public CustomerCreateBuilder consolidatedInvoicing(Boolean value) { + this.consolidatedInvoicing = value; + return this; + } + + public CustomerCreateBuilder tokenId(String value) { + this.tokenId = value; + return this; + } + + public CustomerCreateBuilder businessEntityId(String value) { + this.businessEntityId = value; + return this; + } + + @Deprecated + public CustomerCreateBuilder createdFromIp(String value) { + this.createdFromIp = value; + return this; + } + + public CustomerCreateBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public CustomerCreateBuilder card(CardParams value) { + this.card = value; + return this; + } + + public CustomerCreateBuilder bankAccount(BankAccountParams value) { + this.bankAccount = value; + return this; + } + + public CustomerCreateBuilder paymentMethod(PaymentMethodParams value) { + this.paymentMethod = value; + return this; + } + + public CustomerCreateBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public CustomerCreateBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public CustomerCreateBuilder entityIdentifiers(List value) { + this.entityIdentifiers = value; + return this; + } + + public CustomerCreateBuilder taxProvidersFields(List value) { + this.taxProvidersFields = 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 CustomerCreateBuilder 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 CustomerCreateBuilder 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; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerCreateBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerCreateBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerCreateBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerCreateParams build() { + return new CustomerCreateParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EinvoicingMethod { + AUTOMATIC("automatic"), + + MANUAL("manual"), + + SITE_DEFAULT("site_default"), + + /** An enum member indicating that EinvoicingMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EinvoicingMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EinvoicingMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (EinvoicingMethod enumValue : EinvoicingMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Taxability { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Taxability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Taxability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Taxability fromString(String value) { + if (value == null) return _UNKNOWN; + for (Taxability enumValue : Taxability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum CustomerType { + RESIDENTIAL("residential"), + + BUSINESS("business"), + + SENIOR_CITIZEN("senior_citizen"), + + INDUSTRIAL("industrial"), + + /** An enum member indicating that CustomerType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CustomerType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CustomerType fromString(String value) { + if (value == null) return _UNKNOWN; + for (CustomerType enumValue : CustomerType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TaxjarExemptionCategory { + WHOLESALE("wholesale"), + + GOVERNMENT("government"), + + OTHER("other"), + + /** + * An enum member indicating that TaxjarExemptionCategory was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + TaxjarExemptionCategory(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TaxjarExemptionCategory fromString(String value) { + if (value == null) return _UNKNOWN; + for (TaxjarExemptionCategory enumValue : TaxjarExemptionCategory.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EntityCode { + A("a"), + + B("b"), + + C("c"), + + D("d"), + + E("e"), + + F("f"), + + G("g"), + + H("h"), + + I("i"), + + J("j"), + + K("k"), + + L("l"), + + M("m"), + + N("n"), + + P("p"), + + Q("q"), + + R("r"), + + MED_1("med1"), + + MED_2("med2"), + + /** An enum member indicating that EntityCode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EntityCode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EntityCode fromString(String value) { + if (value == null) return _UNKNOWN; + for (EntityCode enumValue : EntityCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class CardParams { + + 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 java.util.Map additionalInformation; + + private CardParams(CardBuilder 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.additionalInformation = builder.additionalInformation; + } + + 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 java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** 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.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + 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 java.util.Map additionalInformation; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + @Deprecated + public CardBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public CardBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CardBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CardBuilder number(String value) { + this.number = value; + return this; + } + + public CardBuilder expiryMonth(Integer value) { + this.expiryMonth = value; + return this; + } + + public CardBuilder expiryYear(Integer value) { + this.expiryYear = value; + return this; + } + + public CardBuilder cvv(String value) { + this.cvv = value; + return this; + } + + public CardBuilder preferredScheme(PreferredScheme value) { + this.preferredScheme = value; + return this; + } + + public CardBuilder billingAddr1(String value) { + this.billingAddr1 = value; + return this; + } + + public CardBuilder billingAddr2(String value) { + this.billingAddr2 = value; + return this; + } + + public CardBuilder billingCity(String value) { + this.billingCity = value; + return this; + } + + public CardBuilder billingStateCode(String value) { + this.billingStateCode = value; + return this; + } + + public CardBuilder billingState(String value) { + this.billingState = value; + return this; + } + + public CardBuilder billingZip(String value) { + this.billingZip = value; + return this; + } + + public CardBuilder billingCountry(String value) { + this.billingCountry = value; + return this; + } + + @Deprecated + public CardBuilder ipAddress(String value) { + this.ipAddress = value; + return this; + } + + public CardBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public CardParams build() { + return new CardParams(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 BankAccountParams { + + private final String gatewayAccountId; + + private final String iban; + + private final String firstName; + + private final String lastName; + + private final String company; + + private final String email; + + private final String phone; + + private final String bankName; + + private final String accountNumber; + + private final String routingNumber; + + private final String bankCode; + + private final AccountType accountType; + + private final AccountHolderType accountHolderType; + + private final EcheckType echeckType; + + private final String issuingCountry; + + private final String swedishIdentityNumber; + + private final java.util.Map billingAddress; + + private BankAccountParams(BankAccountBuilder builder) { + + this.gatewayAccountId = builder.gatewayAccountId; + + this.iban = builder.iban; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.company = builder.company; + + this.email = builder.email; + + this.phone = builder.phone; + + this.bankName = builder.bankName; + + this.accountNumber = builder.accountNumber; + + this.routingNumber = builder.routingNumber; + + this.bankCode = builder.bankCode; + + this.accountType = builder.accountType; + + this.accountHolderType = builder.accountHolderType; + + this.echeckType = builder.echeckType; + + this.issuingCountry = builder.issuingCountry; + + this.swedishIdentityNumber = builder.swedishIdentityNumber; + + this.billingAddress = builder.billingAddress; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getIban() { + return iban; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getCompany() { + return company; + } + + public String getEmail() { + return email; + } + + public String getPhone() { + return phone; + } + + public String getBankName() { + return bankName; + } + + public String getAccountNumber() { + return accountNumber; + } + + public String getRoutingNumber() { + return routingNumber; + } + + public String getBankCode() { + return bankCode; + } + + public AccountType getAccountType() { + return accountType; + } + + public AccountHolderType getAccountHolderType() { + return accountHolderType; + } + + public EcheckType getEcheckType() { + return echeckType; + } + + public String getIssuingCountry() { + return issuingCountry; + } + + public String getSwedishIdentityNumber() { + return swedishIdentityNumber; + } + + public java.util.Map getBillingAddress() { + return billingAddress; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.iban != null) { + + formData.put("iban", this.iban); + } + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + + if (this.company != null) { + + formData.put("company", this.company); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.bankName != null) { + + formData.put("bank_name", this.bankName); + } + + if (this.accountNumber != null) { + + formData.put("account_number", this.accountNumber); + } + + if (this.routingNumber != null) { + + formData.put("routing_number", this.routingNumber); + } + + if (this.bankCode != null) { + + formData.put("bank_code", this.bankCode); + } + + if (this.accountType != null) { + + formData.put("account_type", this.accountType); + } + + if (this.accountHolderType != null) { + + formData.put("account_holder_type", this.accountHolderType); + } + + if (this.echeckType != null) { + + formData.put("echeck_type", this.echeckType); + } + + if (this.issuingCountry != null) { + + formData.put("issuing_country", this.issuingCountry); + } + + if (this.swedishIdentityNumber != null) { + + formData.put("swedish_identity_number", this.swedishIdentityNumber); + } + + if (this.billingAddress != null) { + + formData.put("billing_address", JsonUtil.toJson(this.billingAddress)); + } + + return formData; + } + + /** Create a new builder for BankAccountParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BankAccountBuilder builder() { + return new BankAccountBuilder(); + } + + public static final class BankAccountBuilder { + + private String gatewayAccountId; + + private String iban; + + private String firstName; + + private String lastName; + + private String company; + + private String email; + + private String phone; + + private String bankName; + + private String accountNumber; + + private String routingNumber; + + private String bankCode; + + private AccountType accountType; + + private AccountHolderType accountHolderType; + + private EcheckType echeckType; + + private String issuingCountry; + + private String swedishIdentityNumber; + + private java.util.Map billingAddress; + + private BankAccountBuilder() {} + + public BankAccountBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public BankAccountBuilder iban(String value) { + this.iban = value; + return this; + } + + public BankAccountBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BankAccountBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BankAccountBuilder company(String value) { + this.company = value; + return this; + } + + public BankAccountBuilder email(String value) { + this.email = value; + return this; + } + + public BankAccountBuilder phone(String value) { + this.phone = value; + return this; + } + + public BankAccountBuilder bankName(String value) { + this.bankName = value; + return this; + } + + public BankAccountBuilder accountNumber(String value) { + this.accountNumber = value; + return this; + } + + public BankAccountBuilder routingNumber(String value) { + this.routingNumber = value; + return this; + } + + public BankAccountBuilder bankCode(String value) { + this.bankCode = value; + return this; + } + + public BankAccountBuilder accountType(AccountType value) { + this.accountType = value; + return this; + } + + public BankAccountBuilder accountHolderType(AccountHolderType value) { + this.accountHolderType = value; + return this; + } + + public BankAccountBuilder echeckType(EcheckType value) { + this.echeckType = value; + return this; + } + + public BankAccountBuilder issuingCountry(String value) { + this.issuingCountry = value; + return this; + } + + public BankAccountBuilder swedishIdentityNumber(String value) { + this.swedishIdentityNumber = value; + return this; + } + + public BankAccountBuilder billingAddress(java.util.Map value) { + this.billingAddress = value; + return this; + } + + public BankAccountParams build() { + return new BankAccountParams(this); + } + } + + public enum AccountType { + CHECKING("checking"), + + SAVINGS("savings"), + + BUSINESS_CHECKING("business_checking"), + + CURRENT("current"), + + /** An enum member indicating that AccountType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AccountType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AccountType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AccountType enumValue : AccountType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AccountHolderType { + INDIVIDUAL("individual"), + + COMPANY("company"), + + /** + * An enum member indicating that AccountHolderType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + AccountHolderType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AccountHolderType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AccountHolderType enumValue : AccountHolderType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EcheckType { + WEB("web"), + + PPD("ppd"), + + CCD("ccd"), + + /** An enum member indicating that EcheckType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EcheckType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EcheckType fromString(String value) { + if (value == null) return _UNKNOWN; + for (EcheckType enumValue : EcheckType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PaymentMethodParams { + + private final Type type; + + private final Gateway gateway; + + private final String gatewayAccountId; + + private final String referenceId; + + private final String tmpToken; + + private final String issuingCountry; + + private final java.util.Map additionalInformation; + + private PaymentMethodParams(PaymentMethodBuilder builder) { + + this.type = builder.type; + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.referenceId = builder.referenceId; + + this.tmpToken = builder.tmpToken; + + this.issuingCountry = builder.issuingCountry; + + this.additionalInformation = builder.additionalInformation; + } + + public Type getType() { + return type; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getReferenceId() { + return referenceId; + } + + public String getTmpToken() { + return tmpToken; + } + + public String getIssuingCountry() { + return issuingCountry; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.gateway != null) { + + formData.put("gateway", this.gateway); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.tmpToken != null) { + + formData.put("tmp_token", this.tmpToken); + } + + if (this.issuingCountry != null) { + + formData.put("issuing_country", this.issuingCountry); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentMethodBuilder builder() { + return new PaymentMethodBuilder(); + } + + public static final class PaymentMethodBuilder { + + private Type type; + + private Gateway gateway; + + private String gatewayAccountId; + + private String referenceId; + + private String tmpToken; + + private String issuingCountry; + + private java.util.Map additionalInformation; + + private PaymentMethodBuilder() {} + + public PaymentMethodBuilder type(Type value) { + this.type = value; + return this; + } + + @Deprecated + public PaymentMethodBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public PaymentMethodBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentMethodBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public PaymentMethodBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public PaymentMethodBuilder issuingCountry(String value) { + this.issuingCountry = value; + return this; + } + + public PaymentMethodBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentMethodParams build() { + return new PaymentMethodParams(this); + } + } + + public enum Type { + CARD("card"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + AMAZON_PAYMENTS("amazon_payments"), + + DIRECT_DEBIT("direct_debit"), + + GENERIC("generic"), + + ALIPAY("alipay"), + + UNIONPAY("unionpay"), + + APPLE_PAY("apple_pay"), + + WECHAT_PAY("wechat_pay"), + + IDEAL("ideal"), + + GOOGLE_PAY("google_pay"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GIROPAY("giropay"), + + DOTPAY("dotpay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + VENMO("venmo"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** 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 Gateway { + 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"), + + GOCARDLESS("gocardless"), + + 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 static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class EntityIdentifiersParams { + + private final String id; + + private final String scheme; + + private final String value; + + private final String standard; + + private EntityIdentifiersParams(EntityIdentifiersBuilder builder) { + + this.id = builder.id; + + this.scheme = builder.scheme; + + this.value = builder.value; + + this.standard = builder.standard; + } + + public String getId() { + return id; + } + + public String getScheme() { + return scheme; + } + + public String getValue() { + return value; + } + + public String getStandard() { + return standard; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.scheme != null) { + + formData.put("scheme", this.scheme); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + if (this.standard != null) { + + formData.put("standard", this.standard); + } + + return formData; + } + + /** Create a new builder for EntityIdentifiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EntityIdentifiersBuilder builder() { + return new EntityIdentifiersBuilder(); + } + + public static final class EntityIdentifiersBuilder { + + private String id; + + private String scheme; + + private String value; + + private String standard; + + private EntityIdentifiersBuilder() {} + + public EntityIdentifiersBuilder id(String value) { + this.id = value; + return this; + } + + public EntityIdentifiersBuilder scheme(String value) { + this.scheme = value; + return this; + } + + public EntityIdentifiersBuilder value(String value) { + this.value = value; + return this; + } + + public EntityIdentifiersBuilder standard(String value) { + this.standard = value; + return this; + } + + public EntityIdentifiersParams build() { + return new EntityIdentifiersParams(this); + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerDeductPromotionalCreditsParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerDeductPromotionalCreditsParams.java new file mode 100644 index 00000000..a63a1d67 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerDeductPromotionalCreditsParams.java @@ -0,0 +1,240 @@ +/* + * 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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CustomerDeductPromotionalCreditsParams { + + private final Long amount; + + private final String currencyCode; + + private final String description; + + private final CreditType creditType; + + private final String reference; + + private final Map consentFields; + + private CustomerDeductPromotionalCreditsParams(CustomerDeductPromotionalCreditsBuilder builder) { + + this.amount = builder.amount; + + this.currencyCode = builder.currencyCode; + + this.description = builder.description; + + this.creditType = builder.creditType; + + this.reference = builder.reference; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public Long getAmount() { + return amount; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getDescription() { + return description; + } + + public CreditType getCreditType() { + return creditType; + } + + public String getReference() { + return reference; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.creditType != null) { + + formData.put("credit_type", this.creditType); + } + + if (this.reference != null) { + + formData.put("reference", this.reference); + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerDeductPromotionalCreditsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerDeductPromotionalCreditsBuilder builder() { + return new CustomerDeductPromotionalCreditsBuilder(); + } + + public static final class CustomerDeductPromotionalCreditsBuilder { + + private Long amount; + + private String currencyCode; + + private String description; + + private CreditType creditType; + + private String reference; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerDeductPromotionalCreditsBuilder() {} + + public CustomerDeductPromotionalCreditsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public CustomerDeductPromotionalCreditsBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public CustomerDeductPromotionalCreditsBuilder description(String value) { + this.description = value; + return this; + } + + public CustomerDeductPromotionalCreditsBuilder creditType(CreditType value) { + this.creditType = value; + return this; + } + + public CustomerDeductPromotionalCreditsBuilder reference(String value) { + this.reference = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerDeductPromotionalCreditsBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerDeductPromotionalCreditsBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerDeductPromotionalCreditsBuilder consentFields( + Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerDeductPromotionalCreditsParams build() { + return new CustomerDeductPromotionalCreditsParams(this); + } + } + + public enum CreditType { + LOYALTY_CREDITS("loyalty_credits"), + + REFERRAL_REWARDS("referral_rewards"), + + GENERAL("general"), + + /** An enum member indicating that CreditType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CreditType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CreditType fromString(String value) { + if (value == null) return _UNKNOWN; + for (CreditType enumValue : CreditType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerDeleteContactParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerDeleteContactParams.java new file mode 100644 index 00000000..e4538054 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerDeleteContactParams.java @@ -0,0 +1,182 @@ +/* + * 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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CustomerDeleteContactParams { + + private final ContactParams contact; + + private final Map consentFields; + + private CustomerDeleteContactParams(CustomerDeleteContactBuilder builder) { + + this.contact = builder.contact; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public ContactParams getContact() { + return contact; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.contact != null) { + + // Single object + Map nestedData = this.contact.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contact[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerDeleteContactParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerDeleteContactBuilder builder() { + return new CustomerDeleteContactBuilder(); + } + + public static final class CustomerDeleteContactBuilder { + + private ContactParams contact; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerDeleteContactBuilder() {} + + public CustomerDeleteContactBuilder contact(ContactParams value) { + this.contact = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerDeleteContactBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerDeleteContactBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerDeleteContactBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerDeleteContactParams build() { + return new CustomerDeleteContactParams(this); + } + } + + public static final class ContactParams { + + private final String id; + + private ContactParams(ContactBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for ContactParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContactBuilder builder() { + return new ContactBuilder(); + } + + public static final class ContactBuilder { + + private String id; + + private ContactBuilder() {} + + public ContactBuilder id(String value) { + this.id = value; + return this; + } + + public ContactParams build() { + return new ContactParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerDeleteParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerDeleteParams.java new file mode 100644 index 00000000..b2e587d0 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerDeleteParams.java @@ -0,0 +1,129 @@ +/* + * 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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CustomerDeleteParams { + + private final Boolean deletePaymentMethod; + + private final Map consentFields; + + private CustomerDeleteParams(CustomerDeleteBuilder builder) { + + this.deletePaymentMethod = builder.deletePaymentMethod; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public Boolean getDeletePaymentMethod() { + return deletePaymentMethod; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.deletePaymentMethod != null) { + + formData.put("delete_payment_method", this.deletePaymentMethod); + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerDeleteBuilder builder() { + return new CustomerDeleteBuilder(); + } + + public static final class CustomerDeleteBuilder { + + private Boolean deletePaymentMethod; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerDeleteBuilder() {} + + public CustomerDeleteBuilder deletePaymentMethod(Boolean value) { + this.deletePaymentMethod = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerDeleteBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerDeleteBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerDeleteBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerDeleteParams build() { + return new CustomerDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerDeleteRelationshipParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerDeleteRelationshipParams.java similarity index 77% rename from src/main/java/com/chargebee/v4/core/models/customer/params/CustomerDeleteRelationshipParams.java rename to src/main/java/com/chargebee/v4/models/customer/params/CustomerDeleteRelationshipParams.java index 1e27eba2..dd91fbd9 100644 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerDeleteRelationshipParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerDeleteRelationshipParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customer.params; +package com.chargebee.v4.models.customer.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class CustomerDeleteRelationshipParams { - private final Map formData; - - private CustomerDeleteRelationshipParams(CustomerDeleteRelationshipBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private CustomerDeleteRelationshipParams(CustomerDeleteRelationshipBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static CustomerDeleteRelationshipBuilder builder() { } public static final class CustomerDeleteRelationshipBuilder { - private final Map formData = new LinkedHashMap<>(); private CustomerDeleteRelationshipBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerHierarchyParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerHierarchyParams.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/customer/params/CustomerHierarchyParams.java rename to src/main/java/com/chargebee/v4/models/customer/params/CustomerHierarchyParams.java index b1b825cf..dec61533 100644 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerHierarchyParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerHierarchyParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customer.params; +package com.chargebee.v4.models.customer.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerListHierarchyDetailParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerListHierarchyDetailParams.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/customer/params/CustomerListHierarchyDetailParams.java rename to src/main/java/com/chargebee/v4/models/customer/params/CustomerListHierarchyDetailParams.java index effc9f68..b1e75d38 100644 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerListHierarchyDetailParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerListHierarchyDetailParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customer.params; +package com.chargebee.v4.models.customer.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerListParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/customer/params/CustomerListParams.java rename to src/main/java/com/chargebee/v4/models/customer/params/CustomerListParams.java index e738b726..977fec9b 100644 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerListParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customer.params; +package com.chargebee.v4.models.customer.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerMergeParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerMergeParams.java new file mode 100644 index 00000000..0df976ef --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerMergeParams.java @@ -0,0 +1,149 @@ +/* + * 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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CustomerMergeParams { + + private final String fromCustomerId; + + private final String toCustomerId; + + private final Map consentFields; + + private CustomerMergeParams(CustomerMergeBuilder builder) { + + this.fromCustomerId = builder.fromCustomerId; + + this.toCustomerId = builder.toCustomerId; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public String getFromCustomerId() { + return fromCustomerId; + } + + public String getToCustomerId() { + return toCustomerId; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.fromCustomerId != null) { + + formData.put("from_customer_id", this.fromCustomerId); + } + + if (this.toCustomerId != null) { + + formData.put("to_customer_id", this.toCustomerId); + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerMergeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerMergeBuilder builder() { + return new CustomerMergeBuilder(); + } + + public static final class CustomerMergeBuilder { + + private String fromCustomerId; + + private String toCustomerId; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerMergeBuilder() {} + + public CustomerMergeBuilder fromCustomerId(String value) { + this.fromCustomerId = value; + return this; + } + + public CustomerMergeBuilder toCustomerId(String value) { + this.toCustomerId = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerMergeBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerMergeBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerMergeBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerMergeParams build() { + return new CustomerMergeParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerMoveParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerMoveParams.java new file mode 100644 index 00000000..90f12fc4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerMoveParams.java @@ -0,0 +1,149 @@ +/* + * 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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CustomerMoveParams { + + private final String idAtFromSite; + + private final String fromSite; + + private final Map consentFields; + + private CustomerMoveParams(CustomerMoveBuilder builder) { + + this.idAtFromSite = builder.idAtFromSite; + + this.fromSite = builder.fromSite; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public String getIdAtFromSite() { + return idAtFromSite; + } + + public String getFromSite() { + return fromSite; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.idAtFromSite != null) { + + formData.put("id_at_from_site", this.idAtFromSite); + } + + if (this.fromSite != null) { + + formData.put("from_site", this.fromSite); + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerMoveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerMoveBuilder builder() { + return new CustomerMoveBuilder(); + } + + public static final class CustomerMoveBuilder { + + private String idAtFromSite; + + private String fromSite; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerMoveBuilder() {} + + public CustomerMoveBuilder idAtFromSite(String value) { + this.idAtFromSite = value; + return this; + } + + public CustomerMoveBuilder fromSite(String value) { + this.fromSite = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerMoveBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerMoveBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerMoveBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerMoveParams build() { + return new CustomerMoveParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerRecordExcessPaymentParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerRecordExcessPaymentParams.java new file mode 100644 index 00000000..7598b007 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerRecordExcessPaymentParams.java @@ -0,0 +1,361 @@ +/* + * 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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class CustomerRecordExcessPaymentParams { + + private final String comment; + + private final TransactionParams transaction; + + private final Map consentFields; + + private CustomerRecordExcessPaymentParams(CustomerRecordExcessPaymentBuilder builder) { + + this.comment = builder.comment; + + this.transaction = builder.transaction; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public String getComment() { + return comment; + } + + public TransactionParams getTransaction() { + return transaction; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.transaction != null) { + + // Single object + Map nestedData = this.transaction.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "transaction[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerRecordExcessPaymentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerRecordExcessPaymentBuilder builder() { + return new CustomerRecordExcessPaymentBuilder(); + } + + public static final class CustomerRecordExcessPaymentBuilder { + + private String comment; + + private TransactionParams transaction; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerRecordExcessPaymentBuilder() {} + + public CustomerRecordExcessPaymentBuilder comment(String value) { + this.comment = value; + return this; + } + + public CustomerRecordExcessPaymentBuilder transaction(TransactionParams value) { + this.transaction = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerRecordExcessPaymentBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerRecordExcessPaymentBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerRecordExcessPaymentBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerRecordExcessPaymentParams build() { + return new CustomerRecordExcessPaymentParams(this); + } + } + + public static final class TransactionParams { + + private final String id; + + private final Long amount; + + private final String currencyCode; + + private final Timestamp date; + + private final PaymentMethod paymentMethod; + + private final String referenceNumber; + + private final String customPaymentMethodId; + + private TransactionParams(TransactionBuilder builder) { + + this.id = builder.id; + + this.amount = builder.amount; + + this.currencyCode = builder.currencyCode; + + this.date = builder.date; + + this.paymentMethod = builder.paymentMethod; + + this.referenceNumber = builder.referenceNumber; + + this.customPaymentMethodId = builder.customPaymentMethodId; + } + + public String getId() { + return id; + } + + public Long getAmount() { + return amount; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public Timestamp getDate() { + return date; + } + + public PaymentMethod getPaymentMethod() { + return paymentMethod; + } + + public String getReferenceNumber() { + return referenceNumber; + } + + public String getCustomPaymentMethodId() { + return customPaymentMethodId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + if (this.paymentMethod != null) { + + formData.put("payment_method", this.paymentMethod); + } + + if (this.referenceNumber != null) { + + formData.put("reference_number", this.referenceNumber); + } + + if (this.customPaymentMethodId != null) { + + formData.put("custom_payment_method_id", this.customPaymentMethodId); + } + + return formData; + } + + /** Create a new builder for TransactionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionBuilder builder() { + return new TransactionBuilder(); + } + + public static final class TransactionBuilder { + + private String id; + + private Long amount; + + private String currencyCode; + + private Timestamp date; + + private PaymentMethod paymentMethod; + + private String referenceNumber; + + private String customPaymentMethodId; + + private TransactionBuilder() {} + + public TransactionBuilder id(String value) { + this.id = value; + return this; + } + + public TransactionBuilder amount(Long value) { + this.amount = value; + return this; + } + + public TransactionBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public TransactionBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public TransactionBuilder paymentMethod(PaymentMethod value) { + this.paymentMethod = value; + return this; + } + + public TransactionBuilder referenceNumber(String value) { + this.referenceNumber = value; + return this; + } + + public TransactionBuilder customPaymentMethodId(String value) { + this.customPaymentMethodId = value; + return this; + } + + public TransactionParams build() { + return new TransactionParams(this); + } + } + + public enum PaymentMethod { + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + OTHER("other"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + CUSTOM("custom"), + + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethod enumValue : PaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerRelationshipsParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerRelationshipsParams.java new file mode 100644 index 00000000..154a893f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerRelationshipsParams.java @@ -0,0 +1,627 @@ +/* + * 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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CustomerRelationshipsParams { + + private final String parentId; + + private final String paymentOwnerId; + + private final String invoiceOwnerId; + + private final Boolean useDefaultHierarchySettings; + + private final ParentAccountAccessParams parentAccountAccess; + + private final ChildAccountAccessParams childAccountAccess; + + private final Map consentFields; + + private CustomerRelationshipsParams(CustomerRelationshipsBuilder builder) { + + this.parentId = builder.parentId; + + this.paymentOwnerId = builder.paymentOwnerId; + + this.invoiceOwnerId = builder.invoiceOwnerId; + + this.useDefaultHierarchySettings = builder.useDefaultHierarchySettings; + + this.parentAccountAccess = builder.parentAccountAccess; + + this.childAccountAccess = builder.childAccountAccess; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public String getParentId() { + return parentId; + } + + public String getPaymentOwnerId() { + return paymentOwnerId; + } + + public String getInvoiceOwnerId() { + return invoiceOwnerId; + } + + public Boolean getUseDefaultHierarchySettings() { + return useDefaultHierarchySettings; + } + + public ParentAccountAccessParams getParentAccountAccess() { + return parentAccountAccess; + } + + public ChildAccountAccessParams getChildAccountAccess() { + return childAccountAccess; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.parentId != null) { + + formData.put("parent_id", this.parentId); + } + + if (this.paymentOwnerId != null) { + + formData.put("payment_owner_id", this.paymentOwnerId); + } + + if (this.invoiceOwnerId != null) { + + formData.put("invoice_owner_id", this.invoiceOwnerId); + } + + if (this.useDefaultHierarchySettings != null) { + + formData.put("use_default_hierarchy_settings", this.useDefaultHierarchySettings); + } + + if (this.parentAccountAccess != null) { + + // Single object + Map nestedData = this.parentAccountAccess.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "parent_account_access[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.childAccountAccess != null) { + + // Single object + Map nestedData = this.childAccountAccess.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "child_account_access[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerRelationshipsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerRelationshipsBuilder builder() { + return new CustomerRelationshipsBuilder(); + } + + public static final class CustomerRelationshipsBuilder { + + private String parentId; + + private String paymentOwnerId; + + private String invoiceOwnerId; + + private Boolean useDefaultHierarchySettings; + + private ParentAccountAccessParams parentAccountAccess; + + private ChildAccountAccessParams childAccountAccess; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerRelationshipsBuilder() {} + + public CustomerRelationshipsBuilder parentId(String value) { + this.parentId = value; + return this; + } + + public CustomerRelationshipsBuilder paymentOwnerId(String value) { + this.paymentOwnerId = value; + return this; + } + + public CustomerRelationshipsBuilder invoiceOwnerId(String value) { + this.invoiceOwnerId = value; + return this; + } + + public CustomerRelationshipsBuilder useDefaultHierarchySettings(Boolean value) { + this.useDefaultHierarchySettings = value; + return this; + } + + public CustomerRelationshipsBuilder parentAccountAccess(ParentAccountAccessParams value) { + this.parentAccountAccess = value; + return this; + } + + public CustomerRelationshipsBuilder childAccountAccess(ChildAccountAccessParams value) { + this.childAccountAccess = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerRelationshipsBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerRelationshipsBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerRelationshipsBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerRelationshipsParams build() { + return new CustomerRelationshipsParams(this); + } + } + + public static final class ParentAccountAccessParams { + + private final PortalEditChildSubscriptions portalEditChildSubscriptions; + + private final PortalDownloadChildInvoices portalDownloadChildInvoices; + + private final Boolean sendSubscriptionEmails; + + private final Boolean sendPaymentEmails; + + private final Boolean sendInvoiceEmails; + + private ParentAccountAccessParams(ParentAccountAccessBuilder builder) { + + this.portalEditChildSubscriptions = builder.portalEditChildSubscriptions; + + this.portalDownloadChildInvoices = builder.portalDownloadChildInvoices; + + this.sendSubscriptionEmails = builder.sendSubscriptionEmails; + + this.sendPaymentEmails = builder.sendPaymentEmails; + + this.sendInvoiceEmails = builder.sendInvoiceEmails; + } + + public PortalEditChildSubscriptions getPortalEditChildSubscriptions() { + return portalEditChildSubscriptions; + } + + public PortalDownloadChildInvoices getPortalDownloadChildInvoices() { + return portalDownloadChildInvoices; + } + + public Boolean getSendSubscriptionEmails() { + return sendSubscriptionEmails; + } + + public Boolean getSendPaymentEmails() { + return sendPaymentEmails; + } + + public Boolean getSendInvoiceEmails() { + return sendInvoiceEmails; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.portalEditChildSubscriptions != null) { + + formData.put("portal_edit_child_subscriptions", this.portalEditChildSubscriptions); + } + + if (this.portalDownloadChildInvoices != null) { + + formData.put("portal_download_child_invoices", this.portalDownloadChildInvoices); + } + + if (this.sendSubscriptionEmails != null) { + + formData.put("send_subscription_emails", this.sendSubscriptionEmails); + } + + if (this.sendPaymentEmails != null) { + + formData.put("send_payment_emails", this.sendPaymentEmails); + } + + if (this.sendInvoiceEmails != null) { + + formData.put("send_invoice_emails", this.sendInvoiceEmails); + } + + return formData; + } + + /** Create a new builder for ParentAccountAccessParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ParentAccountAccessBuilder builder() { + return new ParentAccountAccessBuilder(); + } + + public static final class ParentAccountAccessBuilder { + + private PortalEditChildSubscriptions portalEditChildSubscriptions; + + private PortalDownloadChildInvoices portalDownloadChildInvoices; + + private Boolean sendSubscriptionEmails; + + private Boolean sendPaymentEmails; + + private Boolean sendInvoiceEmails; + + private ParentAccountAccessBuilder() {} + + public ParentAccountAccessBuilder portalEditChildSubscriptions( + PortalEditChildSubscriptions value) { + this.portalEditChildSubscriptions = value; + return this; + } + + public ParentAccountAccessBuilder portalDownloadChildInvoices( + PortalDownloadChildInvoices value) { + this.portalDownloadChildInvoices = value; + return this; + } + + public ParentAccountAccessBuilder sendSubscriptionEmails(Boolean value) { + this.sendSubscriptionEmails = value; + return this; + } + + public ParentAccountAccessBuilder sendPaymentEmails(Boolean value) { + this.sendPaymentEmails = value; + return this; + } + + public ParentAccountAccessBuilder sendInvoiceEmails(Boolean value) { + this.sendInvoiceEmails = value; + return this; + } + + public ParentAccountAccessParams build() { + return new ParentAccountAccessParams(this); + } + } + + public enum PortalEditChildSubscriptions { + YES("yes"), + + VIEW_ONLY("view_only"), + + NO("no"), + + /** + * An enum member indicating that PortalEditChildSubscriptions was instantiated with an + * unknown value. + */ + _UNKNOWN(null); + private final String value; + + PortalEditChildSubscriptions(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PortalEditChildSubscriptions fromString(String value) { + if (value == null) return _UNKNOWN; + for (PortalEditChildSubscriptions enumValue : PortalEditChildSubscriptions.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PortalDownloadChildInvoices { + YES("yes"), + + VIEW_ONLY("view_only"), + + NO("no"), + + /** + * An enum member indicating that PortalDownloadChildInvoices was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + PortalDownloadChildInvoices(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PortalDownloadChildInvoices fromString(String value) { + if (value == null) return _UNKNOWN; + for (PortalDownloadChildInvoices enumValue : PortalDownloadChildInvoices.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ChildAccountAccessParams { + + private final PortalEditSubscriptions portalEditSubscriptions; + + private final PortalDownloadInvoices portalDownloadInvoices; + + private final Boolean sendSubscriptionEmails; + + private final Boolean sendPaymentEmails; + + private final Boolean sendInvoiceEmails; + + private ChildAccountAccessParams(ChildAccountAccessBuilder builder) { + + this.portalEditSubscriptions = builder.portalEditSubscriptions; + + this.portalDownloadInvoices = builder.portalDownloadInvoices; + + this.sendSubscriptionEmails = builder.sendSubscriptionEmails; + + this.sendPaymentEmails = builder.sendPaymentEmails; + + this.sendInvoiceEmails = builder.sendInvoiceEmails; + } + + public PortalEditSubscriptions getPortalEditSubscriptions() { + return portalEditSubscriptions; + } + + public PortalDownloadInvoices getPortalDownloadInvoices() { + return portalDownloadInvoices; + } + + public Boolean getSendSubscriptionEmails() { + return sendSubscriptionEmails; + } + + public Boolean getSendPaymentEmails() { + return sendPaymentEmails; + } + + public Boolean getSendInvoiceEmails() { + return sendInvoiceEmails; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.portalEditSubscriptions != null) { + + formData.put("portal_edit_subscriptions", this.portalEditSubscriptions); + } + + if (this.portalDownloadInvoices != null) { + + formData.put("portal_download_invoices", this.portalDownloadInvoices); + } + + if (this.sendSubscriptionEmails != null) { + + formData.put("send_subscription_emails", this.sendSubscriptionEmails); + } + + if (this.sendPaymentEmails != null) { + + formData.put("send_payment_emails", this.sendPaymentEmails); + } + + if (this.sendInvoiceEmails != null) { + + formData.put("send_invoice_emails", this.sendInvoiceEmails); + } + + return formData; + } + + /** Create a new builder for ChildAccountAccessParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChildAccountAccessBuilder builder() { + return new ChildAccountAccessBuilder(); + } + + public static final class ChildAccountAccessBuilder { + + private PortalEditSubscriptions portalEditSubscriptions; + + private PortalDownloadInvoices portalDownloadInvoices; + + private Boolean sendSubscriptionEmails; + + private Boolean sendPaymentEmails; + + private Boolean sendInvoiceEmails; + + private ChildAccountAccessBuilder() {} + + public ChildAccountAccessBuilder portalEditSubscriptions(PortalEditSubscriptions value) { + this.portalEditSubscriptions = value; + return this; + } + + public ChildAccountAccessBuilder portalDownloadInvoices(PortalDownloadInvoices value) { + this.portalDownloadInvoices = value; + return this; + } + + public ChildAccountAccessBuilder sendSubscriptionEmails(Boolean value) { + this.sendSubscriptionEmails = value; + return this; + } + + public ChildAccountAccessBuilder sendPaymentEmails(Boolean value) { + this.sendPaymentEmails = value; + return this; + } + + public ChildAccountAccessBuilder sendInvoiceEmails(Boolean value) { + this.sendInvoiceEmails = value; + return this; + } + + public ChildAccountAccessParams build() { + return new ChildAccountAccessParams(this); + } + } + + public enum PortalEditSubscriptions { + YES("yes"), + + VIEW_ONLY("view_only"), + + /** + * An enum member indicating that PortalEditSubscriptions was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + PortalEditSubscriptions(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PortalEditSubscriptions fromString(String value) { + if (value == null) return _UNKNOWN; + for (PortalEditSubscriptions enumValue : PortalEditSubscriptions.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PortalDownloadInvoices { + YES("yes"), + + VIEW_ONLY("view_only"), + + NO("no"), + + /** + * An enum member indicating that PortalDownloadInvoices was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + PortalDownloadInvoices(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PortalDownloadInvoices fromString(String value) { + if (value == null) return _UNKNOWN; + for (PortalDownloadInvoices enumValue : PortalDownloadInvoices.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerRetrieveParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/customer/params/CustomerRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/customer/params/CustomerRetrieveParams.java index 2071e3c4..5a843818 100644 --- a/src/main/java/com/chargebee/v4/core/models/customer/params/CustomerRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customer.params; +package com.chargebee.v4.models.customer.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerSetPromotionalCreditsParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerSetPromotionalCreditsParams.java new file mode 100644 index 00000000..34cbcef0 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerSetPromotionalCreditsParams.java @@ -0,0 +1,239 @@ +/* + * 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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CustomerSetPromotionalCreditsParams { + + private final Long amount; + + private final String currencyCode; + + private final String description; + + private final CreditType creditType; + + private final String reference; + + private final Map consentFields; + + private CustomerSetPromotionalCreditsParams(CustomerSetPromotionalCreditsBuilder builder) { + + this.amount = builder.amount; + + this.currencyCode = builder.currencyCode; + + this.description = builder.description; + + this.creditType = builder.creditType; + + this.reference = builder.reference; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public Long getAmount() { + return amount; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getDescription() { + return description; + } + + public CreditType getCreditType() { + return creditType; + } + + public String getReference() { + return reference; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.creditType != null) { + + formData.put("credit_type", this.creditType); + } + + if (this.reference != null) { + + formData.put("reference", this.reference); + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerSetPromotionalCreditsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerSetPromotionalCreditsBuilder builder() { + return new CustomerSetPromotionalCreditsBuilder(); + } + + public static final class CustomerSetPromotionalCreditsBuilder { + + private Long amount; + + private String currencyCode; + + private String description; + + private CreditType creditType; + + private String reference; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerSetPromotionalCreditsBuilder() {} + + public CustomerSetPromotionalCreditsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public CustomerSetPromotionalCreditsBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public CustomerSetPromotionalCreditsBuilder description(String value) { + this.description = value; + return this; + } + + public CustomerSetPromotionalCreditsBuilder creditType(CreditType value) { + this.creditType = value; + return this; + } + + public CustomerSetPromotionalCreditsBuilder reference(String value) { + this.reference = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerSetPromotionalCreditsBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerSetPromotionalCreditsBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerSetPromotionalCreditsBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerSetPromotionalCreditsParams build() { + return new CustomerSetPromotionalCreditsParams(this); + } + } + + public enum CreditType { + LOYALTY_CREDITS("loyalty_credits"), + + REFERRAL_REWARDS("referral_rewards"), + + GENERAL("general"), + + /** An enum member indicating that CreditType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CreditType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CreditType fromString(String value) { + if (value == null) return _UNKNOWN; + for (CreditType enumValue : CreditType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateBillingInfoParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateBillingInfoParams.java new file mode 100644 index 00000000..398f0be3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateBillingInfoParams.java @@ -0,0 +1,972 @@ +/* + * 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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class CustomerUpdateBillingInfoParams { + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final String entityIdentifierScheme; + + private final String entityIdentifierStandard; + + private final Boolean registeredForGst; + + private final Boolean businessCustomerWithoutVatNumber; + + private final Boolean isEinvoiceEnabled; + + private final EinvoicingMethod einvoicingMethod; + + private final BillingAddressParams billingAddress; + + private final List entityIdentifiers; + + private final List taxProvidersFields; + + private final Map consentFields; + + private CustomerUpdateBillingInfoParams(CustomerUpdateBillingInfoBuilder builder) { + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.entityIdentifierScheme = builder.entityIdentifierScheme; + + this.entityIdentifierStandard = builder.entityIdentifierStandard; + + this.registeredForGst = builder.registeredForGst; + + this.businessCustomerWithoutVatNumber = builder.businessCustomerWithoutVatNumber; + + this.isEinvoiceEnabled = builder.isEinvoiceEnabled; + + this.einvoicingMethod = builder.einvoicingMethod; + + this.billingAddress = builder.billingAddress; + + this.entityIdentifiers = builder.entityIdentifiers; + + this.taxProvidersFields = builder.taxProvidersFields; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public String getEntityIdentifierScheme() { + return entityIdentifierScheme; + } + + public String getEntityIdentifierStandard() { + return entityIdentifierStandard; + } + + public Boolean getRegisteredForGst() { + return registeredForGst; + } + + public Boolean getBusinessCustomerWithoutVatNumber() { + return businessCustomerWithoutVatNumber; + } + + public Boolean getIsEinvoiceEnabled() { + return isEinvoiceEnabled; + } + + public EinvoicingMethod getEinvoicingMethod() { + return einvoicingMethod; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public List getEntityIdentifiers() { + return entityIdentifiers; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.entityIdentifierScheme != null) { + + formData.put("entity_identifier_scheme", this.entityIdentifierScheme); + } + + if (this.entityIdentifierStandard != null) { + + formData.put("entity_identifier_standard", this.entityIdentifierStandard); + } + + if (this.registeredForGst != null) { + + formData.put("registered_for_gst", this.registeredForGst); + } + + if (this.businessCustomerWithoutVatNumber != null) { + + formData.put("business_customer_without_vat_number", this.businessCustomerWithoutVatNumber); + } + + if (this.isEinvoiceEnabled != null) { + + formData.put("is_einvoice_enabled", this.isEinvoiceEnabled); + } + + if (this.einvoicingMethod != null) { + + formData.put("einvoicing_method", this.einvoicingMethod); + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.entityIdentifiers != null) { + + // List of objects + for (int i = 0; i < this.entityIdentifiers.size(); i++) { + EntityIdentifiersParams item = this.entityIdentifiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "entity_identifiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerUpdateBillingInfoParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerUpdateBillingInfoBuilder builder() { + return new CustomerUpdateBillingInfoBuilder(); + } + + public static final class CustomerUpdateBillingInfoBuilder { + + private String vatNumber; + + private String vatNumberPrefix; + + private String entityIdentifierScheme; + + private String entityIdentifierStandard; + + private Boolean registeredForGst; + + private Boolean businessCustomerWithoutVatNumber; + + private Boolean isEinvoiceEnabled; + + private EinvoicingMethod einvoicingMethod; + + private BillingAddressParams billingAddress; + + private List entityIdentifiers; + + private List taxProvidersFields; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerUpdateBillingInfoBuilder() {} + + public CustomerUpdateBillingInfoBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerUpdateBillingInfoBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerUpdateBillingInfoBuilder entityIdentifierScheme(String value) { + this.entityIdentifierScheme = value; + return this; + } + + public CustomerUpdateBillingInfoBuilder entityIdentifierStandard(String value) { + this.entityIdentifierStandard = value; + return this; + } + + public CustomerUpdateBillingInfoBuilder registeredForGst(Boolean value) { + this.registeredForGst = value; + return this; + } + + public CustomerUpdateBillingInfoBuilder businessCustomerWithoutVatNumber(Boolean value) { + this.businessCustomerWithoutVatNumber = value; + return this; + } + + public CustomerUpdateBillingInfoBuilder isEinvoiceEnabled(Boolean value) { + this.isEinvoiceEnabled = value; + return this; + } + + public CustomerUpdateBillingInfoBuilder einvoicingMethod(EinvoicingMethod value) { + this.einvoicingMethod = value; + return this; + } + + public CustomerUpdateBillingInfoBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public CustomerUpdateBillingInfoBuilder entityIdentifiers(List value) { + this.entityIdentifiers = value; + return this; + } + + public CustomerUpdateBillingInfoBuilder taxProvidersFields( + List value) { + this.taxProvidersFields = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerUpdateBillingInfoBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerUpdateBillingInfoBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerUpdateBillingInfoBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerUpdateBillingInfoParams build() { + return new CustomerUpdateBillingInfoParams(this); + } + } + + public enum EinvoicingMethod { + AUTOMATIC("automatic"), + + MANUAL("manual"), + + SITE_DEFAULT("site_default"), + + /** An enum member indicating that EinvoicingMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EinvoicingMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EinvoicingMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (EinvoicingMethod enumValue : EinvoicingMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class EntityIdentifiersParams { + + private final String id; + + private final String scheme; + + private final String value; + + private final Operation operation; + + private final String standard; + + private EntityIdentifiersParams(EntityIdentifiersBuilder builder) { + + this.id = builder.id; + + this.scheme = builder.scheme; + + this.value = builder.value; + + this.operation = builder.operation; + + this.standard = builder.standard; + } + + public String getId() { + return id; + } + + public String getScheme() { + return scheme; + } + + public String getValue() { + return value; + } + + public Operation getOperation() { + return operation; + } + + public String getStandard() { + return standard; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.scheme != null) { + + formData.put("scheme", this.scheme); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + if (this.operation != null) { + + formData.put("operation", this.operation); + } + + if (this.standard != null) { + + formData.put("standard", this.standard); + } + + return formData; + } + + /** Create a new builder for EntityIdentifiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EntityIdentifiersBuilder builder() { + return new EntityIdentifiersBuilder(); + } + + public static final class EntityIdentifiersBuilder { + + private String id; + + private String scheme; + + private String value; + + private Operation operation; + + private String standard; + + private EntityIdentifiersBuilder() {} + + public EntityIdentifiersBuilder id(String value) { + this.id = value; + return this; + } + + public EntityIdentifiersBuilder scheme(String value) { + this.scheme = value; + return this; + } + + public EntityIdentifiersBuilder value(String value) { + this.value = value; + return this; + } + + public EntityIdentifiersBuilder operation(Operation value) { + this.operation = value; + return this; + } + + public EntityIdentifiersBuilder standard(String value) { + this.standard = value; + return this; + } + + public EntityIdentifiersParams build() { + return new EntityIdentifiersParams(this); + } + } + + public enum Operation { + CREATE("create"), + + UPDATE("update"), + + DELETE("delete"), + + /** An enum member indicating that Operation was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Operation(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Operation fromString(String value) { + if (value == null) return _UNKNOWN; + for (Operation enumValue : Operation.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateContactParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateContactParams.java new file mode 100644 index 00000000..ae017960 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateContactParams.java @@ -0,0 +1,342 @@ +/* + * 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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CustomerUpdateContactParams { + + private final ContactParams contact; + + private final Map consentFields; + + private CustomerUpdateContactParams(CustomerUpdateContactBuilder builder) { + + this.contact = builder.contact; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public ContactParams getContact() { + return contact; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.contact != null) { + + // Single object + Map nestedData = this.contact.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contact[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerUpdateContactParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerUpdateContactBuilder builder() { + return new CustomerUpdateContactBuilder(); + } + + public static final class CustomerUpdateContactBuilder { + + private ContactParams contact; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerUpdateContactBuilder() {} + + public CustomerUpdateContactBuilder contact(ContactParams value) { + this.contact = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerUpdateContactBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerUpdateContactBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerUpdateContactBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerUpdateContactParams build() { + return new CustomerUpdateContactParams(this); + } + } + + public static final class ContactParams { + + private final String id; + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String phone; + + private final String label; + + private final Boolean enabled; + + private final Boolean sendBillingEmail; + + private final Boolean sendAccountEmail; + + private ContactParams(ContactBuilder builder) { + + this.id = builder.id; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.phone = builder.phone; + + this.label = builder.label; + + this.enabled = builder.enabled; + + this.sendBillingEmail = builder.sendBillingEmail; + + this.sendAccountEmail = builder.sendAccountEmail; + } + + public String getId() { + return id; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getEmail() { + return email; + } + + public String getPhone() { + return phone; + } + + public String getLabel() { + return label; + } + + public Boolean getEnabled() { + return enabled; + } + + public Boolean getSendBillingEmail() { + return sendBillingEmail; + } + + public Boolean getSendAccountEmail() { + return sendAccountEmail; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + 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.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.label != null) { + + formData.put("label", this.label); + } + + if (this.enabled != null) { + + formData.put("enabled", this.enabled); + } + + if (this.sendBillingEmail != null) { + + formData.put("send_billing_email", this.sendBillingEmail); + } + + if (this.sendAccountEmail != null) { + + formData.put("send_account_email", this.sendAccountEmail); + } + + return formData; + } + + /** Create a new builder for ContactParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContactBuilder builder() { + return new ContactBuilder(); + } + + public static final class ContactBuilder { + + private String id; + + private String firstName; + + private String lastName; + + private String email; + + private String phone; + + private String label; + + private Boolean enabled; + + private Boolean sendBillingEmail; + + private Boolean sendAccountEmail; + + private ContactBuilder() {} + + public ContactBuilder id(String value) { + this.id = value; + return this; + } + + public ContactBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ContactBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ContactBuilder email(String value) { + this.email = value; + return this; + } + + public ContactBuilder phone(String value) { + this.phone = value; + return this; + } + + public ContactBuilder label(String value) { + this.label = value; + return this; + } + + public ContactBuilder enabled(Boolean value) { + this.enabled = value; + return this; + } + + public ContactBuilder sendBillingEmail(Boolean value) { + this.sendBillingEmail = value; + return this; + } + + public ContactBuilder sendAccountEmail(Boolean value) { + this.sendAccountEmail = value; + return this; + } + + public ContactParams build() { + return new ContactParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateHierarchySettingsParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateHierarchySettingsParams.java new file mode 100644 index 00000000..44e42919 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateHierarchySettingsParams.java @@ -0,0 +1,569 @@ +/* + * 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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CustomerUpdateHierarchySettingsParams { + + private final Boolean useDefaultHierarchySettings; + + private final ParentAccountAccessParams parentAccountAccess; + + private final ChildAccountAccessParams childAccountAccess; + + private final Map consentFields; + + private CustomerUpdateHierarchySettingsParams(CustomerUpdateHierarchySettingsBuilder builder) { + + this.useDefaultHierarchySettings = builder.useDefaultHierarchySettings; + + this.parentAccountAccess = builder.parentAccountAccess; + + this.childAccountAccess = builder.childAccountAccess; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public Boolean getUseDefaultHierarchySettings() { + return useDefaultHierarchySettings; + } + + public ParentAccountAccessParams getParentAccountAccess() { + return parentAccountAccess; + } + + public ChildAccountAccessParams getChildAccountAccess() { + return childAccountAccess; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.useDefaultHierarchySettings != null) { + + formData.put("use_default_hierarchy_settings", this.useDefaultHierarchySettings); + } + + if (this.parentAccountAccess != null) { + + // Single object + Map nestedData = this.parentAccountAccess.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "parent_account_access[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.childAccountAccess != null) { + + // Single object + Map nestedData = this.childAccountAccess.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "child_account_access[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerUpdateHierarchySettingsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerUpdateHierarchySettingsBuilder builder() { + return new CustomerUpdateHierarchySettingsBuilder(); + } + + public static final class CustomerUpdateHierarchySettingsBuilder { + + private Boolean useDefaultHierarchySettings; + + private ParentAccountAccessParams parentAccountAccess; + + private ChildAccountAccessParams childAccountAccess; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerUpdateHierarchySettingsBuilder() {} + + public CustomerUpdateHierarchySettingsBuilder useDefaultHierarchySettings(Boolean value) { + this.useDefaultHierarchySettings = value; + return this; + } + + public CustomerUpdateHierarchySettingsBuilder parentAccountAccess( + ParentAccountAccessParams value) { + this.parentAccountAccess = value; + return this; + } + + public CustomerUpdateHierarchySettingsBuilder childAccountAccess( + ChildAccountAccessParams value) { + this.childAccountAccess = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerUpdateHierarchySettingsBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerUpdateHierarchySettingsBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerUpdateHierarchySettingsBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerUpdateHierarchySettingsParams build() { + return new CustomerUpdateHierarchySettingsParams(this); + } + } + + public static final class ParentAccountAccessParams { + + private final PortalEditChildSubscriptions portalEditChildSubscriptions; + + private final PortalDownloadChildInvoices portalDownloadChildInvoices; + + private final Boolean sendSubscriptionEmails; + + private final Boolean sendPaymentEmails; + + private final Boolean sendInvoiceEmails; + + private ParentAccountAccessParams(ParentAccountAccessBuilder builder) { + + this.portalEditChildSubscriptions = builder.portalEditChildSubscriptions; + + this.portalDownloadChildInvoices = builder.portalDownloadChildInvoices; + + this.sendSubscriptionEmails = builder.sendSubscriptionEmails; + + this.sendPaymentEmails = builder.sendPaymentEmails; + + this.sendInvoiceEmails = builder.sendInvoiceEmails; + } + + public PortalEditChildSubscriptions getPortalEditChildSubscriptions() { + return portalEditChildSubscriptions; + } + + public PortalDownloadChildInvoices getPortalDownloadChildInvoices() { + return portalDownloadChildInvoices; + } + + public Boolean getSendSubscriptionEmails() { + return sendSubscriptionEmails; + } + + public Boolean getSendPaymentEmails() { + return sendPaymentEmails; + } + + public Boolean getSendInvoiceEmails() { + return sendInvoiceEmails; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.portalEditChildSubscriptions != null) { + + formData.put("portal_edit_child_subscriptions", this.portalEditChildSubscriptions); + } + + if (this.portalDownloadChildInvoices != null) { + + formData.put("portal_download_child_invoices", this.portalDownloadChildInvoices); + } + + if (this.sendSubscriptionEmails != null) { + + formData.put("send_subscription_emails", this.sendSubscriptionEmails); + } + + if (this.sendPaymentEmails != null) { + + formData.put("send_payment_emails", this.sendPaymentEmails); + } + + if (this.sendInvoiceEmails != null) { + + formData.put("send_invoice_emails", this.sendInvoiceEmails); + } + + return formData; + } + + /** Create a new builder for ParentAccountAccessParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ParentAccountAccessBuilder builder() { + return new ParentAccountAccessBuilder(); + } + + public static final class ParentAccountAccessBuilder { + + private PortalEditChildSubscriptions portalEditChildSubscriptions; + + private PortalDownloadChildInvoices portalDownloadChildInvoices; + + private Boolean sendSubscriptionEmails; + + private Boolean sendPaymentEmails; + + private Boolean sendInvoiceEmails; + + private ParentAccountAccessBuilder() {} + + public ParentAccountAccessBuilder portalEditChildSubscriptions( + PortalEditChildSubscriptions value) { + this.portalEditChildSubscriptions = value; + return this; + } + + public ParentAccountAccessBuilder portalDownloadChildInvoices( + PortalDownloadChildInvoices value) { + this.portalDownloadChildInvoices = value; + return this; + } + + public ParentAccountAccessBuilder sendSubscriptionEmails(Boolean value) { + this.sendSubscriptionEmails = value; + return this; + } + + public ParentAccountAccessBuilder sendPaymentEmails(Boolean value) { + this.sendPaymentEmails = value; + return this; + } + + public ParentAccountAccessBuilder sendInvoiceEmails(Boolean value) { + this.sendInvoiceEmails = value; + return this; + } + + public ParentAccountAccessParams build() { + return new ParentAccountAccessParams(this); + } + } + + public enum PortalEditChildSubscriptions { + YES("yes"), + + VIEW_ONLY("view_only"), + + NO("no"), + + /** + * An enum member indicating that PortalEditChildSubscriptions was instantiated with an + * unknown value. + */ + _UNKNOWN(null); + private final String value; + + PortalEditChildSubscriptions(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PortalEditChildSubscriptions fromString(String value) { + if (value == null) return _UNKNOWN; + for (PortalEditChildSubscriptions enumValue : PortalEditChildSubscriptions.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PortalDownloadChildInvoices { + YES("yes"), + + VIEW_ONLY("view_only"), + + NO("no"), + + /** + * An enum member indicating that PortalDownloadChildInvoices was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + PortalDownloadChildInvoices(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PortalDownloadChildInvoices fromString(String value) { + if (value == null) return _UNKNOWN; + for (PortalDownloadChildInvoices enumValue : PortalDownloadChildInvoices.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ChildAccountAccessParams { + + private final PortalEditSubscriptions portalEditSubscriptions; + + private final PortalDownloadInvoices portalDownloadInvoices; + + private final Boolean sendSubscriptionEmails; + + private final Boolean sendPaymentEmails; + + private final Boolean sendInvoiceEmails; + + private ChildAccountAccessParams(ChildAccountAccessBuilder builder) { + + this.portalEditSubscriptions = builder.portalEditSubscriptions; + + this.portalDownloadInvoices = builder.portalDownloadInvoices; + + this.sendSubscriptionEmails = builder.sendSubscriptionEmails; + + this.sendPaymentEmails = builder.sendPaymentEmails; + + this.sendInvoiceEmails = builder.sendInvoiceEmails; + } + + public PortalEditSubscriptions getPortalEditSubscriptions() { + return portalEditSubscriptions; + } + + public PortalDownloadInvoices getPortalDownloadInvoices() { + return portalDownloadInvoices; + } + + public Boolean getSendSubscriptionEmails() { + return sendSubscriptionEmails; + } + + public Boolean getSendPaymentEmails() { + return sendPaymentEmails; + } + + public Boolean getSendInvoiceEmails() { + return sendInvoiceEmails; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.portalEditSubscriptions != null) { + + formData.put("portal_edit_subscriptions", this.portalEditSubscriptions); + } + + if (this.portalDownloadInvoices != null) { + + formData.put("portal_download_invoices", this.portalDownloadInvoices); + } + + if (this.sendSubscriptionEmails != null) { + + formData.put("send_subscription_emails", this.sendSubscriptionEmails); + } + + if (this.sendPaymentEmails != null) { + + formData.put("send_payment_emails", this.sendPaymentEmails); + } + + if (this.sendInvoiceEmails != null) { + + formData.put("send_invoice_emails", this.sendInvoiceEmails); + } + + return formData; + } + + /** Create a new builder for ChildAccountAccessParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChildAccountAccessBuilder builder() { + return new ChildAccountAccessBuilder(); + } + + public static final class ChildAccountAccessBuilder { + + private PortalEditSubscriptions portalEditSubscriptions; + + private PortalDownloadInvoices portalDownloadInvoices; + + private Boolean sendSubscriptionEmails; + + private Boolean sendPaymentEmails; + + private Boolean sendInvoiceEmails; + + private ChildAccountAccessBuilder() {} + + public ChildAccountAccessBuilder portalEditSubscriptions(PortalEditSubscriptions value) { + this.portalEditSubscriptions = value; + return this; + } + + public ChildAccountAccessBuilder portalDownloadInvoices(PortalDownloadInvoices value) { + this.portalDownloadInvoices = value; + return this; + } + + public ChildAccountAccessBuilder sendSubscriptionEmails(Boolean value) { + this.sendSubscriptionEmails = value; + return this; + } + + public ChildAccountAccessBuilder sendPaymentEmails(Boolean value) { + this.sendPaymentEmails = value; + return this; + } + + public ChildAccountAccessBuilder sendInvoiceEmails(Boolean value) { + this.sendInvoiceEmails = value; + return this; + } + + public ChildAccountAccessParams build() { + return new ChildAccountAccessParams(this); + } + } + + public enum PortalEditSubscriptions { + YES("yes"), + + VIEW_ONLY("view_only"), + + /** + * An enum member indicating that PortalEditSubscriptions was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + PortalEditSubscriptions(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PortalEditSubscriptions fromString(String value) { + if (value == null) return _UNKNOWN; + for (PortalEditSubscriptions enumValue : PortalEditSubscriptions.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PortalDownloadInvoices { + YES("yes"), + + VIEW_ONLY("view_only"), + + NO("no"), + + /** + * An enum member indicating that PortalDownloadInvoices was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + PortalDownloadInvoices(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PortalDownloadInvoices fromString(String value) { + if (value == null) return _UNKNOWN; + for (PortalDownloadInvoices enumValue : PortalDownloadInvoices.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateParams.java new file mode 100644 index 00000000..31483a64 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateParams.java @@ -0,0 +1,1003 @@ +/* + * 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.customer.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; + +public final class CustomerUpdateParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String preferredCurrencyCode; + + private final String phone; + + private final String company; + + private final AutoCollection autoCollection; + + private final Boolean allowDirectDebit; + + private final Integer netTermDays; + + private final Taxability taxability; + + private final List exemptionDetails; + + private final CustomerType customerType; + + private final String clientProfileId; + + private final TaxjarExemptionCategory taxjarExemptionCategory; + + private final String locale; + + private final EntityCode entityCode; + + private final String exemptNumber; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final String invoiceNotes; + + private final Boolean autoCloseInvoices; + + private final java.util.Map metaData; + + private final FraudFlag fraudFlag; + + private final Boolean consolidatedInvoicing; + + private final List taxProvidersFields; + + private final Map customFields; + + private final Map consentFields; + + private CustomerUpdateParams(CustomerUpdateBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.preferredCurrencyCode = builder.preferredCurrencyCode; + + this.phone = builder.phone; + + this.company = builder.company; + + this.autoCollection = builder.autoCollection; + + this.allowDirectDebit = builder.allowDirectDebit; + + this.netTermDays = builder.netTermDays; + + this.taxability = builder.taxability; + + this.exemptionDetails = builder.exemptionDetails; + + this.customerType = builder.customerType; + + this.clientProfileId = builder.clientProfileId; + + this.taxjarExemptionCategory = builder.taxjarExemptionCategory; + + this.locale = builder.locale; + + this.entityCode = builder.entityCode; + + this.exemptNumber = builder.exemptNumber; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.invoiceNotes = builder.invoiceNotes; + + this.autoCloseInvoices = builder.autoCloseInvoices; + + this.metaData = builder.metaData; + + this.fraudFlag = builder.fraudFlag; + + this.consolidatedInvoicing = builder.consolidatedInvoicing; + + this.taxProvidersFields = builder.taxProvidersFields; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getEmail() { + return email; + } + + public String getPreferredCurrencyCode() { + return preferredCurrencyCode; + } + + public String getPhone() { + return phone; + } + + public String getCompany() { + return company; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public Boolean getAllowDirectDebit() { + return allowDirectDebit; + } + + public Integer getNetTermDays() { + return netTermDays; + } + + public Taxability getTaxability() { + return taxability; + } + + public List getExemptionDetails() { + return exemptionDetails; + } + + public CustomerType getCustomerType() { + return customerType; + } + + public String getClientProfileId() { + return clientProfileId; + } + + public TaxjarExemptionCategory getTaxjarExemptionCategory() { + return taxjarExemptionCategory; + } + + public String getLocale() { + return locale; + } + + public EntityCode getEntityCode() { + return entityCode; + } + + public String getExemptNumber() { + return exemptNumber; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public Boolean getAutoCloseInvoices() { + return autoCloseInvoices; + } + + public java.util.Map getMetaData() { + return metaData; + } + + public FraudFlag getFraudFlag() { + return fraudFlag; + } + + public Boolean getConsolidatedInvoicing() { + return consolidatedInvoicing; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + public Map customFields() { + return customFields; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + 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.preferredCurrencyCode != null) { + + formData.put("preferred_currency_code", this.preferredCurrencyCode); + } + + if (this.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.company != null) { + + formData.put("company", this.company); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.allowDirectDebit != null) { + + formData.put("allow_direct_debit", this.allowDirectDebit); + } + + if (this.netTermDays != null) { + + formData.put("net_term_days", this.netTermDays); + } + + if (this.taxability != null) { + + formData.put("taxability", this.taxability); + } + + if (this.exemptionDetails != null) { + + formData.put("exemption_details", JsonUtil.toJson(this.exemptionDetails)); + } + + if (this.customerType != null) { + + formData.put("customer_type", this.customerType); + } + + if (this.clientProfileId != null) { + + formData.put("client_profile_id", this.clientProfileId); + } + + if (this.taxjarExemptionCategory != null) { + + formData.put("taxjar_exemption_category", this.taxjarExemptionCategory); + } + + if (this.locale != null) { + + formData.put("locale", this.locale); + } + + if (this.entityCode != null) { + + formData.put("entity_code", this.entityCode); + } + + if (this.exemptNumber != null) { + + formData.put("exempt_number", this.exemptNumber); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.autoCloseInvoices != null) { + + formData.put("auto_close_invoices", this.autoCloseInvoices); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + if (this.fraudFlag != null) { + + formData.put("fraud_flag", this.fraudFlag); + } + + if (this.consolidatedInvoicing != null) { + + formData.put("consolidated_invoicing", this.consolidatedInvoicing); + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerUpdateBuilder builder() { + return new CustomerUpdateBuilder(); + } + + public static final class CustomerUpdateBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String preferredCurrencyCode; + + private String phone; + + private String company; + + private AutoCollection autoCollection; + + private Boolean allowDirectDebit; + + private Integer netTermDays; + + private Taxability taxability; + + private List exemptionDetails; + + private CustomerType customerType; + + private String clientProfileId; + + private TaxjarExemptionCategory taxjarExemptionCategory; + + private String locale; + + private EntityCode entityCode; + + private String exemptNumber; + + private OfflinePaymentMethod offlinePaymentMethod; + + private String invoiceNotes; + + private Boolean autoCloseInvoices; + + private java.util.Map metaData; + + private FraudFlag fraudFlag; + + private Boolean consolidatedInvoicing; + + private List taxProvidersFields; + + private Map customFields = new LinkedHashMap<>(); + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerUpdateBuilder() {} + + public CustomerUpdateBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CustomerUpdateBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CustomerUpdateBuilder email(String value) { + this.email = value; + return this; + } + + public CustomerUpdateBuilder preferredCurrencyCode(String value) { + this.preferredCurrencyCode = value; + return this; + } + + public CustomerUpdateBuilder phone(String value) { + this.phone = value; + return this; + } + + public CustomerUpdateBuilder company(String value) { + this.company = value; + return this; + } + + public CustomerUpdateBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public CustomerUpdateBuilder allowDirectDebit(Boolean value) { + this.allowDirectDebit = value; + return this; + } + + public CustomerUpdateBuilder netTermDays(Integer value) { + this.netTermDays = value; + return this; + } + + public CustomerUpdateBuilder taxability(Taxability value) { + this.taxability = value; + return this; + } + + public CustomerUpdateBuilder exemptionDetails(List value) { + this.exemptionDetails = value; + return this; + } + + public CustomerUpdateBuilder customerType(CustomerType value) { + this.customerType = value; + return this; + } + + public CustomerUpdateBuilder clientProfileId(String value) { + this.clientProfileId = value; + return this; + } + + public CustomerUpdateBuilder taxjarExemptionCategory(TaxjarExemptionCategory value) { + this.taxjarExemptionCategory = value; + return this; + } + + public CustomerUpdateBuilder locale(String value) { + this.locale = value; + return this; + } + + public CustomerUpdateBuilder entityCode(EntityCode value) { + this.entityCode = value; + return this; + } + + public CustomerUpdateBuilder exemptNumber(String value) { + this.exemptNumber = value; + return this; + } + + public CustomerUpdateBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public CustomerUpdateBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public CustomerUpdateBuilder autoCloseInvoices(Boolean value) { + this.autoCloseInvoices = value; + return this; + } + + public CustomerUpdateBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public CustomerUpdateBuilder fraudFlag(FraudFlag value) { + this.fraudFlag = value; + return this; + } + + public CustomerUpdateBuilder consolidatedInvoicing(Boolean value) { + this.consolidatedInvoicing = value; + return this; + } + + public CustomerUpdateBuilder taxProvidersFields(List value) { + this.taxProvidersFields = 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 CustomerUpdateBuilder 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 CustomerUpdateBuilder 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; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerUpdateBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerUpdateBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerUpdateBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerUpdateParams build() { + return new CustomerUpdateParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Taxability { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Taxability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Taxability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Taxability fromString(String value) { + if (value == null) return _UNKNOWN; + for (Taxability enumValue : Taxability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum CustomerType { + RESIDENTIAL("residential"), + + BUSINESS("business"), + + SENIOR_CITIZEN("senior_citizen"), + + INDUSTRIAL("industrial"), + + /** An enum member indicating that CustomerType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CustomerType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CustomerType fromString(String value) { + if (value == null) return _UNKNOWN; + for (CustomerType enumValue : CustomerType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TaxjarExemptionCategory { + WHOLESALE("wholesale"), + + GOVERNMENT("government"), + + OTHER("other"), + + /** + * An enum member indicating that TaxjarExemptionCategory was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + TaxjarExemptionCategory(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TaxjarExemptionCategory fromString(String value) { + if (value == null) return _UNKNOWN; + for (TaxjarExemptionCategory enumValue : TaxjarExemptionCategory.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EntityCode { + A("a"), + + B("b"), + + C("c"), + + D("d"), + + E("e"), + + F("f"), + + G("g"), + + H("h"), + + I("i"), + + J("j"), + + K("k"), + + L("l"), + + M("m"), + + N("n"), + + P("p"), + + Q("q"), + + R("r"), + + MED_1("med1"), + + MED_2("med2"), + + /** An enum member indicating that EntityCode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EntityCode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EntityCode fromString(String value) { + if (value == null) return _UNKNOWN; + for (EntityCode enumValue : EntityCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum FraudFlag { + SAFE("safe"), + + FRAUDULENT("fraudulent"), + + /** An enum member indicating that FraudFlag was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + FraudFlag(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static FraudFlag fromString(String value) { + if (value == null) return _UNKNOWN; + for (FraudFlag enumValue : FraudFlag.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdatePaymentMethodParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdatePaymentMethodParams.java new file mode 100644 index 00000000..395abe22 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdatePaymentMethodParams.java @@ -0,0 +1,520 @@ +/* + * 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.customer.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; + +public final class CustomerUpdatePaymentMethodParams { + + private final PaymentMethodParams paymentMethod; + + private final Map consentFields; + + private CustomerUpdatePaymentMethodParams(CustomerUpdatePaymentMethodBuilder builder) { + + this.paymentMethod = builder.paymentMethod; + + this.consentFields = + builder.consentFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.consentFields)); + } + + public PaymentMethodParams getPaymentMethod() { + return paymentMethod; + } + + public Map consentFields() { + return consentFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.paymentMethod != null) { + + // Single object + Map nestedData = this.paymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + formData.putAll(consentFields); + + return formData; + } + + /** Create a new builder for CustomerUpdatePaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerUpdatePaymentMethodBuilder builder() { + return new CustomerUpdatePaymentMethodBuilder(); + } + + public static final class CustomerUpdatePaymentMethodBuilder { + + private PaymentMethodParams paymentMethod; + + private Map consentFields = new LinkedHashMap<>(); + + private CustomerUpdatePaymentMethodBuilder() {} + + public CustomerUpdatePaymentMethodBuilder paymentMethod(PaymentMethodParams value) { + this.paymentMethod = value; + return this; + } + + /** + * Add a consent field to the request. Consent fields must start with "cs_". Consent fields + * typically hold boolean values or options. + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the value of the consent field (typically Boolean or String for options) + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerUpdatePaymentMethodBuilder consentField(String fieldName, Object value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add a boolean consent field to the request. Consent fields must start with "cs_". + * + * @param fieldName the name of the consent field (e.g., "cs_marketing_consent") + * @param value the boolean value of the consent field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cs_" + */ + public CustomerUpdatePaymentMethodBuilder consentField(String fieldName, Boolean value) { + if (fieldName == null || !fieldName.startsWith("cs_")) { + throw new IllegalArgumentException("Consent field name must start with 'cs_'"); + } + this.consentFields.put(fieldName, value); + return this; + } + + /** + * Add multiple consent fields to the request. All field names must start with "cs_". + * + * @param consentFields map of consent field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cs_" + */ + public CustomerUpdatePaymentMethodBuilder consentFields(Map consentFields) { + if (consentFields != null) { + for (Map.Entry entry : consentFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cs_")) { + throw new IllegalArgumentException( + "Consent field name must start with 'cs_': " + entry.getKey()); + } + this.consentFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CustomerUpdatePaymentMethodParams build() { + return new CustomerUpdatePaymentMethodParams(this); + } + } + + public static final class PaymentMethodParams { + + private final Type type; + + private final Gateway gateway; + + private final String gatewayAccountId; + + private final String referenceId; + + private final String tmpToken; + + private final String issuingCountry; + + private final java.util.Map additionalInformation; + + private PaymentMethodParams(PaymentMethodBuilder builder) { + + this.type = builder.type; + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.referenceId = builder.referenceId; + + this.tmpToken = builder.tmpToken; + + this.issuingCountry = builder.issuingCountry; + + this.additionalInformation = builder.additionalInformation; + } + + public Type getType() { + return type; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getReferenceId() { + return referenceId; + } + + public String getTmpToken() { + return tmpToken; + } + + public String getIssuingCountry() { + return issuingCountry; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.gateway != null) { + + formData.put("gateway", this.gateway); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.tmpToken != null) { + + formData.put("tmp_token", this.tmpToken); + } + + if (this.issuingCountry != null) { + + formData.put("issuing_country", this.issuingCountry); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentMethodBuilder builder() { + return new PaymentMethodBuilder(); + } + + public static final class PaymentMethodBuilder { + + private Type type; + + private Gateway gateway; + + private String gatewayAccountId; + + private String referenceId; + + private String tmpToken; + + private String issuingCountry; + + private java.util.Map additionalInformation; + + private PaymentMethodBuilder() {} + + public PaymentMethodBuilder type(Type value) { + this.type = value; + return this; + } + + @Deprecated + public PaymentMethodBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public PaymentMethodBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentMethodBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public PaymentMethodBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public PaymentMethodBuilder issuingCountry(String value) { + this.issuingCountry = value; + return this; + } + + public PaymentMethodBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentMethodParams build() { + return new PaymentMethodParams(this); + } + } + + public enum Type { + CARD("card"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + AMAZON_PAYMENTS("amazon_payments"), + + DIRECT_DEBIT("direct_debit"), + + GENERIC("generic"), + + ALIPAY("alipay"), + + UNIONPAY("unionpay"), + + WECHAT_PAY("wechat_pay"), + + IDEAL("ideal"), + + GOOGLE_PAY("google_pay"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GIROPAY("giropay"), + + DOTPAY("dotpay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + VENMO("venmo"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** 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 Gateway { + 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"), + + GOCARDLESS("gocardless"), + + 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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/responses/ContactsForCustomerResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/ContactsForCustomerResponse.java new file mode 100644 index 00000000..f0d282f4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/responses/ContactsForCustomerResponse.java @@ -0,0 +1,172 @@ +package com.chargebee.v4.models.customer.responses; + +import java.util.List; + +import com.chargebee.v4.models.contact.Contact; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.CustomerService; +import com.chargebee.v4.models.customer.params.ContactsForCustomerParams; + +/** Immutable response object for ContactsForCustomer operation. Contains paginated list data. */ +public final class ContactsForCustomerResponse { + + private final List list; + + private final String nextOffset; + + private final String customerId; + + private final CustomerService service; + private final ContactsForCustomerParams originalParams; + private final Response httpResponse; + + private ContactsForCustomerResponse( + List list, + String nextOffset, + String customerId, + CustomerService service, + ContactsForCustomerParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.customerId = customerId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into ContactsForCustomerResponse object (no service context). Use this when + * you only need to read a single page (no nextPage()). + */ + public static ContactsForCustomerResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(CustomerContactsForCustomerItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new ContactsForCustomerResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ContactsForCustomerResponse from JSON", e); + } + } + + /** + * Parse JSON response into ContactsForCustomerResponse object with service context for pagination + * (enables nextPage()). + */ + public static ContactsForCustomerResponse fromJson( + String json, + CustomerService service, + ContactsForCustomerParams originalParams, + String customerId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(CustomerContactsForCustomerItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new ContactsForCustomerResponse( + list, nextOffset, customerId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ContactsForCustomerResponse 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 ContactsForCustomerResponse 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)."); + } + + ContactsForCustomerParams nextParams = + (originalParams != null ? originalParams.toBuilder() : ContactsForCustomerParams.builder()) + .offset(nextOffset) + .build(); + + return service.contactsForCustomer(customerId, 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 CustomerContactsForCustomerItem { + + private Contact contact; + + public Contact getContact() { + return contact; + } + + public static CustomerContactsForCustomerItem fromJson(String json) { + CustomerContactsForCustomerItem item = new CustomerContactsForCustomerItem(); + + String __contactJson = JsonUtil.getObject(json, "contact"); + if (__contactJson != null) { + item.contact = Contact.fromJson(__contactJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerAddContactResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerAddContactResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerAddContactResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerAddContactResponse.java index 6dd30ec8..2c13b611 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerAddContactResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerAddContactResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerAddPromotionalCreditsResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerAddPromotionalCreditsResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerAddPromotionalCreditsResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerAddPromotionalCreditsResponse.java index ec31edb6..ab762ae4 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerAddPromotionalCreditsResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerAddPromotionalCreditsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerAssignPaymentRoleResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerAssignPaymentRoleResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerAssignPaymentRoleResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerAssignPaymentRoleResponse.java index dec53fc4..63b50568 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerAssignPaymentRoleResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerAssignPaymentRoleResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerChangeBillingDateResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerChangeBillingDateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerChangeBillingDateResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerChangeBillingDateResponse.java index d8934704..6460c434 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerChangeBillingDateResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerChangeBillingDateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerClearPersonalDataResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerClearPersonalDataResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerClearPersonalDataResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerClearPersonalDataResponse.java index 9a3619b6..47a928b5 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerClearPersonalDataResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerClearPersonalDataResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerCollectPaymentResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerCollectPaymentResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerCollectPaymentResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerCollectPaymentResponse.java index 2f6264c1..5fa81417 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerCollectPaymentResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerCollectPaymentResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerCreateResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerCreateResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerCreateResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerCreateResponse.java index aa862d24..f83d9706 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerCreateResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerDeductPromotionalCreditsResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerDeductPromotionalCreditsResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerDeductPromotionalCreditsResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerDeductPromotionalCreditsResponse.java index f27274ac..1ef3e629 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerDeductPromotionalCreditsResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerDeductPromotionalCreditsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerDeleteContactResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerDeleteContactResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerDeleteContactResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerDeleteContactResponse.java index 5414b807..a2583241 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerDeleteContactResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerDeleteContactResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerDeleteRelationshipResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerDeleteRelationshipResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerDeleteRelationshipResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerDeleteRelationshipResponse.java index f118b680..7ad797b6 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerDeleteRelationshipResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerDeleteRelationshipResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerDeleteResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerDeleteResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerDeleteResponse.java index 0139b521..f46369d7 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerDeleteResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/customer/responses/CustomerHierarchyResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerHierarchyResponse.java new file mode 100644 index 00000000..ff9a6d5e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerHierarchyResponse.java @@ -0,0 +1,81 @@ +package com.chargebee.v4.models.customer.responses; + +import com.chargebee.v4.models.hierarchy.Hierarchy; + +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 CustomerHierarchy operation. Contains the response data from a + * single resource get operation. + */ +public final class CustomerHierarchyResponse extends BaseResponse { + private final List hierarchies; + + private CustomerHierarchyResponse(Builder builder) { + super(builder.httpResponse); + + this.hierarchies = builder.hierarchies; + } + + /** Parse JSON response into CustomerHierarchyResponse object. */ + public static CustomerHierarchyResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CustomerHierarchyResponse object with HTTP response. */ + public static CustomerHierarchyResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __hierarchiesJson = JsonUtil.getArray(json, "hierarchies"); + if (__hierarchiesJson != null) { + builder.hierarchies( + JsonUtil.parseObjectArray(__hierarchiesJson).stream() + .map(Hierarchy::fromJson) + .collect(java.util.stream.Collectors.toList())); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CustomerHierarchyResponse from JSON", e); + } + } + + /** Create a new builder for CustomerHierarchyResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CustomerHierarchyResponse. */ + public static class Builder { + + private List hierarchies; + + private Response httpResponse; + + private Builder() {} + + public Builder hierarchies(List hierarchies) { + this.hierarchies = hierarchies; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CustomerHierarchyResponse build() { + return new CustomerHierarchyResponse(this); + } + } + + /** Get the hierarchies from the response. */ + public List getHierarchies() { + return hierarchies; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerListHierarchyDetailResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerListHierarchyDetailResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerListHierarchyDetailResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerListHierarchyDetailResponse.java index ebec7917..1f953bc8 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerListHierarchyDetailResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerListHierarchyDetailResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; import java.util.List; -import com.chargebee.v4.core.models.hierarchy.Hierarchy; +import com.chargebee.v4.models.hierarchy.Hierarchy; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.CustomerService; -import com.chargebee.v4.core.models.customer.params.CustomerListHierarchyDetailParams; +import com.chargebee.v4.services.CustomerService; +import com.chargebee.v4.models.customer.params.CustomerListHierarchyDetailParams; /** * Immutable response object for CustomerListHierarchyDetail operation. Contains paginated list @@ -110,9 +111,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 CustomerListHierarchyDetailResponse nextPage() throws Exception { + public CustomerListHierarchyDetailResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerListResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerListResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerListResponse.java index 03554a20..69293dff 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerListResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerListResponse.java @@ -1,15 +1,16 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; import java.util.List; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.CustomerService; -import com.chargebee.v4.core.models.customer.params.CustomerListParams; +import com.chargebee.v4.services.CustomerService; +import com.chargebee.v4.models.customer.params.CustomerListParams; /** Immutable response object for CustomerList operation. Contains paginated list data. */ public final class CustomerListResponse { @@ -100,9 +101,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 CustomerListResponse nextPage() throws Exception { + public CustomerListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerMergeResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerMergeResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerMergeResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerMergeResponse.java index 404517bf..9690619b 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerMergeResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerMergeResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerMoveResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerMoveResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerMoveResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerMoveResponse.java index 38744187..05c81d87 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerMoveResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerMoveResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.resourceMigration.ResourceMigration; +import com.chargebee.v4.models.resourceMigration.ResourceMigration; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerRecordExcessPaymentResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerRecordExcessPaymentResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerRecordExcessPaymentResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerRecordExcessPaymentResponse.java index 2278f32d..9f291599 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerRecordExcessPaymentResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerRecordExcessPaymentResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerRelationshipsResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerRelationshipsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerRelationshipsResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerRelationshipsResponse.java index bc33895f..d8b8bf2f 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerRelationshipsResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerRelationshipsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/customer/responses/CustomerRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerRetrieveResponse.java new file mode 100644 index 00000000..20753097 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerRetrieveResponse.java @@ -0,0 +1,100 @@ +package com.chargebee.v4.models.customer.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 CustomerRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class CustomerRetrieveResponse extends BaseResponse { + private final Customer customer; + + private final Card card; + + private CustomerRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.customer = builder.customer; + + this.card = builder.card; + } + + /** Parse JSON response into CustomerRetrieveResponse object. */ + public static CustomerRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CustomerRetrieveResponse object with HTTP response. */ + public static CustomerRetrieveResponse 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 CustomerRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for CustomerRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CustomerRetrieveResponse. */ + 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 CustomerRetrieveResponse build() { + return new CustomerRetrieveResponse(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/core/responses/customer/CustomerSetPromotionalCreditsResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerSetPromotionalCreditsResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerSetPromotionalCreditsResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerSetPromotionalCreditsResponse.java index e34a178c..92aef8a3 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerSetPromotionalCreditsResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerSetPromotionalCreditsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerUpdateBillingInfoResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerUpdateBillingInfoResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerUpdateBillingInfoResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerUpdateBillingInfoResponse.java index 3d5186a3..bbff2076 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerUpdateBillingInfoResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerUpdateBillingInfoResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerUpdateContactResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerUpdateContactResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerUpdateContactResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerUpdateContactResponse.java index 636ea459..067307ac 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerUpdateContactResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerUpdateContactResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerUpdateHierarchySettingsResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerUpdateHierarchySettingsResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerUpdateHierarchySettingsResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerUpdateHierarchySettingsResponse.java index 47a9a79f..ac33b828 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerUpdateHierarchySettingsResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerUpdateHierarchySettingsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerUpdatePaymentMethodResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerUpdatePaymentMethodResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerUpdatePaymentMethodResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerUpdatePaymentMethodResponse.java index 62e7e012..6e44d899 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerUpdatePaymentMethodResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerUpdatePaymentMethodResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerUpdateResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerUpdateResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/customer/CustomerUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/customer/responses/CustomerUpdateResponse.java index fdf45b24..b9a3281e 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customer/CustomerUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerUpdateResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.customer; +package com.chargebee.v4.models.customer.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/customerEntitlement/CustomerEntitlement.java b/src/main/java/com/chargebee/v4/models/customerEntitlement/CustomerEntitlement.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/customerEntitlement/CustomerEntitlement.java rename to src/main/java/com/chargebee/v4/models/customerEntitlement/CustomerEntitlement.java index 4d09bada..de811a67 100644 --- a/src/main/java/com/chargebee/v4/core/models/customerEntitlement/CustomerEntitlement.java +++ b/src/main/java/com/chargebee/v4/models/customerEntitlement/CustomerEntitlement.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customerEntitlement; +package com.chargebee.v4.models.customerEntitlement; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/core/models/customerEntitlement/params/CustomerEntitlementEntitlementsForCustomerParams.java b/src/main/java/com/chargebee/v4/models/customerEntitlement/params/CustomerEntitlementEntitlementsForCustomerParams.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/customerEntitlement/params/CustomerEntitlementEntitlementsForCustomerParams.java rename to src/main/java/com/chargebee/v4/models/customerEntitlement/params/CustomerEntitlementEntitlementsForCustomerParams.java index 87e72bbd..9adbbeae 100644 --- a/src/main/java/com/chargebee/v4/core/models/customerEntitlement/params/CustomerEntitlementEntitlementsForCustomerParams.java +++ b/src/main/java/com/chargebee/v4/models/customerEntitlement/params/CustomerEntitlementEntitlementsForCustomerParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customerEntitlement.params; +package com.chargebee.v4.models.customerEntitlement.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/responses/customerEntitlement/CustomerEntitlementEntitlementsForCustomerResponse.java b/src/main/java/com/chargebee/v4/models/customerEntitlement/responses/CustomerEntitlementEntitlementsForCustomerResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/customerEntitlement/CustomerEntitlementEntitlementsForCustomerResponse.java rename to src/main/java/com/chargebee/v4/models/customerEntitlement/responses/CustomerEntitlementEntitlementsForCustomerResponse.java index a3f02741..edebfd41 100644 --- a/src/main/java/com/chargebee/v4/core/responses/customerEntitlement/CustomerEntitlementEntitlementsForCustomerResponse.java +++ b/src/main/java/com/chargebee/v4/models/customerEntitlement/responses/CustomerEntitlementEntitlementsForCustomerResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.customerEntitlement; +package com.chargebee.v4.models.customerEntitlement.responses; import java.util.List; -import com.chargebee.v4.core.models.customerEntitlement.CustomerEntitlement; +import com.chargebee.v4.models.customerEntitlement.CustomerEntitlement; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.CustomerEntitlementService; -import com.chargebee.v4.core.models.customerEntitlement.params.CustomerEntitlementEntitlementsForCustomerParams; +import com.chargebee.v4.services.CustomerEntitlementService; +import com.chargebee.v4.models.customerEntitlement.params.CustomerEntitlementEntitlementsForCustomerParams; /** * Immutable response object for CustomerEntitlementEntitlementsForCustomer operation. Contains @@ -111,9 +112,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 CustomerEntitlementEntitlementsForCustomerResponse nextPage() throws Exception { + public CustomerEntitlementEntitlementsForCustomerResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/models/differentialPrice/DifferentialPrice.java b/src/main/java/com/chargebee/v4/models/differentialPrice/DifferentialPrice.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/differentialPrice/DifferentialPrice.java rename to src/main/java/com/chargebee/v4/models/differentialPrice/DifferentialPrice.java index 5a0ba9fd..7be55d7a 100644 --- a/src/main/java/com/chargebee/v4/core/models/differentialPrice/DifferentialPrice.java +++ b/src/main/java/com/chargebee/v4/models/differentialPrice/DifferentialPrice.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.differentialPrice; +package com.chargebee.v4.models.differentialPrice; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/differentialPrice/params/DifferentialPriceCreateParams.java b/src/main/java/com/chargebee/v4/models/differentialPrice/params/DifferentialPriceCreateParams.java new file mode 100644 index 00000000..66443ade --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/differentialPrice/params/DifferentialPriceCreateParams.java @@ -0,0 +1,500 @@ +/* + * 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.differentialPrice.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class DifferentialPriceCreateParams { + + private final String parentItemId; + + private final Long price; + + private final String priceInDecimal; + + private final String businessEntityId; + + private final List parentPeriods; + + private final List tiers; + + private DifferentialPriceCreateParams(DifferentialPriceCreateBuilder builder) { + + this.parentItemId = builder.parentItemId; + + this.price = builder.price; + + this.priceInDecimal = builder.priceInDecimal; + + this.businessEntityId = builder.businessEntityId; + + this.parentPeriods = builder.parentPeriods; + + this.tiers = builder.tiers; + } + + public String getParentItemId() { + return parentItemId; + } + + public Long getPrice() { + return price; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public String getBusinessEntityId() { + return businessEntityId; + } + + public List getParentPeriods() { + return parentPeriods; + } + + public List getTiers() { + return tiers; + } + + /** 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); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.businessEntityId != null) { + + formData.put("business_entity_id", this.businessEntityId); + } + + if (this.parentPeriods != null) { + + // List of objects + for (int i = 0; i < this.parentPeriods.size(); i++) { + ParentPeriodsParams item = this.parentPeriods.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "parent_periods[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.tiers != null) { + + // List of objects + for (int i = 0; i < this.tiers.size(); i++) { + TiersParams item = this.tiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for DifferentialPriceCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DifferentialPriceCreateBuilder builder() { + return new DifferentialPriceCreateBuilder(); + } + + public static final class DifferentialPriceCreateBuilder { + + private String parentItemId; + + private Long price; + + private String priceInDecimal; + + private String businessEntityId; + + private List parentPeriods; + + private List tiers; + + private DifferentialPriceCreateBuilder() {} + + public DifferentialPriceCreateBuilder parentItemId(String value) { + this.parentItemId = value; + return this; + } + + public DifferentialPriceCreateBuilder price(Long value) { + this.price = value; + return this; + } + + public DifferentialPriceCreateBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public DifferentialPriceCreateBuilder businessEntityId(String value) { + this.businessEntityId = value; + return this; + } + + public DifferentialPriceCreateBuilder parentPeriods(List value) { + this.parentPeriods = value; + return this; + } + + public DifferentialPriceCreateBuilder tiers(List value) { + this.tiers = value; + return this; + } + + public DifferentialPriceCreateParams build() { + return new DifferentialPriceCreateParams(this); + } + } + + public static final class ParentPeriodsParams { + + private final PeriodUnit periodUnit; + + private final List period; + + private ParentPeriodsParams(ParentPeriodsBuilder builder) { + + this.periodUnit = builder.periodUnit; + + this.period = builder.period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public List getPeriod() { + return period; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.period != null) { + + formData.put("period", JsonUtil.toJson(this.period)); + } + + return formData; + } + + /** Create a new builder for ParentPeriodsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ParentPeriodsBuilder builder() { + return new ParentPeriodsBuilder(); + } + + public static final class ParentPeriodsBuilder { + + private PeriodUnit periodUnit; + + private List period; + + private ParentPeriodsBuilder() {} + + public ParentPeriodsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public ParentPeriodsBuilder period(List value) { + this.period = value; + return this; + } + + public ParentPeriodsParams build() { + return new ParentPeriodsParams(this); + } + } + + 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 TiersParams { + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private TiersParams(TiersBuilder builder) { + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for TiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TiersBuilder builder() { + return new TiersBuilder(); + } + + public static final class TiersBuilder { + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private TiersBuilder() {} + + public TiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public TiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public TiersBuilder price(Long value) { + this.price = value; + return this; + } + + public TiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public TiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public TiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public TiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public TiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public TiersParams build() { + return new TiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/differentialPrice/params/DifferentialPriceDeleteParams.java b/src/main/java/com/chargebee/v4/models/differentialPrice/params/DifferentialPriceDeleteParams.java new file mode 100644 index 00000000..79110767 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/differentialPrice/params/DifferentialPriceDeleteParams.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.differentialPrice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class DifferentialPriceDeleteParams { + + private final String itemPriceId; + + private DifferentialPriceDeleteParams(DifferentialPriceDeleteBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + } + + public String getItemPriceId() { + return itemPriceId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + return formData; + } + + /** Create a new builder for DifferentialPriceDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DifferentialPriceDeleteBuilder builder() { + return new DifferentialPriceDeleteBuilder(); + } + + public static final class DifferentialPriceDeleteBuilder { + + private String itemPriceId; + + private DifferentialPriceDeleteBuilder() {} + + public DifferentialPriceDeleteBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DifferentialPriceDeleteParams build() { + return new DifferentialPriceDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/differentialPrice/params/DifferentialPriceListParams.java b/src/main/java/com/chargebee/v4/models/differentialPrice/params/DifferentialPriceListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/differentialPrice/params/DifferentialPriceListParams.java rename to src/main/java/com/chargebee/v4/models/differentialPrice/params/DifferentialPriceListParams.java index 99eae08b..6c4fae1e 100644 --- a/src/main/java/com/chargebee/v4/core/models/differentialPrice/params/DifferentialPriceListParams.java +++ b/src/main/java/com/chargebee/v4/models/differentialPrice/params/DifferentialPriceListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.differentialPrice.params; +package com.chargebee.v4.models.differentialPrice.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/differentialPrice/params/DifferentialPriceRetrieveParams.java b/src/main/java/com/chargebee/v4/models/differentialPrice/params/DifferentialPriceRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/differentialPrice/params/DifferentialPriceRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/differentialPrice/params/DifferentialPriceRetrieveParams.java index 3bc9fd9d..7f4fde92 100644 --- a/src/main/java/com/chargebee/v4/core/models/differentialPrice/params/DifferentialPriceRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/differentialPrice/params/DifferentialPriceRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.differentialPrice.params; +package com.chargebee.v4.models.differentialPrice.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/differentialPrice/params/DifferentialPriceUpdateParams.java b/src/main/java/com/chargebee/v4/models/differentialPrice/params/DifferentialPriceUpdateParams.java new file mode 100644 index 00000000..2fa5d7b7 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/differentialPrice/params/DifferentialPriceUpdateParams.java @@ -0,0 +1,480 @@ +/* + * 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.differentialPrice.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class DifferentialPriceUpdateParams { + + private final String itemPriceId; + + private final Long price; + + private final String priceInDecimal; + + private final List parentPeriods; + + private final List tiers; + + private DifferentialPriceUpdateParams(DifferentialPriceUpdateBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.price = builder.price; + + this.priceInDecimal = builder.priceInDecimal; + + this.parentPeriods = builder.parentPeriods; + + this.tiers = builder.tiers; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Long getPrice() { + return price; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public List getParentPeriods() { + return parentPeriods; + } + + public List getTiers() { + return tiers; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.parentPeriods != null) { + + // List of objects + for (int i = 0; i < this.parentPeriods.size(); i++) { + ParentPeriodsParams item = this.parentPeriods.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "parent_periods[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.tiers != null) { + + // List of objects + for (int i = 0; i < this.tiers.size(); i++) { + TiersParams item = this.tiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for DifferentialPriceUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DifferentialPriceUpdateBuilder builder() { + return new DifferentialPriceUpdateBuilder(); + } + + public static final class DifferentialPriceUpdateBuilder { + + private String itemPriceId; + + private Long price; + + private String priceInDecimal; + + private List parentPeriods; + + private List tiers; + + private DifferentialPriceUpdateBuilder() {} + + public DifferentialPriceUpdateBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DifferentialPriceUpdateBuilder price(Long value) { + this.price = value; + return this; + } + + public DifferentialPriceUpdateBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public DifferentialPriceUpdateBuilder parentPeriods(List value) { + this.parentPeriods = value; + return this; + } + + public DifferentialPriceUpdateBuilder tiers(List value) { + this.tiers = value; + return this; + } + + public DifferentialPriceUpdateParams build() { + return new DifferentialPriceUpdateParams(this); + } + } + + public static final class ParentPeriodsParams { + + private final PeriodUnit periodUnit; + + private final List period; + + private ParentPeriodsParams(ParentPeriodsBuilder builder) { + + this.periodUnit = builder.periodUnit; + + this.period = builder.period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public List getPeriod() { + return period; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.period != null) { + + formData.put("period", JsonUtil.toJson(this.period)); + } + + return formData; + } + + /** Create a new builder for ParentPeriodsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ParentPeriodsBuilder builder() { + return new ParentPeriodsBuilder(); + } + + public static final class ParentPeriodsBuilder { + + private PeriodUnit periodUnit; + + private List period; + + private ParentPeriodsBuilder() {} + + public ParentPeriodsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public ParentPeriodsBuilder period(List value) { + this.period = value; + return this; + } + + public ParentPeriodsParams build() { + return new ParentPeriodsParams(this); + } + } + + 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 TiersParams { + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private TiersParams(TiersBuilder builder) { + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for TiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TiersBuilder builder() { + return new TiersBuilder(); + } + + public static final class TiersBuilder { + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private TiersBuilder() {} + + public TiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public TiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public TiersBuilder price(Long value) { + this.price = value; + return this; + } + + public TiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public TiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public TiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public TiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public TiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public TiersParams build() { + return new TiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/differentialPrice/DifferentialPriceCreateResponse.java b/src/main/java/com/chargebee/v4/models/differentialPrice/responses/DifferentialPriceCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/differentialPrice/DifferentialPriceCreateResponse.java rename to src/main/java/com/chargebee/v4/models/differentialPrice/responses/DifferentialPriceCreateResponse.java index 3b41c2da..74f021d7 100644 --- a/src/main/java/com/chargebee/v4/core/responses/differentialPrice/DifferentialPriceCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/differentialPrice/responses/DifferentialPriceCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.differentialPrice; +package com.chargebee.v4.models.differentialPrice.responses; -import com.chargebee.v4.core.models.differentialPrice.DifferentialPrice; +import com.chargebee.v4.models.differentialPrice.DifferentialPrice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/differentialPrice/DifferentialPriceDeleteResponse.java b/src/main/java/com/chargebee/v4/models/differentialPrice/responses/DifferentialPriceDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/differentialPrice/DifferentialPriceDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/differentialPrice/responses/DifferentialPriceDeleteResponse.java index 29b31468..bc010822 100644 --- a/src/main/java/com/chargebee/v4/core/responses/differentialPrice/DifferentialPriceDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/differentialPrice/responses/DifferentialPriceDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.differentialPrice; +package com.chargebee.v4.models.differentialPrice.responses; -import com.chargebee.v4.core.models.differentialPrice.DifferentialPrice; +import com.chargebee.v4.models.differentialPrice.DifferentialPrice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/differentialPrice/DifferentialPriceListResponse.java b/src/main/java/com/chargebee/v4/models/differentialPrice/responses/DifferentialPriceListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/differentialPrice/DifferentialPriceListResponse.java rename to src/main/java/com/chargebee/v4/models/differentialPrice/responses/DifferentialPriceListResponse.java index 96bdd0e6..f445a3e5 100644 --- a/src/main/java/com/chargebee/v4/core/responses/differentialPrice/DifferentialPriceListResponse.java +++ b/src/main/java/com/chargebee/v4/models/differentialPrice/responses/DifferentialPriceListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.differentialPrice; +package com.chargebee.v4.models.differentialPrice.responses; import java.util.List; -import com.chargebee.v4.core.models.differentialPrice.DifferentialPrice; +import com.chargebee.v4.models.differentialPrice.DifferentialPrice; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.DifferentialPriceService; -import com.chargebee.v4.core.models.differentialPrice.params.DifferentialPriceListParams; +import com.chargebee.v4.services.DifferentialPriceService; +import com.chargebee.v4.models.differentialPrice.params.DifferentialPriceListParams; /** Immutable response object for DifferentialPriceList operation. Contains paginated list data. */ public final class DifferentialPriceListResponse { @@ -99,9 +100,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 DifferentialPriceListResponse nextPage() throws Exception { + public DifferentialPriceListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/differentialPrice/responses/DifferentialPriceRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/differentialPrice/responses/DifferentialPriceRetrieveResponse.java new file mode 100644 index 00000000..821f4588 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/differentialPrice/responses/DifferentialPriceRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.differentialPrice.responses; + +import com.chargebee.v4.models.differentialPrice.DifferentialPrice; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for DifferentialPriceRetrieve operation. Contains the response data + * from a single resource get operation. + */ +public final class DifferentialPriceRetrieveResponse extends BaseResponse { + private final DifferentialPrice differentialPrice; + + private DifferentialPriceRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.differentialPrice = builder.differentialPrice; + } + + /** Parse JSON response into DifferentialPriceRetrieveResponse object. */ + public static DifferentialPriceRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into DifferentialPriceRetrieveResponse object with HTTP response. */ + public static DifferentialPriceRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __differentialPriceJson = JsonUtil.getObject(json, "differential_price"); + if (__differentialPriceJson != null) { + builder.differentialPrice(DifferentialPrice.fromJson(__differentialPriceJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse DifferentialPriceRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for DifferentialPriceRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for DifferentialPriceRetrieveResponse. */ + public static class Builder { + + private DifferentialPrice differentialPrice; + + private Response httpResponse; + + private Builder() {} + + public Builder differentialPrice(DifferentialPrice differentialPrice) { + this.differentialPrice = differentialPrice; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public DifferentialPriceRetrieveResponse build() { + return new DifferentialPriceRetrieveResponse(this); + } + } + + /** Get the differentialPrice from the response. */ + public DifferentialPrice getDifferentialPrice() { + return differentialPrice; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/differentialPrice/DifferentialPriceUpdateResponse.java b/src/main/java/com/chargebee/v4/models/differentialPrice/responses/DifferentialPriceUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/differentialPrice/DifferentialPriceUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/differentialPrice/responses/DifferentialPriceUpdateResponse.java index 26d44670..65486752 100644 --- a/src/main/java/com/chargebee/v4/core/responses/differentialPrice/DifferentialPriceUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/differentialPrice/responses/DifferentialPriceUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.differentialPrice; +package com.chargebee.v4.models.differentialPrice.responses; -import com.chargebee.v4.core.models.differentialPrice.DifferentialPrice; +import com.chargebee.v4.models.differentialPrice.DifferentialPrice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/discount/Discount.java b/src/main/java/com/chargebee/v4/models/discount/Discount.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/discount/Discount.java rename to src/main/java/com/chargebee/v4/models/discount/Discount.java index 6b47c65d..3289ff2b 100644 --- a/src/main/java/com/chargebee/v4/core/models/discount/Discount.java +++ b/src/main/java/com/chargebee/v4/models/discount/Discount.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.discount; +package com.chargebee.v4.models.discount; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/download/Download.java b/src/main/java/com/chargebee/v4/models/download/Download.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/download/Download.java rename to src/main/java/com/chargebee/v4/models/download/Download.java index c4f80f17..1bfdc4cb 100644 --- a/src/main/java/com/chargebee/v4/core/models/download/Download.java +++ b/src/main/java/com/chargebee/v4/models/download/Download.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.download; +package com.chargebee.v4.models.download; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/einvoice/Einvoice.java b/src/main/java/com/chargebee/v4/models/einvoice/Einvoice.java new file mode 100644 index 00000000..4b91afb2 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/einvoice/Einvoice.java @@ -0,0 +1,84 @@ +/* + * 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.einvoice; + +import com.chargebee.v4.internal.JsonUtil; + +public class Einvoice { + + private String id; + private String referenceNumber; + private Status status; + private String message; + + public String getId() { + return id; + } + + public String getReferenceNumber() { + return referenceNumber; + } + + public Status getStatus() { + return status; + } + + public String getMessage() { + return message; + } + + public enum Status { + SCHEDULED("scheduled"), + + SKIPPED("skipped"), + + IN_PROGRESS("in_progress"), + + SUCCESS("success"), + + FAILED("failed"), + + REGISTERED("registered"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static Einvoice fromJson(String json) { + Einvoice obj = new Einvoice(); + + obj.id = JsonUtil.getString(json, "id"); + + obj.referenceNumber = JsonUtil.getString(json, "reference_number"); + + obj.status = Status.fromString(JsonUtil.getString(json, "status")); + + obj.message = JsonUtil.getString(json, "message"); + + return obj; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/entitlement/Entitlement.java b/src/main/java/com/chargebee/v4/models/entitlement/Entitlement.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/entitlement/Entitlement.java rename to src/main/java/com/chargebee/v4/models/entitlement/Entitlement.java index 101d465a..9c87d5cd 100644 --- a/src/main/java/com/chargebee/v4/core/models/entitlement/Entitlement.java +++ b/src/main/java/com/chargebee/v4/models/entitlement/Entitlement.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.entitlement; +package com.chargebee.v4.models.entitlement; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/models/entitlement/params/EntitlementCreateParams.java b/src/main/java/com/chargebee/v4/models/entitlement/params/EntitlementCreateParams.java new file mode 100644 index 00000000..7fe05091 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/entitlement/params/EntitlementCreateParams.java @@ -0,0 +1,301 @@ +/* + * 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.entitlement.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class EntitlementCreateParams { + + private final Action action; + + private final String changeReason; + + private final List entitlements; + + private EntitlementCreateParams(EntitlementCreateBuilder builder) { + + this.action = builder.action; + + this.changeReason = builder.changeReason; + + this.entitlements = builder.entitlements; + } + + public Action getAction() { + return action; + } + + public String getChangeReason() { + return changeReason; + } + + public List getEntitlements() { + return entitlements; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.action != null) { + + formData.put("action", this.action); + } + + if (this.changeReason != null) { + + formData.put("change_reason", this.changeReason); + } + + if (this.entitlements != null) { + + // List of objects + for (int i = 0; i < this.entitlements.size(); i++) { + EntitlementsParams item = this.entitlements.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "entitlements[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for EntitlementCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EntitlementCreateBuilder builder() { + return new EntitlementCreateBuilder(); + } + + public static final class EntitlementCreateBuilder { + + private Action action; + + private String changeReason; + + private List entitlements; + + private EntitlementCreateBuilder() {} + + public EntitlementCreateBuilder action(Action value) { + this.action = value; + return this; + } + + public EntitlementCreateBuilder changeReason(String value) { + this.changeReason = value; + return this; + } + + public EntitlementCreateBuilder entitlements(List value) { + this.entitlements = value; + return this; + } + + public EntitlementCreateParams build() { + return new EntitlementCreateParams(this); + } + } + + public enum Action { + UPSERT("upsert"), + + REMOVE("remove"), + + /** An enum member indicating that Action was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Action(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Action fromString(String value) { + if (value == null) return _UNKNOWN; + for (Action enumValue : Action.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class EntitlementsParams { + + private final String entityId; + + private final String featureId; + + private final EntityType entityType; + + private final String value; + + private final Boolean applyGrandfathering; + + private EntitlementsParams(EntitlementsBuilder builder) { + + this.entityId = builder.entityId; + + this.featureId = builder.featureId; + + this.entityType = builder.entityType; + + this.value = builder.value; + + this.applyGrandfathering = builder.applyGrandfathering; + } + + public String getEntityId() { + return entityId; + } + + public String getFeatureId() { + return featureId; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getValue() { + return value; + } + + public Boolean getApplyGrandfathering() { + return applyGrandfathering; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + if (this.featureId != null) { + + formData.put("feature_id", this.featureId); + } + + if (this.entityType != null) { + + formData.put("entity_type", this.entityType); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + if (this.applyGrandfathering != null) { + + formData.put("apply_grandfathering", this.applyGrandfathering); + } + + return formData; + } + + /** Create a new builder for EntitlementsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EntitlementsBuilder builder() { + return new EntitlementsBuilder(); + } + + public static final class EntitlementsBuilder { + + private String entityId; + + private String featureId; + + private EntityType entityType; + + private String value; + + private Boolean applyGrandfathering; + + private EntitlementsBuilder() {} + + public EntitlementsBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public EntitlementsBuilder featureId(String value) { + this.featureId = value; + return this; + } + + public EntitlementsBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public EntitlementsBuilder value(String value) { + this.value = value; + return this; + } + + public EntitlementsBuilder applyGrandfathering(Boolean value) { + this.applyGrandfathering = value; + return this; + } + + public EntitlementsParams build() { + return new EntitlementsParams(this); + } + } + + public enum EntityType { + PLAN("plan"), + + ADDON("addon"), + + CHARGE("charge"), + + PLAN_PRICE("plan_price"), + + ADDON_PRICE("addon_price"), + + /** 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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/entitlement/params/EntitlementListParams.java b/src/main/java/com/chargebee/v4/models/entitlement/params/EntitlementListParams.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/entitlement/params/EntitlementListParams.java rename to src/main/java/com/chargebee/v4/models/entitlement/params/EntitlementListParams.java index 34404734..fb09f25c 100644 --- a/src/main/java/com/chargebee/v4/core/models/entitlement/params/EntitlementListParams.java +++ b/src/main/java/com/chargebee/v4/models/entitlement/params/EntitlementListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.entitlement.params; +package com.chargebee.v4.models.entitlement.params; import com.chargebee.v4.internal.Recommended; @@ -90,13 +90,13 @@ public static final class FeatureIdFilter { this.builder = builder; } - public EntitlementListBuilder in(String... values) { - builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + public EntitlementListBuilder is(String value) { + builder.queryParams.put(fieldName + "[is]", value); return builder; } - public EntitlementListBuilder is(String value) { - builder.queryParams.put(fieldName + "[is]", value); + public EntitlementListBuilder in(String... values) { + builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); return builder; } } @@ -110,13 +110,13 @@ public static final class EntityTypeFilter { this.builder = builder; } - public EntitlementListBuilder in(String... values) { - builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + public EntitlementListBuilder is(String value) { + builder.queryParams.put(fieldName + "[is]", value); return builder; } - public EntitlementListBuilder is(String value) { - builder.queryParams.put(fieldName + "[is]", value); + public EntitlementListBuilder in(String... values) { + builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); return builder; } } @@ -130,13 +130,13 @@ public static final class EntityIdFilter { this.builder = builder; } - public EntitlementListBuilder in(String... values) { - builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + public EntitlementListBuilder is(String value) { + builder.queryParams.put(fieldName + "[is]", value); return builder; } - public EntitlementListBuilder is(String value) { - builder.queryParams.put(fieldName + "[is]", value); + public EntitlementListBuilder in(String... values) { + builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); return builder; } } diff --git a/src/main/java/com/chargebee/v4/core/responses/entitlement/EntitlementCreateResponse.java b/src/main/java/com/chargebee/v4/models/entitlement/responses/EntitlementCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/entitlement/EntitlementCreateResponse.java rename to src/main/java/com/chargebee/v4/models/entitlement/responses/EntitlementCreateResponse.java index 2b763022..171399d8 100644 --- a/src/main/java/com/chargebee/v4/core/responses/entitlement/EntitlementCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/entitlement/responses/EntitlementCreateResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.entitlement; +package com.chargebee.v4.models.entitlement.responses; import java.util.List; -import com.chargebee.v4.core.models.entitlement.Entitlement; +import com.chargebee.v4.models.entitlement.Entitlement; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/entitlement/EntitlementListResponse.java b/src/main/java/com/chargebee/v4/models/entitlement/responses/EntitlementListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/entitlement/EntitlementListResponse.java rename to src/main/java/com/chargebee/v4/models/entitlement/responses/EntitlementListResponse.java index 2f33f6ae..83526389 100644 --- a/src/main/java/com/chargebee/v4/core/responses/entitlement/EntitlementListResponse.java +++ b/src/main/java/com/chargebee/v4/models/entitlement/responses/EntitlementListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.entitlement; +package com.chargebee.v4.models.entitlement.responses; import java.util.List; -import com.chargebee.v4.core.models.entitlement.Entitlement; +import com.chargebee.v4.models.entitlement.Entitlement; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.EntitlementService; -import com.chargebee.v4.core.models.entitlement.params.EntitlementListParams; +import com.chargebee.v4.services.EntitlementService; +import com.chargebee.v4.models.entitlement.params.EntitlementListParams; /** Immutable response object for EntitlementList operation. Contains paginated list data. */ public final class EntitlementListResponse { @@ -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 EntitlementListResponse nextPage() throws Exception { + public EntitlementListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/models/entitlementOverride/EntitlementOverride.java b/src/main/java/com/chargebee/v4/models/entitlementOverride/EntitlementOverride.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/entitlementOverride/EntitlementOverride.java rename to src/main/java/com/chargebee/v4/models/entitlementOverride/EntitlementOverride.java index 6f07b27c..f7bd3b1f 100644 --- a/src/main/java/com/chargebee/v4/core/models/entitlementOverride/EntitlementOverride.java +++ b/src/main/java/com/chargebee/v4/models/entitlementOverride/EntitlementOverride.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.entitlementOverride; +package com.chargebee.v4.models.entitlementOverride; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/entitlementOverride/params/AddEntitlementOverrideForSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/entitlementOverride/params/AddEntitlementOverrideForSubscriptionParams.java new file mode 100644 index 00000000..bfbf5473 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/entitlementOverride/params/AddEntitlementOverrideForSubscriptionParams.java @@ -0,0 +1,230 @@ +/* + * 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.entitlementOverride.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class AddEntitlementOverrideForSubscriptionParams { + + private final Action action; + + private final List entitlementOverrides; + + private AddEntitlementOverrideForSubscriptionParams( + AddEntitlementOverrideForSubscriptionBuilder builder) { + + this.action = builder.action; + + this.entitlementOverrides = builder.entitlementOverrides; + } + + public Action getAction() { + return action; + } + + public List getEntitlementOverrides() { + return entitlementOverrides; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.action != null) { + + formData.put("action", this.action); + } + + if (this.entitlementOverrides != null) { + + // List of objects + for (int i = 0; i < this.entitlementOverrides.size(); i++) { + EntitlementOverridesParams item = this.entitlementOverrides.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "entitlement_overrides[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for AddEntitlementOverrideForSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddEntitlementOverrideForSubscriptionBuilder builder() { + return new AddEntitlementOverrideForSubscriptionBuilder(); + } + + public static final class AddEntitlementOverrideForSubscriptionBuilder { + + private Action action; + + private List entitlementOverrides; + + private AddEntitlementOverrideForSubscriptionBuilder() {} + + public AddEntitlementOverrideForSubscriptionBuilder action(Action value) { + this.action = value; + return this; + } + + public AddEntitlementOverrideForSubscriptionBuilder entitlementOverrides( + List value) { + this.entitlementOverrides = value; + return this; + } + + public AddEntitlementOverrideForSubscriptionParams build() { + return new AddEntitlementOverrideForSubscriptionParams(this); + } + } + + public enum Action { + UPSERT("upsert"), + + REMOVE("remove"), + + /** An enum member indicating that Action was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Action(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Action fromString(String value) { + if (value == null) return _UNKNOWN; + for (Action enumValue : Action.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class EntitlementOverridesParams { + + private final String featureId; + + private final String value; + + private final Timestamp expiresAt; + + private final Timestamp effectiveFrom; + + private EntitlementOverridesParams(EntitlementOverridesBuilder builder) { + + this.featureId = builder.featureId; + + this.value = builder.value; + + this.expiresAt = builder.expiresAt; + + this.effectiveFrom = builder.effectiveFrom; + } + + public String getFeatureId() { + return featureId; + } + + public String getValue() { + return value; + } + + public Timestamp getExpiresAt() { + return expiresAt; + } + + public Timestamp getEffectiveFrom() { + return effectiveFrom; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.featureId != null) { + + formData.put("feature_id", this.featureId); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + if (this.expiresAt != null) { + + formData.put("expires_at", this.expiresAt); + } + + if (this.effectiveFrom != null) { + + formData.put("effective_from", this.effectiveFrom); + } + + return formData; + } + + /** Create a new builder for EntitlementOverridesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EntitlementOverridesBuilder builder() { + return new EntitlementOverridesBuilder(); + } + + public static final class EntitlementOverridesBuilder { + + private String featureId; + + private String value; + + private Timestamp expiresAt; + + private Timestamp effectiveFrom; + + private EntitlementOverridesBuilder() {} + + public EntitlementOverridesBuilder featureId(String value) { + this.featureId = value; + return this; + } + + public EntitlementOverridesBuilder value(String value) { + this.value = value; + return this; + } + + public EntitlementOverridesBuilder expiresAt(Timestamp value) { + this.expiresAt = value; + return this; + } + + public EntitlementOverridesBuilder effectiveFrom(Timestamp value) { + this.effectiveFrom = value; + return this; + } + + public EntitlementOverridesParams build() { + return new EntitlementOverridesParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/entitlementOverride/params/ListEntitlementOverrideForSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/entitlementOverride/params/ListEntitlementOverrideForSubscriptionParams.java new file mode 100644 index 00000000..089593c7 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/entitlementOverride/params/ListEntitlementOverrideForSubscriptionParams.java @@ -0,0 +1,80 @@ +/* + * 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.entitlementOverride.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ListEntitlementOverrideForSubscriptionParams { + + private final Map queryParams; + + private ListEntitlementOverrideForSubscriptionParams( + ListEntitlementOverrideForSubscriptionBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public ListEntitlementOverrideForSubscriptionBuilder toBuilder() { + ListEntitlementOverrideForSubscriptionBuilder builder = + new ListEntitlementOverrideForSubscriptionBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for ListEntitlementOverrideForSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ListEntitlementOverrideForSubscriptionBuilder builder() { + return new ListEntitlementOverrideForSubscriptionBuilder(); + } + + public static final class ListEntitlementOverrideForSubscriptionBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private ListEntitlementOverrideForSubscriptionBuilder() {} + + public ListEntitlementOverrideForSubscriptionBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public ListEntitlementOverrideForSubscriptionBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + @Deprecated + public ListEntitlementOverrideForSubscriptionBuilder embed(String value) { + queryParams.put("embed", value); + return this; + } + + @Deprecated + public ListEntitlementOverrideForSubscriptionBuilder includeDrafts(Boolean value) { + queryParams.put("include_drafts", value); + return this; + } + + @Deprecated + public ListEntitlementOverrideForSubscriptionBuilder includeScheduledOverrides(Boolean value) { + queryParams.put("include_scheduled_overrides", value); + return this; + } + + public ListEntitlementOverrideForSubscriptionParams build() { + return new ListEntitlementOverrideForSubscriptionParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/entitlementOverride/responses/AddEntitlementOverrideForSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/entitlementOverride/responses/AddEntitlementOverrideForSubscriptionResponse.java new file mode 100644 index 00000000..3a0df2fb --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/entitlementOverride/responses/AddEntitlementOverrideForSubscriptionResponse.java @@ -0,0 +1,84 @@ +package com.chargebee.v4.models.entitlementOverride.responses; + +import java.util.List; + +import com.chargebee.v4.models.entitlementOverride.EntitlementOverride; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for AddEntitlementOverrideForSubscription operation. Contains the + * response data from the API. + */ +public final class AddEntitlementOverrideForSubscriptionResponse extends BaseResponse { + private final List list; + + private AddEntitlementOverrideForSubscriptionResponse(Builder builder) { + super(builder.httpResponse); + + this.list = builder.list; + } + + /** Parse JSON response into AddEntitlementOverrideForSubscriptionResponse object. */ + public static AddEntitlementOverrideForSubscriptionResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into AddEntitlementOverrideForSubscriptionResponse object with HTTP + * response. + */ + public static AddEntitlementOverrideForSubscriptionResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + builder.list( + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(EntitlementOverride::fromJson) + .collect(java.util.stream.Collectors.toList())); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse AddEntitlementOverrideForSubscriptionResponse from JSON", e); + } + } + + /** Create a new builder for AddEntitlementOverrideForSubscriptionResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for AddEntitlementOverrideForSubscriptionResponse. */ + public static class Builder { + + private List list; + + private Response httpResponse; + + private Builder() {} + + public Builder list(List list) { + this.list = list; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public AddEntitlementOverrideForSubscriptionResponse build() { + return new AddEntitlementOverrideForSubscriptionResponse(this); + } + } + + /** Get the list from the response. */ + public List getList() { + return list; + } +} diff --git a/src/main/java/com/chargebee/v4/models/entitlementOverride/responses/ListEntitlementOverrideForSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/entitlementOverride/responses/ListEntitlementOverrideForSubscriptionResponse.java new file mode 100644 index 00000000..e9def75c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/entitlementOverride/responses/ListEntitlementOverrideForSubscriptionResponse.java @@ -0,0 +1,182 @@ +package com.chargebee.v4.models.entitlementOverride.responses; + +import java.util.List; + +import com.chargebee.v4.models.entitlementOverride.EntitlementOverride; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.EntitlementOverrideService; +import com.chargebee.v4.models.entitlementOverride.params.ListEntitlementOverrideForSubscriptionParams; + +/** + * Immutable response object for ListEntitlementOverrideForSubscription operation. Contains + * paginated list data. + */ +public final class ListEntitlementOverrideForSubscriptionResponse { + + private final List list; + + private final String nextOffset; + + private final String subscriptionId; + + private final EntitlementOverrideService service; + private final ListEntitlementOverrideForSubscriptionParams originalParams; + private final Response httpResponse; + + private ListEntitlementOverrideForSubscriptionResponse( + List list, + String nextOffset, + String subscriptionId, + EntitlementOverrideService service, + ListEntitlementOverrideForSubscriptionParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.subscriptionId = subscriptionId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into ListEntitlementOverrideForSubscriptionResponse object (no service + * context). Use this when you only need to read a single page (no nextPage()). + */ + public static ListEntitlementOverrideForSubscriptionResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(EntitlementOverrideListEntitlementOverrideForSubscriptionItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new ListEntitlementOverrideForSubscriptionResponse( + list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ListEntitlementOverrideForSubscriptionResponse from JSON", e); + } + } + + /** + * Parse JSON response into ListEntitlementOverrideForSubscriptionResponse object with service + * context for pagination (enables nextPage()). + */ + public static ListEntitlementOverrideForSubscriptionResponse fromJson( + String json, + EntitlementOverrideService service, + ListEntitlementOverrideForSubscriptionParams originalParams, + String subscriptionId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(EntitlementOverrideListEntitlementOverrideForSubscriptionItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new ListEntitlementOverrideForSubscriptionResponse( + list, nextOffset, subscriptionId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ListEntitlementOverrideForSubscriptionResponse 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 ListEntitlementOverrideForSubscriptionResponse 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)."); + } + + ListEntitlementOverrideForSubscriptionParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : ListEntitlementOverrideForSubscriptionParams.builder()) + .offset(nextOffset) + .build(); + + return service.listEntitlementOverrideForSubscription(subscriptionId, 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 EntitlementOverrideListEntitlementOverrideForSubscriptionItem { + + private EntitlementOverride entitlementOverride; + + public EntitlementOverride getEntitlementOverride() { + return entitlementOverride; + } + + public static EntitlementOverrideListEntitlementOverrideForSubscriptionItem fromJson( + String json) { + EntitlementOverrideListEntitlementOverrideForSubscriptionItem item = + new EntitlementOverrideListEntitlementOverrideForSubscriptionItem(); + + String __entitlementOverrideJson = JsonUtil.getObject(json, "entitlement_override"); + if (__entitlementOverrideJson != null) { + item.entitlementOverride = EntitlementOverride.fromJson(__entitlementOverrideJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/estimate/Estimate.java b/src/main/java/com/chargebee/v4/models/estimate/Estimate.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/estimate/Estimate.java rename to src/main/java/com/chargebee/v4/models/estimate/Estimate.java index 6778263d..fc198bc1 100644 --- a/src/main/java/com/chargebee/v4/core/models/estimate/Estimate.java +++ b/src/main/java/com/chargebee/v4/models/estimate/Estimate.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.estimate; +package com.chargebee.v4.models.estimate; import com.chargebee.v4.internal.JsonUtil; import java.math.BigDecimal; @@ -2043,6 +2043,7 @@ public static class Discounts { private Long amount; private String description; + private String lineItemId; private EntityType entityType; private DiscountType discountType; private String entityId; @@ -2056,6 +2057,10 @@ public String getDescription() { return description; } + public String getLineItemId() { + return lineItemId; + } + public EntityType getEntityType() { return entityType; } @@ -2143,6 +2148,8 @@ public static Discounts fromJson(String json) { obj.description = JsonUtil.getString(json, "description"); + obj.lineItemId = JsonUtil.getString(json, "line_item_id"); + obj.entityType = EntityType.fromString(JsonUtil.getString(json, "entity_type")); obj.discountType = DiscountType.fromString(JsonUtil.getString(json, "discount_type")); @@ -3216,6 +3223,7 @@ public static class Discounts { private Long amount; private String description; + private String lineItemId; private EntityType entityType; private DiscountType discountType; private String entityId; @@ -3229,6 +3237,10 @@ public String getDescription() { return description; } + public String getLineItemId() { + return lineItemId; + } + public EntityType getEntityType() { return entityType; } @@ -3316,6 +3328,8 @@ public static Discounts fromJson(String json) { obj.description = JsonUtil.getString(json, "description"); + obj.lineItemId = JsonUtil.getString(json, "line_item_id"); + obj.entityType = EntityType.fromString(JsonUtil.getString(json, "entity_type")); obj.discountType = DiscountType.fromString(JsonUtil.getString(json, "discount_type")); @@ -4545,6 +4559,7 @@ public static class Discounts { private Long amount; private String description; + private String lineItemId; private EntityType entityType; private DiscountType discountType; private String entityId; @@ -4558,6 +4573,10 @@ public String getDescription() { return description; } + public String getLineItemId() { + return lineItemId; + } + public EntityType getEntityType() { return entityType; } @@ -4645,6 +4664,8 @@ public static Discounts fromJson(String json) { obj.description = JsonUtil.getString(json, "description"); + obj.lineItemId = JsonUtil.getString(json, "line_item_id"); + obj.entityType = EntityType.fromString(JsonUtil.getString(json, "entity_type")); obj.discountType = DiscountType.fromString(JsonUtil.getString(json, "discount_type")); @@ -5547,6 +5568,7 @@ public static class Discounts { private Long amount; private String description; + private String lineItemId; private EntityType entityType; private DiscountType discountType; private String entityId; @@ -5560,6 +5582,10 @@ public String getDescription() { return description; } + public String getLineItemId() { + return lineItemId; + } + public EntityType getEntityType() { return entityType; } @@ -5647,6 +5673,8 @@ public static Discounts fromJson(String json) { obj.description = JsonUtil.getString(json, "description"); + obj.lineItemId = JsonUtil.getString(json, "line_item_id"); + obj.entityType = EntityType.fromString(JsonUtil.getString(json, "entity_type")); obj.discountType = DiscountType.fromString(JsonUtil.getString(json, "discount_type")); diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/AdvanceInvoiceEstimateParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/AdvanceInvoiceEstimateParams.java new file mode 100644 index 00000000..6dbdaff2 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/AdvanceInvoiceEstimateParams.java @@ -0,0 +1,394 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class AdvanceInvoiceEstimateParams { + + private final Integer termsToCharge; + + private final Boolean invoiceImmediately; + + private final ScheduleType scheduleType; + + private final FixedIntervalScheduleParams fixedIntervalSchedule; + + private final List specificDatesSchedule; + + private AdvanceInvoiceEstimateParams(AdvanceInvoiceEstimateBuilder builder) { + + this.termsToCharge = builder.termsToCharge; + + this.invoiceImmediately = builder.invoiceImmediately; + + this.scheduleType = builder.scheduleType; + + this.fixedIntervalSchedule = builder.fixedIntervalSchedule; + + this.specificDatesSchedule = builder.specificDatesSchedule; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + public ScheduleType getScheduleType() { + return scheduleType; + } + + public FixedIntervalScheduleParams getFixedIntervalSchedule() { + return fixedIntervalSchedule; + } + + public List getSpecificDatesSchedule() { + return specificDatesSchedule; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + if (this.scheduleType != null) { + + formData.put("schedule_type", this.scheduleType); + } + + if (this.fixedIntervalSchedule != null) { + + // Single object + Map nestedData = this.fixedIntervalSchedule.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "fixed_interval_schedule[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.specificDatesSchedule != null) { + + // List of objects + for (int i = 0; i < this.specificDatesSchedule.size(); i++) { + SpecificDatesScheduleParams item = this.specificDatesSchedule.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "specific_dates_schedule[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for AdvanceInvoiceEstimateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AdvanceInvoiceEstimateBuilder builder() { + return new AdvanceInvoiceEstimateBuilder(); + } + + public static final class AdvanceInvoiceEstimateBuilder { + + private Integer termsToCharge; + + private Boolean invoiceImmediately; + + private ScheduleType scheduleType; + + private FixedIntervalScheduleParams fixedIntervalSchedule; + + private List specificDatesSchedule; + + private AdvanceInvoiceEstimateBuilder() {} + + public AdvanceInvoiceEstimateBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public AdvanceInvoiceEstimateBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public AdvanceInvoiceEstimateBuilder scheduleType(ScheduleType value) { + this.scheduleType = value; + return this; + } + + public AdvanceInvoiceEstimateBuilder fixedIntervalSchedule(FixedIntervalScheduleParams value) { + this.fixedIntervalSchedule = value; + return this; + } + + public AdvanceInvoiceEstimateBuilder specificDatesSchedule( + List value) { + this.specificDatesSchedule = value; + return this; + } + + public AdvanceInvoiceEstimateParams build() { + return new AdvanceInvoiceEstimateParams(this); + } + } + + public enum ScheduleType { + IMMEDIATE("immediate"), + + SPECIFIC_DATES("specific_dates"), + + FIXED_INTERVALS("fixed_intervals"), + + /** An enum member indicating that ScheduleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ScheduleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ScheduleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ScheduleType enumValue : ScheduleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class FixedIntervalScheduleParams { + + private final Integer numberOfOccurrences; + + private final Integer daysBeforeRenewal; + + private final EndScheduleOn endScheduleOn; + + private final Timestamp endDate; + + private FixedIntervalScheduleParams(FixedIntervalScheduleBuilder builder) { + + this.numberOfOccurrences = builder.numberOfOccurrences; + + this.daysBeforeRenewal = builder.daysBeforeRenewal; + + this.endScheduleOn = builder.endScheduleOn; + + this.endDate = builder.endDate; + } + + public Integer getNumberOfOccurrences() { + return numberOfOccurrences; + } + + public Integer getDaysBeforeRenewal() { + return daysBeforeRenewal; + } + + public EndScheduleOn getEndScheduleOn() { + return endScheduleOn; + } + + public Timestamp getEndDate() { + return endDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.numberOfOccurrences != null) { + + formData.put("number_of_occurrences", this.numberOfOccurrences); + } + + if (this.daysBeforeRenewal != null) { + + formData.put("days_before_renewal", this.daysBeforeRenewal); + } + + if (this.endScheduleOn != null) { + + formData.put("end_schedule_on", this.endScheduleOn); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + return formData; + } + + /** Create a new builder for FixedIntervalScheduleParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static FixedIntervalScheduleBuilder builder() { + return new FixedIntervalScheduleBuilder(); + } + + public static final class FixedIntervalScheduleBuilder { + + private Integer numberOfOccurrences; + + private Integer daysBeforeRenewal; + + private EndScheduleOn endScheduleOn; + + private Timestamp endDate; + + private FixedIntervalScheduleBuilder() {} + + public FixedIntervalScheduleBuilder numberOfOccurrences(Integer value) { + this.numberOfOccurrences = value; + return this; + } + + public FixedIntervalScheduleBuilder daysBeforeRenewal(Integer value) { + this.daysBeforeRenewal = value; + return this; + } + + public FixedIntervalScheduleBuilder endScheduleOn(EndScheduleOn value) { + this.endScheduleOn = value; + return this; + } + + public FixedIntervalScheduleBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public FixedIntervalScheduleParams build() { + return new FixedIntervalScheduleParams(this); + } + } + + public enum EndScheduleOn { + AFTER_NUMBER_OF_INTERVALS("after_number_of_intervals"), + + SPECIFIC_DATE("specific_date"), + + SUBSCRIPTION_END("subscription_end"), + + /** An enum member indicating that EndScheduleOn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EndScheduleOn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EndScheduleOn fromString(String value) { + if (value == null) return _UNKNOWN; + for (EndScheduleOn enumValue : EndScheduleOn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class SpecificDatesScheduleParams { + + private final Integer termsToCharge; + + private final Timestamp date; + + private SpecificDatesScheduleParams(SpecificDatesScheduleBuilder builder) { + + this.termsToCharge = builder.termsToCharge; + + this.date = builder.date; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Timestamp getDate() { + return date; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + return formData; + } + + /** Create a new builder for SpecificDatesScheduleParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SpecificDatesScheduleBuilder builder() { + return new SpecificDatesScheduleBuilder(); + } + + public static final class SpecificDatesScheduleBuilder { + + private Integer termsToCharge; + + private Timestamp date; + + private SpecificDatesScheduleBuilder() {} + + public SpecificDatesScheduleBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public SpecificDatesScheduleBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public SpecificDatesScheduleParams build() { + return new SpecificDatesScheduleParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionForCustomerEstimateParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionForCustomerEstimateParams.java new file mode 100644 index 00000000..633c1571 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionForCustomerEstimateParams.java @@ -0,0 +1,902 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.sql.Timestamp; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class CreateSubscriptionForCustomerEstimateParams { + + private final Map queryParams; + + private CreateSubscriptionForCustomerEstimateParams( + CreateSubscriptionForCustomerEstimateBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public CreateSubscriptionForCustomerEstimateBuilder toBuilder() { + CreateSubscriptionForCustomerEstimateBuilder builder = + new CreateSubscriptionForCustomerEstimateBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for CreateSubscriptionForCustomerEstimateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreateSubscriptionForCustomerEstimateBuilder builder() { + return new CreateSubscriptionForCustomerEstimateBuilder(); + } + + public static final class CreateSubscriptionForCustomerEstimateBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private CreateSubscriptionForCustomerEstimateBuilder() {} + + public CreateSubscriptionForCustomerEstimateBuilder useExistingBalances(Boolean value) { + queryParams.put("use_existing_balances", value); + return this; + } + + public CreateSubscriptionForCustomerEstimateBuilder invoiceImmediately(Boolean value) { + queryParams.put("invoice_immediately", value); + return this; + } + + public CreateSubscriptionForCustomerEstimateBuilder billingCycles(Integer value) { + queryParams.put("billing_cycles", value); + return this; + } + + public CreateSubscriptionForCustomerEstimateBuilder mandatoryAddonsToRemove( + List value) { + queryParams.put("mandatory_addons_to_remove", value); + return this; + } + + public CreateSubscriptionForCustomerEstimateBuilder termsToCharge(Integer value) { + queryParams.put("terms_to_charge", value); + return this; + } + + public CreateSubscriptionForCustomerEstimateBuilder billingAlignmentMode( + BillingAlignmentMode value) { + queryParams.put("billing_alignment_mode", value); + return this; + } + + public CreateSubscriptionForCustomerEstimateBuilder invoiceDate(Timestamp value) { + queryParams.put("invoice_date", value); + return this; + } + + public CreateSubscriptionForCustomerEstimateBuilder couponIds(List value) { + queryParams.put("coupon_ids", value); + return this; + } + + public CreateSubscriptionForCustomerEstimateBuilder subscription(SubscriptionParams value) { + queryParams.put("subscription", value); + return this; + } + + public CreateSubscriptionForCustomerEstimateBuilder shippingAddress( + ShippingAddressParams value) { + queryParams.put("shipping_address", value); + return this; + } + + public CreateSubscriptionForCustomerEstimateBuilder contractTerm(ContractTermParams value) { + queryParams.put("contract_term", value); + return this; + } + + public CreateSubscriptionForCustomerEstimateBuilder addons(AddonsParams value) { + queryParams.put("addons", value); + return this; + } + + public CreateSubscriptionForCustomerEstimateBuilder eventBasedAddons( + EventBasedAddonsParams value) { + queryParams.put("event_based_addons", value); + return this; + } + + public CreateSubscriptionForCustomerEstimateParams build() { + return new CreateSubscriptionForCustomerEstimateParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum SubscriptionOfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that SubscriptionOfflinePaymentMethod was instantiated with an + * unknown value. + */ + _UNKNOWN(null); + private final String value; + + SubscriptionOfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static SubscriptionOfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (SubscriptionOfflinePaymentMethod enumValue : SubscriptionOfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum SubscriptionFreePeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** + * An enum member indicating that SubscriptionFreePeriodUnit was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + SubscriptionFreePeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static SubscriptionFreePeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (SubscriptionFreePeriodUnit enumValue : SubscriptionFreePeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum SubscriptionTrialEndAction { + SITE_DEFAULT("site_default"), + + PLAN_DEFAULT("plan_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** + * An enum member indicating that SubscriptionTrialEndAction was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + SubscriptionTrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static SubscriptionTrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (SubscriptionTrialEndAction enumValue : SubscriptionTrialEndAction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ShippingAddressValidationStatus { + NOT_VALIDATED("not_validated"), + + VALID("valid"), + + PARTIALLY_VALID("partially_valid"), + + INVALID("invalid"), + + /** + * An enum member indicating that ShippingAddressValidationStatus was instantiated with an + * unknown value. + */ + _UNKNOWN(null); + private final String value; + + ShippingAddressValidationStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ShippingAddressValidationStatus fromString(String value) { + if (value == null) return _UNKNOWN; + for (ShippingAddressValidationStatus enumValue : ShippingAddressValidationStatus.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ContractTermActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** + * An enum member indicating that ContractTermActionAtTermEnd was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + ContractTermActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ContractTermActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ContractTermActionAtTermEnd enumValue : ContractTermActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final Map queryParams; + + private SubscriptionParams(SubscriptionBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public SubscriptionBuilder toBuilder() { + SubscriptionBuilder builder = new SubscriptionBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + queryParams.put("id", value); + return this; + } + + public SubscriptionBuilder planId(String value) { + queryParams.put("plan_id", value); + return this; + } + + public SubscriptionBuilder planQuantity(Integer value) { + queryParams.put("plan_quantity", value); + return this; + } + + public SubscriptionBuilder planQuantityInDecimal(String value) { + queryParams.put("plan_quantity_in_decimal", value); + return this; + } + + public SubscriptionBuilder planUnitPrice(Long value) { + queryParams.put("plan_unit_price", value); + return this; + } + + public SubscriptionBuilder planUnitPriceInDecimal(String value) { + queryParams.put("plan_unit_price_in_decimal", value); + return this; + } + + public SubscriptionBuilder setupFee(Long value) { + queryParams.put("setup_fee", value); + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + queryParams.put("trial_end", value); + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + queryParams.put("start_date", value); + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + queryParams.put("offline_payment_method", value); + return this; + } + + public SubscriptionBuilder freePeriod(Integer value) { + queryParams.put("free_period", value); + return this; + } + + public SubscriptionBuilder freePeriodUnit(FreePeriodUnit value) { + queryParams.put("free_period_unit", value); + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + queryParams.put("contract_term_billing_cycle_on_renewal", value); + return this; + } + + public SubscriptionBuilder trialEndAction(TrialEndAction value) { + queryParams.put("trial_end_action", value); + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum FreePeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + FreePeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static FreePeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialEndAction { + SITE_DEFAULT("site_default"), + + PLAN_DEFAULT("plan_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialEndAction enumValue : TrialEndAction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ShippingAddressParams { + + private final Map queryParams; + + private ShippingAddressParams(ShippingAddressBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public ShippingAddressBuilder toBuilder() { + ShippingAddressBuilder builder = new ShippingAddressBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder line1(String value) { + queryParams.put("line1", value); + return this; + } + + public ShippingAddressBuilder line2(String value) { + queryParams.put("line2", value); + return this; + } + + public ShippingAddressBuilder line3(String value) { + queryParams.put("line3", value); + return this; + } + + public ShippingAddressBuilder city(String value) { + queryParams.put("city", value); + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + queryParams.put("state_code", value); + return this; + } + + public ShippingAddressBuilder zip(String value) { + queryParams.put("zip", value); + return this; + } + + public ShippingAddressBuilder country(String value) { + queryParams.put("country", value); + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + queryParams.put("validation_status", value); + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class ContractTermParams { + + private final Map queryParams; + + private ContractTermParams(ContractTermBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public ContractTermBuilder toBuilder() { + ContractTermBuilder builder = new ContractTermBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + queryParams.put("action_at_term_end", value); + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + queryParams.put("cancellation_cutoff_period", value); + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AddonsParams { + + private final Map queryParams; + + private AddonsParams(AddonsBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public AddonsBuilder toBuilder() { + AddonsBuilder builder = new AddonsBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private AddonsBuilder() {} + + public AddonsBuilder id(List value) { + queryParams.put("id", value); + return this; + } + + public AddonsBuilder quantity(List value) { + queryParams.put("quantity", value); + return this; + } + + public AddonsBuilder quantityInDecimal(List value) { + queryParams.put("quantity_in_decimal", value); + return this; + } + + public AddonsBuilder unitPrice(List value) { + queryParams.put("unit_price", value); + return this; + } + + public AddonsBuilder unitPriceInDecimal(List value) { + queryParams.put("unit_price_in_decimal", value); + return this; + } + + public AddonsBuilder billingCycles(List value) { + queryParams.put("billing_cycles", value); + return this; + } + + public AddonsBuilder trialEnd(List value) { + queryParams.put("trial_end", value); + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class EventBasedAddonsParams { + + private final Map queryParams; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public EventBasedAddonsBuilder toBuilder() { + EventBasedAddonsBuilder builder = new EventBasedAddonsBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(List value) { + queryParams.put("id", value); + return this; + } + + public EventBasedAddonsBuilder quantity(List value) { + queryParams.put("quantity", value); + return this; + } + + public EventBasedAddonsBuilder unitPrice(List value) { + queryParams.put("unit_price", value); + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(List value) { + queryParams.put("quantity_in_decimal", value); + return this; + } + + public EventBasedAddonsBuilder unitPriceInDecimal(List value) { + queryParams.put("unit_price_in_decimal", value); + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(List value) { + queryParams.put("service_period_in_days", value); + return this; + } + + public EventBasedAddonsBuilder onEvent(List value) { + queryParams.put("on_event", value); + return this; + } + + public EventBasedAddonsBuilder chargeOnce(List value) { + queryParams.put("charge_once", value); + return this; + } + + public EventBasedAddonsBuilder chargeOn(List value) { + queryParams.put("charge_on", value); + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionItemEstimateParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionItemEstimateParams.java new file mode 100644 index 00000000..1a6698cb --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionItemEstimateParams.java @@ -0,0 +1,2680 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class CreateSubscriptionItemEstimateParams { + + private final Integer billingCycles; + + private final List mandatoryItemsToRemove; + + private final Integer termsToCharge; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final Boolean invoiceImmediately; + + private final Timestamp invoiceDate; + + private final String clientProfileId; + + private final SubscriptionParams subscription; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final CustomerParams customer; + + private final ContractTermParams contractTerm; + + private final List subscriptionItems; + + private final List discounts; + + private final List itemTiers; + + private final List taxProvidersFields; + + private CreateSubscriptionItemEstimateParams(CreateSubscriptionItemEstimateBuilder builder) { + + this.billingCycles = builder.billingCycles; + + this.mandatoryItemsToRemove = builder.mandatoryItemsToRemove; + + this.termsToCharge = builder.termsToCharge; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.invoiceImmediately = builder.invoiceImmediately; + + this.invoiceDate = builder.invoiceDate; + + this.clientProfileId = builder.clientProfileId; + + this.subscription = builder.subscription; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.customer = builder.customer; + + this.contractTerm = builder.contractTerm; + + this.subscriptionItems = builder.subscriptionItems; + + this.discounts = builder.discounts; + + this.itemTiers = builder.itemTiers; + + this.taxProvidersFields = builder.taxProvidersFields; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public List getMandatoryItemsToRemove() { + return mandatoryItemsToRemove; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public String getClientProfileId() { + return clientProfileId; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public CustomerParams getCustomer() { + return customer; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + public List getDiscounts() { + return discounts; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.mandatoryItemsToRemove != null) { + + formData.put("mandatory_items_to_remove", this.mandatoryItemsToRemove); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.clientProfileId != null) { + + formData.put("client_profile_id", this.clientProfileId); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for CreateSubscriptionItemEstimateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreateSubscriptionItemEstimateBuilder builder() { + return new CreateSubscriptionItemEstimateBuilder(); + } + + public static final class CreateSubscriptionItemEstimateBuilder { + + private Integer billingCycles; + + private List mandatoryItemsToRemove; + + private Integer termsToCharge; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private Boolean invoiceImmediately; + + private Timestamp invoiceDate; + + private String clientProfileId; + + private SubscriptionParams subscription; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private CustomerParams customer; + + private ContractTermParams contractTerm; + + private List subscriptionItems; + + private List discounts; + + private List itemTiers; + + private List taxProvidersFields; + + private CreateSubscriptionItemEstimateBuilder() {} + + public CreateSubscriptionItemEstimateBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder mandatoryItemsToRemove(List value) { + this.mandatoryItemsToRemove = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder billingAlignmentMode(BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder clientProfileId(String value) { + this.clientProfileId = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public CreateSubscriptionItemEstimateBuilder taxProvidersFields( + List value) { + this.taxProvidersFields = value; + return this; + } + + public CreateSubscriptionItemEstimateParams build() { + return new CreateSubscriptionItemEstimateParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final Timestamp trialEnd; + + private final Long setupFee; + + private final Timestamp startDate; + + private final String coupon; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final Integer freePeriod; + + private final FreePeriodUnit freePeriodUnit; + + private final Integer contractTermBillingCycleOnRenewal; + + private final TrialEndAction trialEndAction; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.trialEnd = builder.trialEnd; + + this.setupFee = builder.setupFee; + + this.startDate = builder.startDate; + + this.coupon = builder.coupon; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.freePeriod = builder.freePeriod; + + this.freePeriodUnit = builder.freePeriodUnit; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + + this.trialEndAction = builder.trialEndAction; + } + + public String getId() { + return id; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getStartDate() { + return startDate; + } + + public String getCoupon() { + return coupon; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public Integer getFreePeriod() { + return freePeriod; + } + + public FreePeriodUnit getFreePeriodUnit() { + return freePeriodUnit; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + public TrialEndAction getTrialEndAction() { + return trialEndAction; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.freePeriod != null) { + + formData.put("free_period", this.freePeriod); + } + + if (this.freePeriodUnit != null) { + + formData.put("free_period_unit", this.freePeriodUnit); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + if (this.trialEndAction != null) { + + formData.put("trial_end_action", this.trialEndAction); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private Timestamp trialEnd; + + private Long setupFee; + + private Timestamp startDate; + + private String coupon; + + private OfflinePaymentMethod offlinePaymentMethod; + + private Integer freePeriod; + + private FreePeriodUnit freePeriodUnit; + + private Integer contractTermBillingCycleOnRenewal; + + private TrialEndAction trialEndAction; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + @Deprecated + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + @Deprecated + public SubscriptionBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder freePeriod(Integer value) { + this.freePeriod = value; + return this; + } + + public SubscriptionBuilder freePeriodUnit(FreePeriodUnit value) { + this.freePeriodUnit = value; + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionBuilder trialEndAction(TrialEndAction value) { + this.trialEndAction = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum FreePeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + FreePeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static FreePeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialEndAction { + SITE_DEFAULT("site_default"), + + PLAN_DEFAULT("plan_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialEndAction enumValue : TrialEndAction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String line1; + + private final String line2; + + private final String line3; + + private final String city; + + private final String stateCode; + + private final String zip; + + private final String country; + + private final ValidationStatus validationStatus; + + private BillingAddressParams(BillingAddressBuilder builder) { + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + this.city = builder.city; + + this.stateCode = builder.stateCode; + + this.zip = builder.zip; + + this.country = builder.country; + + this.validationStatus = builder.validationStatus; + } + + public String getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + public String getCity() { + return city; + } + + public String getStateCode() { + return stateCode; + } + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + if (this.city != null) { + + formData.put("city", this.city); + } + + if (this.stateCode != null) { + + formData.put("state_code", this.stateCode); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String line1; + + private final String line2; + + private final String line3; + + private final String city; + + private final String stateCode; + + private final String zip; + + private final String country; + + private final ValidationStatus validationStatus; + + private ShippingAddressParams(ShippingAddressBuilder builder) { + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + this.city = builder.city; + + this.stateCode = builder.stateCode; + + this.zip = builder.zip; + + this.country = builder.country; + + this.validationStatus = builder.validationStatus; + } + + public String getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + public String getCity() { + return city; + } + + public String getStateCode() { + return stateCode; + } + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + if (this.city != null) { + + formData.put("city", this.city); + } + + if (this.stateCode != null) { + + formData.put("state_code", this.stateCode); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class CustomerParams { + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final Boolean registeredForGst; + + private final Taxability taxability; + + private final EntityCode entityCode; + + private final String exemptNumber; + + private final List exemptionDetails; + + private final CustomerType customerType; + + private CustomerParams(CustomerBuilder builder) { + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.registeredForGst = builder.registeredForGst; + + this.taxability = builder.taxability; + + this.entityCode = builder.entityCode; + + this.exemptNumber = builder.exemptNumber; + + this.exemptionDetails = builder.exemptionDetails; + + this.customerType = builder.customerType; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public Boolean getRegisteredForGst() { + return registeredForGst; + } + + public Taxability getTaxability() { + return taxability; + } + + public EntityCode getEntityCode() { + return entityCode; + } + + public String getExemptNumber() { + return exemptNumber; + } + + public List getExemptionDetails() { + return exemptionDetails; + } + + public CustomerType getCustomerType() { + return customerType; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.registeredForGst != null) { + + formData.put("registered_for_gst", this.registeredForGst); + } + + if (this.taxability != null) { + + formData.put("taxability", this.taxability); + } + + if (this.entityCode != null) { + + formData.put("entity_code", this.entityCode); + } + + if (this.exemptNumber != null) { + + formData.put("exempt_number", this.exemptNumber); + } + + if (this.exemptionDetails != null) { + + formData.put("exemption_details", JsonUtil.toJson(this.exemptionDetails)); + } + + if (this.customerType != null) { + + formData.put("customer_type", this.customerType); + } + + 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 String vatNumberPrefix; + + private Boolean registeredForGst; + + private Taxability taxability; + + private EntityCode entityCode; + + private String exemptNumber; + + private List exemptionDetails; + + private CustomerType customerType; + + private CustomerBuilder() {} + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder registeredForGst(Boolean value) { + this.registeredForGst = value; + return this; + } + + public CustomerBuilder taxability(Taxability value) { + this.taxability = value; + return this; + } + + public CustomerBuilder entityCode(EntityCode value) { + this.entityCode = value; + return this; + } + + public CustomerBuilder exemptNumber(String value) { + this.exemptNumber = value; + return this; + } + + public CustomerBuilder exemptionDetails(List value) { + this.exemptionDetails = value; + return this; + } + + public CustomerBuilder customerType(CustomerType value) { + this.customerType = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + + public enum Taxability { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Taxability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Taxability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Taxability fromString(String value) { + if (value == null) return _UNKNOWN; + for (Taxability enumValue : Taxability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EntityCode { + A("a"), + + B("b"), + + C("c"), + + D("d"), + + E("e"), + + F("f"), + + G("g"), + + H("h"), + + I("i"), + + J("j"), + + K("k"), + + L("l"), + + M("m"), + + N("n"), + + P("p"), + + Q("q"), + + R("r"), + + MED_1("med1"), + + MED_2("med2"), + + /** An enum member indicating that EntityCode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EntityCode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EntityCode fromString(String value) { + if (value == null) return _UNKNOWN; + for (EntityCode enumValue : EntityCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum CustomerType { + RESIDENTIAL("residential"), + + BUSINESS("business"), + + SENIOR_CITIZEN("senior_citizen"), + + INDUSTRIAL("industrial"), + + /** An enum member indicating that CustomerType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CustomerType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CustomerType fromString(String value) { + if (value == null) return _UNKNOWN; + for (CustomerType enumValue : CustomerType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Timestamp contractStart; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.contractStart = builder.contractStart; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Timestamp getContractStart() { + return contractStart; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.contractStart != null) { + + formData.put("contract_start", this.contractStart); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Timestamp contractStart; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + @Deprecated + public ContractTermBuilder contractStart(Timestamp value) { + this.contractStart = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ItemType itemType; + + private final ChargeOnOption chargeOnOption; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.itemType = builder.itemType; + + this.chargeOnOption = builder.chargeOnOption; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ItemType getItemType() { + return itemType; + } + + public ChargeOnOption getChargeOnOption() { + return chargeOnOption; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.itemType != null) { + + formData.put("item_type", this.itemType); + } + + if (this.chargeOnOption != null) { + + formData.put("charge_on_option", this.chargeOnOption); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ItemType itemType; + + private ChargeOnOption chargeOnOption; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionItemsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionItemsBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public SubscriptionItemsBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { + this.chargeOnOption = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + + 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"), + + /** 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; + } + } + + 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 enum ChargeOnOption { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnOption enumValue : ChargeOnOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DiscountsParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private final Integer quantity; + + private DiscountsParams(DiscountsBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private Integer quantity; + + private DiscountsBuilder() {} + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionItemForCustomerEstimateParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionItemForCustomerEstimateParams.java new file mode 100644 index 00000000..c1aaea24 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionItemForCustomerEstimateParams.java @@ -0,0 +1,2303 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class CreateSubscriptionItemForCustomerEstimateParams { + + private final Boolean useExistingBalances; + + private final Boolean invoiceImmediately; + + private final Integer billingCycles; + + private final List mandatoryItemsToRemove; + + private final Integer termsToCharge; + + private final BillingAlignmentMode billingAlignmentMode; + + private final Timestamp invoiceDate; + + private final List couponIds; + + private final SubscriptionParams subscription; + + private final ShippingAddressParams shippingAddress; + + private final BillingAddressParams billingAddress; + + private final ContractTermParams contractTerm; + + private final BillingOverrideParams billingOverride; + + private final List subscriptionItems; + + private final List discounts; + + private final List itemTiers; + + private CreateSubscriptionItemForCustomerEstimateParams( + CreateSubscriptionItemForCustomerEstimateBuilder builder) { + + this.useExistingBalances = builder.useExistingBalances; + + this.invoiceImmediately = builder.invoiceImmediately; + + this.billingCycles = builder.billingCycles; + + this.mandatoryItemsToRemove = builder.mandatoryItemsToRemove; + + this.termsToCharge = builder.termsToCharge; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.invoiceDate = builder.invoiceDate; + + this.couponIds = builder.couponIds; + + this.subscription = builder.subscription; + + this.shippingAddress = builder.shippingAddress; + + this.billingAddress = builder.billingAddress; + + this.contractTerm = builder.contractTerm; + + this.billingOverride = builder.billingOverride; + + this.subscriptionItems = builder.subscriptionItems; + + this.discounts = builder.discounts; + + this.itemTiers = builder.itemTiers; + } + + public Boolean getUseExistingBalances() { + return useExistingBalances; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public List getMandatoryItemsToRemove() { + return mandatoryItemsToRemove; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public List getCouponIds() { + return couponIds; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public BillingOverrideParams getBillingOverride() { + return billingOverride; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + public List getDiscounts() { + return discounts; + } + + public List getItemTiers() { + return itemTiers; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.useExistingBalances != null) { + + formData.put("use_existing_balances", this.useExistingBalances); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.mandatoryItemsToRemove != null) { + + formData.put("mandatory_items_to_remove", this.mandatoryItemsToRemove); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingOverride != null) { + + // Single object + Map nestedData = this.billingOverride.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_override[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for CreateSubscriptionItemForCustomerEstimateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreateSubscriptionItemForCustomerEstimateBuilder builder() { + return new CreateSubscriptionItemForCustomerEstimateBuilder(); + } + + public static final class CreateSubscriptionItemForCustomerEstimateBuilder { + + private Boolean useExistingBalances; + + private Boolean invoiceImmediately; + + private Integer billingCycles; + + private List mandatoryItemsToRemove; + + private Integer termsToCharge; + + private BillingAlignmentMode billingAlignmentMode; + + private Timestamp invoiceDate; + + private List couponIds; + + private SubscriptionParams subscription; + + private ShippingAddressParams shippingAddress; + + private BillingAddressParams billingAddress; + + private ContractTermParams contractTerm; + + private BillingOverrideParams billingOverride; + + private List subscriptionItems; + + private List discounts; + + private List itemTiers; + + private CreateSubscriptionItemForCustomerEstimateBuilder() {} + + public CreateSubscriptionItemForCustomerEstimateBuilder useExistingBalances(Boolean value) { + this.useExistingBalances = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateBuilder mandatoryItemsToRemove( + List value) { + this.mandatoryItemsToRemove = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateBuilder billingAlignmentMode( + BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateBuilder shippingAddress( + ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateBuilder billingAddress( + BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateBuilder billingOverride( + BillingOverrideParams value) { + this.billingOverride = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateParams build() { + return new CreateSubscriptionItemForCustomerEstimateParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final Timestamp trialEnd; + + private final Long setupFee; + + private final Timestamp startDate; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final Integer freePeriod; + + private final FreePeriodUnit freePeriodUnit; + + private final Integer contractTermBillingCycleOnRenewal; + + private final TrialEndAction trialEndAction; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.trialEnd = builder.trialEnd; + + this.setupFee = builder.setupFee; + + this.startDate = builder.startDate; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.freePeriod = builder.freePeriod; + + this.freePeriodUnit = builder.freePeriodUnit; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + + this.trialEndAction = builder.trialEndAction; + } + + public String getId() { + return id; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getStartDate() { + return startDate; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public Integer getFreePeriod() { + return freePeriod; + } + + public FreePeriodUnit getFreePeriodUnit() { + return freePeriodUnit; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + public TrialEndAction getTrialEndAction() { + return trialEndAction; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.freePeriod != null) { + + formData.put("free_period", this.freePeriod); + } + + if (this.freePeriodUnit != null) { + + formData.put("free_period_unit", this.freePeriodUnit); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + if (this.trialEndAction != null) { + + formData.put("trial_end_action", this.trialEndAction); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private Timestamp trialEnd; + + private Long setupFee; + + private Timestamp startDate; + + private OfflinePaymentMethod offlinePaymentMethod; + + private Integer freePeriod; + + private FreePeriodUnit freePeriodUnit; + + private Integer contractTermBillingCycleOnRenewal; + + private TrialEndAction trialEndAction; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + @Deprecated + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder freePeriod(Integer value) { + this.freePeriod = value; + return this; + } + + public SubscriptionBuilder freePeriodUnit(FreePeriodUnit value) { + this.freePeriodUnit = value; + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionBuilder trialEndAction(TrialEndAction value) { + this.trialEndAction = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum FreePeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + FreePeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static FreePeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialEndAction { + SITE_DEFAULT("site_default"), + + PLAN_DEFAULT("plan_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialEndAction enumValue : TrialEndAction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ShippingAddressParams { + + private final String line1; + + private final String line2; + + private final String line3; + + private final String city; + + private final String stateCode; + + private final String zip; + + private final String country; + + private final ValidationStatus validationStatus; + + private ShippingAddressParams(ShippingAddressBuilder builder) { + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + this.city = builder.city; + + this.stateCode = builder.stateCode; + + this.zip = builder.zip; + + this.country = builder.country; + + this.validationStatus = builder.validationStatus; + } + + public String getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + public String getCity() { + return city; + } + + public String getStateCode() { + return stateCode; + } + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + if (this.city != null) { + + formData.put("city", this.city); + } + + if (this.stateCode != null) { + + formData.put("state_code", this.stateCode); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class BillingAddressParams { + + private final String line1; + + private final String line2; + + private final String line3; + + private final String city; + + private final String stateCode; + + private final String zip; + + private final String country; + + private final ValidationStatus validationStatus; + + private BillingAddressParams(BillingAddressBuilder builder) { + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + this.city = builder.city; + + this.stateCode = builder.stateCode; + + this.zip = builder.zip; + + this.country = builder.country; + + this.validationStatus = builder.validationStatus; + } + + public String getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + public String getCity() { + return city; + } + + public String getStateCode() { + return stateCode; + } + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + if (this.city != null) { + + formData.put("city", this.city); + } + + if (this.stateCode != null) { + + formData.put("state_code", this.stateCode); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Timestamp contractStart; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.contractStart = builder.contractStart; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Timestamp getContractStart() { + return contractStart; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.contractStart != null) { + + formData.put("contract_start", this.contractStart); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Timestamp contractStart; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + @Deprecated + public ContractTermBuilder contractStart(Timestamp value) { + this.contractStart = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingOverrideParams { + + private final Long maxExcessPaymentUsage; + + private final Long maxRefundableCreditsUsage; + + private BillingOverrideParams(BillingOverrideBuilder builder) { + + this.maxExcessPaymentUsage = builder.maxExcessPaymentUsage; + + this.maxRefundableCreditsUsage = builder.maxRefundableCreditsUsage; + } + + public Long getMaxExcessPaymentUsage() { + return maxExcessPaymentUsage; + } + + public Long getMaxRefundableCreditsUsage() { + return maxRefundableCreditsUsage; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.maxExcessPaymentUsage != null) { + + formData.put("max_excess_payment_usage", this.maxExcessPaymentUsage); + } + + if (this.maxRefundableCreditsUsage != null) { + + formData.put("max_refundable_credits_usage", this.maxRefundableCreditsUsage); + } + + return formData; + } + + /** Create a new builder for BillingOverrideParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingOverrideBuilder builder() { + return new BillingOverrideBuilder(); + } + + public static final class BillingOverrideBuilder { + + private Long maxExcessPaymentUsage; + + private Long maxRefundableCreditsUsage; + + private BillingOverrideBuilder() {} + + public BillingOverrideBuilder maxExcessPaymentUsage(Long value) { + this.maxExcessPaymentUsage = value; + return this; + } + + public BillingOverrideBuilder maxRefundableCreditsUsage(Long value) { + this.maxRefundableCreditsUsage = value; + return this; + } + + public BillingOverrideParams build() { + return new BillingOverrideParams(this); + } + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ItemType itemType; + + private final ChargeOnOption chargeOnOption; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.itemType = builder.itemType; + + this.chargeOnOption = builder.chargeOnOption; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ItemType getItemType() { + return itemType; + } + + public ChargeOnOption getChargeOnOption() { + return chargeOnOption; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.itemType != null) { + + formData.put("item_type", this.itemType); + } + + if (this.chargeOnOption != null) { + + formData.put("charge_on_option", this.chargeOnOption); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ItemType itemType; + + private ChargeOnOption chargeOnOption; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionItemsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionItemsBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public SubscriptionItemsBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { + this.chargeOnOption = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + + 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"), + + /** 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; + } + } + + 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 enum ChargeOnOption { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnOption enumValue : ChargeOnOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DiscountsParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private final Integer quantity; + + private DiscountsParams(DiscountsBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private Integer quantity; + + private DiscountsBuilder() {} + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCancelSubscriptionForItemsParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCancelSubscriptionForItemsParams.java new file mode 100644 index 00000000..56aad632 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCancelSubscriptionForItemsParams.java @@ -0,0 +1,623 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class EstimateCancelSubscriptionForItemsParams { + + private final CancelOption cancelOption; + + private final Boolean endOfTerm; + + private final Timestamp cancelAt; + + private final CreditOptionForCurrentTermCharges creditOptionForCurrentTermCharges; + + private final UnbilledChargesOption unbilledChargesOption; + + private final AccountReceivablesHandling accountReceivablesHandling; + + private final RefundableCreditsHandling refundableCreditsHandling; + + private final ContractTermCancelOption contractTermCancelOption; + + private final Timestamp invoiceDate; + + private final String cancelReasonCode; + + private final List subscriptionItems; + + private EstimateCancelSubscriptionForItemsParams( + EstimateCancelSubscriptionForItemsBuilder builder) { + + this.cancelOption = builder.cancelOption; + + this.endOfTerm = builder.endOfTerm; + + this.cancelAt = builder.cancelAt; + + this.creditOptionForCurrentTermCharges = builder.creditOptionForCurrentTermCharges; + + this.unbilledChargesOption = builder.unbilledChargesOption; + + this.accountReceivablesHandling = builder.accountReceivablesHandling; + + this.refundableCreditsHandling = builder.refundableCreditsHandling; + + this.contractTermCancelOption = builder.contractTermCancelOption; + + this.invoiceDate = builder.invoiceDate; + + this.cancelReasonCode = builder.cancelReasonCode; + + this.subscriptionItems = builder.subscriptionItems; + } + + public CancelOption getCancelOption() { + return cancelOption; + } + + public Boolean getEndOfTerm() { + return endOfTerm; + } + + public Timestamp getCancelAt() { + return cancelAt; + } + + public CreditOptionForCurrentTermCharges getCreditOptionForCurrentTermCharges() { + return creditOptionForCurrentTermCharges; + } + + public UnbilledChargesOption getUnbilledChargesOption() { + return unbilledChargesOption; + } + + public AccountReceivablesHandling getAccountReceivablesHandling() { + return accountReceivablesHandling; + } + + public RefundableCreditsHandling getRefundableCreditsHandling() { + return refundableCreditsHandling; + } + + public ContractTermCancelOption getContractTermCancelOption() { + return contractTermCancelOption; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public String getCancelReasonCode() { + return cancelReasonCode; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.cancelOption != null) { + + formData.put("cancel_option", this.cancelOption); + } + + if (this.endOfTerm != null) { + + formData.put("end_of_term", this.endOfTerm); + } + + if (this.cancelAt != null) { + + formData.put("cancel_at", this.cancelAt); + } + + if (this.creditOptionForCurrentTermCharges != null) { + + formData.put( + "credit_option_for_current_term_charges", this.creditOptionForCurrentTermCharges); + } + + if (this.unbilledChargesOption != null) { + + formData.put("unbilled_charges_option", this.unbilledChargesOption); + } + + if (this.accountReceivablesHandling != null) { + + formData.put("account_receivables_handling", this.accountReceivablesHandling); + } + + if (this.refundableCreditsHandling != null) { + + formData.put("refundable_credits_handling", this.refundableCreditsHandling); + } + + if (this.contractTermCancelOption != null) { + + formData.put("contract_term_cancel_option", this.contractTermCancelOption); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.cancelReasonCode != null) { + + formData.put("cancel_reason_code", this.cancelReasonCode); + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for EstimateCancelSubscriptionForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EstimateCancelSubscriptionForItemsBuilder builder() { + return new EstimateCancelSubscriptionForItemsBuilder(); + } + + public static final class EstimateCancelSubscriptionForItemsBuilder { + + private CancelOption cancelOption; + + private Boolean endOfTerm; + + private Timestamp cancelAt; + + private CreditOptionForCurrentTermCharges creditOptionForCurrentTermCharges; + + private UnbilledChargesOption unbilledChargesOption; + + private AccountReceivablesHandling accountReceivablesHandling; + + private RefundableCreditsHandling refundableCreditsHandling; + + private ContractTermCancelOption contractTermCancelOption; + + private Timestamp invoiceDate; + + private String cancelReasonCode; + + private List subscriptionItems; + + private EstimateCancelSubscriptionForItemsBuilder() {} + + public EstimateCancelSubscriptionForItemsBuilder cancelOption(CancelOption value) { + this.cancelOption = value; + return this; + } + + public EstimateCancelSubscriptionForItemsBuilder endOfTerm(Boolean value) { + this.endOfTerm = value; + return this; + } + + public EstimateCancelSubscriptionForItemsBuilder cancelAt(Timestamp value) { + this.cancelAt = value; + return this; + } + + public EstimateCancelSubscriptionForItemsBuilder creditOptionForCurrentTermCharges( + CreditOptionForCurrentTermCharges value) { + this.creditOptionForCurrentTermCharges = value; + return this; + } + + public EstimateCancelSubscriptionForItemsBuilder unbilledChargesOption( + UnbilledChargesOption value) { + this.unbilledChargesOption = value; + return this; + } + + public EstimateCancelSubscriptionForItemsBuilder accountReceivablesHandling( + AccountReceivablesHandling value) { + this.accountReceivablesHandling = value; + return this; + } + + public EstimateCancelSubscriptionForItemsBuilder refundableCreditsHandling( + RefundableCreditsHandling value) { + this.refundableCreditsHandling = value; + return this; + } + + public EstimateCancelSubscriptionForItemsBuilder contractTermCancelOption( + ContractTermCancelOption value) { + this.contractTermCancelOption = value; + return this; + } + + public EstimateCancelSubscriptionForItemsBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public EstimateCancelSubscriptionForItemsBuilder cancelReasonCode(String value) { + this.cancelReasonCode = value; + return this; + } + + public EstimateCancelSubscriptionForItemsBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public EstimateCancelSubscriptionForItemsParams build() { + return new EstimateCancelSubscriptionForItemsParams(this); + } + } + + public enum CancelOption { + IMMEDIATELY("immediately"), + + END_OF_TERM("end_of_term"), + + SPECIFIC_DATE("specific_date"), + + END_OF_BILLING_TERM("end_of_billing_term"), + + /** An enum member indicating that CancelOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CancelOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CancelOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (CancelOption enumValue : CancelOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum CreditOptionForCurrentTermCharges { + NONE("none"), + + PRORATE("prorate"), + + FULL("full"), + + /** + * An enum member indicating that CreditOptionForCurrentTermCharges was instantiated with an + * unknown value. + */ + _UNKNOWN(null); + private final String value; + + CreditOptionForCurrentTermCharges(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CreditOptionForCurrentTermCharges fromString(String value) { + if (value == null) return _UNKNOWN; + for (CreditOptionForCurrentTermCharges enumValue : + CreditOptionForCurrentTermCharges.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum UnbilledChargesOption { + INVOICE("invoice"), + + DELETE("delete"), + + /** + * An enum member indicating that UnbilledChargesOption was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + UnbilledChargesOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static UnbilledChargesOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (UnbilledChargesOption enumValue : UnbilledChargesOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AccountReceivablesHandling { + NO_ACTION("no_action"), + + SCHEDULE_PAYMENT_COLLECTION("schedule_payment_collection"), + + WRITE_OFF("write_off"), + + /** + * An enum member indicating that AccountReceivablesHandling was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + AccountReceivablesHandling(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AccountReceivablesHandling fromString(String value) { + if (value == null) return _UNKNOWN; + for (AccountReceivablesHandling enumValue : AccountReceivablesHandling.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum RefundableCreditsHandling { + NO_ACTION("no_action"), + + SCHEDULE_REFUND("schedule_refund"), + + /** + * An enum member indicating that RefundableCreditsHandling was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + RefundableCreditsHandling(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static RefundableCreditsHandling fromString(String value) { + if (value == null) return _UNKNOWN; + for (RefundableCreditsHandling enumValue : RefundableCreditsHandling.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ContractTermCancelOption { + TERMINATE_IMMEDIATELY("terminate_immediately"), + + END_OF_CONTRACT_TERM("end_of_contract_term"), + + SPECIFIC_DATE("specific_date"), + + END_OF_SUBSCRIPTION_BILLING_TERM("end_of_subscription_billing_term"), + + /** + * An enum member indicating that ContractTermCancelOption was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + ContractTermCancelOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ContractTermCancelOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ContractTermCancelOption enumValue : ContractTermCancelOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer servicePeriodDays; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.servicePeriodDays = builder.servicePeriodDays; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer servicePeriodDays; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCancelSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCancelSubscriptionParams.java new file mode 100644 index 00000000..c924f284 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCancelSubscriptionParams.java @@ -0,0 +1,580 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class EstimateCancelSubscriptionParams { + + private final CancelOption cancelOption; + + private final Boolean endOfTerm; + + private final Timestamp cancelAt; + + private final CreditOptionForCurrentTermCharges creditOptionForCurrentTermCharges; + + private final UnbilledChargesOption unbilledChargesOption; + + private final AccountReceivablesHandling accountReceivablesHandling; + + private final RefundableCreditsHandling refundableCreditsHandling; + + private final ContractTermCancelOption contractTermCancelOption; + + private final Timestamp invoiceDate; + + private final String cancelReasonCode; + + private final List eventBasedAddons; + + private EstimateCancelSubscriptionParams(EstimateCancelSubscriptionBuilder builder) { + + this.cancelOption = builder.cancelOption; + + this.endOfTerm = builder.endOfTerm; + + this.cancelAt = builder.cancelAt; + + this.creditOptionForCurrentTermCharges = builder.creditOptionForCurrentTermCharges; + + this.unbilledChargesOption = builder.unbilledChargesOption; + + this.accountReceivablesHandling = builder.accountReceivablesHandling; + + this.refundableCreditsHandling = builder.refundableCreditsHandling; + + this.contractTermCancelOption = builder.contractTermCancelOption; + + this.invoiceDate = builder.invoiceDate; + + this.cancelReasonCode = builder.cancelReasonCode; + + this.eventBasedAddons = builder.eventBasedAddons; + } + + public CancelOption getCancelOption() { + return cancelOption; + } + + public Boolean getEndOfTerm() { + return endOfTerm; + } + + public Timestamp getCancelAt() { + return cancelAt; + } + + public CreditOptionForCurrentTermCharges getCreditOptionForCurrentTermCharges() { + return creditOptionForCurrentTermCharges; + } + + public UnbilledChargesOption getUnbilledChargesOption() { + return unbilledChargesOption; + } + + public AccountReceivablesHandling getAccountReceivablesHandling() { + return accountReceivablesHandling; + } + + public RefundableCreditsHandling getRefundableCreditsHandling() { + return refundableCreditsHandling; + } + + public ContractTermCancelOption getContractTermCancelOption() { + return contractTermCancelOption; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public String getCancelReasonCode() { + return cancelReasonCode; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.cancelOption != null) { + + formData.put("cancel_option", this.cancelOption); + } + + if (this.endOfTerm != null) { + + formData.put("end_of_term", this.endOfTerm); + } + + if (this.cancelAt != null) { + + formData.put("cancel_at", this.cancelAt); + } + + if (this.creditOptionForCurrentTermCharges != null) { + + formData.put( + "credit_option_for_current_term_charges", this.creditOptionForCurrentTermCharges); + } + + if (this.unbilledChargesOption != null) { + + formData.put("unbilled_charges_option", this.unbilledChargesOption); + } + + if (this.accountReceivablesHandling != null) { + + formData.put("account_receivables_handling", this.accountReceivablesHandling); + } + + if (this.refundableCreditsHandling != null) { + + formData.put("refundable_credits_handling", this.refundableCreditsHandling); + } + + if (this.contractTermCancelOption != null) { + + formData.put("contract_term_cancel_option", this.contractTermCancelOption); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.cancelReasonCode != null) { + + formData.put("cancel_reason_code", this.cancelReasonCode); + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for EstimateCancelSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EstimateCancelSubscriptionBuilder builder() { + return new EstimateCancelSubscriptionBuilder(); + } + + public static final class EstimateCancelSubscriptionBuilder { + + private CancelOption cancelOption; + + private Boolean endOfTerm; + + private Timestamp cancelAt; + + private CreditOptionForCurrentTermCharges creditOptionForCurrentTermCharges; + + private UnbilledChargesOption unbilledChargesOption; + + private AccountReceivablesHandling accountReceivablesHandling; + + private RefundableCreditsHandling refundableCreditsHandling; + + private ContractTermCancelOption contractTermCancelOption; + + private Timestamp invoiceDate; + + private String cancelReasonCode; + + private List eventBasedAddons; + + private EstimateCancelSubscriptionBuilder() {} + + public EstimateCancelSubscriptionBuilder cancelOption(CancelOption value) { + this.cancelOption = value; + return this; + } + + public EstimateCancelSubscriptionBuilder endOfTerm(Boolean value) { + this.endOfTerm = value; + return this; + } + + public EstimateCancelSubscriptionBuilder cancelAt(Timestamp value) { + this.cancelAt = value; + return this; + } + + public EstimateCancelSubscriptionBuilder creditOptionForCurrentTermCharges( + CreditOptionForCurrentTermCharges value) { + this.creditOptionForCurrentTermCharges = value; + return this; + } + + public EstimateCancelSubscriptionBuilder unbilledChargesOption(UnbilledChargesOption value) { + this.unbilledChargesOption = value; + return this; + } + + public EstimateCancelSubscriptionBuilder accountReceivablesHandling( + AccountReceivablesHandling value) { + this.accountReceivablesHandling = value; + return this; + } + + public EstimateCancelSubscriptionBuilder refundableCreditsHandling( + RefundableCreditsHandling value) { + this.refundableCreditsHandling = value; + return this; + } + + public EstimateCancelSubscriptionBuilder contractTermCancelOption( + ContractTermCancelOption value) { + this.contractTermCancelOption = value; + return this; + } + + public EstimateCancelSubscriptionBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public EstimateCancelSubscriptionBuilder cancelReasonCode(String value) { + this.cancelReasonCode = value; + return this; + } + + public EstimateCancelSubscriptionBuilder eventBasedAddons(List value) { + this.eventBasedAddons = value; + return this; + } + + public EstimateCancelSubscriptionParams build() { + return new EstimateCancelSubscriptionParams(this); + } + } + + public enum CancelOption { + IMMEDIATELY("immediately"), + + END_OF_TERM("end_of_term"), + + SPECIFIC_DATE("specific_date"), + + END_OF_BILLING_TERM("end_of_billing_term"), + + /** An enum member indicating that CancelOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CancelOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CancelOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (CancelOption enumValue : CancelOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum CreditOptionForCurrentTermCharges { + NONE("none"), + + PRORATE("prorate"), + + FULL("full"), + + /** + * An enum member indicating that CreditOptionForCurrentTermCharges was instantiated with an + * unknown value. + */ + _UNKNOWN(null); + private final String value; + + CreditOptionForCurrentTermCharges(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CreditOptionForCurrentTermCharges fromString(String value) { + if (value == null) return _UNKNOWN; + for (CreditOptionForCurrentTermCharges enumValue : + CreditOptionForCurrentTermCharges.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum UnbilledChargesOption { + INVOICE("invoice"), + + DELETE("delete"), + + /** + * An enum member indicating that UnbilledChargesOption was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + UnbilledChargesOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static UnbilledChargesOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (UnbilledChargesOption enumValue : UnbilledChargesOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AccountReceivablesHandling { + NO_ACTION("no_action"), + + SCHEDULE_PAYMENT_COLLECTION("schedule_payment_collection"), + + WRITE_OFF("write_off"), + + /** + * An enum member indicating that AccountReceivablesHandling was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + AccountReceivablesHandling(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AccountReceivablesHandling fromString(String value) { + if (value == null) return _UNKNOWN; + for (AccountReceivablesHandling enumValue : AccountReceivablesHandling.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum RefundableCreditsHandling { + NO_ACTION("no_action"), + + SCHEDULE_REFUND("schedule_refund"), + + /** + * An enum member indicating that RefundableCreditsHandling was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + RefundableCreditsHandling(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static RefundableCreditsHandling fromString(String value) { + if (value == null) return _UNKNOWN; + for (RefundableCreditsHandling enumValue : RefundableCreditsHandling.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ContractTermCancelOption { + TERMINATE_IMMEDIATELY("terminate_immediately"), + + END_OF_CONTRACT_TERM("end_of_contract_term"), + + SPECIFIC_DATE("specific_date"), + + END_OF_SUBSCRIPTION_BILLING_TERM("end_of_subscription_billing_term"), + + /** + * An enum member indicating that ContractTermCancelOption was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + ContractTermCancelOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ContractTermCancelOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ContractTermCancelOption enumValue : ContractTermCancelOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final Integer servicePeriodInDays; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.servicePeriodInDays = builder.servicePeriodInDays; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public Integer getServicePeriodInDays() { + return servicePeriodInDays; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.servicePeriodInDays != null) { + + formData.put("service_period_in_days", this.servicePeriodInDays); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private Integer servicePeriodInDays; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { + this.servicePeriodInDays = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateChangeTermEndParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateChangeTermEndParams.java new file mode 100644 index 00000000..8b2eaf67 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateChangeTermEndParams.java @@ -0,0 +1,101 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class EstimateChangeTermEndParams { + + private final Timestamp termEndsAt; + + private final Boolean prorate; + + private final Boolean invoiceImmediately; + + private EstimateChangeTermEndParams(EstimateChangeTermEndBuilder builder) { + + this.termEndsAt = builder.termEndsAt; + + this.prorate = builder.prorate; + + this.invoiceImmediately = builder.invoiceImmediately; + } + + public Timestamp getTermEndsAt() { + return termEndsAt; + } + + public Boolean getProrate() { + return prorate; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.termEndsAt != null) { + + formData.put("term_ends_at", this.termEndsAt); + } + + if (this.prorate != null) { + + formData.put("prorate", this.prorate); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + return formData; + } + + /** Create a new builder for EstimateChangeTermEndParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EstimateChangeTermEndBuilder builder() { + return new EstimateChangeTermEndBuilder(); + } + + public static final class EstimateChangeTermEndBuilder { + + private Timestamp termEndsAt; + + private Boolean prorate; + + private Boolean invoiceImmediately; + + private EstimateChangeTermEndBuilder() {} + + public EstimateChangeTermEndBuilder termEndsAt(Timestamp value) { + this.termEndsAt = value; + return this; + } + + public EstimateChangeTermEndBuilder prorate(Boolean value) { + this.prorate = value; + return this; + } + + public EstimateChangeTermEndBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public EstimateChangeTermEndParams build() { + return new EstimateChangeTermEndParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCreateInvoiceForItemsParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCreateInvoiceForItemsParams.java new file mode 100644 index 00000000..7e94be3c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCreateInvoiceForItemsParams.java @@ -0,0 +1,2229 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class EstimateCreateInvoiceForItemsParams { + + private final String currencyCode; + + private final String invoiceNote; + + private final Boolean removeGeneralNote; + + private final String coupon; + + private final List couponIds; + + private final String authorizationTransactionId; + + private final String paymentSourceId; + + private final AutoCollection autoCollection; + + private final Timestamp invoiceDate; + + private final InvoiceParams invoice; + + private final ShippingAddressParams shippingAddress; + + private final BillingAddressParams billingAddress; + + private final List itemPrices; + + private final List itemTiers; + + private final List charges; + + private final List notesToRemove; + + private final List discounts; + + private final List taxProvidersFields; + + private EstimateCreateInvoiceForItemsParams(EstimateCreateInvoiceForItemsBuilder builder) { + + this.currencyCode = builder.currencyCode; + + this.invoiceNote = builder.invoiceNote; + + this.removeGeneralNote = builder.removeGeneralNote; + + this.coupon = builder.coupon; + + this.couponIds = builder.couponIds; + + this.authorizationTransactionId = builder.authorizationTransactionId; + + this.paymentSourceId = builder.paymentSourceId; + + this.autoCollection = builder.autoCollection; + + this.invoiceDate = builder.invoiceDate; + + this.invoice = builder.invoice; + + this.shippingAddress = builder.shippingAddress; + + this.billingAddress = builder.billingAddress; + + this.itemPrices = builder.itemPrices; + + this.itemTiers = builder.itemTiers; + + this.charges = builder.charges; + + this.notesToRemove = builder.notesToRemove; + + this.discounts = builder.discounts; + + this.taxProvidersFields = builder.taxProvidersFields; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getInvoiceNote() { + return invoiceNote; + } + + public Boolean getRemoveGeneralNote() { + return removeGeneralNote; + } + + public String getCoupon() { + return coupon; + } + + public List getCouponIds() { + return couponIds; + } + + public String getAuthorizationTransactionId() { + return authorizationTransactionId; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public InvoiceParams getInvoice() { + return invoice; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public List getItemPrices() { + return itemPrices; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getCharges() { + return charges; + } + + public List getNotesToRemove() { + return notesToRemove; + } + + public List getDiscounts() { + return discounts; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.invoiceNote != null) { + + formData.put("invoice_note", this.invoiceNote); + } + + if (this.removeGeneralNote != null) { + + formData.put("remove_general_note", this.removeGeneralNote); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.authorizationTransactionId != null) { + + formData.put("authorization_transaction_id", this.authorizationTransactionId); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.invoice != null) { + + // Single object + Map nestedData = this.invoice.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "invoice[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemPrices != null) { + + // List of objects + for (int i = 0; i < this.itemPrices.size(); i++) { + ItemPricesParams item = this.itemPrices.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_prices[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.charges != null) { + + // List of objects + for (int i = 0; i < this.charges.size(); i++) { + ChargesParams item = this.charges.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.notesToRemove != null) { + + // List of objects + for (int i = 0; i < this.notesToRemove.size(); i++) { + NotesToRemoveParams item = this.notesToRemove.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "notes_to_remove[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for EstimateCreateInvoiceForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EstimateCreateInvoiceForItemsBuilder builder() { + return new EstimateCreateInvoiceForItemsBuilder(); + } + + public static final class EstimateCreateInvoiceForItemsBuilder { + + private String currencyCode; + + private String invoiceNote; + + private Boolean removeGeneralNote; + + private String coupon; + + private List couponIds; + + private String authorizationTransactionId; + + private String paymentSourceId; + + private AutoCollection autoCollection; + + private Timestamp invoiceDate; + + private InvoiceParams invoice; + + private ShippingAddressParams shippingAddress; + + private BillingAddressParams billingAddress; + + private List itemPrices; + + private List itemTiers; + + private List charges; + + private List notesToRemove; + + private List discounts; + + private List taxProvidersFields; + + private EstimateCreateInvoiceForItemsBuilder() {} + + public EstimateCreateInvoiceForItemsBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder invoiceNote(String value) { + this.invoiceNote = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder removeGeneralNote(Boolean value) { + this.removeGeneralNote = value; + return this; + } + + @Deprecated + public EstimateCreateInvoiceForItemsBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder authorizationTransactionId(String value) { + this.authorizationTransactionId = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder invoice(InvoiceParams value) { + this.invoice = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder itemPrices(List value) { + this.itemPrices = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder charges(List value) { + this.charges = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder notesToRemove(List value) { + this.notesToRemove = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public EstimateCreateInvoiceForItemsBuilder taxProvidersFields( + List value) { + this.taxProvidersFields = value; + return this; + } + + public EstimateCreateInvoiceForItemsParams build() { + return new EstimateCreateInvoiceForItemsParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class InvoiceParams { + + private final String customerId; + + private final String subscriptionId; + + private final String poNumber; + + private InvoiceParams(InvoiceBuilder builder) { + + this.customerId = builder.customerId; + + this.subscriptionId = builder.subscriptionId; + + this.poNumber = builder.poNumber; + } + + public String getCustomerId() { + return customerId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getPoNumber() { + return poNumber; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + return formData; + } + + /** Create a new builder for InvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceBuilder builder() { + return new InvoiceBuilder(); + } + + public static final class InvoiceBuilder { + + private String customerId; + + private String subscriptionId; + + private String poNumber; + + private InvoiceBuilder() {} + + public InvoiceBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public InvoiceBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public InvoiceBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public InvoiceParams build() { + return new InvoiceParams(this); + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class BillingAddressParams { + + private final String line1; + + private final String line2; + + private final String line3; + + private final String city; + + private final String stateCode; + + private final String zip; + + private final String country; + + private final ValidationStatus validationStatus; + + private BillingAddressParams(BillingAddressBuilder builder) { + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + this.city = builder.city; + + this.stateCode = builder.stateCode; + + this.zip = builder.zip; + + this.country = builder.country; + + this.validationStatus = builder.validationStatus; + } + + public String getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + public String getCity() { + return city; + } + + public String getStateCode() { + return stateCode; + } + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + if (this.city != null) { + + formData.put("city", this.city); + } + + if (this.stateCode != null) { + + formData.put("state_code", this.stateCode); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ItemPricesParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private ItemPricesParams(ItemPricesBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for ItemPricesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemPricesBuilder builder() { + return new ItemPricesBuilder(); + } + + public static final class ItemPricesBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private ItemPricesBuilder() {} + + public ItemPricesBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemPricesBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public ItemPricesBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public ItemPricesBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public ItemPricesBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public ItemPricesBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public ItemPricesBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public ItemPricesParams build() { + return new ItemPricesParams(this); + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ChargesParams { + + private final Long amount; + + private final String amountInDecimal; + + private final String description; + + private final Boolean taxable; + + private final String taxProfileId; + + private final String avalaraTaxCode; + + private final String hsnCode; + + private final String taxjarProductCode; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private ChargesParams(ChargesBuilder builder) { + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.description = builder.description; + + this.taxable = builder.taxable; + + this.taxProfileId = builder.taxProfileId; + + this.avalaraTaxCode = builder.avalaraTaxCode; + + this.hsnCode = builder.hsnCode; + + this.taxjarProductCode = builder.taxjarProductCode; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getDescription() { + return description; + } + + public Boolean getTaxable() { + return taxable; + } + + public String getTaxProfileId() { + return taxProfileId; + } + + public String getAvalaraTaxCode() { + return avalaraTaxCode; + } + + public String getHsnCode() { + return hsnCode; + } + + public String getTaxjarProductCode() { + return taxjarProductCode; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.taxable != null) { + + formData.put("taxable", this.taxable); + } + + if (this.taxProfileId != null) { + + formData.put("tax_profile_id", this.taxProfileId); + } + + if (this.avalaraTaxCode != null) { + + formData.put("avalara_tax_code", this.avalaraTaxCode); + } + + if (this.hsnCode != null) { + + formData.put("hsn_code", this.hsnCode); + } + + if (this.taxjarProductCode != null) { + + formData.put("taxjar_product_code", this.taxjarProductCode); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for ChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargesBuilder builder() { + return new ChargesBuilder(); + } + + public static final class ChargesBuilder { + + private Long amount; + + private String amountInDecimal; + + private String description; + + private Boolean taxable; + + private String taxProfileId; + + private String avalaraTaxCode; + + private String hsnCode; + + private String taxjarProductCode; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private ChargesBuilder() {} + + public ChargesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public ChargesBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public ChargesBuilder description(String value) { + this.description = value; + return this; + } + + public ChargesBuilder taxable(Boolean value) { + this.taxable = value; + return this; + } + + public ChargesBuilder taxProfileId(String value) { + this.taxProfileId = value; + return this; + } + + public ChargesBuilder avalaraTaxCode(String value) { + this.avalaraTaxCode = value; + return this; + } + + public ChargesBuilder hsnCode(String value) { + this.hsnCode = value; + return this; + } + + public ChargesBuilder taxjarProductCode(String value) { + this.taxjarProductCode = value; + return this; + } + + public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public ChargesBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public ChargesBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public ChargesBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public ChargesBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public ChargesParams build() { + return new ChargesParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class NotesToRemoveParams { + + private final EntityType entityType; + + private final String entityId; + + private NotesToRemoveParams(NotesToRemoveBuilder builder) { + + this.entityType = builder.entityType; + + this.entityId = builder.entityId; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + + /** 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.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + return formData; + } + + /** Create a new builder for NotesToRemoveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NotesToRemoveBuilder builder() { + return new NotesToRemoveBuilder(); + } + + public static final class NotesToRemoveBuilder { + + private EntityType entityType; + + private String entityId; + + private NotesToRemoveBuilder() {} + + public NotesToRemoveBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public NotesToRemoveBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public NotesToRemoveParams build() { + return new NotesToRemoveParams(this); + } + } + + public enum EntityType { + CUSTOMER("customer"), + + SUBSCRIPTION("subscription"), + + COUPON("coupon"), + + PLAN_ITEM_PRICE("plan_item_price"), + + ADDON_ITEM_PRICE("addon_item_price"), + + CHARGE_ITEM_PRICE("charge_item_price"), + + /** 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 static final class DiscountsParams { + + private final Number percentage; + + private final Long amount; + + private final Integer quantity; + + private final ApplyOn applyOn; + + private final String itemPriceId; + + private DiscountsParams(DiscountsBuilder builder) { + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.quantity = builder.quantity; + + this.applyOn = builder.applyOn; + + this.itemPriceId = builder.itemPriceId; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getQuantity() { + return quantity; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public String getItemPriceId() { + return itemPriceId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private Number percentage; + + private Long amount; + + private Integer quantity; + + private ApplyOn applyOn; + + private String itemPriceId; + + private DiscountsBuilder() {} + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCreateInvoiceParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCreateInvoiceParams.java new file mode 100644 index 00000000..52909e88 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCreateInvoiceParams.java @@ -0,0 +1,1527 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class EstimateCreateInvoiceParams { + + private final String currencyCode; + + private final String invoiceNote; + + private final Boolean removeGeneralNote; + + private final String coupon; + + private final List couponIds; + + private final String authorizationTransactionId; + + private final String paymentSourceId; + + private final AutoCollection autoCollection; + + private final Timestamp invoiceDate; + + private final InvoiceParams invoice; + + private final ShippingAddressParams shippingAddress; + + private final List addons; + + private final List charges; + + private final List notesToRemove; + + private final List taxProvidersFields; + + private EstimateCreateInvoiceParams(EstimateCreateInvoiceBuilder builder) { + + this.currencyCode = builder.currencyCode; + + this.invoiceNote = builder.invoiceNote; + + this.removeGeneralNote = builder.removeGeneralNote; + + this.coupon = builder.coupon; + + this.couponIds = builder.couponIds; + + this.authorizationTransactionId = builder.authorizationTransactionId; + + this.paymentSourceId = builder.paymentSourceId; + + this.autoCollection = builder.autoCollection; + + this.invoiceDate = builder.invoiceDate; + + this.invoice = builder.invoice; + + this.shippingAddress = builder.shippingAddress; + + this.addons = builder.addons; + + this.charges = builder.charges; + + this.notesToRemove = builder.notesToRemove; + + this.taxProvidersFields = builder.taxProvidersFields; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getInvoiceNote() { + return invoiceNote; + } + + public Boolean getRemoveGeneralNote() { + return removeGeneralNote; + } + + public String getCoupon() { + return coupon; + } + + public List getCouponIds() { + return couponIds; + } + + public String getAuthorizationTransactionId() { + return authorizationTransactionId; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public InvoiceParams getInvoice() { + return invoice; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public List getAddons() { + return addons; + } + + public List getCharges() { + return charges; + } + + public List getNotesToRemove() { + return notesToRemove; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.invoiceNote != null) { + + formData.put("invoice_note", this.invoiceNote); + } + + if (this.removeGeneralNote != null) { + + formData.put("remove_general_note", this.removeGeneralNote); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.authorizationTransactionId != null) { + + formData.put("authorization_transaction_id", this.authorizationTransactionId); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.invoice != null) { + + // Single object + Map nestedData = this.invoice.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "invoice[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.charges != null) { + + // List of objects + for (int i = 0; i < this.charges.size(); i++) { + ChargesParams item = this.charges.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.notesToRemove != null) { + + // List of objects + for (int i = 0; i < this.notesToRemove.size(); i++) { + NotesToRemoveParams item = this.notesToRemove.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "notes_to_remove[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for EstimateCreateInvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EstimateCreateInvoiceBuilder builder() { + return new EstimateCreateInvoiceBuilder(); + } + + public static final class EstimateCreateInvoiceBuilder { + + private String currencyCode; + + private String invoiceNote; + + private Boolean removeGeneralNote; + + private String coupon; + + private List couponIds; + + private String authorizationTransactionId; + + private String paymentSourceId; + + private AutoCollection autoCollection; + + private Timestamp invoiceDate; + + private InvoiceParams invoice; + + private ShippingAddressParams shippingAddress; + + private List addons; + + private List charges; + + private List notesToRemove; + + private List taxProvidersFields; + + private EstimateCreateInvoiceBuilder() {} + + public EstimateCreateInvoiceBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public EstimateCreateInvoiceBuilder invoiceNote(String value) { + this.invoiceNote = value; + return this; + } + + public EstimateCreateInvoiceBuilder removeGeneralNote(Boolean value) { + this.removeGeneralNote = value; + return this; + } + + @Deprecated + public EstimateCreateInvoiceBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public EstimateCreateInvoiceBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public EstimateCreateInvoiceBuilder authorizationTransactionId(String value) { + this.authorizationTransactionId = value; + return this; + } + + public EstimateCreateInvoiceBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public EstimateCreateInvoiceBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public EstimateCreateInvoiceBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public EstimateCreateInvoiceBuilder invoice(InvoiceParams value) { + this.invoice = value; + return this; + } + + public EstimateCreateInvoiceBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public EstimateCreateInvoiceBuilder addons(List value) { + this.addons = value; + return this; + } + + public EstimateCreateInvoiceBuilder charges(List value) { + this.charges = value; + return this; + } + + public EstimateCreateInvoiceBuilder notesToRemove(List value) { + this.notesToRemove = value; + return this; + } + + public EstimateCreateInvoiceBuilder taxProvidersFields(List value) { + this.taxProvidersFields = value; + return this; + } + + public EstimateCreateInvoiceParams build() { + return new EstimateCreateInvoiceParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class InvoiceParams { + + private final String customerId; + + private final String subscriptionId; + + private final String poNumber; + + private InvoiceParams(InvoiceBuilder builder) { + + this.customerId = builder.customerId; + + this.subscriptionId = builder.subscriptionId; + + this.poNumber = builder.poNumber; + } + + public String getCustomerId() { + return customerId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getPoNumber() { + return poNumber; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + return formData; + } + + /** Create a new builder for InvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceBuilder builder() { + return new InvoiceBuilder(); + } + + public static final class InvoiceBuilder { + + private String customerId; + + private String subscriptionId; + + private String poNumber; + + private InvoiceBuilder() {} + + public InvoiceBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public InvoiceBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public InvoiceBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public InvoiceParams build() { + return new InvoiceParams(this); + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public AddonsBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class ChargesParams { + + private final Long amount; + + private final String amountInDecimal; + + private final String description; + + private final Boolean taxable; + + private final String taxProfileId; + + private final String avalaraTaxCode; + + private final String hsnCode; + + private final String taxjarProductCode; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private ChargesParams(ChargesBuilder builder) { + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.description = builder.description; + + this.taxable = builder.taxable; + + this.taxProfileId = builder.taxProfileId; + + this.avalaraTaxCode = builder.avalaraTaxCode; + + this.hsnCode = builder.hsnCode; + + this.taxjarProductCode = builder.taxjarProductCode; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getDescription() { + return description; + } + + public Boolean getTaxable() { + return taxable; + } + + public String getTaxProfileId() { + return taxProfileId; + } + + public String getAvalaraTaxCode() { + return avalaraTaxCode; + } + + public String getHsnCode() { + return hsnCode; + } + + public String getTaxjarProductCode() { + return taxjarProductCode; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.taxable != null) { + + formData.put("taxable", this.taxable); + } + + if (this.taxProfileId != null) { + + formData.put("tax_profile_id", this.taxProfileId); + } + + if (this.avalaraTaxCode != null) { + + formData.put("avalara_tax_code", this.avalaraTaxCode); + } + + if (this.hsnCode != null) { + + formData.put("hsn_code", this.hsnCode); + } + + if (this.taxjarProductCode != null) { + + formData.put("taxjar_product_code", this.taxjarProductCode); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for ChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargesBuilder builder() { + return new ChargesBuilder(); + } + + public static final class ChargesBuilder { + + private Long amount; + + private String amountInDecimal; + + private String description; + + private Boolean taxable; + + private String taxProfileId; + + private String avalaraTaxCode; + + private String hsnCode; + + private String taxjarProductCode; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private ChargesBuilder() {} + + public ChargesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public ChargesBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public ChargesBuilder description(String value) { + this.description = value; + return this; + } + + public ChargesBuilder taxable(Boolean value) { + this.taxable = value; + return this; + } + + public ChargesBuilder taxProfileId(String value) { + this.taxProfileId = value; + return this; + } + + public ChargesBuilder avalaraTaxCode(String value) { + this.avalaraTaxCode = value; + return this; + } + + public ChargesBuilder hsnCode(String value) { + this.hsnCode = value; + return this; + } + + public ChargesBuilder taxjarProductCode(String value) { + this.taxjarProductCode = value; + return this; + } + + public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public ChargesBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public ChargesBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public ChargesBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public ChargesBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public ChargesParams build() { + return new ChargesParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class NotesToRemoveParams { + + private final EntityType entityType; + + private final String entityId; + + private NotesToRemoveParams(NotesToRemoveBuilder builder) { + + this.entityType = builder.entityType; + + this.entityId = builder.entityId; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + + /** 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.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + return formData; + } + + /** Create a new builder for NotesToRemoveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NotesToRemoveBuilder builder() { + return new NotesToRemoveBuilder(); + } + + public static final class NotesToRemoveBuilder { + + private EntityType entityType; + + private String entityId; + + private NotesToRemoveBuilder() {} + + public NotesToRemoveBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public NotesToRemoveBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public NotesToRemoveParams build() { + return new NotesToRemoveParams(this); + } + } + + public enum EntityType { + PLAN("plan"), + + ADDON("addon"), + + CUSTOMER("customer"), + + SUBSCRIPTION("subscription"), + + COUPON("coupon"), + + /** 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 static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCreateSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCreateSubscriptionParams.java new file mode 100644 index 00000000..854c80c8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCreateSubscriptionParams.java @@ -0,0 +1,2269 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class EstimateCreateSubscriptionParams { + + private final Integer billingCycles; + + private final List mandatoryAddonsToRemove; + + private final Integer termsToCharge; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final Boolean invoiceImmediately; + + private final Timestamp invoiceDate; + + private final String clientProfileId; + + private final SubscriptionParams subscription; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final CustomerParams customer; + + private final ContractTermParams contractTerm; + + private final List addons; + + private final List eventBasedAddons; + + private final List taxProvidersFields; + + private EstimateCreateSubscriptionParams(EstimateCreateSubscriptionBuilder builder) { + + this.billingCycles = builder.billingCycles; + + this.mandatoryAddonsToRemove = builder.mandatoryAddonsToRemove; + + this.termsToCharge = builder.termsToCharge; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.invoiceImmediately = builder.invoiceImmediately; + + this.invoiceDate = builder.invoiceDate; + + this.clientProfileId = builder.clientProfileId; + + this.subscription = builder.subscription; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.customer = builder.customer; + + this.contractTerm = builder.contractTerm; + + this.addons = builder.addons; + + this.eventBasedAddons = builder.eventBasedAddons; + + this.taxProvidersFields = builder.taxProvidersFields; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public List getMandatoryAddonsToRemove() { + return mandatoryAddonsToRemove; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public String getClientProfileId() { + return clientProfileId; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public CustomerParams getCustomer() { + return customer; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getAddons() { + return addons; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.mandatoryAddonsToRemove != null) { + + formData.put("mandatory_addons_to_remove", this.mandatoryAddonsToRemove); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.clientProfileId != null) { + + formData.put("client_profile_id", this.clientProfileId); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for EstimateCreateSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EstimateCreateSubscriptionBuilder builder() { + return new EstimateCreateSubscriptionBuilder(); + } + + public static final class EstimateCreateSubscriptionBuilder { + + private Integer billingCycles; + + private List mandatoryAddonsToRemove; + + private Integer termsToCharge; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private Boolean invoiceImmediately; + + private Timestamp invoiceDate; + + private String clientProfileId; + + private SubscriptionParams subscription; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private CustomerParams customer; + + private ContractTermParams contractTerm; + + private List addons; + + private List eventBasedAddons; + + private List taxProvidersFields; + + private EstimateCreateSubscriptionBuilder() {} + + public EstimateCreateSubscriptionBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public EstimateCreateSubscriptionBuilder mandatoryAddonsToRemove(List value) { + this.mandatoryAddonsToRemove = value; + return this; + } + + public EstimateCreateSubscriptionBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public EstimateCreateSubscriptionBuilder billingAlignmentMode(BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public EstimateCreateSubscriptionBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public EstimateCreateSubscriptionBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public EstimateCreateSubscriptionBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public EstimateCreateSubscriptionBuilder clientProfileId(String value) { + this.clientProfileId = value; + return this; + } + + public EstimateCreateSubscriptionBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public EstimateCreateSubscriptionBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public EstimateCreateSubscriptionBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public EstimateCreateSubscriptionBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public EstimateCreateSubscriptionBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public EstimateCreateSubscriptionBuilder addons(List value) { + this.addons = value; + return this; + } + + public EstimateCreateSubscriptionBuilder eventBasedAddons(List value) { + this.eventBasedAddons = value; + return this; + } + + public EstimateCreateSubscriptionBuilder taxProvidersFields( + List value) { + this.taxProvidersFields = value; + return this; + } + + public EstimateCreateSubscriptionParams build() { + return new EstimateCreateSubscriptionParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final String planId; + + private final Integer planQuantity; + + private final String planQuantityInDecimal; + + private final Long planUnitPrice; + + private final String planUnitPriceInDecimal; + + private final Long setupFee; + + private final Timestamp trialEnd; + + private final Timestamp startDate; + + private final String coupon; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final Integer freePeriod; + + private final FreePeriodUnit freePeriodUnit; + + private final Integer contractTermBillingCycleOnRenewal; + + private final TrialEndAction trialEndAction; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + + this.planUnitPrice = builder.planUnitPrice; + + this.planUnitPriceInDecimal = builder.planUnitPriceInDecimal; + + this.setupFee = builder.setupFee; + + this.trialEnd = builder.trialEnd; + + this.startDate = builder.startDate; + + this.coupon = builder.coupon; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.freePeriod = builder.freePeriod; + + this.freePeriodUnit = builder.freePeriodUnit; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + + this.trialEndAction = builder.trialEndAction; + } + + public String getId() { + return id; + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + public Long getPlanUnitPrice() { + return planUnitPrice; + } + + public String getPlanUnitPriceInDecimal() { + return planUnitPriceInDecimal; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Timestamp getStartDate() { + return startDate; + } + + public String getCoupon() { + return coupon; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public Integer getFreePeriod() { + return freePeriod; + } + + public FreePeriodUnit getFreePeriodUnit() { + return freePeriodUnit; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + public TrialEndAction getTrialEndAction() { + return trialEndAction; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + if (this.planUnitPrice != null) { + + formData.put("plan_unit_price", this.planUnitPrice); + } + + if (this.planUnitPriceInDecimal != null) { + + formData.put("plan_unit_price_in_decimal", this.planUnitPriceInDecimal); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.freePeriod != null) { + + formData.put("free_period", this.freePeriod); + } + + if (this.freePeriodUnit != null) { + + formData.put("free_period_unit", this.freePeriodUnit); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + if (this.trialEndAction != null) { + + formData.put("trial_end_action", this.trialEndAction); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private String planId; + + private Integer planQuantity; + + private String planQuantityInDecimal; + + private Long planUnitPrice; + + private String planUnitPriceInDecimal; + + private Long setupFee; + + private Timestamp trialEnd; + + private Timestamp startDate; + + private String coupon; + + private OfflinePaymentMethod offlinePaymentMethod; + + private Integer freePeriod; + + private FreePeriodUnit freePeriodUnit; + + private Integer contractTermBillingCycleOnRenewal; + + private TrialEndAction trialEndAction; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionBuilder planId(String value) { + this.planId = value; + return this; + } + + public SubscriptionBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public SubscriptionBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + public SubscriptionBuilder planUnitPrice(Long value) { + this.planUnitPrice = value; + return this; + } + + public SubscriptionBuilder planUnitPriceInDecimal(String value) { + this.planUnitPriceInDecimal = value; + return this; + } + + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + @Deprecated + public SubscriptionBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder freePeriod(Integer value) { + this.freePeriod = value; + return this; + } + + public SubscriptionBuilder freePeriodUnit(FreePeriodUnit value) { + this.freePeriodUnit = value; + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionBuilder trialEndAction(TrialEndAction value) { + this.trialEndAction = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum FreePeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + FreePeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static FreePeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialEndAction { + SITE_DEFAULT("site_default"), + + PLAN_DEFAULT("plan_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialEndAction enumValue : TrialEndAction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String line1; + + private final String line2; + + private final String line3; + + private final String city; + + private final String stateCode; + + private final String zip; + + private final String country; + + private final ValidationStatus validationStatus; + + private BillingAddressParams(BillingAddressBuilder builder) { + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + this.city = builder.city; + + this.stateCode = builder.stateCode; + + this.zip = builder.zip; + + this.country = builder.country; + + this.validationStatus = builder.validationStatus; + } + + public String getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + public String getCity() { + return city; + } + + public String getStateCode() { + return stateCode; + } + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + if (this.city != null) { + + formData.put("city", this.city); + } + + if (this.stateCode != null) { + + formData.put("state_code", this.stateCode); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String line1; + + private final String line2; + + private final String line3; + + private final String city; + + private final String stateCode; + + private final String zip; + + private final String country; + + private final ValidationStatus validationStatus; + + private ShippingAddressParams(ShippingAddressBuilder builder) { + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + this.city = builder.city; + + this.stateCode = builder.stateCode; + + this.zip = builder.zip; + + this.country = builder.country; + + this.validationStatus = builder.validationStatus; + } + + public String getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + public String getCity() { + return city; + } + + public String getStateCode() { + return stateCode; + } + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + if (this.city != null) { + + formData.put("city", this.city); + } + + if (this.stateCode != null) { + + formData.put("state_code", this.stateCode); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class CustomerParams { + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final Boolean registeredForGst; + + private final Taxability taxability; + + private final EntityCode entityCode; + + private final String exemptNumber; + + private final List exemptionDetails; + + private final CustomerType customerType; + + private CustomerParams(CustomerBuilder builder) { + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.registeredForGst = builder.registeredForGst; + + this.taxability = builder.taxability; + + this.entityCode = builder.entityCode; + + this.exemptNumber = builder.exemptNumber; + + this.exemptionDetails = builder.exemptionDetails; + + this.customerType = builder.customerType; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public Boolean getRegisteredForGst() { + return registeredForGst; + } + + public Taxability getTaxability() { + return taxability; + } + + public EntityCode getEntityCode() { + return entityCode; + } + + public String getExemptNumber() { + return exemptNumber; + } + + public List getExemptionDetails() { + return exemptionDetails; + } + + public CustomerType getCustomerType() { + return customerType; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.registeredForGst != null) { + + formData.put("registered_for_gst", this.registeredForGst); + } + + if (this.taxability != null) { + + formData.put("taxability", this.taxability); + } + + if (this.entityCode != null) { + + formData.put("entity_code", this.entityCode); + } + + if (this.exemptNumber != null) { + + formData.put("exempt_number", this.exemptNumber); + } + + if (this.exemptionDetails != null) { + + formData.put("exemption_details", JsonUtil.toJson(this.exemptionDetails)); + } + + if (this.customerType != null) { + + formData.put("customer_type", this.customerType); + } + + 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 String vatNumberPrefix; + + private Boolean registeredForGst; + + private Taxability taxability; + + private EntityCode entityCode; + + private String exemptNumber; + + private List exemptionDetails; + + private CustomerType customerType; + + private CustomerBuilder() {} + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder registeredForGst(Boolean value) { + this.registeredForGst = value; + return this; + } + + public CustomerBuilder taxability(Taxability value) { + this.taxability = value; + return this; + } + + public CustomerBuilder entityCode(EntityCode value) { + this.entityCode = value; + return this; + } + + public CustomerBuilder exemptNumber(String value) { + this.exemptNumber = value; + return this; + } + + public CustomerBuilder exemptionDetails(List value) { + this.exemptionDetails = value; + return this; + } + + public CustomerBuilder customerType(CustomerType value) { + this.customerType = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + + public enum Taxability { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Taxability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Taxability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Taxability fromString(String value) { + if (value == null) return _UNKNOWN; + for (Taxability enumValue : Taxability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EntityCode { + A("a"), + + B("b"), + + C("c"), + + D("d"), + + E("e"), + + F("f"), + + G("g"), + + H("h"), + + I("i"), + + J("j"), + + K("k"), + + L("l"), + + M("m"), + + N("n"), + + P("p"), + + Q("q"), + + R("r"), + + MED_1("med1"), + + MED_2("med2"), + + /** An enum member indicating that EntityCode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EntityCode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EntityCode fromString(String value) { + if (value == null) return _UNKNOWN; + for (EntityCode enumValue : EntityCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum CustomerType { + RESIDENTIAL("residential"), + + BUSINESS("business"), + + SENIOR_CITIZEN("senior_citizen"), + + INDUSTRIAL("industrial"), + + /** An enum member indicating that CustomerType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CustomerType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CustomerType fromString(String value) { + if (value == null) return _UNKNOWN; + for (CustomerType enumValue : CustomerType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AddonsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private final Integer servicePeriodInDays; + + private final OnEvent onEvent; + + private final Boolean chargeOnce; + + private final ChargeOn chargeOn; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.servicePeriodInDays = builder.servicePeriodInDays; + + this.onEvent = builder.onEvent; + + this.chargeOnce = builder.chargeOnce; + + this.chargeOn = builder.chargeOn; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getServicePeriodInDays() { + return servicePeriodInDays; + } + + public OnEvent getOnEvent() { + return onEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ChargeOn getChargeOn() { + return chargeOn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.servicePeriodInDays != null) { + + formData.put("service_period_in_days", this.servicePeriodInDays); + } + + if (this.onEvent != null) { + + formData.put("on_event", this.onEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.chargeOn != null) { + + formData.put("charge_on", this.chargeOn); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private Integer servicePeriodInDays; + + private OnEvent onEvent; + + private Boolean chargeOnce; + + private ChargeOn chargeOn; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { + this.servicePeriodInDays = value; + return this; + } + + public EventBasedAddonsBuilder onEvent(OnEvent value) { + this.onEvent = value; + return this; + } + + public EventBasedAddonsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public EventBasedAddonsBuilder chargeOn(ChargeOn value) { + this.chargeOn = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + + public enum OnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** An enum member indicating that OnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (OnEvent enumValue : OnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChargeOn { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOn fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOn enumValue : ChargeOn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionForItemsParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionForItemsParams.java new file mode 100644 index 00000000..f9640a0b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionForItemsParams.java @@ -0,0 +1,1456 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class EstimateGiftSubscriptionForItemsParams { + + private final List couponIds; + + private final GiftParams gift; + + private final GifterParams gifter; + + private final GiftReceiverParams giftReceiver; + + private final PaymentIntentParams paymentIntent; + + private final ShippingAddressParams shippingAddress; + + private final List subscriptionItems; + + private final List itemTiers; + + private EstimateGiftSubscriptionForItemsParams(EstimateGiftSubscriptionForItemsBuilder builder) { + + this.couponIds = builder.couponIds; + + this.gift = builder.gift; + + this.gifter = builder.gifter; + + this.giftReceiver = builder.giftReceiver; + + this.paymentIntent = builder.paymentIntent; + + this.shippingAddress = builder.shippingAddress; + + this.subscriptionItems = builder.subscriptionItems; + + this.itemTiers = builder.itemTiers; + } + + public List getCouponIds() { + return couponIds; + } + + public GiftParams getGift() { + return gift; + } + + public GifterParams getGifter() { + return gifter; + } + + public GiftReceiverParams getGiftReceiver() { + return giftReceiver; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + public List getItemTiers() { + return itemTiers; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.gift != null) { + + // Single object + Map nestedData = this.gift.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "gift[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.gifter != null) { + + // Single object + Map nestedData = this.gifter.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "gifter[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.giftReceiver != null) { + + // Single object + Map nestedData = this.giftReceiver.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "gift_receiver[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for EstimateGiftSubscriptionForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EstimateGiftSubscriptionForItemsBuilder builder() { + return new EstimateGiftSubscriptionForItemsBuilder(); + } + + public static final class EstimateGiftSubscriptionForItemsBuilder { + + private List couponIds; + + private GiftParams gift; + + private GifterParams gifter; + + private GiftReceiverParams giftReceiver; + + private PaymentIntentParams paymentIntent; + + private ShippingAddressParams shippingAddress; + + private List subscriptionItems; + + private List itemTiers; + + private EstimateGiftSubscriptionForItemsBuilder() {} + + public EstimateGiftSubscriptionForItemsBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public EstimateGiftSubscriptionForItemsBuilder gift(GiftParams value) { + this.gift = value; + return this; + } + + public EstimateGiftSubscriptionForItemsBuilder gifter(GifterParams value) { + this.gifter = value; + return this; + } + + public EstimateGiftSubscriptionForItemsBuilder giftReceiver(GiftReceiverParams value) { + this.giftReceiver = value; + return this; + } + + public EstimateGiftSubscriptionForItemsBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public EstimateGiftSubscriptionForItemsBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public EstimateGiftSubscriptionForItemsBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public EstimateGiftSubscriptionForItemsBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public EstimateGiftSubscriptionForItemsParams build() { + return new EstimateGiftSubscriptionForItemsParams(this); + } + } + + public static final class GiftParams { + + private final Timestamp scheduledAt; + + private final Boolean autoClaim; + + private final Boolean noExpiry; + + private final Timestamp claimExpiryDate; + + private GiftParams(GiftBuilder builder) { + + this.scheduledAt = builder.scheduledAt; + + this.autoClaim = builder.autoClaim; + + this.noExpiry = builder.noExpiry; + + this.claimExpiryDate = builder.claimExpiryDate; + } + + public Timestamp getScheduledAt() { + return scheduledAt; + } + + public Boolean getAutoClaim() { + return autoClaim; + } + + public Boolean getNoExpiry() { + return noExpiry; + } + + public Timestamp getClaimExpiryDate() { + return claimExpiryDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.scheduledAt != null) { + + formData.put("scheduled_at", this.scheduledAt); + } + + if (this.autoClaim != null) { + + formData.put("auto_claim", this.autoClaim); + } + + if (this.noExpiry != null) { + + formData.put("no_expiry", this.noExpiry); + } + + if (this.claimExpiryDate != null) { + + formData.put("claim_expiry_date", this.claimExpiryDate); + } + + return formData; + } + + /** Create a new builder for GiftParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GiftBuilder builder() { + return new GiftBuilder(); + } + + public static final class GiftBuilder { + + private Timestamp scheduledAt; + + private Boolean autoClaim; + + private Boolean noExpiry; + + private Timestamp claimExpiryDate; + + private GiftBuilder() {} + + public GiftBuilder scheduledAt(Timestamp value) { + this.scheduledAt = value; + return this; + } + + public GiftBuilder autoClaim(Boolean value) { + this.autoClaim = value; + return this; + } + + public GiftBuilder noExpiry(Boolean value) { + this.noExpiry = value; + return this; + } + + public GiftBuilder claimExpiryDate(Timestamp value) { + this.claimExpiryDate = value; + return this; + } + + public GiftParams build() { + return new GiftParams(this); + } + } + } + + public static final class GifterParams { + + private final String customerId; + + private final String signature; + + private final String note; + + private final String paymentSrcId; + + private GifterParams(GifterBuilder builder) { + + this.customerId = builder.customerId; + + this.signature = builder.signature; + + this.note = builder.note; + + this.paymentSrcId = builder.paymentSrcId; + } + + public String getCustomerId() { + return customerId; + } + + public String getSignature() { + return signature; + } + + public String getNote() { + return note; + } + + public String getPaymentSrcId() { + return paymentSrcId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.signature != null) { + + formData.put("signature", this.signature); + } + + if (this.note != null) { + + formData.put("note", this.note); + } + + if (this.paymentSrcId != null) { + + formData.put("payment_src_id", this.paymentSrcId); + } + + return formData; + } + + /** Create a new builder for GifterParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GifterBuilder builder() { + return new GifterBuilder(); + } + + public static final class GifterBuilder { + + private String customerId; + + private String signature; + + private String note; + + private String paymentSrcId; + + private GifterBuilder() {} + + public GifterBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public GifterBuilder signature(String value) { + this.signature = value; + return this; + } + + public GifterBuilder note(String value) { + this.note = value; + return this; + } + + public GifterBuilder paymentSrcId(String value) { + this.paymentSrcId = value; + return this; + } + + public GifterParams build() { + return new GifterParams(this); + } + } + } + + public static final class GiftReceiverParams { + + private final String customerId; + + private final String firstName; + + private final String lastName; + + private final String email; + + private GiftReceiverParams(GiftReceiverBuilder builder) { + + this.customerId = builder.customerId; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + } + + public String getCustomerId() { + return customerId; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getEmail() { + return email; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + 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); + } + + return formData; + } + + /** Create a new builder for GiftReceiverParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GiftReceiverBuilder builder() { + return new GiftReceiverBuilder(); + } + + public static final class GiftReceiverBuilder { + + private String customerId; + + private String firstName; + + private String lastName; + + private String email; + + private GiftReceiverBuilder() {} + + public GiftReceiverBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public GiftReceiverBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public GiftReceiverBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public GiftReceiverBuilder email(String value) { + this.email = value; + return this; + } + + public GiftReceiverParams build() { + return new GiftReceiverParams(this); + } + } + } + + public static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionParams.java new file mode 100644 index 00000000..1f8896fa --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionParams.java @@ -0,0 +1,1330 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class EstimateGiftSubscriptionParams { + + private final List couponIds; + + private final GiftParams gift; + + private final GifterParams gifter; + + private final GiftReceiverParams giftReceiver; + + private final PaymentIntentParams paymentIntent; + + private final ShippingAddressParams shippingAddress; + + private final SubscriptionParams subscription; + + private final List addons; + + private EstimateGiftSubscriptionParams(EstimateGiftSubscriptionBuilder builder) { + + this.couponIds = builder.couponIds; + + this.gift = builder.gift; + + this.gifter = builder.gifter; + + this.giftReceiver = builder.giftReceiver; + + this.paymentIntent = builder.paymentIntent; + + this.shippingAddress = builder.shippingAddress; + + this.subscription = builder.subscription; + + this.addons = builder.addons; + } + + public List getCouponIds() { + return couponIds; + } + + public GiftParams getGift() { + return gift; + } + + public GifterParams getGifter() { + return gifter; + } + + public GiftReceiverParams getGiftReceiver() { + return giftReceiver; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public List getAddons() { + return addons; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.gift != null) { + + // Single object + Map nestedData = this.gift.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "gift[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.gifter != null) { + + // Single object + Map nestedData = this.gifter.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "gifter[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.giftReceiver != null) { + + // Single object + Map nestedData = this.giftReceiver.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "gift_receiver[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for EstimateGiftSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EstimateGiftSubscriptionBuilder builder() { + return new EstimateGiftSubscriptionBuilder(); + } + + public static final class EstimateGiftSubscriptionBuilder { + + private List couponIds; + + private GiftParams gift; + + private GifterParams gifter; + + private GiftReceiverParams giftReceiver; + + private PaymentIntentParams paymentIntent; + + private ShippingAddressParams shippingAddress; + + private SubscriptionParams subscription; + + private List addons; + + private EstimateGiftSubscriptionBuilder() {} + + public EstimateGiftSubscriptionBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public EstimateGiftSubscriptionBuilder gift(GiftParams value) { + this.gift = value; + return this; + } + + public EstimateGiftSubscriptionBuilder gifter(GifterParams value) { + this.gifter = value; + return this; + } + + public EstimateGiftSubscriptionBuilder giftReceiver(GiftReceiverParams value) { + this.giftReceiver = value; + return this; + } + + public EstimateGiftSubscriptionBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public EstimateGiftSubscriptionBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public EstimateGiftSubscriptionBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public EstimateGiftSubscriptionBuilder addons(List value) { + this.addons = value; + return this; + } + + public EstimateGiftSubscriptionParams build() { + return new EstimateGiftSubscriptionParams(this); + } + } + + public static final class GiftParams { + + private final Timestamp scheduledAt; + + private final Boolean autoClaim; + + private final Boolean noExpiry; + + private final Timestamp claimExpiryDate; + + private GiftParams(GiftBuilder builder) { + + this.scheduledAt = builder.scheduledAt; + + this.autoClaim = builder.autoClaim; + + this.noExpiry = builder.noExpiry; + + this.claimExpiryDate = builder.claimExpiryDate; + } + + public Timestamp getScheduledAt() { + return scheduledAt; + } + + public Boolean getAutoClaim() { + return autoClaim; + } + + public Boolean getNoExpiry() { + return noExpiry; + } + + public Timestamp getClaimExpiryDate() { + return claimExpiryDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.scheduledAt != null) { + + formData.put("scheduled_at", this.scheduledAt); + } + + if (this.autoClaim != null) { + + formData.put("auto_claim", this.autoClaim); + } + + if (this.noExpiry != null) { + + formData.put("no_expiry", this.noExpiry); + } + + if (this.claimExpiryDate != null) { + + formData.put("claim_expiry_date", this.claimExpiryDate); + } + + return formData; + } + + /** Create a new builder for GiftParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GiftBuilder builder() { + return new GiftBuilder(); + } + + public static final class GiftBuilder { + + private Timestamp scheduledAt; + + private Boolean autoClaim; + + private Boolean noExpiry; + + private Timestamp claimExpiryDate; + + private GiftBuilder() {} + + public GiftBuilder scheduledAt(Timestamp value) { + this.scheduledAt = value; + return this; + } + + public GiftBuilder autoClaim(Boolean value) { + this.autoClaim = value; + return this; + } + + public GiftBuilder noExpiry(Boolean value) { + this.noExpiry = value; + return this; + } + + public GiftBuilder claimExpiryDate(Timestamp value) { + this.claimExpiryDate = value; + return this; + } + + public GiftParams build() { + return new GiftParams(this); + } + } + } + + public static final class GifterParams { + + private final String customerId; + + private final String signature; + + private final String note; + + private final String paymentSrcId; + + private GifterParams(GifterBuilder builder) { + + this.customerId = builder.customerId; + + this.signature = builder.signature; + + this.note = builder.note; + + this.paymentSrcId = builder.paymentSrcId; + } + + public String getCustomerId() { + return customerId; + } + + public String getSignature() { + return signature; + } + + public String getNote() { + return note; + } + + public String getPaymentSrcId() { + return paymentSrcId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.signature != null) { + + formData.put("signature", this.signature); + } + + if (this.note != null) { + + formData.put("note", this.note); + } + + if (this.paymentSrcId != null) { + + formData.put("payment_src_id", this.paymentSrcId); + } + + return formData; + } + + /** Create a new builder for GifterParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GifterBuilder builder() { + return new GifterBuilder(); + } + + public static final class GifterBuilder { + + private String customerId; + + private String signature; + + private String note; + + private String paymentSrcId; + + private GifterBuilder() {} + + public GifterBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public GifterBuilder signature(String value) { + this.signature = value; + return this; + } + + public GifterBuilder note(String value) { + this.note = value; + return this; + } + + public GifterBuilder paymentSrcId(String value) { + this.paymentSrcId = value; + return this; + } + + public GifterParams build() { + return new GifterParams(this); + } + } + } + + public static final class GiftReceiverParams { + + private final String customerId; + + private final String firstName; + + private final String lastName; + + private final String email; + + private GiftReceiverParams(GiftReceiverBuilder builder) { + + this.customerId = builder.customerId; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + } + + public String getCustomerId() { + return customerId; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getEmail() { + return email; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + 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); + } + + return formData; + } + + /** Create a new builder for GiftReceiverParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GiftReceiverBuilder builder() { + return new GiftReceiverBuilder(); + } + + public static final class GiftReceiverBuilder { + + private String customerId; + + private String firstName; + + private String lastName; + + private String email; + + private GiftReceiverBuilder() {} + + public GiftReceiverBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public GiftReceiverBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public GiftReceiverBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public GiftReceiverBuilder email(String value) { + this.email = value; + return this; + } + + public GiftReceiverParams build() { + return new GiftReceiverParams(this); + } + } + } + + public static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class SubscriptionParams { + + private final String planId; + + private final Integer planQuantity; + + private final String planQuantityInDecimal; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String planId; + + private Integer planQuantity; + + private String planQuantityInDecimal; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder planId(String value) { + this.planId = value; + return this; + } + + public SubscriptionBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public SubscriptionBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimatePauseSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimatePauseSubscriptionParams.java new file mode 100644 index 00000000..2b463d6d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimatePauseSubscriptionParams.java @@ -0,0 +1,257 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class EstimatePauseSubscriptionParams { + + private final PauseOption pauseOption; + + private final UnbilledChargesHandling unbilledChargesHandling; + + private final SubscriptionParams subscription; + + private EstimatePauseSubscriptionParams(EstimatePauseSubscriptionBuilder builder) { + + this.pauseOption = builder.pauseOption; + + this.unbilledChargesHandling = builder.unbilledChargesHandling; + + this.subscription = builder.subscription; + } + + public PauseOption getPauseOption() { + return pauseOption; + } + + public UnbilledChargesHandling getUnbilledChargesHandling() { + return unbilledChargesHandling; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.pauseOption != null) { + + formData.put("pause_option", this.pauseOption); + } + + if (this.unbilledChargesHandling != null) { + + formData.put("unbilled_charges_handling", this.unbilledChargesHandling); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for EstimatePauseSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EstimatePauseSubscriptionBuilder builder() { + return new EstimatePauseSubscriptionBuilder(); + } + + public static final class EstimatePauseSubscriptionBuilder { + + private PauseOption pauseOption; + + private UnbilledChargesHandling unbilledChargesHandling; + + private SubscriptionParams subscription; + + private EstimatePauseSubscriptionBuilder() {} + + public EstimatePauseSubscriptionBuilder pauseOption(PauseOption value) { + this.pauseOption = value; + return this; + } + + public EstimatePauseSubscriptionBuilder unbilledChargesHandling(UnbilledChargesHandling value) { + this.unbilledChargesHandling = value; + return this; + } + + public EstimatePauseSubscriptionBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public EstimatePauseSubscriptionParams build() { + return new EstimatePauseSubscriptionParams(this); + } + } + + public enum PauseOption { + IMMEDIATELY("immediately"), + + END_OF_TERM("end_of_term"), + + SPECIFIC_DATE("specific_date"), + + BILLING_CYCLES("billing_cycles"), + + /** An enum member indicating that PauseOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PauseOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PauseOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (PauseOption enumValue : PauseOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum UnbilledChargesHandling { + NO_ACTION("no_action"), + + INVOICE("invoice"), + + /** + * An enum member indicating that UnbilledChargesHandling was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + UnbilledChargesHandling(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static UnbilledChargesHandling fromString(String value) { + if (value == null) return _UNKNOWN; + for (UnbilledChargesHandling enumValue : UnbilledChargesHandling.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final Timestamp pauseDate; + + private final Timestamp resumeDate; + + private final Integer skipBillingCycles; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.pauseDate = builder.pauseDate; + + this.resumeDate = builder.resumeDate; + + this.skipBillingCycles = builder.skipBillingCycles; + } + + public Timestamp getPauseDate() { + return pauseDate; + } + + public Timestamp getResumeDate() { + return resumeDate; + } + + public Integer getSkipBillingCycles() { + return skipBillingCycles; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.pauseDate != null) { + + formData.put("pause_date", this.pauseDate); + } + + if (this.resumeDate != null) { + + formData.put("resume_date", this.resumeDate); + } + + if (this.skipBillingCycles != null) { + + formData.put("skip_billing_cycles", this.skipBillingCycles); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private Timestamp pauseDate; + + private Timestamp resumeDate; + + private Integer skipBillingCycles; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder pauseDate(Timestamp value) { + this.pauseDate = value; + return this; + } + + public SubscriptionBuilder resumeDate(Timestamp value) { + this.resumeDate = value; + return this; + } + + public SubscriptionBuilder skipBillingCycles(Integer value) { + this.skipBillingCycles = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimatePaymentSchedulesParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimatePaymentSchedulesParams.java new file mode 100644 index 00000000..4cf09ae8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimatePaymentSchedulesParams.java @@ -0,0 +1,121 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class EstimatePaymentSchedulesParams { + + private final String schemeId; + + private final Long amount; + + private final String invoiceId; + + private final Timestamp paymentScheduleStartDate; + + private EstimatePaymentSchedulesParams(EstimatePaymentSchedulesBuilder builder) { + + this.schemeId = builder.schemeId; + + this.amount = builder.amount; + + this.invoiceId = builder.invoiceId; + + this.paymentScheduleStartDate = builder.paymentScheduleStartDate; + } + + public String getSchemeId() { + return schemeId; + } + + public Long getAmount() { + return amount; + } + + public String getInvoiceId() { + return invoiceId; + } + + public Timestamp getPaymentScheduleStartDate() { + return paymentScheduleStartDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.schemeId != null) { + + formData.put("scheme_id", this.schemeId); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.invoiceId != null) { + + formData.put("invoice_id", this.invoiceId); + } + + if (this.paymentScheduleStartDate != null) { + + formData.put("payment_schedule_start_date", this.paymentScheduleStartDate); + } + + return formData; + } + + /** Create a new builder for EstimatePaymentSchedulesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EstimatePaymentSchedulesBuilder builder() { + return new EstimatePaymentSchedulesBuilder(); + } + + public static final class EstimatePaymentSchedulesBuilder { + + private String schemeId; + + private Long amount; + + private String invoiceId; + + private Timestamp paymentScheduleStartDate; + + private EstimatePaymentSchedulesBuilder() {} + + public EstimatePaymentSchedulesBuilder schemeId(String value) { + this.schemeId = value; + return this; + } + + public EstimatePaymentSchedulesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public EstimatePaymentSchedulesBuilder invoiceId(String value) { + this.invoiceId = value; + return this; + } + + public EstimatePaymentSchedulesBuilder paymentScheduleStartDate(Timestamp value) { + this.paymentScheduleStartDate = value; + return this; + } + + public EstimatePaymentSchedulesParams build() { + return new EstimatePaymentSchedulesParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateResumeSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateResumeSubscriptionParams.java new file mode 100644 index 00000000..1f1d42c9 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateResumeSubscriptionParams.java @@ -0,0 +1,210 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class EstimateResumeSubscriptionParams { + + private final ResumeOption resumeOption; + + private final ChargesHandling chargesHandling; + + private final SubscriptionParams subscription; + + private EstimateResumeSubscriptionParams(EstimateResumeSubscriptionBuilder builder) { + + this.resumeOption = builder.resumeOption; + + this.chargesHandling = builder.chargesHandling; + + this.subscription = builder.subscription; + } + + public ResumeOption getResumeOption() { + return resumeOption; + } + + public ChargesHandling getChargesHandling() { + return chargesHandling; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.resumeOption != null) { + + formData.put("resume_option", this.resumeOption); + } + + if (this.chargesHandling != null) { + + formData.put("charges_handling", this.chargesHandling); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for EstimateResumeSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EstimateResumeSubscriptionBuilder builder() { + return new EstimateResumeSubscriptionBuilder(); + } + + public static final class EstimateResumeSubscriptionBuilder { + + private ResumeOption resumeOption; + + private ChargesHandling chargesHandling; + + private SubscriptionParams subscription; + + private EstimateResumeSubscriptionBuilder() {} + + public EstimateResumeSubscriptionBuilder resumeOption(ResumeOption value) { + this.resumeOption = value; + return this; + } + + public EstimateResumeSubscriptionBuilder chargesHandling(ChargesHandling value) { + this.chargesHandling = value; + return this; + } + + public EstimateResumeSubscriptionBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public EstimateResumeSubscriptionParams build() { + return new EstimateResumeSubscriptionParams(this); + } + } + + public enum ResumeOption { + IMMEDIATELY("immediately"), + + SPECIFIC_DATE("specific_date"), + + /** An enum member indicating that ResumeOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ResumeOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ResumeOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ResumeOption enumValue : ResumeOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChargesHandling { + INVOICE_IMMEDIATELY("invoice_immediately"), + + ADD_TO_UNBILLED_CHARGES("add_to_unbilled_charges"), + + /** An enum member indicating that ChargesHandling was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargesHandling(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargesHandling fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargesHandling enumValue : ChargesHandling.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final Timestamp resumeDate; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.resumeDate = builder.resumeDate; + } + + public Timestamp getResumeDate() { + return resumeDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.resumeDate != null) { + + formData.put("resume_date", this.resumeDate); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private Timestamp resumeDate; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder resumeDate(Timestamp value) { + this.resumeDate = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateUpdateSubscriptionForItemsParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateUpdateSubscriptionForItemsParams.java new file mode 100644 index 00000000..3bc10fb3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateUpdateSubscriptionForItemsParams.java @@ -0,0 +1,2733 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class EstimateUpdateSubscriptionForItemsParams { + + private final Timestamp changesScheduledAt; + + private final ChangeOption changeOption; + + private final List mandatoryItemsToRemove; + + private final Boolean replaceItemsList; + + private final Timestamp invoiceDate; + + private final Integer billingCycles; + + private final Integer termsToCharge; + + private final Timestamp reactivateFrom; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final Boolean replaceCouponList; + + private final Boolean prorate; + + private final Boolean endOfTerm; + + private final Boolean forceTermReset; + + private final Boolean reactivate; + + private final Boolean includeDelayedCharges; + + private final Boolean useExistingBalances; + + private final Boolean invoiceImmediately; + + private final Boolean invoiceUsages; + + private final SubscriptionParams subscription; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final CustomerParams customer; + + private final BillingOverrideParams billingOverride; + + private final List subscriptionItems; + + private final List discounts; + + private final List itemTiers; + + private EstimateUpdateSubscriptionForItemsParams( + EstimateUpdateSubscriptionForItemsBuilder builder) { + + this.changesScheduledAt = builder.changesScheduledAt; + + this.changeOption = builder.changeOption; + + this.mandatoryItemsToRemove = builder.mandatoryItemsToRemove; + + this.replaceItemsList = builder.replaceItemsList; + + this.invoiceDate = builder.invoiceDate; + + this.billingCycles = builder.billingCycles; + + this.termsToCharge = builder.termsToCharge; + + this.reactivateFrom = builder.reactivateFrom; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.replaceCouponList = builder.replaceCouponList; + + this.prorate = builder.prorate; + + this.endOfTerm = builder.endOfTerm; + + this.forceTermReset = builder.forceTermReset; + + this.reactivate = builder.reactivate; + + this.includeDelayedCharges = builder.includeDelayedCharges; + + this.useExistingBalances = builder.useExistingBalances; + + this.invoiceImmediately = builder.invoiceImmediately; + + this.invoiceUsages = builder.invoiceUsages; + + this.subscription = builder.subscription; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.customer = builder.customer; + + this.billingOverride = builder.billingOverride; + + this.subscriptionItems = builder.subscriptionItems; + + this.discounts = builder.discounts; + + this.itemTiers = builder.itemTiers; + } + + public Timestamp getChangesScheduledAt() { + return changesScheduledAt; + } + + public ChangeOption getChangeOption() { + return changeOption; + } + + public List getMandatoryItemsToRemove() { + return mandatoryItemsToRemove; + } + + public Boolean getReplaceItemsList() { + return replaceItemsList; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Timestamp getReactivateFrom() { + return reactivateFrom; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public Boolean getReplaceCouponList() { + return replaceCouponList; + } + + public Boolean getProrate() { + return prorate; + } + + public Boolean getEndOfTerm() { + return endOfTerm; + } + + public Boolean getForceTermReset() { + return forceTermReset; + } + + public Boolean getReactivate() { + return reactivate; + } + + public Boolean getIncludeDelayedCharges() { + return includeDelayedCharges; + } + + public Boolean getUseExistingBalances() { + return useExistingBalances; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + public Boolean getInvoiceUsages() { + return invoiceUsages; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public CustomerParams getCustomer() { + return customer; + } + + public BillingOverrideParams getBillingOverride() { + return billingOverride; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + public List getDiscounts() { + return discounts; + } + + public List getItemTiers() { + return itemTiers; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.changesScheduledAt != null) { + + formData.put("changes_scheduled_at", this.changesScheduledAt); + } + + if (this.changeOption != null) { + + formData.put("change_option", this.changeOption); + } + + if (this.mandatoryItemsToRemove != null) { + + formData.put("mandatory_items_to_remove", this.mandatoryItemsToRemove); + } + + if (this.replaceItemsList != null) { + + formData.put("replace_items_list", this.replaceItemsList); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.reactivateFrom != null) { + + formData.put("reactivate_from", this.reactivateFrom); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.replaceCouponList != null) { + + formData.put("replace_coupon_list", this.replaceCouponList); + } + + if (this.prorate != null) { + + formData.put("prorate", this.prorate); + } + + if (this.endOfTerm != null) { + + formData.put("end_of_term", this.endOfTerm); + } + + if (this.forceTermReset != null) { + + formData.put("force_term_reset", this.forceTermReset); + } + + if (this.reactivate != null) { + + formData.put("reactivate", this.reactivate); + } + + if (this.includeDelayedCharges != null) { + + formData.put("include_delayed_charges", this.includeDelayedCharges); + } + + if (this.useExistingBalances != null) { + + formData.put("use_existing_balances", this.useExistingBalances); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + if (this.invoiceUsages != null) { + + formData.put("invoice_usages", this.invoiceUsages); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.billingOverride != null) { + + // Single object + Map nestedData = this.billingOverride.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_override[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for EstimateUpdateSubscriptionForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EstimateUpdateSubscriptionForItemsBuilder builder() { + return new EstimateUpdateSubscriptionForItemsBuilder(); + } + + public static final class EstimateUpdateSubscriptionForItemsBuilder { + + private Timestamp changesScheduledAt; + + private ChangeOption changeOption; + + private List mandatoryItemsToRemove; + + private Boolean replaceItemsList; + + private Timestamp invoiceDate; + + private Integer billingCycles; + + private Integer termsToCharge; + + private Timestamp reactivateFrom; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private Boolean replaceCouponList; + + private Boolean prorate; + + private Boolean endOfTerm; + + private Boolean forceTermReset; + + private Boolean reactivate; + + private Boolean includeDelayedCharges; + + private Boolean useExistingBalances; + + private Boolean invoiceImmediately; + + private Boolean invoiceUsages; + + private SubscriptionParams subscription; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private CustomerParams customer; + + private BillingOverrideParams billingOverride; + + private List subscriptionItems; + + private List discounts; + + private List itemTiers; + + private EstimateUpdateSubscriptionForItemsBuilder() {} + + public EstimateUpdateSubscriptionForItemsBuilder changesScheduledAt(Timestamp value) { + this.changesScheduledAt = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder changeOption(ChangeOption value) { + this.changeOption = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder mandatoryItemsToRemove(List value) { + this.mandatoryItemsToRemove = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder replaceItemsList(Boolean value) { + this.replaceItemsList = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder reactivateFrom(Timestamp value) { + this.reactivateFrom = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder billingAlignmentMode( + BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder replaceCouponList(Boolean value) { + this.replaceCouponList = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder prorate(Boolean value) { + this.prorate = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder endOfTerm(Boolean value) { + this.endOfTerm = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder forceTermReset(Boolean value) { + this.forceTermReset = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder reactivate(Boolean value) { + this.reactivate = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder includeDelayedCharges(Boolean value) { + this.includeDelayedCharges = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder useExistingBalances(Boolean value) { + this.useExistingBalances = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder invoiceUsages(Boolean value) { + this.invoiceUsages = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder billingOverride(BillingOverrideParams value) { + this.billingOverride = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public EstimateUpdateSubscriptionForItemsParams build() { + return new EstimateUpdateSubscriptionForItemsParams(this); + } + } + + public enum ChangeOption { + IMMEDIATELY("immediately"), + + END_OF_TERM("end_of_term"), + + SPECIFIC_DATE("specific_date"), + + /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChangeOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChangeOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChangeOption enumValue : ChangeOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final Long setupFee; + + private final Timestamp startDate; + + private final Timestamp trialEnd; + + private final String coupon; + + private final AutoCollection autoCollection; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final Integer freePeriod; + + private final FreePeriodUnit freePeriodUnit; + + private final TrialEndAction trialEndAction; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.setupFee = builder.setupFee; + + this.startDate = builder.startDate; + + this.trialEnd = builder.trialEnd; + + this.coupon = builder.coupon; + + this.autoCollection = builder.autoCollection; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.freePeriod = builder.freePeriod; + + this.freePeriodUnit = builder.freePeriodUnit; + + this.trialEndAction = builder.trialEndAction; + } + + public String getId() { + return id; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public String getCoupon() { + return coupon; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public Integer getFreePeriod() { + return freePeriod; + } + + public FreePeriodUnit getFreePeriodUnit() { + return freePeriodUnit; + } + + public TrialEndAction getTrialEndAction() { + return trialEndAction; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.freePeriod != null) { + + formData.put("free_period", this.freePeriod); + } + + if (this.freePeriodUnit != null) { + + formData.put("free_period_unit", this.freePeriodUnit); + } + + if (this.trialEndAction != null) { + + formData.put("trial_end_action", this.trialEndAction); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private Long setupFee; + + private Timestamp startDate; + + private Timestamp trialEnd; + + private String coupon; + + private AutoCollection autoCollection; + + private OfflinePaymentMethod offlinePaymentMethod; + + private Integer freePeriod; + + private FreePeriodUnit freePeriodUnit; + + private TrialEndAction trialEndAction; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + @Deprecated + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + @Deprecated + public SubscriptionBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder freePeriod(Integer value) { + this.freePeriod = value; + return this; + } + + public SubscriptionBuilder freePeriodUnit(FreePeriodUnit value) { + this.freePeriodUnit = value; + return this; + } + + public SubscriptionBuilder trialEndAction(TrialEndAction value) { + this.trialEndAction = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum FreePeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + FreePeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static FreePeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialEndAction { + SITE_DEFAULT("site_default"), + + PLAN_DEFAULT("plan_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialEndAction enumValue : TrialEndAction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String line1; + + private final String line2; + + private final String line3; + + private final String city; + + private final String stateCode; + + private final String zip; + + private final String country; + + private final ValidationStatus validationStatus; + + private BillingAddressParams(BillingAddressBuilder builder) { + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + this.city = builder.city; + + this.stateCode = builder.stateCode; + + this.zip = builder.zip; + + this.country = builder.country; + + this.validationStatus = builder.validationStatus; + } + + public String getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + public String getCity() { + return city; + } + + public String getStateCode() { + return stateCode; + } + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + if (this.city != null) { + + formData.put("city", this.city); + } + + if (this.stateCode != null) { + + formData.put("state_code", this.stateCode); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String line1; + + private final String line2; + + private final String line3; + + private final String city; + + private final String stateCode; + + private final String zip; + + private final String country; + + private final ValidationStatus validationStatus; + + private ShippingAddressParams(ShippingAddressBuilder builder) { + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + this.city = builder.city; + + this.stateCode = builder.stateCode; + + this.zip = builder.zip; + + this.country = builder.country; + + this.validationStatus = builder.validationStatus; + } + + public String getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + public String getCity() { + return city; + } + + public String getStateCode() { + return stateCode; + } + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + if (this.city != null) { + + formData.put("city", this.city); + } + + if (this.stateCode != null) { + + formData.put("state_code", this.stateCode); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class CustomerParams { + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final Boolean registeredForGst; + + private final Taxability taxability; + + private CustomerParams(CustomerBuilder builder) { + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.registeredForGst = builder.registeredForGst; + + this.taxability = builder.taxability; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public Boolean getRegisteredForGst() { + return registeredForGst; + } + + public Taxability getTaxability() { + return taxability; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.registeredForGst != null) { + + formData.put("registered_for_gst", this.registeredForGst); + } + + if (this.taxability != null) { + + formData.put("taxability", this.taxability); + } + + 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 String vatNumberPrefix; + + private Boolean registeredForGst; + + private Taxability taxability; + + private CustomerBuilder() {} + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder registeredForGst(Boolean value) { + this.registeredForGst = value; + return this; + } + + @Deprecated + public CustomerBuilder taxability(Taxability value) { + this.taxability = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + + public enum Taxability { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Taxability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Taxability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Taxability fromString(String value) { + if (value == null) return _UNKNOWN; + for (Taxability enumValue : Taxability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingOverrideParams { + + private final Long maxExcessPaymentUsage; + + private final Long maxRefundableCreditsUsage; + + private BillingOverrideParams(BillingOverrideBuilder builder) { + + this.maxExcessPaymentUsage = builder.maxExcessPaymentUsage; + + this.maxRefundableCreditsUsage = builder.maxRefundableCreditsUsage; + } + + public Long getMaxExcessPaymentUsage() { + return maxExcessPaymentUsage; + } + + public Long getMaxRefundableCreditsUsage() { + return maxRefundableCreditsUsage; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.maxExcessPaymentUsage != null) { + + formData.put("max_excess_payment_usage", this.maxExcessPaymentUsage); + } + + if (this.maxRefundableCreditsUsage != null) { + + formData.put("max_refundable_credits_usage", this.maxRefundableCreditsUsage); + } + + return formData; + } + + /** Create a new builder for BillingOverrideParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingOverrideBuilder builder() { + return new BillingOverrideBuilder(); + } + + public static final class BillingOverrideBuilder { + + private Long maxExcessPaymentUsage; + + private Long maxRefundableCreditsUsage; + + private BillingOverrideBuilder() {} + + public BillingOverrideBuilder maxExcessPaymentUsage(Long value) { + this.maxExcessPaymentUsage = value; + return this; + } + + public BillingOverrideBuilder maxRefundableCreditsUsage(Long value) { + this.maxRefundableCreditsUsage = value; + return this; + } + + public BillingOverrideParams build() { + return new BillingOverrideParams(this); + } + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ChargeOnOption chargeOnOption; + + private final ItemType itemType; + + private final ProrationType prorationType; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.chargeOnOption = builder.chargeOnOption; + + this.itemType = builder.itemType; + + this.prorationType = builder.prorationType; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ChargeOnOption getChargeOnOption() { + return chargeOnOption; + } + + public ItemType getItemType() { + return itemType; + } + + public ProrationType getProrationType() { + return prorationType; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.chargeOnOption != null) { + + formData.put("charge_on_option", this.chargeOnOption); + } + + if (this.itemType != null) { + + formData.put("item_type", this.itemType); + } + + if (this.prorationType != null) { + + formData.put("proration_type", this.prorationType); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ChargeOnOption chargeOnOption; + + private ItemType itemType; + + private ProrationType prorationType; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionItemsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionItemsBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { + this.chargeOnOption = value; + return this; + } + + public SubscriptionItemsBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public SubscriptionItemsBuilder prorationType(ProrationType value) { + this.prorationType = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + + 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"), + + /** 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; + } + } + + public enum ChargeOnOption { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnOption enumValue : ChargeOnOption.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 enum ProrationType { + FULL_TERM("full_term"), + + PARTIAL_TERM("partial_term"), + + NONE("none"), + + /** An enum member indicating that ProrationType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationType enumValue : ProrationType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DiscountsParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private final Integer quantity; + + private final OperationType operationType; + + private final String id; + + private DiscountsParams(DiscountsBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.operationType = builder.operationType; + + this.id = builder.id; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public OperationType getOperationType() { + return operationType; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.operationType != null) { + + formData.put("operation_type", this.operationType); + } + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private Integer quantity; + + private OperationType operationType; + + private String id; + + private DiscountsBuilder() {} + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder operationType(OperationType value) { + this.operationType = value; + return this; + } + + public DiscountsBuilder id(String value) { + this.id = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 enum OperationType { + ADD("add"), + + REMOVE("remove"), + + /** An enum member indicating that OperationType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OperationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OperationType fromString(String value) { + if (value == null) return _UNKNOWN; + for (OperationType enumValue : OperationType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateUpdateSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateUpdateSubscriptionParams.java new file mode 100644 index 00000000..b52db207 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateUpdateSubscriptionParams.java @@ -0,0 +1,2160 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class EstimateUpdateSubscriptionParams { + + private final Timestamp changesScheduledAt; + + private final ChangeOption changeOption; + + private final Boolean replaceAddonList; + + private final List mandatoryAddonsToRemove; + + private final Timestamp invoiceDate; + + private final Integer billingCycles; + + private final Integer termsToCharge; + + private final Timestamp reactivateFrom; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final Boolean replaceCouponList; + + private final Boolean prorate; + + private final Boolean endOfTerm; + + private final Boolean forceTermReset; + + private final Boolean reactivate; + + private final Boolean includeDelayedCharges; + + private final Boolean useExistingBalances; + + private final Boolean invoiceImmediately; + + private final SubscriptionParams subscription; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final CustomerParams customer; + + private final List addons; + + private final List eventBasedAddons; + + private EstimateUpdateSubscriptionParams(EstimateUpdateSubscriptionBuilder builder) { + + this.changesScheduledAt = builder.changesScheduledAt; + + this.changeOption = builder.changeOption; + + this.replaceAddonList = builder.replaceAddonList; + + this.mandatoryAddonsToRemove = builder.mandatoryAddonsToRemove; + + this.invoiceDate = builder.invoiceDate; + + this.billingCycles = builder.billingCycles; + + this.termsToCharge = builder.termsToCharge; + + this.reactivateFrom = builder.reactivateFrom; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.replaceCouponList = builder.replaceCouponList; + + this.prorate = builder.prorate; + + this.endOfTerm = builder.endOfTerm; + + this.forceTermReset = builder.forceTermReset; + + this.reactivate = builder.reactivate; + + this.includeDelayedCharges = builder.includeDelayedCharges; + + this.useExistingBalances = builder.useExistingBalances; + + this.invoiceImmediately = builder.invoiceImmediately; + + this.subscription = builder.subscription; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.customer = builder.customer; + + this.addons = builder.addons; + + this.eventBasedAddons = builder.eventBasedAddons; + } + + public Timestamp getChangesScheduledAt() { + return changesScheduledAt; + } + + public ChangeOption getChangeOption() { + return changeOption; + } + + public Boolean getReplaceAddonList() { + return replaceAddonList; + } + + public List getMandatoryAddonsToRemove() { + return mandatoryAddonsToRemove; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Timestamp getReactivateFrom() { + return reactivateFrom; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public Boolean getReplaceCouponList() { + return replaceCouponList; + } + + public Boolean getProrate() { + return prorate; + } + + public Boolean getEndOfTerm() { + return endOfTerm; + } + + public Boolean getForceTermReset() { + return forceTermReset; + } + + public Boolean getReactivate() { + return reactivate; + } + + public Boolean getIncludeDelayedCharges() { + return includeDelayedCharges; + } + + public Boolean getUseExistingBalances() { + return useExistingBalances; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public CustomerParams getCustomer() { + return customer; + } + + public List getAddons() { + return addons; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.changesScheduledAt != null) { + + formData.put("changes_scheduled_at", this.changesScheduledAt); + } + + if (this.changeOption != null) { + + formData.put("change_option", this.changeOption); + } + + if (this.replaceAddonList != null) { + + formData.put("replace_addon_list", this.replaceAddonList); + } + + if (this.mandatoryAddonsToRemove != null) { + + formData.put("mandatory_addons_to_remove", this.mandatoryAddonsToRemove); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.reactivateFrom != null) { + + formData.put("reactivate_from", this.reactivateFrom); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.replaceCouponList != null) { + + formData.put("replace_coupon_list", this.replaceCouponList); + } + + if (this.prorate != null) { + + formData.put("prorate", this.prorate); + } + + if (this.endOfTerm != null) { + + formData.put("end_of_term", this.endOfTerm); + } + + if (this.forceTermReset != null) { + + formData.put("force_term_reset", this.forceTermReset); + } + + if (this.reactivate != null) { + + formData.put("reactivate", this.reactivate); + } + + if (this.includeDelayedCharges != null) { + + formData.put("include_delayed_charges", this.includeDelayedCharges); + } + + if (this.useExistingBalances != null) { + + formData.put("use_existing_balances", this.useExistingBalances); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for EstimateUpdateSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EstimateUpdateSubscriptionBuilder builder() { + return new EstimateUpdateSubscriptionBuilder(); + } + + public static final class EstimateUpdateSubscriptionBuilder { + + private Timestamp changesScheduledAt; + + private ChangeOption changeOption; + + private Boolean replaceAddonList; + + private List mandatoryAddonsToRemove; + + private Timestamp invoiceDate; + + private Integer billingCycles; + + private Integer termsToCharge; + + private Timestamp reactivateFrom; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private Boolean replaceCouponList; + + private Boolean prorate; + + private Boolean endOfTerm; + + private Boolean forceTermReset; + + private Boolean reactivate; + + private Boolean includeDelayedCharges; + + private Boolean useExistingBalances; + + private Boolean invoiceImmediately; + + private SubscriptionParams subscription; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private CustomerParams customer; + + private List addons; + + private List eventBasedAddons; + + private EstimateUpdateSubscriptionBuilder() {} + + public EstimateUpdateSubscriptionBuilder changesScheduledAt(Timestamp value) { + this.changesScheduledAt = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder changeOption(ChangeOption value) { + this.changeOption = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder replaceAddonList(Boolean value) { + this.replaceAddonList = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder mandatoryAddonsToRemove(List value) { + this.mandatoryAddonsToRemove = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder reactivateFrom(Timestamp value) { + this.reactivateFrom = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder billingAlignmentMode(BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder replaceCouponList(Boolean value) { + this.replaceCouponList = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder prorate(Boolean value) { + this.prorate = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder endOfTerm(Boolean value) { + this.endOfTerm = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder forceTermReset(Boolean value) { + this.forceTermReset = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder reactivate(Boolean value) { + this.reactivate = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder includeDelayedCharges(Boolean value) { + this.includeDelayedCharges = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder useExistingBalances(Boolean value) { + this.useExistingBalances = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder addons(List value) { + this.addons = value; + return this; + } + + public EstimateUpdateSubscriptionBuilder eventBasedAddons(List value) { + this.eventBasedAddons = value; + return this; + } + + public EstimateUpdateSubscriptionParams build() { + return new EstimateUpdateSubscriptionParams(this); + } + } + + public enum ChangeOption { + IMMEDIATELY("immediately"), + + END_OF_TERM("end_of_term"), + + SPECIFIC_DATE("specific_date"), + + /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChangeOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChangeOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChangeOption enumValue : ChangeOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final String planId; + + private final Integer planQuantity; + + private final Long planUnitPrice; + + private final Long setupFee; + + private final String planQuantityInDecimal; + + private final String planUnitPriceInDecimal; + + private final Timestamp startDate; + + private final Timestamp trialEnd; + + private final String coupon; + + private final AutoCollection autoCollection; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final Integer freePeriod; + + private final FreePeriodUnit freePeriodUnit; + + private final TrialEndAction trialEndAction; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planUnitPrice = builder.planUnitPrice; + + this.setupFee = builder.setupFee; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + + this.planUnitPriceInDecimal = builder.planUnitPriceInDecimal; + + this.startDate = builder.startDate; + + this.trialEnd = builder.trialEnd; + + this.coupon = builder.coupon; + + this.autoCollection = builder.autoCollection; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.freePeriod = builder.freePeriod; + + this.freePeriodUnit = builder.freePeriodUnit; + + this.trialEndAction = builder.trialEndAction; + } + + public String getId() { + return id; + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public Long getPlanUnitPrice() { + return planUnitPrice; + } + + public Long getSetupFee() { + return setupFee; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + public String getPlanUnitPriceInDecimal() { + return planUnitPriceInDecimal; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public String getCoupon() { + return coupon; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public Integer getFreePeriod() { + return freePeriod; + } + + public FreePeriodUnit getFreePeriodUnit() { + return freePeriodUnit; + } + + public TrialEndAction getTrialEndAction() { + return trialEndAction; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planUnitPrice != null) { + + formData.put("plan_unit_price", this.planUnitPrice); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + if (this.planUnitPriceInDecimal != null) { + + formData.put("plan_unit_price_in_decimal", this.planUnitPriceInDecimal); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.freePeriod != null) { + + formData.put("free_period", this.freePeriod); + } + + if (this.freePeriodUnit != null) { + + formData.put("free_period_unit", this.freePeriodUnit); + } + + if (this.trialEndAction != null) { + + formData.put("trial_end_action", this.trialEndAction); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private String planId; + + private Integer planQuantity; + + private Long planUnitPrice; + + private Long setupFee; + + private String planQuantityInDecimal; + + private String planUnitPriceInDecimal; + + private Timestamp startDate; + + private Timestamp trialEnd; + + private String coupon; + + private AutoCollection autoCollection; + + private OfflinePaymentMethod offlinePaymentMethod; + + private Integer freePeriod; + + private FreePeriodUnit freePeriodUnit; + + private TrialEndAction trialEndAction; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionBuilder planId(String value) { + this.planId = value; + return this; + } + + public SubscriptionBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public SubscriptionBuilder planUnitPrice(Long value) { + this.planUnitPrice = value; + return this; + } + + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + public SubscriptionBuilder planUnitPriceInDecimal(String value) { + this.planUnitPriceInDecimal = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + @Deprecated + public SubscriptionBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder freePeriod(Integer value) { + this.freePeriod = value; + return this; + } + + public SubscriptionBuilder freePeriodUnit(FreePeriodUnit value) { + this.freePeriodUnit = value; + return this; + } + + public SubscriptionBuilder trialEndAction(TrialEndAction value) { + this.trialEndAction = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum FreePeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + FreePeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static FreePeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialEndAction { + SITE_DEFAULT("site_default"), + + PLAN_DEFAULT("plan_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialEndAction enumValue : TrialEndAction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String line1; + + private final String line2; + + private final String line3; + + private final String city; + + private final String stateCode; + + private final String zip; + + private final String country; + + private final ValidationStatus validationStatus; + + private BillingAddressParams(BillingAddressBuilder builder) { + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + this.city = builder.city; + + this.stateCode = builder.stateCode; + + this.zip = builder.zip; + + this.country = builder.country; + + this.validationStatus = builder.validationStatus; + } + + public String getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + public String getCity() { + return city; + } + + public String getStateCode() { + return stateCode; + } + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + if (this.city != null) { + + formData.put("city", this.city); + } + + if (this.stateCode != null) { + + formData.put("state_code", this.stateCode); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String line1; + + private final String line2; + + private final String line3; + + private final String city; + + private final String stateCode; + + private final String zip; + + private final String country; + + private final ValidationStatus validationStatus; + + private ShippingAddressParams(ShippingAddressBuilder builder) { + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + this.city = builder.city; + + this.stateCode = builder.stateCode; + + this.zip = builder.zip; + + this.country = builder.country; + + this.validationStatus = builder.validationStatus; + } + + public String getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + public String getCity() { + return city; + } + + public String getStateCode() { + return stateCode; + } + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + if (this.city != null) { + + formData.put("city", this.city); + } + + if (this.stateCode != null) { + + formData.put("state_code", this.stateCode); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class CustomerParams { + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final Boolean registeredForGst; + + private final Taxability taxability; + + private CustomerParams(CustomerBuilder builder) { + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.registeredForGst = builder.registeredForGst; + + this.taxability = builder.taxability; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public Boolean getRegisteredForGst() { + return registeredForGst; + } + + public Taxability getTaxability() { + return taxability; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.registeredForGst != null) { + + formData.put("registered_for_gst", this.registeredForGst); + } + + if (this.taxability != null) { + + formData.put("taxability", this.taxability); + } + + 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 String vatNumberPrefix; + + private Boolean registeredForGst; + + private Taxability taxability; + + private CustomerBuilder() {} + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder registeredForGst(Boolean value) { + this.registeredForGst = value; + return this; + } + + @Deprecated + public CustomerBuilder taxability(Taxability value) { + this.taxability = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + + public enum Taxability { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Taxability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Taxability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Taxability fromString(String value) { + if (value == null) return _UNKNOWN; + for (Taxability enumValue : Taxability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final Integer billingCycles; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private final Timestamp trialEnd; + + private final ProrationType prorationType; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.billingCycles = builder.billingCycles; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.trialEnd = builder.trialEnd; + + this.prorationType = builder.prorationType; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public ProrationType getProrationType() { + return prorationType; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.prorationType != null) { + + formData.put("proration_type", this.prorationType); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private Integer billingCycles; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private Timestamp trialEnd; + + private ProrationType prorationType; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public AddonsBuilder prorationType(ProrationType value) { + this.prorationType = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + + public enum ProrationType { + FULL_TERM("full_term"), + + PARTIAL_TERM("partial_term"), + + NONE("none"), + + /** An enum member indicating that ProrationType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationType enumValue : ProrationType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final Integer servicePeriodInDays; + + private final ChargeOn chargeOn; + + private final OnEvent onEvent; + + private final Boolean chargeOnce; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.servicePeriodInDays = builder.servicePeriodInDays; + + this.chargeOn = builder.chargeOn; + + this.onEvent = builder.onEvent; + + this.chargeOnce = builder.chargeOnce; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public Integer getServicePeriodInDays() { + return servicePeriodInDays; + } + + public ChargeOn getChargeOn() { + return chargeOn; + } + + public OnEvent getOnEvent() { + return onEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.servicePeriodInDays != null) { + + formData.put("service_period_in_days", this.servicePeriodInDays); + } + + if (this.chargeOn != null) { + + formData.put("charge_on", this.chargeOn); + } + + if (this.onEvent != null) { + + formData.put("on_event", this.onEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private Integer servicePeriodInDays; + + private ChargeOn chargeOn; + + private OnEvent onEvent; + + private Boolean chargeOnce; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { + this.servicePeriodInDays = value; + return this; + } + + public EventBasedAddonsBuilder chargeOn(ChargeOn value) { + this.chargeOn = value; + return this; + } + + public EventBasedAddonsBuilder onEvent(OnEvent value) { + this.onEvent = value; + return this; + } + + public EventBasedAddonsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + + public enum ChargeOn { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOn fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOn enumValue : ChargeOn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** An enum member indicating that OnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (OnEvent enumValue : OnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/RegenerateInvoiceEstimateParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/RegenerateInvoiceEstimateParams.java new file mode 100644 index 00000000..46ff139d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/RegenerateInvoiceEstimateParams.java @@ -0,0 +1,121 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class RegenerateInvoiceEstimateParams { + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private final Boolean prorate; + + private final Boolean invoiceImmediately; + + private RegenerateInvoiceEstimateParams(RegenerateInvoiceEstimateBuilder builder) { + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + + this.prorate = builder.prorate; + + this.invoiceImmediately = builder.invoiceImmediately; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + public Boolean getProrate() { + return prorate; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + if (this.prorate != null) { + + formData.put("prorate", this.prorate); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + return formData; + } + + /** Create a new builder for RegenerateInvoiceEstimateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RegenerateInvoiceEstimateBuilder builder() { + return new RegenerateInvoiceEstimateBuilder(); + } + + public static final class RegenerateInvoiceEstimateBuilder { + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private Boolean prorate; + + private Boolean invoiceImmediately; + + private RegenerateInvoiceEstimateBuilder() {} + + public RegenerateInvoiceEstimateBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public RegenerateInvoiceEstimateBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public RegenerateInvoiceEstimateBuilder prorate(Boolean value) { + this.prorate = value; + return this; + } + + public RegenerateInvoiceEstimateBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public RegenerateInvoiceEstimateParams build() { + return new RegenerateInvoiceEstimateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/RenewalEstimateParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/RenewalEstimateParams.java new file mode 100644 index 00000000..e15be559 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/RenewalEstimateParams.java @@ -0,0 +1,103 @@ +/* + * 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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class RenewalEstimateParams { + + private final Map queryParams; + + private RenewalEstimateParams(RenewalEstimateBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public RenewalEstimateBuilder toBuilder() { + RenewalEstimateBuilder builder = new RenewalEstimateBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for RenewalEstimateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RenewalEstimateBuilder builder() { + return new RenewalEstimateBuilder(); + } + + public static final class RenewalEstimateBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private RenewalEstimateBuilder() {} + + public RenewalEstimateBuilder includeDelayedCharges(Boolean value) { + queryParams.put("include_delayed_charges", value); + return this; + } + + public RenewalEstimateBuilder useExistingBalances(Boolean value) { + queryParams.put("use_existing_balances", value); + return this; + } + + public RenewalEstimateBuilder ignoreScheduledCancellation(Boolean value) { + queryParams.put("ignore_scheduled_cancellation", value); + return this; + } + + public RenewalEstimateBuilder ignoreScheduledChanges(Boolean value) { + queryParams.put("ignore_scheduled_changes", value); + return this; + } + + public RenewalEstimateBuilder excludeTaxType(ExcludeTaxType value) { + queryParams.put("exclude_tax_type", value); + return this; + } + + public RenewalEstimateParams build() { + return new RenewalEstimateParams(this); + } + } + + public enum ExcludeTaxType { + EXCLUSIVE("exclusive"), + + NONE("none"), + + /** An enum member indicating that ExcludeTaxType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ExcludeTaxType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ExcludeTaxType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ExcludeTaxType enumValue : ExcludeTaxType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/UpcomingInvoicesEstimateParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/UpcomingInvoicesEstimateParams.java new file mode 100644 index 00000000..fa7fc50d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/params/UpcomingInvoicesEstimateParams.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.estimate.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class UpcomingInvoicesEstimateParams { + + private final Map queryParams; + + private UpcomingInvoicesEstimateParams(UpcomingInvoicesEstimateBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public UpcomingInvoicesEstimateBuilder toBuilder() { + UpcomingInvoicesEstimateBuilder builder = new UpcomingInvoicesEstimateBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for UpcomingInvoicesEstimateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpcomingInvoicesEstimateBuilder builder() { + return new UpcomingInvoicesEstimateBuilder(); + } + + public static final class UpcomingInvoicesEstimateBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private UpcomingInvoicesEstimateBuilder() {} + + public UpcomingInvoicesEstimateParams build() { + return new UpcomingInvoicesEstimateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/responses/AdvanceInvoiceEstimateResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/AdvanceInvoiceEstimateResponse.java new file mode 100644 index 00000000..ca0ba476 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/AdvanceInvoiceEstimateResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.estimate.responses; + +import com.chargebee.v4.models.estimate.Estimate; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for AdvanceInvoiceEstimate operation. Contains the response data from + * the API. + */ +public final class AdvanceInvoiceEstimateResponse extends BaseResponse { + private final Estimate estimate; + + private AdvanceInvoiceEstimateResponse(Builder builder) { + super(builder.httpResponse); + + this.estimate = builder.estimate; + } + + /** Parse JSON response into AdvanceInvoiceEstimateResponse object. */ + public static AdvanceInvoiceEstimateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into AdvanceInvoiceEstimateResponse object with HTTP response. */ + public static AdvanceInvoiceEstimateResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __estimateJson = JsonUtil.getObject(json, "estimate"); + if (__estimateJson != null) { + builder.estimate(Estimate.fromJson(__estimateJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse AdvanceInvoiceEstimateResponse from JSON", e); + } + } + + /** Create a new builder for AdvanceInvoiceEstimateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for AdvanceInvoiceEstimateResponse. */ + public static class Builder { + + private Estimate estimate; + + private Response httpResponse; + + private Builder() {} + + public Builder estimate(Estimate estimate) { + this.estimate = estimate; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public AdvanceInvoiceEstimateResponse build() { + return new AdvanceInvoiceEstimateResponse(this); + } + } + + /** Get the estimate from the response. */ + public Estimate getEstimate() { + return estimate; + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/responses/CreateSubscriptionForCustomerEstimateResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/CreateSubscriptionForCustomerEstimateResponse.java new file mode 100644 index 00000000..7371b7e8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/CreateSubscriptionForCustomerEstimateResponse.java @@ -0,0 +1,82 @@ +package com.chargebee.v4.models.estimate.responses; + +import com.chargebee.v4.models.estimate.Estimate; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CreateSubscriptionForCustomerEstimate operation. Contains the + * response data from a single resource get operation. + */ +public final class CreateSubscriptionForCustomerEstimateResponse extends BaseResponse { + private final Estimate estimate; + + private CreateSubscriptionForCustomerEstimateResponse(Builder builder) { + super(builder.httpResponse); + + this.estimate = builder.estimate; + } + + /** Parse JSON response into CreateSubscriptionForCustomerEstimateResponse object. */ + public static CreateSubscriptionForCustomerEstimateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into CreateSubscriptionForCustomerEstimateResponse object with HTTP + * response. + */ + public static CreateSubscriptionForCustomerEstimateResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __estimateJson = JsonUtil.getObject(json, "estimate"); + if (__estimateJson != null) { + builder.estimate(Estimate.fromJson(__estimateJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse CreateSubscriptionForCustomerEstimateResponse from JSON", e); + } + } + + /** Create a new builder for CreateSubscriptionForCustomerEstimateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CreateSubscriptionForCustomerEstimateResponse. */ + public static class Builder { + + private Estimate estimate; + + private Response httpResponse; + + private Builder() {} + + public Builder estimate(Estimate estimate) { + this.estimate = estimate; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CreateSubscriptionForCustomerEstimateResponse build() { + return new CreateSubscriptionForCustomerEstimateResponse(this); + } + } + + /** Get the estimate from the response. */ + public Estimate getEstimate() { + return estimate; + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/responses/CreateSubscriptionItemEstimateResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/CreateSubscriptionItemEstimateResponse.java new file mode 100644 index 00000000..5d3bfb5d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/CreateSubscriptionItemEstimateResponse.java @@ -0,0 +1,79 @@ +package com.chargebee.v4.models.estimate.responses; + +import com.chargebee.v4.models.estimate.Estimate; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CreateSubscriptionItemEstimate operation. Contains the response + * data from the API. + */ +public final class CreateSubscriptionItemEstimateResponse extends BaseResponse { + private final Estimate estimate; + + private CreateSubscriptionItemEstimateResponse(Builder builder) { + super(builder.httpResponse); + + this.estimate = builder.estimate; + } + + /** Parse JSON response into CreateSubscriptionItemEstimateResponse object. */ + public static CreateSubscriptionItemEstimateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CreateSubscriptionItemEstimateResponse object with HTTP response. */ + public static CreateSubscriptionItemEstimateResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __estimateJson = JsonUtil.getObject(json, "estimate"); + if (__estimateJson != null) { + builder.estimate(Estimate.fromJson(__estimateJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse CreateSubscriptionItemEstimateResponse from JSON", e); + } + } + + /** Create a new builder for CreateSubscriptionItemEstimateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CreateSubscriptionItemEstimateResponse. */ + public static class Builder { + + private Estimate estimate; + + private Response httpResponse; + + private Builder() {} + + public Builder estimate(Estimate estimate) { + this.estimate = estimate; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CreateSubscriptionItemEstimateResponse build() { + return new CreateSubscriptionItemEstimateResponse(this); + } + } + + /** Get the estimate from the response. */ + public Estimate getEstimate() { + return estimate; + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/responses/CreateSubscriptionItemForCustomerEstimateResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/CreateSubscriptionItemForCustomerEstimateResponse.java new file mode 100644 index 00000000..418da411 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/CreateSubscriptionItemForCustomerEstimateResponse.java @@ -0,0 +1,82 @@ +package com.chargebee.v4.models.estimate.responses; + +import com.chargebee.v4.models.estimate.Estimate; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CreateSubscriptionItemForCustomerEstimate operation. Contains the + * response data from the API. + */ +public final class CreateSubscriptionItemForCustomerEstimateResponse extends BaseResponse { + private final Estimate estimate; + + private CreateSubscriptionItemForCustomerEstimateResponse(Builder builder) { + super(builder.httpResponse); + + this.estimate = builder.estimate; + } + + /** Parse JSON response into CreateSubscriptionItemForCustomerEstimateResponse object. */ + public static CreateSubscriptionItemForCustomerEstimateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into CreateSubscriptionItemForCustomerEstimateResponse object with HTTP + * response. + */ + public static CreateSubscriptionItemForCustomerEstimateResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __estimateJson = JsonUtil.getObject(json, "estimate"); + if (__estimateJson != null) { + builder.estimate(Estimate.fromJson(__estimateJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse CreateSubscriptionItemForCustomerEstimateResponse from JSON", e); + } + } + + /** Create a new builder for CreateSubscriptionItemForCustomerEstimateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CreateSubscriptionItemForCustomerEstimateResponse. */ + public static class Builder { + + private Estimate estimate; + + private Response httpResponse; + + private Builder() {} + + public Builder estimate(Estimate estimate) { + this.estimate = estimate; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CreateSubscriptionItemForCustomerEstimateResponse build() { + return new CreateSubscriptionItemForCustomerEstimateResponse(this); + } + } + + /** Get the estimate from the response. */ + public Estimate getEstimate() { + return estimate; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCancelSubscriptionForItemsResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateCancelSubscriptionForItemsResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCancelSubscriptionForItemsResponse.java rename to src/main/java/com/chargebee/v4/models/estimate/responses/EstimateCancelSubscriptionForItemsResponse.java index 74b7c980..df53d1ca 100644 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCancelSubscriptionForItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateCancelSubscriptionForItemsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.estimate; +package com.chargebee.v4.models.estimate.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCancelSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateCancelSubscriptionResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCancelSubscriptionResponse.java rename to src/main/java/com/chargebee/v4/models/estimate/responses/EstimateCancelSubscriptionResponse.java index aa348b8d..b253de87 100644 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCancelSubscriptionResponse.java +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateCancelSubscriptionResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.estimate; +package com.chargebee.v4.models.estimate.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateChangeTermEndResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateChangeTermEndResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/estimate/EstimateChangeTermEndResponse.java rename to src/main/java/com/chargebee/v4/models/estimate/responses/EstimateChangeTermEndResponse.java index 54ee15b9..9a7d390d 100644 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateChangeTermEndResponse.java +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateChangeTermEndResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.estimate; +package com.chargebee.v4.models.estimate.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateInvoiceForItemsResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateCreateInvoiceForItemsResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateInvoiceForItemsResponse.java rename to src/main/java/com/chargebee/v4/models/estimate/responses/EstimateCreateInvoiceForItemsResponse.java index fd2c9f67..c4b2c599 100644 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateInvoiceForItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateCreateInvoiceForItemsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.estimate; +package com.chargebee.v4.models.estimate.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateInvoiceResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateCreateInvoiceResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateInvoiceResponse.java rename to src/main/java/com/chargebee/v4/models/estimate/responses/EstimateCreateInvoiceResponse.java index 9cc0c730..7ac827a3 100644 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateInvoiceResponse.java +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateCreateInvoiceResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.estimate; +package com.chargebee.v4.models.estimate.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateCreateSubscriptionResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateSubscriptionResponse.java rename to src/main/java/com/chargebee/v4/models/estimate/responses/EstimateCreateSubscriptionResponse.java index 35ffe41f..e5a31d99 100644 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateCreateSubscriptionResponse.java +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateCreateSubscriptionResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.estimate; +package com.chargebee.v4.models.estimate.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateGiftSubscriptionForItemsResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateGiftSubscriptionForItemsResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/estimate/EstimateGiftSubscriptionForItemsResponse.java rename to src/main/java/com/chargebee/v4/models/estimate/responses/EstimateGiftSubscriptionForItemsResponse.java index 87b7bd9a..28da1823 100644 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateGiftSubscriptionForItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateGiftSubscriptionForItemsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.estimate; +package com.chargebee.v4.models.estimate.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateGiftSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateGiftSubscriptionResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/estimate/EstimateGiftSubscriptionResponse.java rename to src/main/java/com/chargebee/v4/models/estimate/responses/EstimateGiftSubscriptionResponse.java index 23141980..25b96dc1 100644 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateGiftSubscriptionResponse.java +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateGiftSubscriptionResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.estimate; +package com.chargebee.v4.models.estimate.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimatePauseSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimatePauseSubscriptionResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/estimate/EstimatePauseSubscriptionResponse.java rename to src/main/java/com/chargebee/v4/models/estimate/responses/EstimatePauseSubscriptionResponse.java index 2444b51a..2b858001 100644 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimatePauseSubscriptionResponse.java +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimatePauseSubscriptionResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.estimate; +package com.chargebee.v4.models.estimate.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimatePaymentSchedulesResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimatePaymentSchedulesResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/estimate/EstimatePaymentSchedulesResponse.java rename to src/main/java/com/chargebee/v4/models/estimate/responses/EstimatePaymentSchedulesResponse.java index 90fdbd25..475cde51 100644 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimatePaymentSchedulesResponse.java +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimatePaymentSchedulesResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.estimate; +package com.chargebee.v4.models.estimate.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateResumeSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateResumeSubscriptionResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/estimate/EstimateResumeSubscriptionResponse.java rename to src/main/java/com/chargebee/v4/models/estimate/responses/EstimateResumeSubscriptionResponse.java index d387916d..e2785e95 100644 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateResumeSubscriptionResponse.java +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateResumeSubscriptionResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.estimate; +package com.chargebee.v4.models.estimate.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateUpdateSubscriptionForItemsResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateUpdateSubscriptionForItemsResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/estimate/EstimateUpdateSubscriptionForItemsResponse.java rename to src/main/java/com/chargebee/v4/models/estimate/responses/EstimateUpdateSubscriptionForItemsResponse.java index afd2aa01..8d6d2311 100644 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateUpdateSubscriptionForItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateUpdateSubscriptionForItemsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.estimate; +package com.chargebee.v4.models.estimate.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateUpdateSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateUpdateSubscriptionResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/estimate/EstimateUpdateSubscriptionResponse.java rename to src/main/java/com/chargebee/v4/models/estimate/responses/EstimateUpdateSubscriptionResponse.java index fe6630a2..ff8443a7 100644 --- a/src/main/java/com/chargebee/v4/core/responses/estimate/EstimateUpdateSubscriptionResponse.java +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/EstimateUpdateSubscriptionResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.estimate; +package com.chargebee.v4.models.estimate.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/estimate/responses/RegenerateInvoiceEstimateResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/RegenerateInvoiceEstimateResponse.java new file mode 100644 index 00000000..8c0f6017 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/RegenerateInvoiceEstimateResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.estimate.responses; + +import com.chargebee.v4.models.estimate.Estimate; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for RegenerateInvoiceEstimate operation. Contains the response data + * from the API. + */ +public final class RegenerateInvoiceEstimateResponse extends BaseResponse { + private final Estimate estimate; + + private RegenerateInvoiceEstimateResponse(Builder builder) { + super(builder.httpResponse); + + this.estimate = builder.estimate; + } + + /** Parse JSON response into RegenerateInvoiceEstimateResponse object. */ + public static RegenerateInvoiceEstimateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into RegenerateInvoiceEstimateResponse object with HTTP response. */ + public static RegenerateInvoiceEstimateResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __estimateJson = JsonUtil.getObject(json, "estimate"); + if (__estimateJson != null) { + builder.estimate(Estimate.fromJson(__estimateJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse RegenerateInvoiceEstimateResponse from JSON", e); + } + } + + /** Create a new builder for RegenerateInvoiceEstimateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for RegenerateInvoiceEstimateResponse. */ + public static class Builder { + + private Estimate estimate; + + private Response httpResponse; + + private Builder() {} + + public Builder estimate(Estimate estimate) { + this.estimate = estimate; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public RegenerateInvoiceEstimateResponse build() { + return new RegenerateInvoiceEstimateResponse(this); + } + } + + /** Get the estimate from the response. */ + public Estimate getEstimate() { + return estimate; + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/responses/RenewalEstimateResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/RenewalEstimateResponse.java new file mode 100644 index 00000000..0df95276 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/RenewalEstimateResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.estimate.responses; + +import com.chargebee.v4.models.estimate.Estimate; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for RenewalEstimate operation. Contains the response data from a single + * resource get operation. + */ +public final class RenewalEstimateResponse extends BaseResponse { + private final Estimate estimate; + + private RenewalEstimateResponse(Builder builder) { + super(builder.httpResponse); + + this.estimate = builder.estimate; + } + + /** Parse JSON response into RenewalEstimateResponse object. */ + public static RenewalEstimateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into RenewalEstimateResponse object with HTTP response. */ + public static RenewalEstimateResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __estimateJson = JsonUtil.getObject(json, "estimate"); + if (__estimateJson != null) { + builder.estimate(Estimate.fromJson(__estimateJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse RenewalEstimateResponse from JSON", e); + } + } + + /** Create a new builder for RenewalEstimateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for RenewalEstimateResponse. */ + public static class Builder { + + private Estimate estimate; + + private Response httpResponse; + + private Builder() {} + + public Builder estimate(Estimate estimate) { + this.estimate = estimate; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public RenewalEstimateResponse build() { + return new RenewalEstimateResponse(this); + } + } + + /** Get the estimate from the response. */ + public Estimate getEstimate() { + return estimate; + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/responses/UpcomingInvoicesEstimateResponse.java b/src/main/java/com/chargebee/v4/models/estimate/responses/UpcomingInvoicesEstimateResponse.java new file mode 100644 index 00000000..b673ae3d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/estimate/responses/UpcomingInvoicesEstimateResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.estimate.responses; + +import com.chargebee.v4.models.estimate.Estimate; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for UpcomingInvoicesEstimate operation. Contains the response data from + * a single resource get operation. + */ +public final class UpcomingInvoicesEstimateResponse extends BaseResponse { + private final Estimate estimate; + + private UpcomingInvoicesEstimateResponse(Builder builder) { + super(builder.httpResponse); + + this.estimate = builder.estimate; + } + + /** Parse JSON response into UpcomingInvoicesEstimateResponse object. */ + public static UpcomingInvoicesEstimateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into UpcomingInvoicesEstimateResponse object with HTTP response. */ + public static UpcomingInvoicesEstimateResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __estimateJson = JsonUtil.getObject(json, "estimate"); + if (__estimateJson != null) { + builder.estimate(Estimate.fromJson(__estimateJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse UpcomingInvoicesEstimateResponse from JSON", e); + } + } + + /** Create a new builder for UpcomingInvoicesEstimateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UpcomingInvoicesEstimateResponse. */ + public static class Builder { + + private Estimate estimate; + + private Response httpResponse; + + private Builder() {} + + public Builder estimate(Estimate estimate) { + this.estimate = estimate; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public UpcomingInvoicesEstimateResponse build() { + return new UpcomingInvoicesEstimateResponse(this); + } + } + + /** Get the estimate from the response. */ + public Estimate getEstimate() { + return estimate; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/addUsagesReminderEvent/AddUsagesReminderEvent.java b/src/main/java/com/chargebee/v4/models/event/AddUsagesReminderEvent.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/models/addUsagesReminderEvent/AddUsagesReminderEvent.java rename to src/main/java/com/chargebee/v4/models/event/AddUsagesReminderEvent.java index e0655e56..50b39563 100644 --- a/src/main/java/com/chargebee/v4/core/models/addUsagesReminderEvent/AddUsagesReminderEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/AddUsagesReminderEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.addUsagesReminderEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.usageReminderInfo.UsageReminderInfo; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.usageReminderInfo.UsageReminderInfo; public class AddUsagesReminderEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/addonCreatedEvent/AddonCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/AddonCreatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/addonCreatedEvent/AddonCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/AddonCreatedEvent.java index cc7be541..5d53da54 100644 --- a/src/main/java/com/chargebee/v4/core/models/addonCreatedEvent/AddonCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/AddonCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.addonCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.addon.Addon; +import com.chargebee.v4.models.addon.Addon; public class AddonCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/addonDeletedEvent/AddonDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/AddonDeletedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/addonDeletedEvent/AddonDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/AddonDeletedEvent.java index 5c2b9cd7..4ec76f25 100644 --- a/src/main/java/com/chargebee/v4/core/models/addonDeletedEvent/AddonDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/AddonDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.addonDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.addon.Addon; +import com.chargebee.v4.models.addon.Addon; public class AddonDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/addonUpdatedEvent/AddonUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/AddonUpdatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/addonUpdatedEvent/AddonUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/AddonUpdatedEvent.java index d8abdcc5..4904e669 100644 --- a/src/main/java/com/chargebee/v4/core/models/addonUpdatedEvent/AddonUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/AddonUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.addonUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.addon.Addon; +import com.chargebee.v4.models.addon.Addon; public class AddonUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/attachedItemCreatedEvent/AttachedItemCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/AttachedItemCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/attachedItemCreatedEvent/AttachedItemCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/AttachedItemCreatedEvent.java index e115b244..3aaacee6 100644 --- a/src/main/java/com/chargebee/v4/core/models/attachedItemCreatedEvent/AttachedItemCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/AttachedItemCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.attachedItemCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.attachedItem.AttachedItem; +import com.chargebee.v4.models.attachedItem.AttachedItem; public class AttachedItemCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/attachedItemDeletedEvent/AttachedItemDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/AttachedItemDeletedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/attachedItemDeletedEvent/AttachedItemDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/AttachedItemDeletedEvent.java index 7155ec22..294398ba 100644 --- a/src/main/java/com/chargebee/v4/core/models/attachedItemDeletedEvent/AttachedItemDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/AttachedItemDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.attachedItemDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.attachedItem.AttachedItem; +import com.chargebee.v4.models.attachedItem.AttachedItem; public class AttachedItemDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/attachedItemUpdatedEvent/AttachedItemUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/AttachedItemUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/attachedItemUpdatedEvent/AttachedItemUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/AttachedItemUpdatedEvent.java index 96917aeb..62657d80 100644 --- a/src/main/java/com/chargebee/v4/core/models/attachedItemUpdatedEvent/AttachedItemUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/AttachedItemUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.attachedItemUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.attachedItem.AttachedItem; +import com.chargebee.v4.models.attachedItem.AttachedItem; public class AttachedItemUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/authorizationSucceededEvent/AuthorizationSucceededEvent.java b/src/main/java/com/chargebee/v4/models/event/AuthorizationSucceededEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/authorizationSucceededEvent/AuthorizationSucceededEvent.java rename to src/main/java/com/chargebee/v4/models/event/AuthorizationSucceededEvent.java index ded4ce7a..487175df 100644 --- a/src/main/java/com/chargebee/v4/core/models/authorizationSucceededEvent/AuthorizationSucceededEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/AuthorizationSucceededEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.authorizationSucceededEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; public class AuthorizationSucceededEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/authorizationVoidedEvent/AuthorizationVoidedEvent.java b/src/main/java/com/chargebee/v4/models/event/AuthorizationVoidedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/authorizationVoidedEvent/AuthorizationVoidedEvent.java rename to src/main/java/com/chargebee/v4/models/event/AuthorizationVoidedEvent.java index a297ed6c..b1b1fe2a 100644 --- a/src/main/java/com/chargebee/v4/core/models/authorizationVoidedEvent/AuthorizationVoidedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/AuthorizationVoidedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.authorizationVoidedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; public class AuthorizationVoidedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/businessEntityCreatedEvent/BusinessEntityCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/BusinessEntityCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/businessEntityCreatedEvent/BusinessEntityCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/BusinessEntityCreatedEvent.java index 9438ff84..3627eaea 100644 --- a/src/main/java/com/chargebee/v4/core/models/businessEntityCreatedEvent/BusinessEntityCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/BusinessEntityCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.businessEntityCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.businessEntity.BusinessEntity; +import com.chargebee.v4.models.businessEntity.BusinessEntity; public class BusinessEntityCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/businessEntityDeletedEvent/BusinessEntityDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/BusinessEntityDeletedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/businessEntityDeletedEvent/BusinessEntityDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/BusinessEntityDeletedEvent.java index a1311a51..600e4f40 100644 --- a/src/main/java/com/chargebee/v4/core/models/businessEntityDeletedEvent/BusinessEntityDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/BusinessEntityDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.businessEntityDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.businessEntity.BusinessEntity; +import com.chargebee.v4.models.businessEntity.BusinessEntity; public class BusinessEntityDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/businessEntityUpdatedEvent/BusinessEntityUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/BusinessEntityUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/businessEntityUpdatedEvent/BusinessEntityUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/BusinessEntityUpdatedEvent.java index b9271966..a7eb0452 100644 --- a/src/main/java/com/chargebee/v4/core/models/businessEntityUpdatedEvent/BusinessEntityUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/BusinessEntityUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.businessEntityUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.businessEntity.BusinessEntity; +import com.chargebee.v4.models.businessEntity.BusinessEntity; public class BusinessEntityUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/cardAddedEvent/CardAddedEvent.java b/src/main/java/com/chargebee/v4/models/event/CardAddedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/cardAddedEvent/CardAddedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CardAddedEvent.java index f5b54bc7..565e67df 100644 --- a/src/main/java/com/chargebee/v4/core/models/cardAddedEvent/CardAddedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CardAddedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.cardAddedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; public class CardAddedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/cardDeletedEvent/CardDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/CardDeletedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/cardDeletedEvent/CardDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CardDeletedEvent.java index 15777664..adf958e8 100644 --- a/src/main/java/com/chargebee/v4/core/models/cardDeletedEvent/CardDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CardDeletedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.cardDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; public class CardDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/cardExpiredEvent/CardExpiredEvent.java b/src/main/java/com/chargebee/v4/models/event/CardExpiredEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/cardExpiredEvent/CardExpiredEvent.java rename to src/main/java/com/chargebee/v4/models/event/CardExpiredEvent.java index 55026168..24127810 100644 --- a/src/main/java/com/chargebee/v4/core/models/cardExpiredEvent/CardExpiredEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CardExpiredEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.cardExpiredEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; public class CardExpiredEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/cardExpiryReminderEvent/CardExpiryReminderEvent.java b/src/main/java/com/chargebee/v4/models/event/CardExpiryReminderEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/cardExpiryReminderEvent/CardExpiryReminderEvent.java rename to src/main/java/com/chargebee/v4/models/event/CardExpiryReminderEvent.java index ac34c143..d82aeb15 100644 --- a/src/main/java/com/chargebee/v4/core/models/cardExpiryReminderEvent/CardExpiryReminderEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CardExpiryReminderEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.cardExpiryReminderEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; public class CardExpiryReminderEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/cardUpdatedEvent/CardUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/CardUpdatedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/cardUpdatedEvent/CardUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CardUpdatedEvent.java index b9dc2733..df0f86cd 100644 --- a/src/main/java/com/chargebee/v4/core/models/cardUpdatedEvent/CardUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CardUpdatedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.cardUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; public class CardUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/contractTermCancelledEvent/ContractTermCancelledEvent.java b/src/main/java/com/chargebee/v4/models/event/ContractTermCancelledEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/contractTermCancelledEvent/ContractTermCancelledEvent.java rename to src/main/java/com/chargebee/v4/models/event/ContractTermCancelledEvent.java index 9dd16d5a..cf4c77f0 100644 --- a/src/main/java/com/chargebee/v4/core/models/contractTermCancelledEvent/ContractTermCancelledEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ContractTermCancelledEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.contractTermCancelledEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.contractTerm.ContractTerm; +import com.chargebee.v4.models.contractTerm.ContractTerm; public class ContractTermCancelledEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/contractTermCompletedEvent/ContractTermCompletedEvent.java b/src/main/java/com/chargebee/v4/models/event/ContractTermCompletedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/contractTermCompletedEvent/ContractTermCompletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ContractTermCompletedEvent.java index c0f2292b..b93645c8 100644 --- a/src/main/java/com/chargebee/v4/core/models/contractTermCompletedEvent/ContractTermCompletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ContractTermCompletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.contractTermCompletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.contractTerm.ContractTerm; +import com.chargebee.v4.models.contractTerm.ContractTerm; public class ContractTermCompletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/contractTermCreatedEvent/ContractTermCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/ContractTermCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/contractTermCreatedEvent/ContractTermCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ContractTermCreatedEvent.java index 86d52d5d..76d587ae 100644 --- a/src/main/java/com/chargebee/v4/core/models/contractTermCreatedEvent/ContractTermCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ContractTermCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.contractTermCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.contractTerm.ContractTerm; +import com.chargebee.v4.models.contractTerm.ContractTerm; public class ContractTermCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/contractTermRenewedEvent/ContractTermRenewedEvent.java b/src/main/java/com/chargebee/v4/models/event/ContractTermRenewedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/contractTermRenewedEvent/ContractTermRenewedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ContractTermRenewedEvent.java index 4672ccba..7bf11e18 100644 --- a/src/main/java/com/chargebee/v4/core/models/contractTermRenewedEvent/ContractTermRenewedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ContractTermRenewedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.contractTermRenewedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.contractTerm.ContractTerm; +import com.chargebee.v4.models.contractTerm.ContractTerm; public class ContractTermRenewedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/contractTermTerminatedEvent/ContractTermTerminatedEvent.java b/src/main/java/com/chargebee/v4/models/event/ContractTermTerminatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/contractTermTerminatedEvent/ContractTermTerminatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ContractTermTerminatedEvent.java index 4232f5a8..86500a84 100644 --- a/src/main/java/com/chargebee/v4/core/models/contractTermTerminatedEvent/ContractTermTerminatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ContractTermTerminatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.contractTermTerminatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.contractTerm.ContractTerm; +import com.chargebee.v4.models.contractTerm.ContractTerm; public class ContractTermTerminatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/couponCodesAddedEvent/CouponCodesAddedEvent.java b/src/main/java/com/chargebee/v4/models/event/CouponCodesAddedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/couponCodesAddedEvent/CouponCodesAddedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CouponCodesAddedEvent.java index a19402b3..e0eadd89 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponCodesAddedEvent/CouponCodesAddedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CouponCodesAddedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponCodesAddedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.couponSet.CouponSet; -import com.chargebee.v4.core.models.couponSet.CouponSet; +import com.chargebee.v4.models.coupon.Coupon; public class CouponCodesAddedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/couponCodesDeletedEvent/CouponCodesDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/CouponCodesDeletedEvent.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/couponCodesDeletedEvent/CouponCodesDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CouponCodesDeletedEvent.java index 02a80353..35523cce 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponCodesDeletedEvent/CouponCodesDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CouponCodesDeletedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponCodesDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.couponSet.CouponSet; -import com.chargebee.v4.core.models.couponSet.CouponSet; +import com.chargebee.v4.models.couponCode.CouponCode; -import com.chargebee.v4.core.models.couponCode.CouponCode; +import com.chargebee.v4.models.coupon.Coupon; public class CouponCodesDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/couponCodesUpdatedEvent/CouponCodesUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/CouponCodesUpdatedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/couponCodesUpdatedEvent/CouponCodesUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CouponCodesUpdatedEvent.java index b0aab530..7d0fb32c 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponCodesUpdatedEvent/CouponCodesUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CouponCodesUpdatedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponCodesUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.couponSet.CouponSet; -import com.chargebee.v4.core.models.couponSet.CouponSet; +import com.chargebee.v4.models.coupon.Coupon; public class CouponCodesUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/couponCreatedEvent/CouponCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/CouponCreatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/couponCreatedEvent/CouponCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CouponCreatedEvent.java index 771c554d..5165f385 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponCreatedEvent/CouponCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CouponCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.coupon.Coupon; public class CouponCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/couponDeletedEvent/CouponDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/CouponDeletedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/couponDeletedEvent/CouponDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CouponDeletedEvent.java index e076f77a..f41d84b2 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponDeletedEvent/CouponDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CouponDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.coupon.Coupon; public class CouponDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/couponSetCreatedEvent/CouponSetCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/CouponSetCreatedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/couponSetCreatedEvent/CouponSetCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CouponSetCreatedEvent.java index 747f4626..b6483f39 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponSetCreatedEvent/CouponSetCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CouponSetCreatedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponSetCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.couponSet.CouponSet; -import com.chargebee.v4.core.models.couponSet.CouponSet; +import com.chargebee.v4.models.coupon.Coupon; public class CouponSetCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/couponSetDeletedEvent/CouponSetDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/CouponSetDeletedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/couponSetDeletedEvent/CouponSetDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CouponSetDeletedEvent.java index 1fab75f3..5675b663 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponSetDeletedEvent/CouponSetDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CouponSetDeletedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponSetDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.couponSet.CouponSet; -import com.chargebee.v4.core.models.couponSet.CouponSet; +import com.chargebee.v4.models.coupon.Coupon; public class CouponSetDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/couponSetUpdatedEvent/CouponSetUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/CouponSetUpdatedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/couponSetUpdatedEvent/CouponSetUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CouponSetUpdatedEvent.java index b3329de8..9aa3029b 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponSetUpdatedEvent/CouponSetUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CouponSetUpdatedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponSetUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.couponSet.CouponSet; -import com.chargebee.v4.core.models.couponSet.CouponSet; +import com.chargebee.v4.models.coupon.Coupon; public class CouponSetUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/couponUpdatedEvent/CouponUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/CouponUpdatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/couponUpdatedEvent/CouponUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CouponUpdatedEvent.java index cc6ae24d..4414dd01 100644 --- a/src/main/java/com/chargebee/v4/core/models/couponUpdatedEvent/CouponUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CouponUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.couponUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.coupon.Coupon; +import com.chargebee.v4.models.coupon.Coupon; public class CouponUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/creditNoteCreatedEvent/CreditNoteCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/CreditNoteCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/creditNoteCreatedEvent/CreditNoteCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CreditNoteCreatedEvent.java index e5915958..9d6bbf16 100644 --- a/src/main/java/com/chargebee/v4/core/models/creditNoteCreatedEvent/CreditNoteCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CreditNoteCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.creditNoteCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; public class CreditNoteCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/creditNoteCreatedWithBackdatingEvent/CreditNoteCreatedWithBackdatingEvent.java b/src/main/java/com/chargebee/v4/models/event/CreditNoteCreatedWithBackdatingEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/creditNoteCreatedWithBackdatingEvent/CreditNoteCreatedWithBackdatingEvent.java rename to src/main/java/com/chargebee/v4/models/event/CreditNoteCreatedWithBackdatingEvent.java index 15c799ff..5a108c3b 100644 --- a/src/main/java/com/chargebee/v4/core/models/creditNoteCreatedWithBackdatingEvent/CreditNoteCreatedWithBackdatingEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CreditNoteCreatedWithBackdatingEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.creditNoteCreatedWithBackdatingEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; public class CreditNoteCreatedWithBackdatingEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/creditNoteDeletedEvent/CreditNoteDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/CreditNoteDeletedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/creditNoteDeletedEvent/CreditNoteDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CreditNoteDeletedEvent.java index b9c1cd28..5c09db77 100644 --- a/src/main/java/com/chargebee/v4/core/models/creditNoteDeletedEvent/CreditNoteDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CreditNoteDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.creditNoteDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; public class CreditNoteDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/creditNoteUpdatedEvent/CreditNoteUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/CreditNoteUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/creditNoteUpdatedEvent/CreditNoteUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CreditNoteUpdatedEvent.java index 3bc93340..ca298feb 100644 --- a/src/main/java/com/chargebee/v4/core/models/creditNoteUpdatedEvent/CreditNoteUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CreditNoteUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.creditNoteUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; public class CreditNoteUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/customerBusinessEntityChangedEvent/CustomerBusinessEntityChangedEvent.java b/src/main/java/com/chargebee/v4/models/event/CustomerBusinessEntityChangedEvent.java similarity index 78% rename from src/main/java/com/chargebee/v4/core/models/customerBusinessEntityChangedEvent/CustomerBusinessEntityChangedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CustomerBusinessEntityChangedEvent.java index 962eebbd..bf6a4316 100644 --- a/src/main/java/com/chargebee/v4/core/models/customerBusinessEntityChangedEvent/CustomerBusinessEntityChangedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CustomerBusinessEntityChangedEvent.java @@ -5,15 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customerBusinessEntityChangedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.businessEntityChange.BusinessEntityChange; - -import com.chargebee.v4.core.models.businessEntityTransfer.BusinessEntityTransfer; +import com.chargebee.v4.models.businessEntityTransfer.BusinessEntityTransfer; public class CustomerBusinessEntityChangedEvent { @@ -85,14 +83,9 @@ public static CustomerBusinessEntityChangedEvent fromJson(String json) { public static class Content { - private BusinessEntityChange businessEntityChange; private BusinessEntityTransfer businessEntityTransfer; private Customer customer; - public BusinessEntityChange getBusinessEntityChange() { - return businessEntityChange; - } - public BusinessEntityTransfer getBusinessEntityTransfer() { return businessEntityTransfer; } @@ -104,11 +97,6 @@ public Customer getCustomer() { public static Content fromJson(String json) { Content obj = new Content(); - String __businessEntityChangeJson = JsonUtil.getObject(json, "business_entity_change"); - if (__businessEntityChangeJson != null) { - obj.businessEntityChange = BusinessEntityChange.fromJson(__businessEntityChangeJson); - } - String __businessEntityTransferJson = JsonUtil.getObject(json, "business_entity_transfer"); if (__businessEntityTransferJson != null) { obj.businessEntityTransfer = BusinessEntityTransfer.fromJson(__businessEntityTransferJson); diff --git a/src/main/java/com/chargebee/v4/core/models/customerChangedEvent/CustomerChangedEvent.java b/src/main/java/com/chargebee/v4/models/event/CustomerChangedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/customerChangedEvent/CustomerChangedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CustomerChangedEvent.java index 25c22114..f21bd596 100644 --- a/src/main/java/com/chargebee/v4/core/models/customerChangedEvent/CustomerChangedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CustomerChangedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customerChangedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; public class CustomerChangedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/customerCreatedEvent/CustomerCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/CustomerCreatedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/customerCreatedEvent/CustomerCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CustomerCreatedEvent.java index 3bea88ec..99b540e8 100644 --- a/src/main/java/com/chargebee/v4/core/models/customerCreatedEvent/CustomerCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CustomerCreatedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customerCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; public class CustomerCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/customerDeletedEvent/CustomerDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/CustomerDeletedEvent.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/customerDeletedEvent/CustomerDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CustomerDeletedEvent.java index 4bb406ae..b823eefa 100644 --- a/src/main/java/com/chargebee/v4/core/models/customerDeletedEvent/CustomerDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CustomerDeletedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customerDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; public class CustomerDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/customerEntitlementsUpdatedEvent/CustomerEntitlementsUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/CustomerEntitlementsUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/customerEntitlementsUpdatedEvent/CustomerEntitlementsUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/CustomerEntitlementsUpdatedEvent.java index 44929d03..702dabe8 100644 --- a/src/main/java/com/chargebee/v4/core/models/customerEntitlementsUpdatedEvent/CustomerEntitlementsUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CustomerEntitlementsUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customerEntitlementsUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.impactedCustomer.ImpactedCustomer; +import com.chargebee.v4.models.impactedCustomer.ImpactedCustomer; public class CustomerEntitlementsUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/customerMovedInEvent/CustomerMovedInEvent.java b/src/main/java/com/chargebee/v4/models/event/CustomerMovedInEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/customerMovedInEvent/CustomerMovedInEvent.java rename to src/main/java/com/chargebee/v4/models/event/CustomerMovedInEvent.java index 26e19382..99fb5495 100644 --- a/src/main/java/com/chargebee/v4/core/models/customerMovedInEvent/CustomerMovedInEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CustomerMovedInEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customerMovedInEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; public class CustomerMovedInEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/customerMovedOutEvent/CustomerMovedOutEvent.java b/src/main/java/com/chargebee/v4/models/event/CustomerMovedOutEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/customerMovedOutEvent/CustomerMovedOutEvent.java rename to src/main/java/com/chargebee/v4/models/event/CustomerMovedOutEvent.java index 575c436e..5f1dc646 100644 --- a/src/main/java/com/chargebee/v4/core/models/customerMovedOutEvent/CustomerMovedOutEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/CustomerMovedOutEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.customerMovedOutEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; public class CustomerMovedOutEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/differentialPriceCreatedEvent/DifferentialPriceCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/DifferentialPriceCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/differentialPriceCreatedEvent/DifferentialPriceCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/DifferentialPriceCreatedEvent.java index f3f852ee..a00ce00e 100644 --- a/src/main/java/com/chargebee/v4/core/models/differentialPriceCreatedEvent/DifferentialPriceCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/DifferentialPriceCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.differentialPriceCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.differentialPrice.DifferentialPrice; +import com.chargebee.v4.models.differentialPrice.DifferentialPrice; public class DifferentialPriceCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/differentialPriceDeletedEvent/DifferentialPriceDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/DifferentialPriceDeletedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/differentialPriceDeletedEvent/DifferentialPriceDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/DifferentialPriceDeletedEvent.java index 048b486c..94117d0c 100644 --- a/src/main/java/com/chargebee/v4/core/models/differentialPriceDeletedEvent/DifferentialPriceDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/DifferentialPriceDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.differentialPriceDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.differentialPrice.DifferentialPrice; +import com.chargebee.v4.models.differentialPrice.DifferentialPrice; public class DifferentialPriceDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/differentialPriceUpdatedEvent/DifferentialPriceUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/DifferentialPriceUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/differentialPriceUpdatedEvent/DifferentialPriceUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/DifferentialPriceUpdatedEvent.java index 58b9e73a..e8471da3 100644 --- a/src/main/java/com/chargebee/v4/core/models/differentialPriceUpdatedEvent/DifferentialPriceUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/DifferentialPriceUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.differentialPriceUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.differentialPrice.DifferentialPrice; +import com.chargebee.v4.models.differentialPrice.DifferentialPrice; public class DifferentialPriceUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/dunningUpdatedEvent/DunningUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/DunningUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/dunningUpdatedEvent/DunningUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/DunningUpdatedEvent.java index 3702967d..a919ef71 100644 --- a/src/main/java/com/chargebee/v4/core/models/dunningUpdatedEvent/DunningUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/DunningUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.dunningUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; public class DunningUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/entitlementOverridesAutoRemovedEvent/EntitlementOverridesAutoRemovedEvent.java b/src/main/java/com/chargebee/v4/models/event/EntitlementOverridesAutoRemovedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/entitlementOverridesAutoRemovedEvent/EntitlementOverridesAutoRemovedEvent.java rename to src/main/java/com/chargebee/v4/models/event/EntitlementOverridesAutoRemovedEvent.java index 59e1c9d1..ef2489e3 100644 --- a/src/main/java/com/chargebee/v4/core/models/entitlementOverridesAutoRemovedEvent/EntitlementOverridesAutoRemovedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/EntitlementOverridesAutoRemovedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.entitlementOverridesAutoRemovedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.impactedItem.ImpactedItem; +import com.chargebee.v4.models.impactedItem.ImpactedItem; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.metadata.Metadata; -import com.chargebee.v4.core.models.impactedSubscription.ImpactedSubscription; +import com.chargebee.v4.models.impactedSubscription.ImpactedSubscription; -import com.chargebee.v4.core.models.metadata.Metadata; +import com.chargebee.v4.models.feature.Feature; public class EntitlementOverridesAutoRemovedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/entitlementOverridesRemovedEvent/EntitlementOverridesRemovedEvent.java b/src/main/java/com/chargebee/v4/models/event/EntitlementOverridesRemovedEvent.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/entitlementOverridesRemovedEvent/EntitlementOverridesRemovedEvent.java rename to src/main/java/com/chargebee/v4/models/event/EntitlementOverridesRemovedEvent.java index 67bac305..30eebeb5 100644 --- a/src/main/java/com/chargebee/v4/core/models/entitlementOverridesRemovedEvent/EntitlementOverridesRemovedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/EntitlementOverridesRemovedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.entitlementOverridesRemovedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.impactedSubscription.ImpactedSubscription; +import com.chargebee.v4.models.metadata.Metadata; -import com.chargebee.v4.core.models.metadata.Metadata; +import com.chargebee.v4.models.impactedSubscription.ImpactedSubscription; public class EntitlementOverridesRemovedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/entitlementOverridesUpdatedEvent/EntitlementOverridesUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/EntitlementOverridesUpdatedEvent.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/entitlementOverridesUpdatedEvent/EntitlementOverridesUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/EntitlementOverridesUpdatedEvent.java index 3967a10d..ab88eeb7 100644 --- a/src/main/java/com/chargebee/v4/core/models/entitlementOverridesUpdatedEvent/EntitlementOverridesUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/EntitlementOverridesUpdatedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.entitlementOverridesUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.impactedSubscription.ImpactedSubscription; +import com.chargebee.v4.models.metadata.Metadata; -import com.chargebee.v4.core.models.metadata.Metadata; +import com.chargebee.v4.models.impactedSubscription.ImpactedSubscription; public class EntitlementOverridesUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/event/Event.java b/src/main/java/com/chargebee/v4/models/event/Event.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/event/Event.java rename to src/main/java/com/chargebee/v4/models/event/Event.java index 0067314a..e63bf73c 100644 --- a/src/main/java/com/chargebee/v4/core/models/event/Event.java +++ b/src/main/java/com/chargebee/v4/models/event/Event.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.event; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/featureActivatedEvent/FeatureActivatedEvent.java b/src/main/java/com/chargebee/v4/models/event/FeatureActivatedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/featureActivatedEvent/FeatureActivatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/FeatureActivatedEvent.java index 97f9855a..f48e1609 100644 --- a/src/main/java/com/chargebee/v4/core/models/featureActivatedEvent/FeatureActivatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/FeatureActivatedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.featureActivatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.impactedItem.ImpactedItem; +import com.chargebee.v4.models.impactedItem.ImpactedItem; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.metadata.Metadata; -import com.chargebee.v4.core.models.impactedSubscription.ImpactedSubscription; +import com.chargebee.v4.models.impactedSubscription.ImpactedSubscription; -import com.chargebee.v4.core.models.metadata.Metadata; +import com.chargebee.v4.models.feature.Feature; public class FeatureActivatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/featureArchivedEvent/FeatureArchivedEvent.java b/src/main/java/com/chargebee/v4/models/event/FeatureArchivedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/featureArchivedEvent/FeatureArchivedEvent.java rename to src/main/java/com/chargebee/v4/models/event/FeatureArchivedEvent.java index 59ebbe52..cf845d76 100644 --- a/src/main/java/com/chargebee/v4/core/models/featureArchivedEvent/FeatureArchivedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/FeatureArchivedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.featureArchivedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.metadata.Metadata; -import com.chargebee.v4.core.models.metadata.Metadata; +import com.chargebee.v4.models.feature.Feature; public class FeatureArchivedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/featureCreatedEvent/FeatureCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/FeatureCreatedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/featureCreatedEvent/FeatureCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/FeatureCreatedEvent.java index 3cbebded..84286959 100644 --- a/src/main/java/com/chargebee/v4/core/models/featureCreatedEvent/FeatureCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/FeatureCreatedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.featureCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.impactedItem.ImpactedItem; +import com.chargebee.v4.models.impactedItem.ImpactedItem; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.metadata.Metadata; -import com.chargebee.v4.core.models.impactedSubscription.ImpactedSubscription; +import com.chargebee.v4.models.impactedSubscription.ImpactedSubscription; -import com.chargebee.v4.core.models.metadata.Metadata; +import com.chargebee.v4.models.feature.Feature; public class FeatureCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/featureDeletedEvent/FeatureDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/FeatureDeletedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/featureDeletedEvent/FeatureDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/FeatureDeletedEvent.java index 92f687a9..106c08fd 100644 --- a/src/main/java/com/chargebee/v4/core/models/featureDeletedEvent/FeatureDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/FeatureDeletedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.featureDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.impactedItem.ImpactedItem; +import com.chargebee.v4.models.impactedItem.ImpactedItem; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.metadata.Metadata; -import com.chargebee.v4.core.models.impactedSubscription.ImpactedSubscription; +import com.chargebee.v4.models.impactedSubscription.ImpactedSubscription; -import com.chargebee.v4.core.models.metadata.Metadata; +import com.chargebee.v4.models.feature.Feature; public class FeatureDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/featureReactivatedEvent/FeatureReactivatedEvent.java b/src/main/java/com/chargebee/v4/models/event/FeatureReactivatedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/featureReactivatedEvent/FeatureReactivatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/FeatureReactivatedEvent.java index 3eea5baf..516b1775 100644 --- a/src/main/java/com/chargebee/v4/core/models/featureReactivatedEvent/FeatureReactivatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/FeatureReactivatedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.featureReactivatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.metadata.Metadata; -import com.chargebee.v4.core.models.metadata.Metadata; +import com.chargebee.v4.models.feature.Feature; public class FeatureReactivatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/featureUpdatedEvent/FeatureUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/FeatureUpdatedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/featureUpdatedEvent/FeatureUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/FeatureUpdatedEvent.java index 4c4c69ab..91b0c121 100644 --- a/src/main/java/com/chargebee/v4/core/models/featureUpdatedEvent/FeatureUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/FeatureUpdatedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.featureUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.metadata.Metadata; -import com.chargebee.v4.core.models.metadata.Metadata; +import com.chargebee.v4.models.feature.Feature; public class FeatureUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/giftCancelledEvent/GiftCancelledEvent.java b/src/main/java/com/chargebee/v4/models/event/GiftCancelledEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/giftCancelledEvent/GiftCancelledEvent.java rename to src/main/java/com/chargebee/v4/models/event/GiftCancelledEvent.java index 52ca9b5a..08dfbb82 100644 --- a/src/main/java/com/chargebee/v4/core/models/giftCancelledEvent/GiftCancelledEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/GiftCancelledEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.giftCancelledEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.gift.Gift; +import com.chargebee.v4.models.gift.Gift; public class GiftCancelledEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/giftClaimedEvent/GiftClaimedEvent.java b/src/main/java/com/chargebee/v4/models/event/GiftClaimedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/giftClaimedEvent/GiftClaimedEvent.java rename to src/main/java/com/chargebee/v4/models/event/GiftClaimedEvent.java index 08a6927a..4e64c834 100644 --- a/src/main/java/com/chargebee/v4/core/models/giftClaimedEvent/GiftClaimedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/GiftClaimedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.giftClaimedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.gift.Gift; +import com.chargebee.v4.models.gift.Gift; public class GiftClaimedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/giftExpiredEvent/GiftExpiredEvent.java b/src/main/java/com/chargebee/v4/models/event/GiftExpiredEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/giftExpiredEvent/GiftExpiredEvent.java rename to src/main/java/com/chargebee/v4/models/event/GiftExpiredEvent.java index 23b5473a..f60d2bb0 100644 --- a/src/main/java/com/chargebee/v4/core/models/giftExpiredEvent/GiftExpiredEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/GiftExpiredEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.giftExpiredEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.gift.Gift; +import com.chargebee.v4.models.gift.Gift; public class GiftExpiredEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/giftScheduledEvent/GiftScheduledEvent.java b/src/main/java/com/chargebee/v4/models/event/GiftScheduledEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/giftScheduledEvent/GiftScheduledEvent.java rename to src/main/java/com/chargebee/v4/models/event/GiftScheduledEvent.java index cff60be0..411da0ba 100644 --- a/src/main/java/com/chargebee/v4/core/models/giftScheduledEvent/GiftScheduledEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/GiftScheduledEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.giftScheduledEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.gift.Gift; +import com.chargebee.v4.models.gift.Gift; public class GiftScheduledEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/giftUnclaimedEvent/GiftUnclaimedEvent.java b/src/main/java/com/chargebee/v4/models/event/GiftUnclaimedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/giftUnclaimedEvent/GiftUnclaimedEvent.java rename to src/main/java/com/chargebee/v4/models/event/GiftUnclaimedEvent.java index 84645775..95a50259 100644 --- a/src/main/java/com/chargebee/v4/core/models/giftUnclaimedEvent/GiftUnclaimedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/GiftUnclaimedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.giftUnclaimedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.gift.Gift; +import com.chargebee.v4.models.gift.Gift; public class GiftUnclaimedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/giftUpdatedEvent/GiftUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/GiftUpdatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/giftUpdatedEvent/GiftUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/GiftUpdatedEvent.java index 63c9d65d..8f036005 100644 --- a/src/main/java/com/chargebee/v4/core/models/giftUpdatedEvent/GiftUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/GiftUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.giftUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.gift.Gift; +import com.chargebee.v4.models.gift.Gift; public class GiftUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/hierarchyCreatedEvent/HierarchyCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/HierarchyCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/hierarchyCreatedEvent/HierarchyCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/HierarchyCreatedEvent.java index 9cad49e3..777da810 100644 --- a/src/main/java/com/chargebee/v4/core/models/hierarchyCreatedEvent/HierarchyCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/HierarchyCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.hierarchyCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; public class HierarchyCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/hierarchyDeletedEvent/HierarchyDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/HierarchyDeletedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/hierarchyDeletedEvent/HierarchyDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/HierarchyDeletedEvent.java index 79aa6542..e2785836 100644 --- a/src/main/java/com/chargebee/v4/core/models/hierarchyDeletedEvent/HierarchyDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/HierarchyDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.hierarchyDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; public class HierarchyDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/invoiceDeletedEvent/InvoiceDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/InvoiceDeletedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/invoiceDeletedEvent/InvoiceDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/InvoiceDeletedEvent.java index 6ccbd390..a86c1ada 100644 --- a/src/main/java/com/chargebee/v4/core/models/invoiceDeletedEvent/InvoiceDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/InvoiceDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.invoiceDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; public class InvoiceDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/invoiceGeneratedEvent/InvoiceGeneratedEvent.java b/src/main/java/com/chargebee/v4/models/event/InvoiceGeneratedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/invoiceGeneratedEvent/InvoiceGeneratedEvent.java rename to src/main/java/com/chargebee/v4/models/event/InvoiceGeneratedEvent.java index 170b68b1..16e1119e 100644 --- a/src/main/java/com/chargebee/v4/core/models/invoiceGeneratedEvent/InvoiceGeneratedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/InvoiceGeneratedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.invoiceGeneratedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; public class InvoiceGeneratedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/invoiceGeneratedWithBackdatingEvent/InvoiceGeneratedWithBackdatingEvent.java b/src/main/java/com/chargebee/v4/models/event/InvoiceGeneratedWithBackdatingEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/invoiceGeneratedWithBackdatingEvent/InvoiceGeneratedWithBackdatingEvent.java rename to src/main/java/com/chargebee/v4/models/event/InvoiceGeneratedWithBackdatingEvent.java index e8be9499..89a07cee 100644 --- a/src/main/java/com/chargebee/v4/core/models/invoiceGeneratedWithBackdatingEvent/InvoiceGeneratedWithBackdatingEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/InvoiceGeneratedWithBackdatingEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.invoiceGeneratedWithBackdatingEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; public class InvoiceGeneratedWithBackdatingEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/invoiceUpdatedEvent/InvoiceUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/InvoiceUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/invoiceUpdatedEvent/InvoiceUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/InvoiceUpdatedEvent.java index 5f161a16..148bc3cc 100644 --- a/src/main/java/com/chargebee/v4/core/models/invoiceUpdatedEvent/InvoiceUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/InvoiceUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.invoiceUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; public class InvoiceUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/itemCreatedEvent/ItemCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/ItemCreatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/itemCreatedEvent/ItemCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ItemCreatedEvent.java index 3bc2e806..f8ca6dc9 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemCreatedEvent/ItemCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ItemCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.item.Item; +import com.chargebee.v4.models.item.Item; public class ItemCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/itemDeletedEvent/ItemDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/ItemDeletedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/itemDeletedEvent/ItemDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ItemDeletedEvent.java index 17960d5a..e7657162 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemDeletedEvent/ItemDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ItemDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.item.Item; +import com.chargebee.v4.models.item.Item; public class ItemDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/itemEntitlementsRemovedEvent/ItemEntitlementsRemovedEvent.java b/src/main/java/com/chargebee/v4/models/event/ItemEntitlementsRemovedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/itemEntitlementsRemovedEvent/ItemEntitlementsRemovedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ItemEntitlementsRemovedEvent.java index 0b2b34b8..6fe68cf9 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemEntitlementsRemovedEvent/ItemEntitlementsRemovedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ItemEntitlementsRemovedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemEntitlementsRemovedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.impactedItem.ImpactedItem; +import com.chargebee.v4.models.impactedItem.ImpactedItem; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.metadata.Metadata; -import com.chargebee.v4.core.models.impactedSubscription.ImpactedSubscription; +import com.chargebee.v4.models.impactedSubscription.ImpactedSubscription; -import com.chargebee.v4.core.models.metadata.Metadata; +import com.chargebee.v4.models.feature.Feature; public class ItemEntitlementsRemovedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/itemEntitlementsUpdatedEvent/ItemEntitlementsUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/ItemEntitlementsUpdatedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/itemEntitlementsUpdatedEvent/ItemEntitlementsUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ItemEntitlementsUpdatedEvent.java index fec0a630..792c95f9 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemEntitlementsUpdatedEvent/ItemEntitlementsUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ItemEntitlementsUpdatedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemEntitlementsUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.impactedItem.ImpactedItem; +import com.chargebee.v4.models.impactedItem.ImpactedItem; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.metadata.Metadata; -import com.chargebee.v4.core.models.impactedSubscription.ImpactedSubscription; +import com.chargebee.v4.models.impactedSubscription.ImpactedSubscription; -import com.chargebee.v4.core.models.metadata.Metadata; +import com.chargebee.v4.models.feature.Feature; public class ItemEntitlementsUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/itemFamilyCreatedEvent/ItemFamilyCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/ItemFamilyCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/itemFamilyCreatedEvent/ItemFamilyCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ItemFamilyCreatedEvent.java index 49c8e4a5..df8344c8 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemFamilyCreatedEvent/ItemFamilyCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ItemFamilyCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemFamilyCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.itemFamily.ItemFamily; +import com.chargebee.v4.models.itemFamily.ItemFamily; public class ItemFamilyCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/itemFamilyDeletedEvent/ItemFamilyDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/ItemFamilyDeletedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/itemFamilyDeletedEvent/ItemFamilyDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ItemFamilyDeletedEvent.java index c7377e6a..f62daafd 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemFamilyDeletedEvent/ItemFamilyDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ItemFamilyDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemFamilyDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.itemFamily.ItemFamily; +import com.chargebee.v4.models.itemFamily.ItemFamily; public class ItemFamilyDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/itemFamilyUpdatedEvent/ItemFamilyUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/ItemFamilyUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/itemFamilyUpdatedEvent/ItemFamilyUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ItemFamilyUpdatedEvent.java index 4c58c38a..c2e5c9e8 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemFamilyUpdatedEvent/ItemFamilyUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ItemFamilyUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemFamilyUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.itemFamily.ItemFamily; +import com.chargebee.v4.models.itemFamily.ItemFamily; public class ItemFamilyUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/itemPriceCreatedEvent/ItemPriceCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/ItemPriceCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/itemPriceCreatedEvent/ItemPriceCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ItemPriceCreatedEvent.java index 1d417935..cc676864 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemPriceCreatedEvent/ItemPriceCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ItemPriceCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemPriceCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.itemPrice.ItemPrice; +import com.chargebee.v4.models.itemPrice.ItemPrice; public class ItemPriceCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/itemPriceDeletedEvent/ItemPriceDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/ItemPriceDeletedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/itemPriceDeletedEvent/ItemPriceDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ItemPriceDeletedEvent.java index 44700077..48cebf1e 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemPriceDeletedEvent/ItemPriceDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ItemPriceDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemPriceDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.itemPrice.ItemPrice; +import com.chargebee.v4.models.itemPrice.ItemPrice; public class ItemPriceDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/itemPriceEntitlementsRemovedEvent/ItemPriceEntitlementsRemovedEvent.java b/src/main/java/com/chargebee/v4/models/event/ItemPriceEntitlementsRemovedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/itemPriceEntitlementsRemovedEvent/ItemPriceEntitlementsRemovedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ItemPriceEntitlementsRemovedEvent.java index 7532ade7..01e68f1e 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemPriceEntitlementsRemovedEvent/ItemPriceEntitlementsRemovedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ItemPriceEntitlementsRemovedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemPriceEntitlementsRemovedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.metadata.Metadata; -import com.chargebee.v4.core.models.impactedItemPrice.ImpactedItemPrice; +import com.chargebee.v4.models.impactedItemPrice.ImpactedItemPrice; -import com.chargebee.v4.core.models.impactedSubscription.ImpactedSubscription; +import com.chargebee.v4.models.impactedSubscription.ImpactedSubscription; -import com.chargebee.v4.core.models.metadata.Metadata; +import com.chargebee.v4.models.feature.Feature; public class ItemPriceEntitlementsRemovedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/itemPriceEntitlementsUpdatedEvent/ItemPriceEntitlementsUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/ItemPriceEntitlementsUpdatedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/itemPriceEntitlementsUpdatedEvent/ItemPriceEntitlementsUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ItemPriceEntitlementsUpdatedEvent.java index 0e83127f..77bc7341 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemPriceEntitlementsUpdatedEvent/ItemPriceEntitlementsUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ItemPriceEntitlementsUpdatedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemPriceEntitlementsUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.metadata.Metadata; -import com.chargebee.v4.core.models.impactedItemPrice.ImpactedItemPrice; +import com.chargebee.v4.models.impactedItemPrice.ImpactedItemPrice; -import com.chargebee.v4.core.models.impactedSubscription.ImpactedSubscription; +import com.chargebee.v4.models.impactedSubscription.ImpactedSubscription; -import com.chargebee.v4.core.models.metadata.Metadata; +import com.chargebee.v4.models.feature.Feature; public class ItemPriceEntitlementsUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/itemPriceUpdatedEvent/ItemPriceUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/ItemPriceUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/itemPriceUpdatedEvent/ItemPriceUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ItemPriceUpdatedEvent.java index ca98a387..124c98c9 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemPriceUpdatedEvent/ItemPriceUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ItemPriceUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemPriceUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.itemPrice.ItemPrice; +import com.chargebee.v4.models.itemPrice.ItemPrice; public class ItemPriceUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/itemUpdatedEvent/ItemUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/ItemUpdatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/itemUpdatedEvent/ItemUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ItemUpdatedEvent.java index 896fb558..d6a01f77 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemUpdatedEvent/ItemUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ItemUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.item.Item; +import com.chargebee.v4.models.item.Item; public class ItemUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/mrrUpdatedEvent/MrrUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/MrrUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/mrrUpdatedEvent/MrrUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/MrrUpdatedEvent.java index 37c3f5c8..4abb1aad 100644 --- a/src/main/java/com/chargebee/v4/core/models/mrrUpdatedEvent/MrrUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/MrrUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.mrrUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; public class MrrUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/netdPaymentDueReminderEvent/NetdPaymentDueReminderEvent.java b/src/main/java/com/chargebee/v4/models/event/NetdPaymentDueReminderEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/netdPaymentDueReminderEvent/NetdPaymentDueReminderEvent.java rename to src/main/java/com/chargebee/v4/models/event/NetdPaymentDueReminderEvent.java index b9d3fb1b..434f2dcf 100644 --- a/src/main/java/com/chargebee/v4/core/models/netdPaymentDueReminderEvent/NetdPaymentDueReminderEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/NetdPaymentDueReminderEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.netdPaymentDueReminderEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; public class NetdPaymentDueReminderEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrderCreatedEvent/OmnichannelOneTimeOrderCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelOneTimeOrderCreatedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrderCreatedEvent/OmnichannelOneTimeOrderCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelOneTimeOrderCreatedEvent.java index 4267e109..0d04524f 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrderCreatedEvent/OmnichannelOneTimeOrderCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelOneTimeOrderCreatedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelOneTimeOrderCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelTransaction.OmnichannelTransaction; +import com.chargebee.v4.models.omnichannelOneTimeOrder.OmnichannelOneTimeOrder; -import com.chargebee.v4.core.models.omnichannelOneTimeOrder.OmnichannelOneTimeOrder; +import com.chargebee.v4.models.omnichannelOneTimeOrderItem.OmnichannelOneTimeOrderItem; -import com.chargebee.v4.core.models.omnichannelOneTimeOrderItem.OmnichannelOneTimeOrderItem; +import com.chargebee.v4.models.omnichannelTransaction.OmnichannelTransaction; public class OmnichannelOneTimeOrderCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrderItemCancelledEvent/OmnichannelOneTimeOrderItemCancelledEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelOneTimeOrderItemCancelledEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrderItemCancelledEvent/OmnichannelOneTimeOrderItemCancelledEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelOneTimeOrderItemCancelledEvent.java index 31b0091f..d1fdacd7 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrderItemCancelledEvent/OmnichannelOneTimeOrderItemCancelledEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelOneTimeOrderItemCancelledEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelOneTimeOrderItemCancelledEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelTransaction.OmnichannelTransaction; +import com.chargebee.v4.models.omnichannelOneTimeOrder.OmnichannelOneTimeOrder; -import com.chargebee.v4.core.models.omnichannelOneTimeOrder.OmnichannelOneTimeOrder; +import com.chargebee.v4.models.omnichannelOneTimeOrderItem.OmnichannelOneTimeOrderItem; -import com.chargebee.v4.core.models.omnichannelOneTimeOrderItem.OmnichannelOneTimeOrderItem; +import com.chargebee.v4.models.omnichannelTransaction.OmnichannelTransaction; public class OmnichannelOneTimeOrderItemCancelledEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionCreatedEvent/OmnichannelSubscriptionCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionCreatedEvent.java similarity index 89% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionCreatedEvent/OmnichannelSubscriptionCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionCreatedEvent.java index 8caff076..1f675f8c 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionCreatedEvent/OmnichannelSubscriptionCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionCreatedEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelTransaction.OmnichannelTransaction; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelTransaction.OmnichannelTransaction; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; public class OmnichannelSubscriptionCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionImportedEvent/OmnichannelSubscriptionImportedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionImportedEvent.java similarity index 89% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionImportedEvent/OmnichannelSubscriptionImportedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionImportedEvent.java index 53244216..850d0a5b 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionImportedEvent/OmnichannelSubscriptionImportedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionImportedEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionImportedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelTransaction.OmnichannelTransaction; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelTransaction.OmnichannelTransaction; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; public class OmnichannelSubscriptionImportedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemCancellationScheduledEvent/OmnichannelSubscriptionItemCancellationScheduledEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemCancellationScheduledEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemCancellationScheduledEvent/OmnichannelSubscriptionItemCancellationScheduledEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemCancellationScheduledEvent.java index 76f50620..89d2feee 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemCancellationScheduledEvent/OmnichannelSubscriptionItemCancellationScheduledEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemCancellationScheduledEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemCancellationScheduledEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; public class OmnichannelSubscriptionItemCancellationScheduledEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemCancelledEvent/OmnichannelSubscriptionItemCancelledEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemCancelledEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemCancelledEvent/OmnichannelSubscriptionItemCancelledEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemCancelledEvent.java index a6990811..2648f536 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemCancelledEvent/OmnichannelSubscriptionItemCancelledEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemCancelledEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemCancelledEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; public class OmnichannelSubscriptionItemCancelledEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemChangeScheduledEvent/OmnichannelSubscriptionItemChangeScheduledEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemChangeScheduledEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemChangeScheduledEvent/OmnichannelSubscriptionItemChangeScheduledEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemChangeScheduledEvent.java index bf141a14..a0064ebc 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemChangeScheduledEvent/OmnichannelSubscriptionItemChangeScheduledEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemChangeScheduledEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemChangeScheduledEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; public class OmnichannelSubscriptionItemChangeScheduledEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemChangedEvent/OmnichannelSubscriptionItemChangedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemChangedEvent.java similarity index 89% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemChangedEvent/OmnichannelSubscriptionItemChangedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemChangedEvent.java index eec1e846..5afbd41a 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemChangedEvent/OmnichannelSubscriptionItemChangedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemChangedEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemChangedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelTransaction.OmnichannelTransaction; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelTransaction.OmnichannelTransaction; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; public class OmnichannelSubscriptionItemChangedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemDowngradeScheduledEvent/OmnichannelSubscriptionItemDowngradeScheduledEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemDowngradeScheduledEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemDowngradeScheduledEvent/OmnichannelSubscriptionItemDowngradeScheduledEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemDowngradeScheduledEvent.java index d2072917..6ec638c6 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemDowngradeScheduledEvent/OmnichannelSubscriptionItemDowngradeScheduledEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemDowngradeScheduledEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemDowngradeScheduledEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; public class OmnichannelSubscriptionItemDowngradeScheduledEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemDowngradedEvent/OmnichannelSubscriptionItemDowngradedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemDowngradedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemDowngradedEvent/OmnichannelSubscriptionItemDowngradedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemDowngradedEvent.java index 559770c6..6ad7915b 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemDowngradedEvent/OmnichannelSubscriptionItemDowngradedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemDowngradedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemDowngradedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelTransaction.OmnichannelTransaction; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelTransaction.OmnichannelTransaction; public class OmnichannelSubscriptionItemDowngradedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemDunningExpiredEvent/OmnichannelSubscriptionItemDunningExpiredEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemDunningExpiredEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemDunningExpiredEvent/OmnichannelSubscriptionItemDunningExpiredEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemDunningExpiredEvent.java index 5a0de9cc..7f01451c 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemDunningExpiredEvent/OmnichannelSubscriptionItemDunningExpiredEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemDunningExpiredEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemDunningExpiredEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; public class OmnichannelSubscriptionItemDunningExpiredEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemDunningStartedEvent/OmnichannelSubscriptionItemDunningStartedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemDunningStartedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemDunningStartedEvent/OmnichannelSubscriptionItemDunningStartedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemDunningStartedEvent.java index 2fe631f8..9a90d941 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemDunningStartedEvent/OmnichannelSubscriptionItemDunningStartedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemDunningStartedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemDunningStartedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; public class OmnichannelSubscriptionItemDunningStartedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemExpiredEvent/OmnichannelSubscriptionItemExpiredEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemExpiredEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemExpiredEvent/OmnichannelSubscriptionItemExpiredEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemExpiredEvent.java index 8434027a..7200725d 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemExpiredEvent/OmnichannelSubscriptionItemExpiredEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemExpiredEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemExpiredEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; public class OmnichannelSubscriptionItemExpiredEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemGracePeriodExpiredEvent/OmnichannelSubscriptionItemGracePeriodExpiredEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemGracePeriodExpiredEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemGracePeriodExpiredEvent/OmnichannelSubscriptionItemGracePeriodExpiredEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemGracePeriodExpiredEvent.java index c2bb0678..1ba71ae9 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemGracePeriodExpiredEvent/OmnichannelSubscriptionItemGracePeriodExpiredEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemGracePeriodExpiredEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemGracePeriodExpiredEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; public class OmnichannelSubscriptionItemGracePeriodExpiredEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemGracePeriodStartedEvent/OmnichannelSubscriptionItemGracePeriodStartedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemGracePeriodStartedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemGracePeriodStartedEvent/OmnichannelSubscriptionItemGracePeriodStartedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemGracePeriodStartedEvent.java index 1be523b5..32257fe5 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemGracePeriodStartedEvent/OmnichannelSubscriptionItemGracePeriodStartedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemGracePeriodStartedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemGracePeriodStartedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; public class OmnichannelSubscriptionItemGracePeriodStartedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemPauseScheduledEvent/OmnichannelSubscriptionItemPauseScheduledEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemPauseScheduledEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemPauseScheduledEvent/OmnichannelSubscriptionItemPauseScheduledEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemPauseScheduledEvent.java index 23a32d65..e902e5ba 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemPauseScheduledEvent/OmnichannelSubscriptionItemPauseScheduledEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemPauseScheduledEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemPauseScheduledEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; public class OmnichannelSubscriptionItemPauseScheduledEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemPausedEvent/OmnichannelSubscriptionItemPausedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemPausedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemPausedEvent/OmnichannelSubscriptionItemPausedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemPausedEvent.java index 1e2cae36..086e7c90 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemPausedEvent/OmnichannelSubscriptionItemPausedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemPausedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemPausedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; public class OmnichannelSubscriptionItemPausedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemReactivatedEvent/OmnichannelSubscriptionItemReactivatedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemReactivatedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemReactivatedEvent/OmnichannelSubscriptionItemReactivatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemReactivatedEvent.java index 6efbafaf..fb78d019 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemReactivatedEvent/OmnichannelSubscriptionItemReactivatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemReactivatedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemReactivatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; public class OmnichannelSubscriptionItemReactivatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemRenewedEvent/OmnichannelSubscriptionItemRenewedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemRenewedEvent.java similarity index 89% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemRenewedEvent/OmnichannelSubscriptionItemRenewedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemRenewedEvent.java index 5a0be6e2..0b9ea8dd 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemRenewedEvent/OmnichannelSubscriptionItemRenewedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemRenewedEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemRenewedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelTransaction.OmnichannelTransaction; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelTransaction.OmnichannelTransaction; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; public class OmnichannelSubscriptionItemRenewedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemResubscribedEvent/OmnichannelSubscriptionItemResubscribedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemResubscribedEvent.java similarity index 89% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemResubscribedEvent/OmnichannelSubscriptionItemResubscribedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemResubscribedEvent.java index f14becf4..12013522 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemResubscribedEvent/OmnichannelSubscriptionItemResubscribedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemResubscribedEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemResubscribedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelTransaction.OmnichannelTransaction; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelTransaction.OmnichannelTransaction; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; public class OmnichannelSubscriptionItemResubscribedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemResumedEvent/OmnichannelSubscriptionItemResumedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemResumedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemResumedEvent/OmnichannelSubscriptionItemResumedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemResumedEvent.java index f0739ad3..3746174d 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemResumedEvent/OmnichannelSubscriptionItemResumedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemResumedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemResumedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; public class OmnichannelSubscriptionItemResumedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemScheduledCancellationRemovedEvent/OmnichannelSubscriptionItemScheduledCancellationRemovedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemScheduledCancellationRemovedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemScheduledCancellationRemovedEvent/OmnichannelSubscriptionItemScheduledCancellationRemovedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemScheduledCancellationRemovedEvent.java index c14f2102..e07e1dc8 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemScheduledCancellationRemovedEvent/OmnichannelSubscriptionItemScheduledCancellationRemovedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemScheduledCancellationRemovedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemScheduledCancellationRemovedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; public class OmnichannelSubscriptionItemScheduledCancellationRemovedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemScheduledChangeRemovedEvent/OmnichannelSubscriptionItemScheduledChangeRemovedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemScheduledChangeRemovedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemScheduledChangeRemovedEvent/OmnichannelSubscriptionItemScheduledChangeRemovedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemScheduledChangeRemovedEvent.java index 62ce302c..f7355dd0 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemScheduledChangeRemovedEvent/OmnichannelSubscriptionItemScheduledChangeRemovedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemScheduledChangeRemovedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemScheduledChangeRemovedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; public class OmnichannelSubscriptionItemScheduledChangeRemovedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemScheduledDowngradeRemovedEvent/OmnichannelSubscriptionItemScheduledDowngradeRemovedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemScheduledDowngradeRemovedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemScheduledDowngradeRemovedEvent/OmnichannelSubscriptionItemScheduledDowngradeRemovedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemScheduledDowngradeRemovedEvent.java index 7691ab6c..5ecd1a1a 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemScheduledDowngradeRemovedEvent/OmnichannelSubscriptionItemScheduledDowngradeRemovedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemScheduledDowngradeRemovedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemScheduledDowngradeRemovedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; public class OmnichannelSubscriptionItemScheduledDowngradeRemovedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemUpgradedEvent/OmnichannelSubscriptionItemUpgradedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemUpgradedEvent.java similarity index 89% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemUpgradedEvent/OmnichannelSubscriptionItemUpgradedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemUpgradedEvent.java index c64ad473..5e6a9c9e 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemUpgradedEvent/OmnichannelSubscriptionItemUpgradedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemUpgradedEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemUpgradedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.models.omnichannelTransaction.OmnichannelTransaction; +import com.chargebee.v4.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; -import com.chargebee.v4.core.models.omnichannelSubscriptionItem.OmnichannelSubscriptionItem; +import com.chargebee.v4.models.omnichannelTransaction.OmnichannelTransaction; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; public class OmnichannelSubscriptionItemUpgradedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionMovedInEvent/OmnichannelSubscriptionMovedInEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionMovedInEvent.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionMovedInEvent/OmnichannelSubscriptionMovedInEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionMovedInEvent.java index 9f5299e8..23cfac59 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionMovedInEvent/OmnichannelSubscriptionMovedInEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionMovedInEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionMovedInEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; public class OmnichannelSubscriptionMovedInEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelTransactionCreatedEvent/OmnichannelTransactionCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/OmnichannelTransactionCreatedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/omnichannelTransactionCreatedEvent/OmnichannelTransactionCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OmnichannelTransactionCreatedEvent.java index f2a1f6e4..69f9af9b 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelTransactionCreatedEvent/OmnichannelTransactionCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OmnichannelTransactionCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelTransactionCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.omnichannelTransaction.OmnichannelTransaction; +import com.chargebee.v4.models.omnichannelTransaction.OmnichannelTransaction; public class OmnichannelTransactionCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/orderCancelledEvent/OrderCancelledEvent.java b/src/main/java/com/chargebee/v4/models/event/OrderCancelledEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/orderCancelledEvent/OrderCancelledEvent.java rename to src/main/java/com/chargebee/v4/models/event/OrderCancelledEvent.java index 82a2cca7..f31310bd 100644 --- a/src/main/java/com/chargebee/v4/core/models/orderCancelledEvent/OrderCancelledEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OrderCancelledEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.orderCancelledEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; public class OrderCancelledEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/orderCreatedEvent/OrderCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/OrderCreatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/orderCreatedEvent/OrderCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OrderCreatedEvent.java index 402342a9..fa30bde6 100644 --- a/src/main/java/com/chargebee/v4/core/models/orderCreatedEvent/OrderCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OrderCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.orderCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; public class OrderCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/orderDeletedEvent/OrderDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/OrderDeletedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/orderDeletedEvent/OrderDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OrderDeletedEvent.java index 3954df05..b58e0b1d 100644 --- a/src/main/java/com/chargebee/v4/core/models/orderDeletedEvent/OrderDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OrderDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.orderDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; public class OrderDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/orderDeliveredEvent/OrderDeliveredEvent.java b/src/main/java/com/chargebee/v4/models/event/OrderDeliveredEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/orderDeliveredEvent/OrderDeliveredEvent.java rename to src/main/java/com/chargebee/v4/models/event/OrderDeliveredEvent.java index ba9b9318..19292f4e 100644 --- a/src/main/java/com/chargebee/v4/core/models/orderDeliveredEvent/OrderDeliveredEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OrderDeliveredEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.orderDeliveredEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; public class OrderDeliveredEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/orderReadyToProcessEvent/OrderReadyToProcessEvent.java b/src/main/java/com/chargebee/v4/models/event/OrderReadyToProcessEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/orderReadyToProcessEvent/OrderReadyToProcessEvent.java rename to src/main/java/com/chargebee/v4/models/event/OrderReadyToProcessEvent.java index 588a315e..a47258d7 100644 --- a/src/main/java/com/chargebee/v4/core/models/orderReadyToProcessEvent/OrderReadyToProcessEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OrderReadyToProcessEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.orderReadyToProcessEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; public class OrderReadyToProcessEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/orderReadyToShipEvent/OrderReadyToShipEvent.java b/src/main/java/com/chargebee/v4/models/event/OrderReadyToShipEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/orderReadyToShipEvent/OrderReadyToShipEvent.java rename to src/main/java/com/chargebee/v4/models/event/OrderReadyToShipEvent.java index 96d00f8e..933414e1 100644 --- a/src/main/java/com/chargebee/v4/core/models/orderReadyToShipEvent/OrderReadyToShipEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OrderReadyToShipEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.orderReadyToShipEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; public class OrderReadyToShipEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/orderResentEvent/OrderResentEvent.java b/src/main/java/com/chargebee/v4/models/event/OrderResentEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/orderResentEvent/OrderResentEvent.java rename to src/main/java/com/chargebee/v4/models/event/OrderResentEvent.java index 34d42e97..5429ff7b 100644 --- a/src/main/java/com/chargebee/v4/core/models/orderResentEvent/OrderResentEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OrderResentEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.orderResentEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; public class OrderResentEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/orderReturnedEvent/OrderReturnedEvent.java b/src/main/java/com/chargebee/v4/models/event/OrderReturnedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/orderReturnedEvent/OrderReturnedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OrderReturnedEvent.java index ac2a362d..10e48258 100644 --- a/src/main/java/com/chargebee/v4/core/models/orderReturnedEvent/OrderReturnedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OrderReturnedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.orderReturnedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; public class OrderReturnedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/orderUpdatedEvent/OrderUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/OrderUpdatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/orderUpdatedEvent/OrderUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/OrderUpdatedEvent.java index 2b34965c..6d5393c9 100644 --- a/src/main/java/com/chargebee/v4/core/models/orderUpdatedEvent/OrderUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/OrderUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.orderUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; public class OrderUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentFailedEvent/PaymentFailedEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentFailedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/paymentFailedEvent/PaymentFailedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentFailedEvent.java index 2d26400f..b19c5fc8 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentFailedEvent/PaymentFailedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentFailedEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentFailedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class PaymentFailedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentInitiatedEvent/PaymentInitiatedEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentInitiatedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/paymentInitiatedEvent/PaymentInitiatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentInitiatedEvent.java index 13d06c0d..8c3b4cc3 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentInitiatedEvent/PaymentInitiatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentInitiatedEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentInitiatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class PaymentInitiatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentIntentCreatedEvent/PaymentIntentCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentIntentCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/paymentIntentCreatedEvent/PaymentIntentCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentIntentCreatedEvent.java index 65b97184..8c2bd175 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentIntentCreatedEvent/PaymentIntentCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentIntentCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentIntentCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.paymentIntent.PaymentIntent; +import com.chargebee.v4.models.paymentIntent.PaymentIntent; public class PaymentIntentCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentIntentUpdatedEvent/PaymentIntentUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentIntentUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/paymentIntentUpdatedEvent/PaymentIntentUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentIntentUpdatedEvent.java index 539c6a6a..483fbef5 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentIntentUpdatedEvent/PaymentIntentUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentIntentUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentIntentUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.paymentIntent.PaymentIntent; +import com.chargebee.v4.models.paymentIntent.PaymentIntent; public class PaymentIntentUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentRefundedEvent/PaymentRefundedEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentRefundedEvent.java similarity index 89% rename from src/main/java/com/chargebee/v4/core/models/paymentRefundedEvent/PaymentRefundedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentRefundedEvent.java index 19ee426c..8711f46a 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentRefundedEvent/PaymentRefundedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentRefundedEvent.java @@ -5,21 +5,21 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentRefundedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class PaymentRefundedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentScheduleSchemeCreatedEvent/PaymentScheduleSchemeCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentScheduleSchemeCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/paymentScheduleSchemeCreatedEvent/PaymentScheduleSchemeCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentScheduleSchemeCreatedEvent.java index f0e4a419..3de4c931 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentScheduleSchemeCreatedEvent/PaymentScheduleSchemeCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentScheduleSchemeCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentScheduleSchemeCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.paymentScheduleScheme.PaymentScheduleScheme; +import com.chargebee.v4.models.paymentScheduleScheme.PaymentScheduleScheme; public class PaymentScheduleSchemeCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentScheduleSchemeDeletedEvent/PaymentScheduleSchemeDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentScheduleSchemeDeletedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/paymentScheduleSchemeDeletedEvent/PaymentScheduleSchemeDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentScheduleSchemeDeletedEvent.java index 3e832a54..d03a5aca 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentScheduleSchemeDeletedEvent/PaymentScheduleSchemeDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentScheduleSchemeDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentScheduleSchemeDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.paymentScheduleScheme.PaymentScheduleScheme; +import com.chargebee.v4.models.paymentScheduleScheme.PaymentScheduleScheme; public class PaymentScheduleSchemeDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSchedulesCreatedEvent/PaymentSchedulesCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentSchedulesCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/paymentSchedulesCreatedEvent/PaymentSchedulesCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentSchedulesCreatedEvent.java index 488bd199..5a63d848 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSchedulesCreatedEvent/PaymentSchedulesCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentSchedulesCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSchedulesCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.paymentSchedule.PaymentSchedule; +import com.chargebee.v4.models.paymentSchedule.PaymentSchedule; public class PaymentSchedulesCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSchedulesUpdatedEvent/PaymentSchedulesUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentSchedulesUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/paymentSchedulesUpdatedEvent/PaymentSchedulesUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentSchedulesUpdatedEvent.java index cb11c7cf..437dcccd 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSchedulesUpdatedEvent/PaymentSchedulesUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentSchedulesUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSchedulesUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.paymentSchedule.PaymentSchedule; +import com.chargebee.v4.models.paymentSchedule.PaymentSchedule; public class PaymentSchedulesUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSourceAddedEvent/PaymentSourceAddedEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentSourceAddedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/paymentSourceAddedEvent/PaymentSourceAddedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentSourceAddedEvent.java index 1d0578c1..52cc0de6 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSourceAddedEvent/PaymentSourceAddedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentSourceAddedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSourceAddedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; public class PaymentSourceAddedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSourceDeletedEvent/PaymentSourceDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentSourceDeletedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/paymentSourceDeletedEvent/PaymentSourceDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentSourceDeletedEvent.java index ed0cb0b0..fc0f9308 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSourceDeletedEvent/PaymentSourceDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentSourceDeletedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSourceDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; public class PaymentSourceDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSourceExpiredEvent/PaymentSourceExpiredEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentSourceExpiredEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/paymentSourceExpiredEvent/PaymentSourceExpiredEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentSourceExpiredEvent.java index e2383ecc..cd064f17 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSourceExpiredEvent/PaymentSourceExpiredEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentSourceExpiredEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSourceExpiredEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; public class PaymentSourceExpiredEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSourceExpiringEvent/PaymentSourceExpiringEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentSourceExpiringEvent.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/paymentSourceExpiringEvent/PaymentSourceExpiringEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentSourceExpiringEvent.java index ce9cb90b..aa5f12b8 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSourceExpiringEvent/PaymentSourceExpiringEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentSourceExpiringEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSourceExpiringEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; public class PaymentSourceExpiringEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSourceLocallyDeletedEvent/PaymentSourceLocallyDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentSourceLocallyDeletedEvent.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/paymentSourceLocallyDeletedEvent/PaymentSourceLocallyDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentSourceLocallyDeletedEvent.java index 367afea1..a9f4ff6a 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSourceLocallyDeletedEvent/PaymentSourceLocallyDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentSourceLocallyDeletedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSourceLocallyDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; public class PaymentSourceLocallyDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSourceUpdatedEvent/PaymentSourceUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentSourceUpdatedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/paymentSourceUpdatedEvent/PaymentSourceUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentSourceUpdatedEvent.java index 5ea6a5b8..e476d4e4 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSourceUpdatedEvent/PaymentSourceUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentSourceUpdatedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSourceUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; public class PaymentSourceUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSucceededEvent/PaymentSucceededEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentSucceededEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/paymentSucceededEvent/PaymentSucceededEvent.java rename to src/main/java/com/chargebee/v4/models/event/PaymentSucceededEvent.java index 7b6b67df..6c4211b5 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSucceededEvent/PaymentSucceededEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PaymentSucceededEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSucceededEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class PaymentSucceededEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/pendingInvoiceCreatedEvent/PendingInvoiceCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/PendingInvoiceCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/pendingInvoiceCreatedEvent/PendingInvoiceCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PendingInvoiceCreatedEvent.java index 982ed951..6e5d882c 100644 --- a/src/main/java/com/chargebee/v4/core/models/pendingInvoiceCreatedEvent/PendingInvoiceCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PendingInvoiceCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pendingInvoiceCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; public class PendingInvoiceCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/pendingInvoiceUpdatedEvent/PendingInvoiceUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/PendingInvoiceUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/pendingInvoiceUpdatedEvent/PendingInvoiceUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PendingInvoiceUpdatedEvent.java index 16bb9c50..11efad2f 100644 --- a/src/main/java/com/chargebee/v4/core/models/pendingInvoiceUpdatedEvent/PendingInvoiceUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PendingInvoiceUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pendingInvoiceUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; public class PendingInvoiceUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/planCreatedEvent/PlanCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/PlanCreatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/planCreatedEvent/PlanCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PlanCreatedEvent.java index 2726251e..5d9c71f9 100644 --- a/src/main/java/com/chargebee/v4/core/models/planCreatedEvent/PlanCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PlanCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.planCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.plan.Plan; +import com.chargebee.v4.models.plan.Plan; public class PlanCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/planDeletedEvent/PlanDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/PlanDeletedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/planDeletedEvent/PlanDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PlanDeletedEvent.java index f2ba7209..1afb2989 100644 --- a/src/main/java/com/chargebee/v4/core/models/planDeletedEvent/PlanDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PlanDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.planDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.plan.Plan; +import com.chargebee.v4.models.plan.Plan; public class PlanDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/planUpdatedEvent/PlanUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/PlanUpdatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/planUpdatedEvent/PlanUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PlanUpdatedEvent.java index ba6cdb18..b30af5d9 100644 --- a/src/main/java/com/chargebee/v4/core/models/planUpdatedEvent/PlanUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PlanUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.planUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.plan.Plan; +import com.chargebee.v4.models.plan.Plan; public class PlanUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/priceVariantCreatedEvent/PriceVariantCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/PriceVariantCreatedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/priceVariantCreatedEvent/PriceVariantCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PriceVariantCreatedEvent.java index ea8745f7..b5787a76 100644 --- a/src/main/java/com/chargebee/v4/core/models/priceVariantCreatedEvent/PriceVariantCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PriceVariantCreatedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.priceVariantCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.attribute.Attribute; +import com.chargebee.v4.models.priceVariant.PriceVariant; -import com.chargebee.v4.core.models.priceVariant.PriceVariant; +import com.chargebee.v4.models.attribute.Attribute; public class PriceVariantCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/priceVariantDeletedEvent/PriceVariantDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/PriceVariantDeletedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/priceVariantDeletedEvent/PriceVariantDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PriceVariantDeletedEvent.java index eb72cee2..5fccd31d 100644 --- a/src/main/java/com/chargebee/v4/core/models/priceVariantDeletedEvent/PriceVariantDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PriceVariantDeletedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.priceVariantDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.attribute.Attribute; +import com.chargebee.v4.models.priceVariant.PriceVariant; -import com.chargebee.v4.core.models.priceVariant.PriceVariant; +import com.chargebee.v4.models.attribute.Attribute; public class PriceVariantDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/priceVariantUpdatedEvent/PriceVariantUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/PriceVariantUpdatedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/priceVariantUpdatedEvent/PriceVariantUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PriceVariantUpdatedEvent.java index c3785dd1..3d2a4292 100644 --- a/src/main/java/com/chargebee/v4/core/models/priceVariantUpdatedEvent/PriceVariantUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PriceVariantUpdatedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.priceVariantUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.attribute.Attribute; +import com.chargebee.v4.models.priceVariant.PriceVariant; -import com.chargebee.v4.core.models.priceVariant.PriceVariant; +import com.chargebee.v4.models.attribute.Attribute; public class PriceVariantUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/productCreatedEvent/ProductCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/ProductCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/productCreatedEvent/ProductCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ProductCreatedEvent.java index 91106499..5e4f7a79 100644 --- a/src/main/java/com/chargebee/v4/core/models/productCreatedEvent/ProductCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ProductCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.productCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.product.Product; +import com.chargebee.v4.models.product.Product; public class ProductCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/productDeletedEvent/ProductDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/ProductDeletedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/productDeletedEvent/ProductDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ProductDeletedEvent.java index 5e233bcd..f0521e9b 100644 --- a/src/main/java/com/chargebee/v4/core/models/productDeletedEvent/ProductDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ProductDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.productDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.product.Product; +import com.chargebee.v4.models.product.Product; public class ProductDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/productUpdatedEvent/ProductUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/ProductUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/productUpdatedEvent/ProductUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/ProductUpdatedEvent.java index 52e6f44e..67b140e7 100644 --- a/src/main/java/com/chargebee/v4/core/models/productUpdatedEvent/ProductUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/ProductUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.productUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.product.Product; +import com.chargebee.v4.models.product.Product; public class ProductUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/promotionalCreditsAddedEvent/PromotionalCreditsAddedEvent.java b/src/main/java/com/chargebee/v4/models/event/PromotionalCreditsAddedEvent.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/promotionalCreditsAddedEvent/PromotionalCreditsAddedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PromotionalCreditsAddedEvent.java index b32fcead..88759055 100644 --- a/src/main/java/com/chargebee/v4/core/models/promotionalCreditsAddedEvent/PromotionalCreditsAddedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PromotionalCreditsAddedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.promotionalCreditsAddedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.promotionalCredit.PromotionalCredit; +import com.chargebee.v4.models.promotionalCredit.PromotionalCredit; public class PromotionalCreditsAddedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/promotionalCreditsDeductedEvent/PromotionalCreditsDeductedEvent.java b/src/main/java/com/chargebee/v4/models/event/PromotionalCreditsDeductedEvent.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/promotionalCreditsDeductedEvent/PromotionalCreditsDeductedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PromotionalCreditsDeductedEvent.java index 441d0e54..8b788ed5 100644 --- a/src/main/java/com/chargebee/v4/core/models/promotionalCreditsDeductedEvent/PromotionalCreditsDeductedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PromotionalCreditsDeductedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.promotionalCreditsDeductedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.promotionalCredit.PromotionalCredit; +import com.chargebee.v4.models.promotionalCredit.PromotionalCredit; public class PromotionalCreditsDeductedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/purchaseCreatedEvent/PurchaseCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/PurchaseCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/purchaseCreatedEvent/PurchaseCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/PurchaseCreatedEvent.java index a12d1e21..3458d843 100644 --- a/src/main/java/com/chargebee/v4/core/models/purchaseCreatedEvent/PurchaseCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/PurchaseCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.purchaseCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.purchase.Purchase; +import com.chargebee.v4.models.purchase.Purchase; public class PurchaseCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/quoteCreatedEvent/QuoteCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/QuoteCreatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/quoteCreatedEvent/QuoteCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/QuoteCreatedEvent.java index 147f1a53..cedb3739 100644 --- a/src/main/java/com/chargebee/v4/core/models/quoteCreatedEvent/QuoteCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/QuoteCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.quoteCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.quote.Quote; +import com.chargebee.v4.models.quote.Quote; public class QuoteCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/quoteDeletedEvent/QuoteDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/QuoteDeletedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/quoteDeletedEvent/QuoteDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/QuoteDeletedEvent.java index 030e2958..0619a7f2 100644 --- a/src/main/java/com/chargebee/v4/core/models/quoteDeletedEvent/QuoteDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/QuoteDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.quoteDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.quote.Quote; +import com.chargebee.v4.models.quote.Quote; public class QuoteDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/quoteUpdatedEvent/QuoteUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/QuoteUpdatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/quoteUpdatedEvent/QuoteUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/QuoteUpdatedEvent.java index 2d012748..ebba1b2a 100644 --- a/src/main/java/com/chargebee/v4/core/models/quoteUpdatedEvent/QuoteUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/QuoteUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.quoteUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.quote.Quote; +import com.chargebee.v4.models.quote.Quote; public class QuoteUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/recordPurchaseFailedEvent/RecordPurchaseFailedEvent.java b/src/main/java/com/chargebee/v4/models/event/RecordPurchaseFailedEvent.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/recordPurchaseFailedEvent/RecordPurchaseFailedEvent.java rename to src/main/java/com/chargebee/v4/models/event/RecordPurchaseFailedEvent.java index 7bd1b2ab..0b0499a4 100644 --- a/src/main/java/com/chargebee/v4/core/models/recordPurchaseFailedEvent/RecordPurchaseFailedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/RecordPurchaseFailedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.recordPurchaseFailedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.recordedPurchase.RecordedPurchase; +import com.chargebee.v4.models.recordedPurchase.RecordedPurchase; public class RecordPurchaseFailedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/refundInitiatedEvent/RefundInitiatedEvent.java b/src/main/java/com/chargebee/v4/models/event/RefundInitiatedEvent.java similarity index 89% rename from src/main/java/com/chargebee/v4/core/models/refundInitiatedEvent/RefundInitiatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/RefundInitiatedEvent.java index 85b254c6..680a5286 100644 --- a/src/main/java/com/chargebee/v4/core/models/refundInitiatedEvent/RefundInitiatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/RefundInitiatedEvent.java @@ -5,21 +5,21 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.refundInitiatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class RefundInitiatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/ruleCreatedEvent/RuleCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/RuleCreatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/ruleCreatedEvent/RuleCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/RuleCreatedEvent.java index 9d9e4170..a2317560 100644 --- a/src/main/java/com/chargebee/v4/core/models/ruleCreatedEvent/RuleCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/RuleCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.ruleCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.rule.Rule; +import com.chargebee.v4.models.rule.Rule; public class RuleCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/ruleDeletedEvent/RuleDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/RuleDeletedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/ruleDeletedEvent/RuleDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/RuleDeletedEvent.java index 42e31591..6218ae1c 100644 --- a/src/main/java/com/chargebee/v4/core/models/ruleDeletedEvent/RuleDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/RuleDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.ruleDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.rule.Rule; +import com.chargebee.v4.models.rule.Rule; public class RuleDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/ruleUpdatedEvent/RuleUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/RuleUpdatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/ruleUpdatedEvent/RuleUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/RuleUpdatedEvent.java index 70f98b90..94ccb535 100644 --- a/src/main/java/com/chargebee/v4/core/models/ruleUpdatedEvent/RuleUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/RuleUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.ruleUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.rule.Rule; +import com.chargebee.v4.models.rule.Rule; public class RuleUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/salesOrderCreatedEvent/SalesOrderCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/SalesOrderCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/salesOrderCreatedEvent/SalesOrderCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SalesOrderCreatedEvent.java index 365ddb86..8fcc4019 100644 --- a/src/main/java/com/chargebee/v4/core/models/salesOrderCreatedEvent/SalesOrderCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SalesOrderCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.salesOrderCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.salesOrder.SalesOrder; +import com.chargebee.v4.models.salesOrder.SalesOrder; public class SalesOrderCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/salesOrderUpdatedEvent/SalesOrderUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/SalesOrderUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/salesOrderUpdatedEvent/SalesOrderUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SalesOrderUpdatedEvent.java index 83217b52..f0f1eacf 100644 --- a/src/main/java/com/chargebee/v4/core/models/salesOrderUpdatedEvent/SalesOrderUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SalesOrderUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.salesOrderUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.salesOrder.SalesOrder; +import com.chargebee.v4.models.salesOrder.SalesOrder; public class SalesOrderUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionActivatedEvent/SubscriptionActivatedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionActivatedEvent.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/models/subscriptionActivatedEvent/SubscriptionActivatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionActivatedEvent.java index 662b207c..0b65ab7e 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionActivatedEvent/SubscriptionActivatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionActivatedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionActivatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class SubscriptionActivatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionActivatedWithBackdatingEvent/SubscriptionActivatedWithBackdatingEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionActivatedWithBackdatingEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionActivatedWithBackdatingEvent/SubscriptionActivatedWithBackdatingEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionActivatedWithBackdatingEvent.java index 0d3ff150..28c246b2 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionActivatedWithBackdatingEvent/SubscriptionActivatedWithBackdatingEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionActivatedWithBackdatingEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionActivatedWithBackdatingEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class SubscriptionActivatedWithBackdatingEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionAdvanceInvoiceScheduleAddedEvent/SubscriptionAdvanceInvoiceScheduleAddedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionAdvanceInvoiceScheduleAddedEvent.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/models/subscriptionAdvanceInvoiceScheduleAddedEvent/SubscriptionAdvanceInvoiceScheduleAddedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionAdvanceInvoiceScheduleAddedEvent.java index 50409c42..eace564a 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionAdvanceInvoiceScheduleAddedEvent/SubscriptionAdvanceInvoiceScheduleAddedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionAdvanceInvoiceScheduleAddedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionAdvanceInvoiceScheduleAddedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.subscription.Subscription; public class SubscriptionAdvanceInvoiceScheduleAddedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionAdvanceInvoiceScheduleRemovedEvent/SubscriptionAdvanceInvoiceScheduleRemovedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionAdvanceInvoiceScheduleRemovedEvent.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/models/subscriptionAdvanceInvoiceScheduleRemovedEvent/SubscriptionAdvanceInvoiceScheduleRemovedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionAdvanceInvoiceScheduleRemovedEvent.java index 547d711c..26a51b73 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionAdvanceInvoiceScheduleRemovedEvent/SubscriptionAdvanceInvoiceScheduleRemovedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionAdvanceInvoiceScheduleRemovedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionAdvanceInvoiceScheduleRemovedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.subscription.Subscription; public class SubscriptionAdvanceInvoiceScheduleRemovedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionAdvanceInvoiceScheduleUpdatedEvent/SubscriptionAdvanceInvoiceScheduleUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionAdvanceInvoiceScheduleUpdatedEvent.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/models/subscriptionAdvanceInvoiceScheduleUpdatedEvent/SubscriptionAdvanceInvoiceScheduleUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionAdvanceInvoiceScheduleUpdatedEvent.java index 47e3c11e..a5882e95 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionAdvanceInvoiceScheduleUpdatedEvent/SubscriptionAdvanceInvoiceScheduleUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionAdvanceInvoiceScheduleUpdatedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionAdvanceInvoiceScheduleUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.subscription.Subscription; public class SubscriptionAdvanceInvoiceScheduleUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionBusinessEntityChangedEvent/SubscriptionBusinessEntityChangedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionBusinessEntityChangedEvent.java similarity index 78% rename from src/main/java/com/chargebee/v4/core/models/subscriptionBusinessEntityChangedEvent/SubscriptionBusinessEntityChangedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionBusinessEntityChangedEvent.java index 6e53262f..b7a674bf 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionBusinessEntityChangedEvent/SubscriptionBusinessEntityChangedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionBusinessEntityChangedEvent.java @@ -5,15 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionBusinessEntityChangedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.businessEntityTransfer.BusinessEntityTransfer; -import com.chargebee.v4.core.models.businessEntityChange.BusinessEntityChange; - -import com.chargebee.v4.core.models.businessEntityTransfer.BusinessEntityTransfer; +import com.chargebee.v4.models.subscription.Subscription; public class SubscriptionBusinessEntityChangedEvent { @@ -85,14 +83,9 @@ public static SubscriptionBusinessEntityChangedEvent fromJson(String json) { public static class Content { - private BusinessEntityChange businessEntityChange; private BusinessEntityTransfer businessEntityTransfer; private Subscription subscription; - public BusinessEntityChange getBusinessEntityChange() { - return businessEntityChange; - } - public BusinessEntityTransfer getBusinessEntityTransfer() { return businessEntityTransfer; } @@ -104,11 +97,6 @@ public Subscription getSubscription() { public static Content fromJson(String json) { Content obj = new Content(); - String __businessEntityChangeJson = JsonUtil.getObject(json, "business_entity_change"); - if (__businessEntityChangeJson != null) { - obj.businessEntityChange = BusinessEntityChange.fromJson(__businessEntityChangeJson); - } - String __businessEntityTransferJson = JsonUtil.getObject(json, "business_entity_transfer"); if (__businessEntityTransferJson != null) { obj.businessEntityTransfer = BusinessEntityTransfer.fromJson(__businessEntityTransferJson); diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionCanceledWithBackdatingEvent/SubscriptionCanceledWithBackdatingEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionCanceledWithBackdatingEvent.java similarity index 89% rename from src/main/java/com/chargebee/v4/core/models/subscriptionCanceledWithBackdatingEvent/SubscriptionCanceledWithBackdatingEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionCanceledWithBackdatingEvent.java index e3382f86..71915da2 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionCanceledWithBackdatingEvent/SubscriptionCanceledWithBackdatingEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionCanceledWithBackdatingEvent.java @@ -5,21 +5,21 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionCanceledWithBackdatingEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class SubscriptionCanceledWithBackdatingEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionCancellationReminderEvent/SubscriptionCancellationReminderEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionCancellationReminderEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionCancellationReminderEvent/SubscriptionCancellationReminderEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionCancellationReminderEvent.java index 6364d55d..ae82998d 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionCancellationReminderEvent/SubscriptionCancellationReminderEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionCancellationReminderEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionCancellationReminderEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.card.Card; public class SubscriptionCancellationReminderEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionCancellationScheduledEvent/SubscriptionCancellationScheduledEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionCancellationScheduledEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionCancellationScheduledEvent/SubscriptionCancellationScheduledEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionCancellationScheduledEvent.java index 659a1e14..5f324c81 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionCancellationScheduledEvent/SubscriptionCancellationScheduledEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionCancellationScheduledEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionCancellationScheduledEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.card.Card; public class SubscriptionCancellationScheduledEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionCancelledEvent/SubscriptionCancelledEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionCancelledEvent.java similarity index 89% rename from src/main/java/com/chargebee/v4/core/models/subscriptionCancelledEvent/SubscriptionCancelledEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionCancelledEvent.java index 7b8c6c34..09365302 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionCancelledEvent/SubscriptionCancelledEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionCancelledEvent.java @@ -5,21 +5,21 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionCancelledEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class SubscriptionCancelledEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionChangedEvent/SubscriptionChangedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionChangedEvent.java similarity index 89% rename from src/main/java/com/chargebee/v4/core/models/subscriptionChangedEvent/SubscriptionChangedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionChangedEvent.java index 83deae4d..46ace6d7 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionChangedEvent/SubscriptionChangedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionChangedEvent.java @@ -5,21 +5,21 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionChangedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class SubscriptionChangedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionChangedWithBackdatingEvent/SubscriptionChangedWithBackdatingEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionChangedWithBackdatingEvent.java similarity index 89% rename from src/main/java/com/chargebee/v4/core/models/subscriptionChangedWithBackdatingEvent/SubscriptionChangedWithBackdatingEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionChangedWithBackdatingEvent.java index 4aad3d1a..03322194 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionChangedWithBackdatingEvent/SubscriptionChangedWithBackdatingEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionChangedWithBackdatingEvent.java @@ -5,21 +5,21 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionChangedWithBackdatingEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class SubscriptionChangedWithBackdatingEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionChangesScheduledEvent/SubscriptionChangesScheduledEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionChangesScheduledEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionChangesScheduledEvent/SubscriptionChangesScheduledEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionChangesScheduledEvent.java index bf812a1c..9e3aa67c 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionChangesScheduledEvent/SubscriptionChangesScheduledEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionChangesScheduledEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionChangesScheduledEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.card.Card; public class SubscriptionChangesScheduledEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionCreatedEvent/SubscriptionCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionCreatedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionCreatedEvent/SubscriptionCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionCreatedEvent.java index cba6b755..dfe078eb 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionCreatedEvent/SubscriptionCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionCreatedEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class SubscriptionCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionCreatedWithBackdatingEvent/SubscriptionCreatedWithBackdatingEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionCreatedWithBackdatingEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionCreatedWithBackdatingEvent/SubscriptionCreatedWithBackdatingEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionCreatedWithBackdatingEvent.java index f5263bbc..360275f8 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionCreatedWithBackdatingEvent/SubscriptionCreatedWithBackdatingEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionCreatedWithBackdatingEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionCreatedWithBackdatingEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class SubscriptionCreatedWithBackdatingEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionDeletedEvent/SubscriptionDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionDeletedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionDeletedEvent/SubscriptionDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionDeletedEvent.java index e902528b..6e91c744 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionDeletedEvent/SubscriptionDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionDeletedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.card.Card; public class SubscriptionDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlementsCreatedEvent/SubscriptionEntitlementsCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionEntitlementsCreatedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/subscriptionEntitlementsCreatedEvent/SubscriptionEntitlementsCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionEntitlementsCreatedEvent.java index 8c380707..aa617823 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlementsCreatedEvent/SubscriptionEntitlementsCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionEntitlementsCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionEntitlementsCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.subscriptionEntitlementsCreatedDetail.SubscriptionEntitlementsCreatedDetail; +import com.chargebee.v4.models.subscriptionEntitlementsCreatedDetail.SubscriptionEntitlementsCreatedDetail; public class SubscriptionEntitlementsCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlementsUpdatedEvent/SubscriptionEntitlementsUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionEntitlementsUpdatedEvent.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/subscriptionEntitlementsUpdatedEvent/SubscriptionEntitlementsUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionEntitlementsUpdatedEvent.java index dd68996d..7565ffbf 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlementsUpdatedEvent/SubscriptionEntitlementsUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionEntitlementsUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionEntitlementsUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.subscriptionEntitlementsUpdatedDetail.SubscriptionEntitlementsUpdatedDetail; +import com.chargebee.v4.models.subscriptionEntitlementsUpdatedDetail.SubscriptionEntitlementsUpdatedDetail; public class SubscriptionEntitlementsUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionItemsRenewedEvent/SubscriptionItemsRenewedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionItemsRenewedEvent.java similarity index 89% rename from src/main/java/com/chargebee/v4/core/models/subscriptionItemsRenewedEvent/SubscriptionItemsRenewedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionItemsRenewedEvent.java index 731a8c6e..79568991 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionItemsRenewedEvent/SubscriptionItemsRenewedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionItemsRenewedEvent.java @@ -5,21 +5,21 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionItemsRenewedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class SubscriptionItemsRenewedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionMovedInEvent/SubscriptionMovedInEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionMovedInEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/subscriptionMovedInEvent/SubscriptionMovedInEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionMovedInEvent.java index c95f9eaa..f5c73297 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionMovedInEvent/SubscriptionMovedInEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionMovedInEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionMovedInEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; public class SubscriptionMovedInEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionMovedOutEvent/SubscriptionMovedOutEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionMovedOutEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/subscriptionMovedOutEvent/SubscriptionMovedOutEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionMovedOutEvent.java index 1050bc93..11074b62 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionMovedOutEvent/SubscriptionMovedOutEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionMovedOutEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionMovedOutEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; public class SubscriptionMovedOutEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionMovementFailedEvent/SubscriptionMovementFailedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionMovementFailedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/subscriptionMovementFailedEvent/SubscriptionMovementFailedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionMovementFailedEvent.java index 4170cfd0..dd711e9e 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionMovementFailedEvent/SubscriptionMovementFailedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionMovementFailedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionMovementFailedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; public class SubscriptionMovementFailedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionPauseScheduledEvent/SubscriptionPauseScheduledEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionPauseScheduledEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionPauseScheduledEvent/SubscriptionPauseScheduledEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionPauseScheduledEvent.java index a66c9b49..6d6f1266 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionPauseScheduledEvent/SubscriptionPauseScheduledEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionPauseScheduledEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionPauseScheduledEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.card.Card; public class SubscriptionPauseScheduledEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionPausedEvent/SubscriptionPausedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionPausedEvent.java similarity index 89% rename from src/main/java/com/chargebee/v4/core/models/subscriptionPausedEvent/SubscriptionPausedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionPausedEvent.java index 028df9ef..490136cc 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionPausedEvent/SubscriptionPausedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionPausedEvent.java @@ -5,21 +5,21 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionPausedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class SubscriptionPausedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionRampAppliedEvent/SubscriptionRampAppliedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionRampAppliedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/subscriptionRampAppliedEvent/SubscriptionRampAppliedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionRampAppliedEvent.java index 835c5c7f..d325b728 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionRampAppliedEvent/SubscriptionRampAppliedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionRampAppliedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionRampAppliedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.ramp.Ramp; +import com.chargebee.v4.models.ramp.Ramp; public class SubscriptionRampAppliedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionRampCreatedEvent/SubscriptionRampCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionRampCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/subscriptionRampCreatedEvent/SubscriptionRampCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionRampCreatedEvent.java index a65adad6..4af8a2a5 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionRampCreatedEvent/SubscriptionRampCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionRampCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionRampCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.ramp.Ramp; +import com.chargebee.v4.models.ramp.Ramp; public class SubscriptionRampCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionRampDeletedEvent/SubscriptionRampDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionRampDeletedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/subscriptionRampDeletedEvent/SubscriptionRampDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionRampDeletedEvent.java index d057664b..433a57ed 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionRampDeletedEvent/SubscriptionRampDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionRampDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionRampDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.ramp.Ramp; +import com.chargebee.v4.models.ramp.Ramp; public class SubscriptionRampDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionRampDraftedEvent/SubscriptionRampDraftedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionRampDraftedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/subscriptionRampDraftedEvent/SubscriptionRampDraftedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionRampDraftedEvent.java index b01bee8c..699ba60f 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionRampDraftedEvent/SubscriptionRampDraftedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionRampDraftedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionRampDraftedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.ramp.Ramp; +import com.chargebee.v4.models.ramp.Ramp; public class SubscriptionRampDraftedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionRampUpdatedEvent/SubscriptionRampUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionRampUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/subscriptionRampUpdatedEvent/SubscriptionRampUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionRampUpdatedEvent.java index 94ed9074..b5ae266e 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionRampUpdatedEvent/SubscriptionRampUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionRampUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionRampUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.ramp.Ramp; +import com.chargebee.v4.models.ramp.Ramp; public class SubscriptionRampUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionReactivatedEvent/SubscriptionReactivatedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionReactivatedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionReactivatedEvent/SubscriptionReactivatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionReactivatedEvent.java index b8b2b564..176caa45 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionReactivatedEvent/SubscriptionReactivatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionReactivatedEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionReactivatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class SubscriptionReactivatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionReactivatedWithBackdatingEvent/SubscriptionReactivatedWithBackdatingEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionReactivatedWithBackdatingEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionReactivatedWithBackdatingEvent/SubscriptionReactivatedWithBackdatingEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionReactivatedWithBackdatingEvent.java index 0c03f5ed..9fe2431c 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionReactivatedWithBackdatingEvent/SubscriptionReactivatedWithBackdatingEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionReactivatedWithBackdatingEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionReactivatedWithBackdatingEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class SubscriptionReactivatedWithBackdatingEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionRenewalReminderEvent/SubscriptionRenewalReminderEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionRenewalReminderEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionRenewalReminderEvent/SubscriptionRenewalReminderEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionRenewalReminderEvent.java index 8b7a0468..91a06659 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionRenewalReminderEvent/SubscriptionRenewalReminderEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionRenewalReminderEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionRenewalReminderEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.card.Card; public class SubscriptionRenewalReminderEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionRenewedEvent/SubscriptionRenewedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionRenewedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionRenewedEvent/SubscriptionRenewedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionRenewedEvent.java index 2e16fa67..1fa20bd0 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionRenewedEvent/SubscriptionRenewedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionRenewedEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionRenewedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class SubscriptionRenewedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionResumedEvent/SubscriptionResumedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionResumedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionResumedEvent/SubscriptionResumedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionResumedEvent.java index 44801b10..ecb6f159 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionResumedEvent/SubscriptionResumedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionResumedEvent.java @@ -5,19 +5,19 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionResumedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class SubscriptionResumedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionResumptionScheduledEvent/SubscriptionResumptionScheduledEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionResumptionScheduledEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionResumptionScheduledEvent/SubscriptionResumptionScheduledEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionResumptionScheduledEvent.java index cde2d9a4..7eb4bb02 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionResumptionScheduledEvent/SubscriptionResumptionScheduledEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionResumptionScheduledEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionResumptionScheduledEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.card.Card; public class SubscriptionResumptionScheduledEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionScheduledCancellationRemovedEvent/SubscriptionScheduledCancellationRemovedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionScheduledCancellationRemovedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionScheduledCancellationRemovedEvent/SubscriptionScheduledCancellationRemovedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionScheduledCancellationRemovedEvent.java index a38ecd28..816ed1a5 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionScheduledCancellationRemovedEvent/SubscriptionScheduledCancellationRemovedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionScheduledCancellationRemovedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionScheduledCancellationRemovedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.card.Card; public class SubscriptionScheduledCancellationRemovedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionScheduledChangesRemovedEvent/SubscriptionScheduledChangesRemovedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionScheduledChangesRemovedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionScheduledChangesRemovedEvent/SubscriptionScheduledChangesRemovedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionScheduledChangesRemovedEvent.java index acd6b8fc..016dbe25 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionScheduledChangesRemovedEvent/SubscriptionScheduledChangesRemovedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionScheduledChangesRemovedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionScheduledChangesRemovedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.card.Card; public class SubscriptionScheduledChangesRemovedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionScheduledPauseRemovedEvent/SubscriptionScheduledPauseRemovedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionScheduledPauseRemovedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionScheduledPauseRemovedEvent/SubscriptionScheduledPauseRemovedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionScheduledPauseRemovedEvent.java index f2a27855..d6d14f42 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionScheduledPauseRemovedEvent/SubscriptionScheduledPauseRemovedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionScheduledPauseRemovedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionScheduledPauseRemovedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.card.Card; public class SubscriptionScheduledPauseRemovedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionScheduledResumptionRemovedEvent/SubscriptionScheduledResumptionRemovedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionScheduledResumptionRemovedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionScheduledResumptionRemovedEvent/SubscriptionScheduledResumptionRemovedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionScheduledResumptionRemovedEvent.java index b58d4cd1..131b6c6a 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionScheduledResumptionRemovedEvent/SubscriptionScheduledResumptionRemovedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionScheduledResumptionRemovedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionScheduledResumptionRemovedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.card.Card; public class SubscriptionScheduledResumptionRemovedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionShippingAddressUpdatedEvent/SubscriptionShippingAddressUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionShippingAddressUpdatedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionShippingAddressUpdatedEvent/SubscriptionShippingAddressUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionShippingAddressUpdatedEvent.java index 57d2b168..33277f7e 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionShippingAddressUpdatedEvent/SubscriptionShippingAddressUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionShippingAddressUpdatedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionShippingAddressUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.card.Card; public class SubscriptionShippingAddressUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionStartedEvent/SubscriptionStartedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionStartedEvent.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/models/subscriptionStartedEvent/SubscriptionStartedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionStartedEvent.java index 12b859ce..00e5b502 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionStartedEvent/SubscriptionStartedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionStartedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionStartedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.invoice.Invoice; public class SubscriptionStartedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionTrialEndReminderEvent/SubscriptionTrialEndReminderEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionTrialEndReminderEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionTrialEndReminderEvent/SubscriptionTrialEndReminderEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionTrialEndReminderEvent.java index b9cc55de..7777daf5 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionTrialEndReminderEvent/SubscriptionTrialEndReminderEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionTrialEndReminderEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionTrialEndReminderEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.card.Card; public class SubscriptionTrialEndReminderEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionTrialExtendedEvent/SubscriptionTrialExtendedEvent.java b/src/main/java/com/chargebee/v4/models/event/SubscriptionTrialExtendedEvent.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/subscriptionTrialExtendedEvent/SubscriptionTrialExtendedEvent.java rename to src/main/java/com/chargebee/v4/models/event/SubscriptionTrialExtendedEvent.java index 574301b1..ac20b25c 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionTrialExtendedEvent/SubscriptionTrialExtendedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/SubscriptionTrialExtendedEvent.java @@ -5,17 +5,17 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionTrialExtendedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.card.Card; public class SubscriptionTrialExtendedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/taxWithheldDeletedEvent/TaxWithheldDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/TaxWithheldDeletedEvent.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/models/taxWithheldDeletedEvent/TaxWithheldDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/TaxWithheldDeletedEvent.java index 83df4ce3..f677924f 100644 --- a/src/main/java/com/chargebee/v4/core/models/taxWithheldDeletedEvent/TaxWithheldDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/TaxWithheldDeletedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.taxWithheldDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.taxWithheld.TaxWithheld; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.taxWithheld.TaxWithheld; +import com.chargebee.v4.models.invoice.Invoice; public class TaxWithheldDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/taxWithheldRecordedEvent/TaxWithheldRecordedEvent.java b/src/main/java/com/chargebee/v4/models/event/TaxWithheldRecordedEvent.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/models/taxWithheldRecordedEvent/TaxWithheldRecordedEvent.java rename to src/main/java/com/chargebee/v4/models/event/TaxWithheldRecordedEvent.java index bb3d787a..79f7cc9a 100644 --- a/src/main/java/com/chargebee/v4/core/models/taxWithheldRecordedEvent/TaxWithheldRecordedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/TaxWithheldRecordedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.taxWithheldRecordedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.taxWithheld.TaxWithheld; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.taxWithheld.TaxWithheld; +import com.chargebee.v4.models.invoice.Invoice; public class TaxWithheldRecordedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/taxWithheldRefundedEvent/TaxWithheldRefundedEvent.java b/src/main/java/com/chargebee/v4/models/event/TaxWithheldRefundedEvent.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/models/taxWithheldRefundedEvent/TaxWithheldRefundedEvent.java rename to src/main/java/com/chargebee/v4/models/event/TaxWithheldRefundedEvent.java index 6594f6e9..161c69d0 100644 --- a/src/main/java/com/chargebee/v4/core/models/taxWithheldRefundedEvent/TaxWithheldRefundedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/TaxWithheldRefundedEvent.java @@ -5,15 +5,15 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.taxWithheldRefundedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.taxWithheld.TaxWithheld; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.taxWithheld.TaxWithheld; +import com.chargebee.v4.models.invoice.Invoice; public class TaxWithheldRefundedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/tokenConsumedEvent/TokenConsumedEvent.java b/src/main/java/com/chargebee/v4/models/event/TokenConsumedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/tokenConsumedEvent/TokenConsumedEvent.java rename to src/main/java/com/chargebee/v4/models/event/TokenConsumedEvent.java index ea13f4b3..9217503d 100644 --- a/src/main/java/com/chargebee/v4/core/models/tokenConsumedEvent/TokenConsumedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/TokenConsumedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.tokenConsumedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.token.Token; +import com.chargebee.v4.models.token.Token; public class TokenConsumedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/tokenCreatedEvent/TokenCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/TokenCreatedEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/tokenCreatedEvent/TokenCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/TokenCreatedEvent.java index f2712f21..ec17000a 100644 --- a/src/main/java/com/chargebee/v4/core/models/tokenCreatedEvent/TokenCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/TokenCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.tokenCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.token.Token; +import com.chargebee.v4.models.token.Token; public class TokenCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/tokenExpiredEvent/TokenExpiredEvent.java b/src/main/java/com/chargebee/v4/models/event/TokenExpiredEvent.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/tokenExpiredEvent/TokenExpiredEvent.java rename to src/main/java/com/chargebee/v4/models/event/TokenExpiredEvent.java index aa1e9cac..41ac57b4 100644 --- a/src/main/java/com/chargebee/v4/core/models/tokenExpiredEvent/TokenExpiredEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/TokenExpiredEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.tokenExpiredEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.token.Token; +import com.chargebee.v4.models.token.Token; public class TokenExpiredEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/transactionCreatedEvent/TransactionCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/TransactionCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/transactionCreatedEvent/TransactionCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/TransactionCreatedEvent.java index 9d23e5ff..6de0db9d 100644 --- a/src/main/java/com/chargebee/v4/core/models/transactionCreatedEvent/TransactionCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/TransactionCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.transactionCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; public class TransactionCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/transactionDeletedEvent/TransactionDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/TransactionDeletedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/transactionDeletedEvent/TransactionDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/TransactionDeletedEvent.java index 4aa64bc5..dc5ae16e 100644 --- a/src/main/java/com/chargebee/v4/core/models/transactionDeletedEvent/TransactionDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/TransactionDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.transactionDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; public class TransactionDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/transactionUpdatedEvent/TransactionUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/TransactionUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/transactionUpdatedEvent/TransactionUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/TransactionUpdatedEvent.java index 8d8a9d38..a5d34777 100644 --- a/src/main/java/com/chargebee/v4/core/models/transactionUpdatedEvent/TransactionUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/TransactionUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.transactionUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; public class TransactionUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/unbilledChargesCreatedEvent/UnbilledChargesCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/UnbilledChargesCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/unbilledChargesCreatedEvent/UnbilledChargesCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/UnbilledChargesCreatedEvent.java index 195920c9..d45dc6f5 100644 --- a/src/main/java/com/chargebee/v4/core/models/unbilledChargesCreatedEvent/UnbilledChargesCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/UnbilledChargesCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.unbilledChargesCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; public class UnbilledChargesCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/unbilledChargesDeletedEvent/UnbilledChargesDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/UnbilledChargesDeletedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/unbilledChargesDeletedEvent/UnbilledChargesDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/UnbilledChargesDeletedEvent.java index 3fe395b0..26575cc9 100644 --- a/src/main/java/com/chargebee/v4/core/models/unbilledChargesDeletedEvent/UnbilledChargesDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/UnbilledChargesDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.unbilledChargesDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; public class UnbilledChargesDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/unbilledChargesInvoicedEvent/UnbilledChargesInvoicedEvent.java b/src/main/java/com/chargebee/v4/models/event/UnbilledChargesInvoicedEvent.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/unbilledChargesInvoicedEvent/UnbilledChargesInvoicedEvent.java rename to src/main/java/com/chargebee/v4/models/event/UnbilledChargesInvoicedEvent.java index 1f9a608c..d16032ba 100644 --- a/src/main/java/com/chargebee/v4/core/models/unbilledChargesInvoicedEvent/UnbilledChargesInvoicedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/UnbilledChargesInvoicedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.unbilledChargesInvoicedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.invoice.Invoice; public class UnbilledChargesInvoicedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/unbilledChargesVoidedEvent/UnbilledChargesVoidedEvent.java b/src/main/java/com/chargebee/v4/models/event/UnbilledChargesVoidedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/unbilledChargesVoidedEvent/UnbilledChargesVoidedEvent.java rename to src/main/java/com/chargebee/v4/models/event/UnbilledChargesVoidedEvent.java index f0da096e..33f20556 100644 --- a/src/main/java/com/chargebee/v4/core/models/unbilledChargesVoidedEvent/UnbilledChargesVoidedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/UnbilledChargesVoidedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.unbilledChargesVoidedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; public class UnbilledChargesVoidedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/usageFileIngestedEvent/UsageFileIngestedEvent.java b/src/main/java/com/chargebee/v4/models/event/UsageFileIngestedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/usageFileIngestedEvent/UsageFileIngestedEvent.java rename to src/main/java/com/chargebee/v4/models/event/UsageFileIngestedEvent.java index 31156f70..d6023788 100644 --- a/src/main/java/com/chargebee/v4/core/models/usageFileIngestedEvent/UsageFileIngestedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/UsageFileIngestedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.usageFileIngestedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.usageFile.UsageFile; +import com.chargebee.v4.models.usageFile.UsageFile; public class UsageFileIngestedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/variantCreatedEvent/VariantCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/VariantCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/variantCreatedEvent/VariantCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/VariantCreatedEvent.java index e063869e..a7e4d973 100644 --- a/src/main/java/com/chargebee/v4/core/models/variantCreatedEvent/VariantCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/VariantCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.variantCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.variant.Variant; +import com.chargebee.v4.models.variant.Variant; public class VariantCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/variantDeletedEvent/VariantDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/VariantDeletedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/variantDeletedEvent/VariantDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/VariantDeletedEvent.java index 2764b6b7..69b1aef9 100644 --- a/src/main/java/com/chargebee/v4/core/models/variantDeletedEvent/VariantDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/VariantDeletedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.variantDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.variant.Variant; +import com.chargebee.v4.models.variant.Variant; public class VariantDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/variantUpdatedEvent/VariantUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/VariantUpdatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/variantUpdatedEvent/VariantUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/VariantUpdatedEvent.java index eec7ecad..c458a9b7 100644 --- a/src/main/java/com/chargebee/v4/core/models/variantUpdatedEvent/VariantUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/VariantUpdatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.variantUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.variant.Variant; +import com.chargebee.v4.models.variant.Variant; public class VariantUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/virtualBankAccountAddedEvent/VirtualBankAccountAddedEvent.java b/src/main/java/com/chargebee/v4/models/event/VirtualBankAccountAddedEvent.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/virtualBankAccountAddedEvent/VirtualBankAccountAddedEvent.java rename to src/main/java/com/chargebee/v4/models/event/VirtualBankAccountAddedEvent.java index 55d3e8a7..7a262aa1 100644 --- a/src/main/java/com/chargebee/v4/core/models/virtualBankAccountAddedEvent/VirtualBankAccountAddedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/VirtualBankAccountAddedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.virtualBankAccountAddedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.virtualBankAccount.VirtualBankAccount; +import com.chargebee.v4.models.virtualBankAccount.VirtualBankAccount; public class VirtualBankAccountAddedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/virtualBankAccountDeletedEvent/VirtualBankAccountDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/VirtualBankAccountDeletedEvent.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/virtualBankAccountDeletedEvent/VirtualBankAccountDeletedEvent.java rename to src/main/java/com/chargebee/v4/models/event/VirtualBankAccountDeletedEvent.java index bc15426a..7c3e6e5e 100644 --- a/src/main/java/com/chargebee/v4/core/models/virtualBankAccountDeletedEvent/VirtualBankAccountDeletedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/VirtualBankAccountDeletedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.virtualBankAccountDeletedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.virtualBankAccount.VirtualBankAccount; +import com.chargebee.v4.models.virtualBankAccount.VirtualBankAccount; public class VirtualBankAccountDeletedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/virtualBankAccountUpdatedEvent/VirtualBankAccountUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/VirtualBankAccountUpdatedEvent.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/virtualBankAccountUpdatedEvent/VirtualBankAccountUpdatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/VirtualBankAccountUpdatedEvent.java index 23524885..17738307 100644 --- a/src/main/java/com/chargebee/v4/core/models/virtualBankAccountUpdatedEvent/VirtualBankAccountUpdatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/VirtualBankAccountUpdatedEvent.java @@ -5,13 +5,13 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.virtualBankAccountUpdatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.virtualBankAccount.VirtualBankAccount; +import com.chargebee.v4.models.virtualBankAccount.VirtualBankAccount; public class VirtualBankAccountUpdatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/voucherCreateFailedEvent/VoucherCreateFailedEvent.java b/src/main/java/com/chargebee/v4/models/event/VoucherCreateFailedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/voucherCreateFailedEvent/VoucherCreateFailedEvent.java rename to src/main/java/com/chargebee/v4/models/event/VoucherCreateFailedEvent.java index 1db7575c..e5f11a03 100644 --- a/src/main/java/com/chargebee/v4/core/models/voucherCreateFailedEvent/VoucherCreateFailedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/VoucherCreateFailedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.voucherCreateFailedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.paymentVoucher.PaymentVoucher; +import com.chargebee.v4.models.paymentVoucher.PaymentVoucher; public class VoucherCreateFailedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/voucherCreatedEvent/VoucherCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/VoucherCreatedEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/voucherCreatedEvent/VoucherCreatedEvent.java rename to src/main/java/com/chargebee/v4/models/event/VoucherCreatedEvent.java index 748d23b2..78b62dde 100644 --- a/src/main/java/com/chargebee/v4/core/models/voucherCreatedEvent/VoucherCreatedEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/VoucherCreatedEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.voucherCreatedEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.paymentVoucher.PaymentVoucher; +import com.chargebee.v4.models.paymentVoucher.PaymentVoucher; public class VoucherCreatedEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/voucherExpiredEvent/VoucherExpiredEvent.java b/src/main/java/com/chargebee/v4/models/event/VoucherExpiredEvent.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/voucherExpiredEvent/VoucherExpiredEvent.java rename to src/main/java/com/chargebee/v4/models/event/VoucherExpiredEvent.java index af01a4d8..51718e50 100644 --- a/src/main/java/com/chargebee/v4/core/models/voucherExpiredEvent/VoucherExpiredEvent.java +++ b/src/main/java/com/chargebee/v4/models/event/VoucherExpiredEvent.java @@ -5,11 +5,11 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.voucherExpiredEvent; +package com.chargebee.v4.models.event; import com.chargebee.v4.internal.JsonUtil; -import com.chargebee.v4.core.models.paymentVoucher.PaymentVoucher; +import com.chargebee.v4.models.paymentVoucher.PaymentVoucher; public class VoucherExpiredEvent { diff --git a/src/main/java/com/chargebee/v4/core/models/event/params/EventListParams.java b/src/main/java/com/chargebee/v4/models/event/params/EventListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/event/params/EventListParams.java rename to src/main/java/com/chargebee/v4/models/event/params/EventListParams.java index 9e7d6b74..4dcf6f67 100644 --- a/src/main/java/com/chargebee/v4/core/models/event/params/EventListParams.java +++ b/src/main/java/com/chargebee/v4/models/event/params/EventListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.event.params; +package com.chargebee.v4.models.event.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/event/params/EventRetrieveParams.java b/src/main/java/com/chargebee/v4/models/event/params/EventRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/event/params/EventRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/event/params/EventRetrieveParams.java index 30ea3871..1724f6f2 100644 --- a/src/main/java/com/chargebee/v4/core/models/event/params/EventRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/event/params/EventRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.event.params; +package com.chargebee.v4.models.event.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/responses/event/EventListResponse.java b/src/main/java/com/chargebee/v4/models/event/responses/EventListResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/event/EventListResponse.java rename to src/main/java/com/chargebee/v4/models/event/responses/EventListResponse.java index e7e2ae42..343b6ca3 100644 --- a/src/main/java/com/chargebee/v4/core/responses/event/EventListResponse.java +++ b/src/main/java/com/chargebee/v4/models/event/responses/EventListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.event; +package com.chargebee.v4.models.event.responses; import java.util.List; -import com.chargebee.v4.core.models.event.Event; +import com.chargebee.v4.models.event.Event; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.EventService; -import com.chargebee.v4.core.models.event.params.EventListParams; +import com.chargebee.v4.services.EventService; +import com.chargebee.v4.models.event.params.EventListParams; /** Immutable response object for EventList operation. Contains paginated list data. */ public final class EventListResponse { @@ -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 EventListResponse nextPage() throws Exception { + public EventListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/event/responses/EventRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/event/responses/EventRetrieveResponse.java new file mode 100644 index 00000000..e893b2c4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/responses/EventRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.event.responses; + +import com.chargebee.v4.models.event.Event; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for EventRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class EventRetrieveResponse extends BaseResponse { + private final Event event; + + private EventRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.event = builder.event; + } + + /** Parse JSON response into EventRetrieveResponse object. */ + public static EventRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into EventRetrieveResponse object with HTTP response. */ + public static EventRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __eventJson = JsonUtil.getObject(json, "event"); + if (__eventJson != null) { + builder.event(Event.fromJson(__eventJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse EventRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for EventRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for EventRetrieveResponse. */ + public static class Builder { + + private Event event; + + private Response httpResponse; + + private Builder() {} + + public Builder event(Event event) { + this.event = event; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public EventRetrieveResponse build() { + return new EventRetrieveResponse(this); + } + } + + /** Get the event from the response. */ + public Event getEvent() { + return event; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/export/Export.java b/src/main/java/com/chargebee/v4/models/export/Export.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/export/Export.java rename to src/main/java/com/chargebee/v4/models/export/Export.java index 87ae8b4d..2e069149 100644 --- a/src/main/java/com/chargebee/v4/core/models/export/Export.java +++ b/src/main/java/com/chargebee/v4/models/export/Export.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.export; +package com.chargebee.v4.models.export; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportAddonsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportAddonsParams.java new file mode 100644 index 00000000..e5e8819a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportAddonsParams.java @@ -0,0 +1,1847 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportAddonsParams { + + private final CurrencyCodeParams currencyCode; + + private final AddonParams addon; + + private ExportAddonsParams(ExportAddonsBuilder builder) { + + this.currencyCode = builder.currencyCode; + + this.addon = builder.addon; + } + + public CurrencyCodeParams getCurrencyCode() { + return currencyCode; + } + + public AddonParams getAddon() { + return addon; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.currencyCode != null) { + + // Single object + Map nestedData = this.currencyCode.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "currency_code[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addon != null) { + + // Single object + Map nestedData = this.addon.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "addon[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportAddonsBuilder builder() { + return new ExportAddonsBuilder(); + } + + public static final class ExportAddonsBuilder { + + private CurrencyCodeParams currencyCode; + + private AddonParams addon; + + private ExportAddonsBuilder() {} + + public ExportAddonsBuilder currencyCode(CurrencyCodeParams value) { + this.currencyCode = value; + return this; + } + + public ExportAddonsBuilder addon(AddonParams value) { + this.addon = value; + return this; + } + + public ExportAddonsParams build() { + return new ExportAddonsParams(this); + } + } + + public static final class CurrencyCodeParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private CurrencyCodeParams(CurrencyCodeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for CurrencyCodeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CurrencyCodeBuilder builder() { + return new CurrencyCodeBuilder(); + } + + public static final class CurrencyCodeBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private CurrencyCodeBuilder() {} + + public CurrencyCodeBuilder is(String value) { + this.is = value; + return this; + } + + public CurrencyCodeBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CurrencyCodeBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CurrencyCodeBuilder in(String value) { + this.in = value; + return this; + } + + public CurrencyCodeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CurrencyCodeParams build() { + return new CurrencyCodeParams(this); + } + } + } + + public static final class AddonParams { + + private final IdParams id; + + private final NameParams name; + + private final ChargeTypeParams chargeType; + + private final PriceParams price; + + private final PeriodParams period; + + private final PeriodUnitParams periodUnit; + + private final StatusParams status; + + private final UpdatedAtParams updatedAt; + + private final ChannelParams channel; + + private AddonParams(AddonBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.chargeType = builder.chargeType; + + this.price = builder.price; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.status = builder.status; + + this.updatedAt = builder.updatedAt; + + this.channel = builder.channel; + } + + public IdParams getId() { + return id; + } + + public NameParams getName() { + return name; + } + + public ChargeTypeParams getChargeType() { + return chargeType; + } + + public PriceParams getPrice() { + return price; + } + + public PeriodParams getPeriod() { + return period; + } + + public PeriodUnitParams getPeriodUnit() { + return periodUnit; + } + + public StatusParams getStatus() { + return status; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + public ChannelParams getChannel() { + return channel; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.name != null) { + + // Single object + Map nestedData = this.name.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "name[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.chargeType != null) { + + // Single object + Map nestedData = this.chargeType.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "charge_type[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.price != null) { + + // Single object + Map nestedData = this.price.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "price[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.period != null) { + + // Single object + Map nestedData = this.period.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "period[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.periodUnit != null) { + + // Single object + Map nestedData = this.periodUnit.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "period_unit[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.status != null) { + + // Single object + Map nestedData = this.status.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.channel != null) { + + // Single object + Map nestedData = this.channel.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "channel[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for AddonParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonBuilder builder() { + return new AddonBuilder(); + } + + public static final class AddonBuilder { + + private IdParams id; + + private NameParams name; + + private ChargeTypeParams chargeType; + + private PriceParams price; + + private PeriodParams period; + + private PeriodUnitParams periodUnit; + + private StatusParams status; + + private UpdatedAtParams updatedAt; + + private ChannelParams channel; + + private AddonBuilder() {} + + public AddonBuilder id(IdParams value) { + this.id = value; + return this; + } + + public AddonBuilder name(NameParams value) { + this.name = value; + return this; + } + + public AddonBuilder chargeType(ChargeTypeParams value) { + this.chargeType = value; + return this; + } + + public AddonBuilder price(PriceParams value) { + this.price = value; + return this; + } + + public AddonBuilder period(PeriodParams value) { + this.period = value; + return this; + } + + public AddonBuilder periodUnit(PeriodUnitParams value) { + this.periodUnit = value; + return this; + } + + public AddonBuilder status(StatusParams value) { + this.status = value; + return this; + } + + public AddonBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public AddonBuilder channel(ChannelParams value) { + this.channel = value; + return this; + } + + public AddonParams build() { + return new AddonParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class NameParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private NameParams(NameBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for NameParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NameBuilder builder() { + return new NameBuilder(); + } + + public static final class NameBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private NameBuilder() {} + + public NameBuilder is(String value) { + this.is = value; + return this; + } + + public NameBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public NameBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public NameBuilder in(String value) { + this.in = value; + return this; + } + + public NameBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public NameParams build() { + return new NameParams(this); + } + } + } + + public static final class ChargeTypeParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ChargeTypeParams(ChargeTypeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ChargeTypeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargeTypeBuilder builder() { + return new ChargeTypeBuilder(); + } + + public static final class ChargeTypeBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ChargeTypeBuilder() {} + + public ChargeTypeBuilder is(Is value) { + this.is = value; + return this; + } + + public ChargeTypeBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ChargeTypeBuilder in(String value) { + this.in = value; + return this; + } + + public ChargeTypeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ChargeTypeParams build() { + return new ChargeTypeParams(this); + } + } + + public enum Is { + RECURRING("recurring"), + + NON_RECURRING("non_recurring"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + RECURRING("recurring"), + + NON_RECURRING("non_recurring"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PriceParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private PriceParams(PriceBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for PriceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PriceBuilder builder() { + return new PriceBuilder(); + } + + public static final class PriceBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private PriceBuilder() {} + + public PriceBuilder is(String value) { + this.is = value; + return this; + } + + public PriceBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PriceBuilder lt(String value) { + this.lt = value; + return this; + } + + public PriceBuilder lte(String value) { + this.lte = value; + return this; + } + + public PriceBuilder gt(String value) { + this.gt = value; + return this; + } + + public PriceBuilder gte(String value) { + this.gte = value; + return this; + } + + public PriceBuilder between(String value) { + this.between = value; + return this; + } + + public PriceParams build() { + return new PriceParams(this); + } + } + } + + public static final class PeriodParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private PeriodParams(PeriodBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for PeriodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PeriodBuilder builder() { + return new PeriodBuilder(); + } + + public static final class PeriodBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private PeriodBuilder() {} + + public PeriodBuilder is(String value) { + this.is = value; + return this; + } + + public PeriodBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PeriodBuilder lt(String value) { + this.lt = value; + return this; + } + + public PeriodBuilder lte(String value) { + this.lte = value; + return this; + } + + public PeriodBuilder gt(String value) { + this.gt = value; + return this; + } + + public PeriodBuilder gte(String value) { + this.gte = value; + return this; + } + + public PeriodBuilder between(String value) { + this.between = value; + return this; + } + + public PeriodParams build() { + return new PeriodParams(this); + } + } + } + + public static final class PeriodUnitParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private PeriodUnitParams(PeriodUnitBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PeriodUnitParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PeriodUnitBuilder builder() { + return new PeriodUnitBuilder(); + } + + public static final class PeriodUnitBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private PeriodUnitBuilder() {} + + public PeriodUnitBuilder is(Is value) { + this.is = value; + return this; + } + + public PeriodUnitBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public PeriodUnitBuilder in(String value) { + this.in = value; + return this; + } + + public PeriodUnitBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PeriodUnitParams build() { + return new PeriodUnitParams(this); + } + } + + public enum Is { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + NOT_APPLICABLE("not_applicable"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + NOT_APPLICABLE("not_applicable"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class StatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private StatusParams(StatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for StatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatusBuilder builder() { + return new StatusBuilder(); + } + + public static final class StatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private StatusBuilder() {} + + public StatusBuilder is(Is value) { + this.is = value; + return this; + } + + public StatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public StatusBuilder in(String value) { + this.in = value; + return this; + } + + public StatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public StatusParams build() { + return new StatusParams(this); + } + } + + public enum Is { + ACTIVE("active"), + + ARCHIVED("archived"), + + DELETED("deleted"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + ACTIVE("active"), + + ARCHIVED("archived"), + + DELETED("deleted"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } + + public static final class ChannelParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ChannelParams(ChannelBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ChannelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChannelBuilder builder() { + return new ChannelBuilder(); + } + + public static final class ChannelBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ChannelBuilder() {} + + public ChannelBuilder is(Is value) { + this.is = value; + return this; + } + + public ChannelBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ChannelBuilder in(String value) { + this.in = value; + return this; + } + + public ChannelBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ChannelParams build() { + return new ChannelParams(this); + } + } + + public enum Is { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportAttachedItemsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportAttachedItemsParams.java new file mode 100644 index 00000000..c5ac3ade --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportAttachedItemsParams.java @@ -0,0 +1,1276 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportAttachedItemsParams { + + private final ItemTypeParams itemType; + + private final AttachedItemParams attachedItem; + + private ExportAttachedItemsParams(ExportAttachedItemsBuilder builder) { + + this.itemType = builder.itemType; + + this.attachedItem = builder.attachedItem; + } + + public ItemTypeParams getItemType() { + return itemType; + } + + public AttachedItemParams getAttachedItem() { + return attachedItem; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemType != null) { + + // Single object + Map nestedData = this.itemType.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_type[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.attachedItem != null) { + + // Single object + Map nestedData = this.attachedItem.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "attached_item[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportAttachedItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportAttachedItemsBuilder builder() { + return new ExportAttachedItemsBuilder(); + } + + public static final class ExportAttachedItemsBuilder { + + private ItemTypeParams itemType; + + private AttachedItemParams attachedItem; + + private ExportAttachedItemsBuilder() {} + + public ExportAttachedItemsBuilder itemType(ItemTypeParams value) { + this.itemType = value; + return this; + } + + public ExportAttachedItemsBuilder attachedItem(AttachedItemParams value) { + this.attachedItem = value; + return this; + } + + public ExportAttachedItemsParams build() { + return new ExportAttachedItemsParams(this); + } + } + + public static final class ItemTypeParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ItemTypeParams(ItemTypeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ItemTypeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTypeBuilder builder() { + return new ItemTypeBuilder(); + } + + public static final class ItemTypeBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ItemTypeBuilder() {} + + public ItemTypeBuilder is(Is value) { + this.is = value; + return this; + } + + public ItemTypeBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ItemTypeBuilder in(String value) { + this.in = value; + return this; + } + + public ItemTypeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ItemTypeParams build() { + return new ItemTypeParams(this); + } + } + + public enum Is { + PLAN("plan"), + + ADDON("addon"), + + CHARGE("charge"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + PLAN("plan"), + + ADDON("addon"), + + CHARGE("charge"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AttachedItemParams { + + private final IdParams id; + + private final ItemIdParams itemId; + + private final TypeParams type; + + private final ChargeOnEventParams chargeOnEvent; + + private final UpdatedAtParams updatedAt; + + private final ParentItemIdParams parentItemId; + + private AttachedItemParams(AttachedItemBuilder builder) { + + this.id = builder.id; + + this.itemId = builder.itemId; + + this.type = builder.type; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.updatedAt = builder.updatedAt; + + this.parentItemId = builder.parentItemId; + } + + public IdParams getId() { + return id; + } + + public ItemIdParams getItemId() { + return itemId; + } + + public TypeParams getType() { + return type; + } + + public ChargeOnEventParams getChargeOnEvent() { + return chargeOnEvent; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + public ParentItemIdParams getParentItemId() { + return parentItemId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemId != null) { + + // Single object + Map nestedData = this.itemId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.type != null) { + + // Single object + Map nestedData = this.type.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "type[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.chargeOnEvent != null) { + + // Single object + Map nestedData = this.chargeOnEvent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "charge_on_event[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.parentItemId != null) { + + // Single object + Map nestedData = this.parentItemId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "parent_item_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for AttachedItemParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AttachedItemBuilder builder() { + return new AttachedItemBuilder(); + } + + public static final class AttachedItemBuilder { + + private IdParams id; + + private ItemIdParams itemId; + + private TypeParams type; + + private ChargeOnEventParams chargeOnEvent; + + private UpdatedAtParams updatedAt; + + private ParentItemIdParams parentItemId; + + private AttachedItemBuilder() {} + + public AttachedItemBuilder id(IdParams value) { + this.id = value; + return this; + } + + public AttachedItemBuilder itemId(ItemIdParams value) { + this.itemId = value; + return this; + } + + public AttachedItemBuilder type(TypeParams value) { + this.type = value; + return this; + } + + public AttachedItemBuilder chargeOnEvent(ChargeOnEventParams value) { + this.chargeOnEvent = value; + return this; + } + + public AttachedItemBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public AttachedItemBuilder parentItemId(ParentItemIdParams value) { + this.parentItemId = value; + return this; + } + + public AttachedItemParams build() { + return new AttachedItemParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class ItemIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ItemIdParams(ItemIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ItemIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemIdBuilder builder() { + return new ItemIdBuilder(); + } + + public static final class ItemIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ItemIdBuilder() {} + + public ItemIdBuilder is(String value) { + this.is = value; + return this; + } + + public ItemIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ItemIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ItemIdBuilder in(String value) { + this.in = value; + return this; + } + + public ItemIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ItemIdParams build() { + return new ItemIdParams(this); + } + } + } + + public static final class TypeParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private TypeParams(TypeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for TypeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TypeBuilder builder() { + return new TypeBuilder(); + } + + public static final class TypeBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private TypeBuilder() {} + + public TypeBuilder is(Is value) { + this.is = value; + return this; + } + + public TypeBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public TypeBuilder in(String value) { + this.in = value; + return this; + } + + public TypeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public TypeParams build() { + return new TypeParams(this); + } + } + + public enum Is { + RECOMMENDED("recommended"), + + MANDATORY("mandatory"), + + OPTIONAL("optional"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + RECOMMENDED("recommended"), + + MANDATORY("mandatory"), + + OPTIONAL("optional"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ChargeOnEventParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ChargeOnEventParams(ChargeOnEventBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ChargeOnEventParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargeOnEventBuilder builder() { + return new ChargeOnEventBuilder(); + } + + public static final class ChargeOnEventBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ChargeOnEventBuilder() {} + + public ChargeOnEventBuilder is(Is value) { + this.is = value; + return this; + } + + public ChargeOnEventBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ChargeOnEventBuilder in(String value) { + this.in = value; + return this; + } + + public ChargeOnEventBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ChargeOnEventParams build() { + return new ChargeOnEventParams(this); + } + } + + public enum Is { + 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 Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + 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 IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } + + public static final class ParentItemIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ParentItemIdParams(ParentItemIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ParentItemIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ParentItemIdBuilder builder() { + return new ParentItemIdBuilder(); + } + + public static final class ParentItemIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ParentItemIdBuilder() {} + + public ParentItemIdBuilder is(String value) { + this.is = value; + return this; + } + + public ParentItemIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ParentItemIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ParentItemIdBuilder in(String value) { + this.in = value; + return this; + } + + public ParentItemIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ParentItemIdParams build() { + return new ParentItemIdParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportCouponsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportCouponsParams.java new file mode 100644 index 00000000..340c5b8d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportCouponsParams.java @@ -0,0 +1,1602 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportCouponsParams { + + private final CurrencyCodeParams currencyCode; + + private final CouponParams coupon; + + private ExportCouponsParams(ExportCouponsBuilder builder) { + + this.currencyCode = builder.currencyCode; + + this.coupon = builder.coupon; + } + + public CurrencyCodeParams getCurrencyCode() { + return currencyCode; + } + + public CouponParams getCoupon() { + return coupon; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.currencyCode != null) { + + // Single object + Map nestedData = this.currencyCode.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "currency_code[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.coupon != null) { + + // Single object + Map nestedData = this.coupon.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "coupon[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportCouponsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportCouponsBuilder builder() { + return new ExportCouponsBuilder(); + } + + public static final class ExportCouponsBuilder { + + private CurrencyCodeParams currencyCode; + + private CouponParams coupon; + + private ExportCouponsBuilder() {} + + public ExportCouponsBuilder currencyCode(CurrencyCodeParams value) { + this.currencyCode = value; + return this; + } + + public ExportCouponsBuilder coupon(CouponParams value) { + this.coupon = value; + return this; + } + + public ExportCouponsParams build() { + return new ExportCouponsParams(this); + } + } + + public static final class CurrencyCodeParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private CurrencyCodeParams(CurrencyCodeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for CurrencyCodeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CurrencyCodeBuilder builder() { + return new CurrencyCodeBuilder(); + } + + public static final class CurrencyCodeBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private CurrencyCodeBuilder() {} + + public CurrencyCodeBuilder is(String value) { + this.is = value; + return this; + } + + public CurrencyCodeBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CurrencyCodeBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CurrencyCodeBuilder in(String value) { + this.in = value; + return this; + } + + public CurrencyCodeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CurrencyCodeParams build() { + return new CurrencyCodeParams(this); + } + } + } + + public static final class CouponParams { + + private final IdParams id; + + private final NameParams name; + + private final DiscountTypeParams discountType; + + private final DurationTypeParams durationType; + + private final StatusParams status; + + private final ApplyOnParams applyOn; + + private final CreatedAtParams createdAt; + + private final UpdatedAtParams updatedAt; + + private CouponParams(CouponBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.discountType = builder.discountType; + + this.durationType = builder.durationType; + + this.status = builder.status; + + this.applyOn = builder.applyOn; + + this.createdAt = builder.createdAt; + + this.updatedAt = builder.updatedAt; + } + + public IdParams getId() { + return id; + } + + public NameParams getName() { + return name; + } + + public DiscountTypeParams getDiscountType() { + return discountType; + } + + public DurationTypeParams getDurationType() { + return durationType; + } + + public StatusParams getStatus() { + return status; + } + + public ApplyOnParams getApplyOn() { + return applyOn; + } + + public CreatedAtParams getCreatedAt() { + return createdAt; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.name != null) { + + // Single object + Map nestedData = this.name.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "name[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.discountType != null) { + + // Single object + Map nestedData = this.discountType.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "discount_type[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.durationType != null) { + + // Single object + Map nestedData = this.durationType.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "duration_type[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.status != null) { + + // Single object + Map nestedData = this.status.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.applyOn != null) { + + // Single object + Map nestedData = this.applyOn.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "apply_on[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.createdAt != null) { + + // Single object + Map nestedData = this.createdAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "created_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for CouponParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponBuilder builder() { + return new CouponBuilder(); + } + + public static final class CouponBuilder { + + private IdParams id; + + private NameParams name; + + private DiscountTypeParams discountType; + + private DurationTypeParams durationType; + + private StatusParams status; + + private ApplyOnParams applyOn; + + private CreatedAtParams createdAt; + + private UpdatedAtParams updatedAt; + + private CouponBuilder() {} + + public CouponBuilder id(IdParams value) { + this.id = value; + return this; + } + + public CouponBuilder name(NameParams value) { + this.name = value; + return this; + } + + public CouponBuilder discountType(DiscountTypeParams value) { + this.discountType = value; + return this; + } + + public CouponBuilder durationType(DurationTypeParams value) { + this.durationType = value; + return this; + } + + public CouponBuilder status(StatusParams value) { + this.status = value; + return this; + } + + public CouponBuilder applyOn(ApplyOnParams value) { + this.applyOn = value; + return this; + } + + public CouponBuilder createdAt(CreatedAtParams value) { + this.createdAt = value; + return this; + } + + public CouponBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public CouponParams build() { + return new CouponParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class NameParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private NameParams(NameBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for NameParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NameBuilder builder() { + return new NameBuilder(); + } + + public static final class NameBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private NameBuilder() {} + + public NameBuilder is(String value) { + this.is = value; + return this; + } + + public NameBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public NameBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public NameBuilder in(String value) { + this.in = value; + return this; + } + + public NameBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public NameParams build() { + return new NameParams(this); + } + } + } + + public static final class DiscountTypeParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private DiscountTypeParams(DiscountTypeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for DiscountTypeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountTypeBuilder builder() { + return new DiscountTypeBuilder(); + } + + public static final class DiscountTypeBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private DiscountTypeBuilder() {} + + public DiscountTypeBuilder is(Is value) { + this.is = value; + return this; + } + + public DiscountTypeBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public DiscountTypeBuilder in(String value) { + this.in = value; + return this; + } + + public DiscountTypeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public DiscountTypeParams build() { + return new DiscountTypeParams(this); + } + } + + public enum Is { + FIXED_AMOUNT("fixed_amount"), + + PERCENTAGE("percentage"), + + OFFER_QUANTITY("offer_quantity"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + FIXED_AMOUNT("fixed_amount"), + + PERCENTAGE("percentage"), + + OFFER_QUANTITY("offer_quantity"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DurationTypeParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private DurationTypeParams(DurationTypeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for DurationTypeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DurationTypeBuilder builder() { + return new DurationTypeBuilder(); + } + + public static final class DurationTypeBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private DurationTypeBuilder() {} + + public DurationTypeBuilder is(Is value) { + this.is = value; + return this; + } + + public DurationTypeBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public DurationTypeBuilder in(String value) { + this.in = value; + return this; + } + + public DurationTypeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public DurationTypeParams build() { + return new DurationTypeParams(this); + } + } + + public enum Is { + ONE_TIME("one_time"), + + FOREVER("forever"), + + LIMITED_PERIOD("limited_period"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + ONE_TIME("one_time"), + + FOREVER("forever"), + + LIMITED_PERIOD("limited_period"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class StatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private StatusParams(StatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for StatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatusBuilder builder() { + return new StatusBuilder(); + } + + public static final class StatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private StatusBuilder() {} + + public StatusBuilder is(Is value) { + this.is = value; + return this; + } + + public StatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public StatusBuilder in(String value) { + this.in = value; + return this; + } + + public StatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public StatusParams build() { + return new StatusParams(this); + } + } + + public enum Is { + ACTIVE("active"), + + EXPIRED("expired"), + + ARCHIVED("archived"), + + DELETED("deleted"), + + FUTURE("future"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + ACTIVE("active"), + + EXPIRED("expired"), + + ARCHIVED("archived"), + + DELETED("deleted"), + + FUTURE("future"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ApplyOnParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ApplyOnParams(ApplyOnBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ApplyOnParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ApplyOnBuilder builder() { + return new ApplyOnBuilder(); + } + + public static final class ApplyOnBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ApplyOnBuilder() {} + + public ApplyOnBuilder is(Is value) { + this.is = value; + return this; + } + + public ApplyOnBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ApplyOnBuilder in(String value) { + this.in = value; + return this; + } + + public ApplyOnBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ApplyOnParams build() { + return new ApplyOnParams(this); + } + } + + public enum Is { + 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 Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + 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 IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CreatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private CreatedAtParams(CreatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for CreatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreatedAtBuilder builder() { + return new CreatedAtBuilder(); + } + + public static final class CreatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private CreatedAtBuilder() {} + + public CreatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public CreatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public CreatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public CreatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public CreatedAtParams build() { + return new CreatedAtParams(this); + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportCreditNotesParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportCreditNotesParams.java new file mode 100644 index 00000000..e14949e2 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportCreditNotesParams.java @@ -0,0 +1,3126 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportCreditNotesParams { + + private final CreditNoteParams creditNote; + + private ExportCreditNotesParams(ExportCreditNotesBuilder builder) { + + this.creditNote = builder.creditNote; + } + + public CreditNoteParams getCreditNote() { + return creditNote; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.creditNote != null) { + + // Single object + Map nestedData = this.creditNote.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "credit_note[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportCreditNotesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportCreditNotesBuilder builder() { + return new ExportCreditNotesBuilder(); + } + + public static final class ExportCreditNotesBuilder { + + private CreditNoteParams creditNote; + + private ExportCreditNotesBuilder() {} + + public ExportCreditNotesBuilder creditNote(CreditNoteParams value) { + this.creditNote = value; + return this; + } + + public ExportCreditNotesParams build() { + return new ExportCreditNotesParams(this); + } + } + + public static final class CreditNoteParams { + + private final IdParams id; + + private final CustomerIdParams customerId; + + private final SubscriptionIdParams subscriptionId; + + private final ReferenceInvoiceIdParams referenceInvoiceId; + + private final TypeParams type; + + private final ReasonCodeParams reasonCode; + + private final CreateReasonCodeParams createReasonCode; + + private final StatusParams status; + + private final DateParams date; + + private final TotalParams total; + + private final PriceTypeParams priceType; + + private final AmountAllocatedParams amountAllocated; + + private final AmountRefundedParams amountRefunded; + + private final AmountAvailableParams amountAvailable; + + private final VoidedAtParams voidedAt; + + private final UpdatedAtParams updatedAt; + + private final ChannelParams channel; + + private CreditNoteParams(CreditNoteBuilder builder) { + + this.id = builder.id; + + this.customerId = builder.customerId; + + this.subscriptionId = builder.subscriptionId; + + this.referenceInvoiceId = builder.referenceInvoiceId; + + this.type = builder.type; + + this.reasonCode = builder.reasonCode; + + this.createReasonCode = builder.createReasonCode; + + this.status = builder.status; + + this.date = builder.date; + + this.total = builder.total; + + this.priceType = builder.priceType; + + this.amountAllocated = builder.amountAllocated; + + this.amountRefunded = builder.amountRefunded; + + this.amountAvailable = builder.amountAvailable; + + this.voidedAt = builder.voidedAt; + + this.updatedAt = builder.updatedAt; + + this.channel = builder.channel; + } + + public IdParams getId() { + return id; + } + + public CustomerIdParams getCustomerId() { + return customerId; + } + + public SubscriptionIdParams getSubscriptionId() { + return subscriptionId; + } + + public ReferenceInvoiceIdParams getReferenceInvoiceId() { + return referenceInvoiceId; + } + + public TypeParams getType() { + return type; + } + + public ReasonCodeParams getReasonCode() { + return reasonCode; + } + + public CreateReasonCodeParams getCreateReasonCode() { + return createReasonCode; + } + + public StatusParams getStatus() { + return status; + } + + public DateParams getDate() { + return date; + } + + public TotalParams getTotal() { + return total; + } + + public PriceTypeParams getPriceType() { + return priceType; + } + + public AmountAllocatedParams getAmountAllocated() { + return amountAllocated; + } + + public AmountRefundedParams getAmountRefunded() { + return amountRefunded; + } + + public AmountAvailableParams getAmountAvailable() { + return amountAvailable; + } + + public VoidedAtParams getVoidedAt() { + return voidedAt; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + public ChannelParams getChannel() { + return channel; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.customerId != null) { + + // Single object + Map nestedData = this.customerId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "customer_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionId != null) { + + // Single object + Map nestedData = this.subscriptionId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.referenceInvoiceId != null) { + + // Single object + Map nestedData = this.referenceInvoiceId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "reference_invoice_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.type != null) { + + // Single object + Map nestedData = this.type.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "type[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.reasonCode != null) { + + // Single object + Map nestedData = this.reasonCode.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "reason_code[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.createReasonCode != null) { + + // Single object + Map nestedData = this.createReasonCode.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "create_reason_code[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.status != null) { + + // Single object + Map nestedData = this.status.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.date != null) { + + // Single object + Map nestedData = this.date.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "date[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.total != null) { + + // Single object + Map nestedData = this.total.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "total[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.priceType != null) { + + // Single object + Map nestedData = this.priceType.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "price_type[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.amountAllocated != null) { + + // Single object + Map nestedData = this.amountAllocated.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "amount_allocated[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.amountRefunded != null) { + + // Single object + Map nestedData = this.amountRefunded.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "amount_refunded[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.amountAvailable != null) { + + // Single object + Map nestedData = this.amountAvailable.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "amount_available[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.voidedAt != null) { + + // Single object + Map nestedData = this.voidedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "voided_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.channel != null) { + + // Single object + Map nestedData = this.channel.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "channel[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for CreditNoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNoteBuilder builder() { + return new CreditNoteBuilder(); + } + + public static final class CreditNoteBuilder { + + private IdParams id; + + private CustomerIdParams customerId; + + private SubscriptionIdParams subscriptionId; + + private ReferenceInvoiceIdParams referenceInvoiceId; + + private TypeParams type; + + private ReasonCodeParams reasonCode; + + private CreateReasonCodeParams createReasonCode; + + private StatusParams status; + + private DateParams date; + + private TotalParams total; + + private PriceTypeParams priceType; + + private AmountAllocatedParams amountAllocated; + + private AmountRefundedParams amountRefunded; + + private AmountAvailableParams amountAvailable; + + private VoidedAtParams voidedAt; + + private UpdatedAtParams updatedAt; + + private ChannelParams channel; + + private CreditNoteBuilder() {} + + public CreditNoteBuilder id(IdParams value) { + this.id = value; + return this; + } + + public CreditNoteBuilder customerId(CustomerIdParams value) { + this.customerId = value; + return this; + } + + public CreditNoteBuilder subscriptionId(SubscriptionIdParams value) { + this.subscriptionId = value; + return this; + } + + public CreditNoteBuilder referenceInvoiceId(ReferenceInvoiceIdParams value) { + this.referenceInvoiceId = value; + return this; + } + + public CreditNoteBuilder type(TypeParams value) { + this.type = value; + return this; + } + + public CreditNoteBuilder reasonCode(ReasonCodeParams value) { + this.reasonCode = value; + return this; + } + + public CreditNoteBuilder createReasonCode(CreateReasonCodeParams value) { + this.createReasonCode = value; + return this; + } + + public CreditNoteBuilder status(StatusParams value) { + this.status = value; + return this; + } + + public CreditNoteBuilder date(DateParams value) { + this.date = value; + return this; + } + + public CreditNoteBuilder total(TotalParams value) { + this.total = value; + return this; + } + + public CreditNoteBuilder priceType(PriceTypeParams value) { + this.priceType = value; + return this; + } + + public CreditNoteBuilder amountAllocated(AmountAllocatedParams value) { + this.amountAllocated = value; + return this; + } + + public CreditNoteBuilder amountRefunded(AmountRefundedParams value) { + this.amountRefunded = value; + return this; + } + + public CreditNoteBuilder amountAvailable(AmountAvailableParams value) { + this.amountAvailable = value; + return this; + } + + public CreditNoteBuilder voidedAt(VoidedAtParams value) { + this.voidedAt = value; + return this; + } + + public CreditNoteBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public CreditNoteBuilder channel(ChannelParams value) { + this.channel = value; + return this; + } + + public CreditNoteParams build() { + return new CreditNoteParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class CustomerIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private CustomerIdParams(CustomerIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for CustomerIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerIdBuilder builder() { + return new CustomerIdBuilder(); + } + + public static final class CustomerIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private CustomerIdBuilder() {} + + public CustomerIdBuilder is(String value) { + this.is = value; + return this; + } + + public CustomerIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CustomerIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CustomerIdBuilder in(String value) { + this.in = value; + return this; + } + + public CustomerIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CustomerIdParams build() { + return new CustomerIdParams(this); + } + } + } + + public static final class SubscriptionIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private final String in; + + private final String notIn; + + private SubscriptionIdParams(SubscriptionIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for SubscriptionIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionIdBuilder builder() { + return new SubscriptionIdBuilder(); + } + + public static final class SubscriptionIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private String in; + + private String notIn; + + private SubscriptionIdBuilder() {} + + public SubscriptionIdBuilder is(String value) { + this.is = value; + return this; + } + + public SubscriptionIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public SubscriptionIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public SubscriptionIdBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public SubscriptionIdBuilder in(String value) { + this.in = value; + return this; + } + + public SubscriptionIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public SubscriptionIdParams build() { + return new SubscriptionIdParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ReferenceInvoiceIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private final String in; + + private final String notIn; + + private ReferenceInvoiceIdParams(ReferenceInvoiceIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ReferenceInvoiceIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ReferenceInvoiceIdBuilder builder() { + return new ReferenceInvoiceIdBuilder(); + } + + public static final class ReferenceInvoiceIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private String in; + + private String notIn; + + private ReferenceInvoiceIdBuilder() {} + + public ReferenceInvoiceIdBuilder is(String value) { + this.is = value; + return this; + } + + public ReferenceInvoiceIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ReferenceInvoiceIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ReferenceInvoiceIdBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public ReferenceInvoiceIdBuilder in(String value) { + this.in = value; + return this; + } + + public ReferenceInvoiceIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ReferenceInvoiceIdParams build() { + return new ReferenceInvoiceIdParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TypeParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private TypeParams(TypeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for TypeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TypeBuilder builder() { + return new TypeBuilder(); + } + + public static final class TypeBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private TypeBuilder() {} + + public TypeBuilder is(Is value) { + this.is = value; + return this; + } + + public TypeBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public TypeBuilder in(String value) { + this.in = value; + return this; + } + + public TypeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public TypeParams build() { + return new TypeParams(this); + } + } + + public enum Is { + ADJUSTMENT("adjustment"), + + REFUNDABLE("refundable"), + + STORE("store"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + ADJUSTMENT("adjustment"), + + REFUNDABLE("refundable"), + + STORE("store"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ReasonCodeParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ReasonCodeParams(ReasonCodeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ReasonCodeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ReasonCodeBuilder builder() { + return new ReasonCodeBuilder(); + } + + public static final class ReasonCodeBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ReasonCodeBuilder() {} + + public ReasonCodeBuilder is(Is value) { + this.is = value; + return this; + } + + public ReasonCodeBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ReasonCodeBuilder in(String value) { + this.in = value; + return this; + } + + public ReasonCodeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ReasonCodeParams build() { + return new ReasonCodeParams(this); + } + } + + public enum Is { + WRITE_OFF("write_off"), + + SUBSCRIPTION_CHANGE("subscription_change"), + + SUBSCRIPTION_CANCELLATION("subscription_cancellation"), + + SUBSCRIPTION_PAUSE("subscription_pause"), + + CHARGEBACK("chargeback"), + + PRODUCT_UNSATISFACTORY("product_unsatisfactory"), + + SERVICE_UNSATISFACTORY("service_unsatisfactory"), + + ORDER_CHANGE("order_change"), + + ORDER_CANCELLATION("order_cancellation"), + + WAIVER("waiver"), + + OTHER("other"), + + FRAUDULENT("fraudulent"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + WRITE_OFF("write_off"), + + SUBSCRIPTION_CHANGE("subscription_change"), + + SUBSCRIPTION_CANCELLATION("subscription_cancellation"), + + SUBSCRIPTION_PAUSE("subscription_pause"), + + CHARGEBACK("chargeback"), + + PRODUCT_UNSATISFACTORY("product_unsatisfactory"), + + SERVICE_UNSATISFACTORY("service_unsatisfactory"), + + ORDER_CHANGE("order_change"), + + ORDER_CANCELLATION("order_cancellation"), + + WAIVER("waiver"), + + OTHER("other"), + + FRAUDULENT("fraudulent"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CreateReasonCodeParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private CreateReasonCodeParams(CreateReasonCodeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for CreateReasonCodeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreateReasonCodeBuilder builder() { + return new CreateReasonCodeBuilder(); + } + + public static final class CreateReasonCodeBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private CreateReasonCodeBuilder() {} + + public CreateReasonCodeBuilder is(String value) { + this.is = value; + return this; + } + + public CreateReasonCodeBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CreateReasonCodeBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CreateReasonCodeBuilder in(String value) { + this.in = value; + return this; + } + + public CreateReasonCodeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CreateReasonCodeParams build() { + return new CreateReasonCodeParams(this); + } + } + } + + public static final class StatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private StatusParams(StatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for StatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatusBuilder builder() { + return new StatusBuilder(); + } + + public static final class StatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private StatusBuilder() {} + + public StatusBuilder is(Is value) { + this.is = value; + return this; + } + + public StatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public StatusBuilder in(String value) { + this.in = value; + return this; + } + + public StatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public StatusParams build() { + return new StatusParams(this); + } + } + + public enum Is { + ADJUSTED("adjusted"), + + REFUNDED("refunded"), + + REFUND_DUE("refund_due"), + + VOIDED("voided"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + ADJUSTED("adjusted"), + + REFUNDED("refunded"), + + REFUND_DUE("refund_due"), + + VOIDED("voided"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DateParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private DateParams(DateBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for DateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DateBuilder builder() { + return new DateBuilder(); + } + + public static final class DateBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private DateBuilder() {} + + public DateBuilder after(String value) { + this.after = value; + return this; + } + + public DateBuilder before(String value) { + this.before = value; + return this; + } + + public DateBuilder on(String value) { + this.on = value; + return this; + } + + public DateBuilder between(String value) { + this.between = value; + return this; + } + + public DateParams build() { + return new DateParams(this); + } + } + } + + public static final class TotalParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private TotalParams(TotalBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for TotalParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TotalBuilder builder() { + return new TotalBuilder(); + } + + public static final class TotalBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private TotalBuilder() {} + + public TotalBuilder is(String value) { + this.is = value; + return this; + } + + public TotalBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public TotalBuilder lt(String value) { + this.lt = value; + return this; + } + + public TotalBuilder lte(String value) { + this.lte = value; + return this; + } + + public TotalBuilder gt(String value) { + this.gt = value; + return this; + } + + public TotalBuilder gte(String value) { + this.gte = value; + return this; + } + + public TotalBuilder between(String value) { + this.between = value; + return this; + } + + public TotalParams build() { + return new TotalParams(this); + } + } + } + + public static final class PriceTypeParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private PriceTypeParams(PriceTypeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PriceTypeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PriceTypeBuilder builder() { + return new PriceTypeBuilder(); + } + + public static final class PriceTypeBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private PriceTypeBuilder() {} + + public PriceTypeBuilder is(Is value) { + this.is = value; + return this; + } + + public PriceTypeBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public PriceTypeBuilder in(String value) { + this.in = value; + return this; + } + + public PriceTypeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PriceTypeParams build() { + return new PriceTypeParams(this); + } + } + + public enum Is { + TAX_EXCLUSIVE("tax_exclusive"), + + TAX_INCLUSIVE("tax_inclusive"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + TAX_EXCLUSIVE("tax_exclusive"), + + TAX_INCLUSIVE("tax_inclusive"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AmountAllocatedParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private AmountAllocatedParams(AmountAllocatedBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for AmountAllocatedParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AmountAllocatedBuilder builder() { + return new AmountAllocatedBuilder(); + } + + public static final class AmountAllocatedBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private AmountAllocatedBuilder() {} + + public AmountAllocatedBuilder is(String value) { + this.is = value; + return this; + } + + public AmountAllocatedBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public AmountAllocatedBuilder lt(String value) { + this.lt = value; + return this; + } + + public AmountAllocatedBuilder lte(String value) { + this.lte = value; + return this; + } + + public AmountAllocatedBuilder gt(String value) { + this.gt = value; + return this; + } + + public AmountAllocatedBuilder gte(String value) { + this.gte = value; + return this; + } + + public AmountAllocatedBuilder between(String value) { + this.between = value; + return this; + } + + public AmountAllocatedParams build() { + return new AmountAllocatedParams(this); + } + } + } + + public static final class AmountRefundedParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private AmountRefundedParams(AmountRefundedBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for AmountRefundedParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AmountRefundedBuilder builder() { + return new AmountRefundedBuilder(); + } + + public static final class AmountRefundedBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private AmountRefundedBuilder() {} + + public AmountRefundedBuilder is(String value) { + this.is = value; + return this; + } + + public AmountRefundedBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public AmountRefundedBuilder lt(String value) { + this.lt = value; + return this; + } + + public AmountRefundedBuilder lte(String value) { + this.lte = value; + return this; + } + + public AmountRefundedBuilder gt(String value) { + this.gt = value; + return this; + } + + public AmountRefundedBuilder gte(String value) { + this.gte = value; + return this; + } + + public AmountRefundedBuilder between(String value) { + this.between = value; + return this; + } + + public AmountRefundedParams build() { + return new AmountRefundedParams(this); + } + } + } + + public static final class AmountAvailableParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private AmountAvailableParams(AmountAvailableBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for AmountAvailableParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AmountAvailableBuilder builder() { + return new AmountAvailableBuilder(); + } + + public static final class AmountAvailableBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private AmountAvailableBuilder() {} + + public AmountAvailableBuilder is(String value) { + this.is = value; + return this; + } + + public AmountAvailableBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public AmountAvailableBuilder lt(String value) { + this.lt = value; + return this; + } + + public AmountAvailableBuilder lte(String value) { + this.lte = value; + return this; + } + + public AmountAvailableBuilder gt(String value) { + this.gt = value; + return this; + } + + public AmountAvailableBuilder gte(String value) { + this.gte = value; + return this; + } + + public AmountAvailableBuilder between(String value) { + this.between = value; + return this; + } + + public AmountAvailableParams build() { + return new AmountAvailableParams(this); + } + } + } + + public static final class VoidedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private VoidedAtParams(VoidedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for VoidedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static VoidedAtBuilder builder() { + return new VoidedAtBuilder(); + } + + public static final class VoidedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private VoidedAtBuilder() {} + + public VoidedAtBuilder after(String value) { + this.after = value; + return this; + } + + public VoidedAtBuilder before(String value) { + this.before = value; + return this; + } + + public VoidedAtBuilder on(String value) { + this.on = value; + return this; + } + + public VoidedAtBuilder between(String value) { + this.between = value; + return this; + } + + public VoidedAtParams build() { + return new VoidedAtParams(this); + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } + + public static final class ChannelParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ChannelParams(ChannelBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ChannelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChannelBuilder builder() { + return new ChannelBuilder(); + } + + public static final class ChannelBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ChannelBuilder() {} + + public ChannelBuilder is(Is value) { + this.is = value; + return this; + } + + public ChannelBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ChannelBuilder in(String value) { + this.in = value; + return this; + } + + public ChannelBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ChannelParams build() { + return new ChannelParams(this); + } + } + + public enum Is { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportCustomersParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportCustomersParams.java new file mode 100644 index 00000000..73747fbd --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportCustomersParams.java @@ -0,0 +1,2775 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportCustomersParams { + + private final ExportType exportType; + + private final BusinessEntityIdParams businessEntityId; + + private final CustomerParams customer; + + private final RelationshipParams relationship; + + private ExportCustomersParams(ExportCustomersBuilder builder) { + + this.exportType = builder.exportType; + + this.businessEntityId = builder.businessEntityId; + + this.customer = builder.customer; + + this.relationship = builder.relationship; + } + + public ExportType getExportType() { + return exportType; + } + + public BusinessEntityIdParams getBusinessEntityId() { + return businessEntityId; + } + + public CustomerParams getCustomer() { + return customer; + } + + public RelationshipParams getRelationship() { + return relationship; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.exportType != null) { + + formData.put("export_type", this.exportType); + } + + if (this.businessEntityId != null) { + + // Single object + Map nestedData = this.businessEntityId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "business_entity_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.relationship != null) { + + // Single object + Map nestedData = this.relationship.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "relationship[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportCustomersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportCustomersBuilder builder() { + return new ExportCustomersBuilder(); + } + + public static final class ExportCustomersBuilder { + + private ExportType exportType; + + private BusinessEntityIdParams businessEntityId; + + private CustomerParams customer; + + private RelationshipParams relationship; + + private ExportCustomersBuilder() {} + + public ExportCustomersBuilder exportType(ExportType value) { + this.exportType = value; + return this; + } + + public ExportCustomersBuilder businessEntityId(BusinessEntityIdParams value) { + this.businessEntityId = value; + return this; + } + + public ExportCustomersBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public ExportCustomersBuilder relationship(RelationshipParams value) { + this.relationship = value; + return this; + } + + public ExportCustomersParams build() { + return new ExportCustomersParams(this); + } + } + + public enum ExportType { + DATA("data"), + + IMPORT_FRIENDLY_DATA("import_friendly_data"), + + /** An enum member indicating that ExportType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ExportType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ExportType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ExportType enumValue : ExportType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class BusinessEntityIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private BusinessEntityIdParams(BusinessEntityIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for BusinessEntityIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessEntityIdBuilder builder() { + return new BusinessEntityIdBuilder(); + } + + public static final class BusinessEntityIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private BusinessEntityIdBuilder() {} + + public BusinessEntityIdBuilder is(String value) { + this.is = value; + return this; + } + + public BusinessEntityIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public BusinessEntityIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public BusinessEntityIdParams build() { + return new BusinessEntityIdParams(this); + } + } + } + + public static final class CustomerParams { + + private final IdParams id; + + private final FirstNameParams firstName; + + private final LastNameParams lastName; + + private final EmailParams email; + + private final CompanyParams company; + + private final PhoneParams phone; + + private final AutoCollectionParams autoCollection; + + private final TaxabilityParams taxability; + + private final CreatedAtParams createdAt; + + private final UpdatedAtParams updatedAt; + + private final OfflinePaymentMethodParams offlinePaymentMethod; + + private final AutoCloseInvoicesParams autoCloseInvoices; + + private final ChannelParams channel; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.autoCollection = builder.autoCollection; + + this.taxability = builder.taxability; + + this.createdAt = builder.createdAt; + + this.updatedAt = builder.updatedAt; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.autoCloseInvoices = builder.autoCloseInvoices; + + this.channel = builder.channel; + } + + public IdParams getId() { + return id; + } + + public FirstNameParams getFirstName() { + return firstName; + } + + public LastNameParams getLastName() { + return lastName; + } + + public EmailParams getEmail() { + return email; + } + + public CompanyParams getCompany() { + return company; + } + + public PhoneParams getPhone() { + return phone; + } + + public AutoCollectionParams getAutoCollection() { + return autoCollection; + } + + public TaxabilityParams getTaxability() { + return taxability; + } + + public CreatedAtParams getCreatedAt() { + return createdAt; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + public OfflinePaymentMethodParams getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public AutoCloseInvoicesParams getAutoCloseInvoices() { + return autoCloseInvoices; + } + + public ChannelParams getChannel() { + return channel; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.firstName != null) { + + // Single object + Map nestedData = this.firstName.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "first_name[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.lastName != null) { + + // Single object + Map nestedData = this.lastName.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "last_name[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.email != null) { + + // Single object + Map nestedData = this.email.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "email[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.company != null) { + + // Single object + Map nestedData = this.company.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "company[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.phone != null) { + + // Single object + Map nestedData = this.phone.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "phone[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.autoCollection != null) { + + // Single object + Map nestedData = this.autoCollection.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "auto_collection[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.taxability != null) { + + // Single object + Map nestedData = this.taxability.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "taxability[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.createdAt != null) { + + // Single object + Map nestedData = this.createdAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "created_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.offlinePaymentMethod != null) { + + // Single object + Map nestedData = this.offlinePaymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "offline_payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.autoCloseInvoices != null) { + + // Single object + Map nestedData = this.autoCloseInvoices.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "auto_close_invoices[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.channel != null) { + + // Single object + Map nestedData = this.channel.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "channel[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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 IdParams id; + + private FirstNameParams firstName; + + private LastNameParams lastName; + + private EmailParams email; + + private CompanyParams company; + + private PhoneParams phone; + + private AutoCollectionParams autoCollection; + + private TaxabilityParams taxability; + + private CreatedAtParams createdAt; + + private UpdatedAtParams updatedAt; + + private OfflinePaymentMethodParams offlinePaymentMethod; + + private AutoCloseInvoicesParams autoCloseInvoices; + + private ChannelParams channel; + + private CustomerBuilder() {} + + public CustomerBuilder id(IdParams value) { + this.id = value; + return this; + } + + public CustomerBuilder firstName(FirstNameParams value) { + this.firstName = value; + return this; + } + + public CustomerBuilder lastName(LastNameParams value) { + this.lastName = value; + return this; + } + + public CustomerBuilder email(EmailParams value) { + this.email = value; + return this; + } + + public CustomerBuilder company(CompanyParams value) { + this.company = value; + return this; + } + + public CustomerBuilder phone(PhoneParams value) { + this.phone = value; + return this; + } + + public CustomerBuilder autoCollection(AutoCollectionParams value) { + this.autoCollection = value; + return this; + } + + public CustomerBuilder taxability(TaxabilityParams value) { + this.taxability = value; + return this; + } + + public CustomerBuilder createdAt(CreatedAtParams value) { + this.createdAt = value; + return this; + } + + public CustomerBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public CustomerBuilder offlinePaymentMethod(OfflinePaymentMethodParams value) { + this.offlinePaymentMethod = value; + return this; + } + + public CustomerBuilder autoCloseInvoices(AutoCloseInvoicesParams value) { + this.autoCloseInvoices = value; + return this; + } + + public CustomerBuilder channel(ChannelParams value) { + this.channel = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class FirstNameParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private FirstNameParams(FirstNameBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for FirstNameParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static FirstNameBuilder builder() { + return new FirstNameBuilder(); + } + + public static final class FirstNameBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private FirstNameBuilder() {} + + public FirstNameBuilder is(String value) { + this.is = value; + return this; + } + + public FirstNameBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public FirstNameBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public FirstNameBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public FirstNameParams build() { + return new FirstNameParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class LastNameParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private LastNameParams(LastNameBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for LastNameParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static LastNameBuilder builder() { + return new LastNameBuilder(); + } + + public static final class LastNameBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private LastNameBuilder() {} + + public LastNameBuilder is(String value) { + this.is = value; + return this; + } + + public LastNameBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public LastNameBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public LastNameBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public LastNameParams build() { + return new LastNameParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class EmailParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private EmailParams(EmailBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for EmailParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EmailBuilder builder() { + return new EmailBuilder(); + } + + public static final class EmailBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private EmailBuilder() {} + + public EmailBuilder is(String value) { + this.is = value; + return this; + } + + public EmailBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public EmailBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public EmailBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public EmailParams build() { + return new EmailParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CompanyParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private CompanyParams(CompanyBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for CompanyParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CompanyBuilder builder() { + return new CompanyBuilder(); + } + + public static final class CompanyBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private CompanyBuilder() {} + + public CompanyBuilder is(String value) { + this.is = value; + return this; + } + + public CompanyBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CompanyBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CompanyBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public CompanyParams build() { + return new CompanyParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PhoneParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private PhoneParams(PhoneBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for PhoneParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PhoneBuilder builder() { + return new PhoneBuilder(); + } + + public static final class PhoneBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private PhoneBuilder() {} + + public PhoneBuilder is(String value) { + this.is = value; + return this; + } + + public PhoneBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PhoneBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public PhoneBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public PhoneParams build() { + return new PhoneParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AutoCollectionParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private AutoCollectionParams(AutoCollectionBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for AutoCollectionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AutoCollectionBuilder builder() { + return new AutoCollectionBuilder(); + } + + public static final class AutoCollectionBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private AutoCollectionBuilder() {} + + public AutoCollectionBuilder is(Is value) { + this.is = value; + return this; + } + + public AutoCollectionBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public AutoCollectionBuilder in(String value) { + this.in = value; + return this; + } + + public AutoCollectionBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public AutoCollectionParams build() { + return new AutoCollectionParams(this); + } + } + + public enum Is { + ON("on"), + + OFF("off"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + ON("on"), + + OFF("off"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TaxabilityParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private TaxabilityParams(TaxabilityBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for TaxabilityParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxabilityBuilder builder() { + return new TaxabilityBuilder(); + } + + public static final class TaxabilityBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private TaxabilityBuilder() {} + + public TaxabilityBuilder is(Is value) { + this.is = value; + return this; + } + + public TaxabilityBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public TaxabilityBuilder in(String value) { + this.in = value; + return this; + } + + public TaxabilityBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public TaxabilityParams build() { + return new TaxabilityParams(this); + } + } + + public enum Is { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CreatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private CreatedAtParams(CreatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for CreatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreatedAtBuilder builder() { + return new CreatedAtBuilder(); + } + + public static final class CreatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private CreatedAtBuilder() {} + + public CreatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public CreatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public CreatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public CreatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public CreatedAtParams build() { + return new CreatedAtParams(this); + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } + + public static final class OfflinePaymentMethodParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private OfflinePaymentMethodParams(OfflinePaymentMethodBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for OfflinePaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OfflinePaymentMethodBuilder builder() { + return new OfflinePaymentMethodBuilder(); + } + + public static final class OfflinePaymentMethodBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private OfflinePaymentMethodBuilder() {} + + public OfflinePaymentMethodBuilder is(Is value) { + this.is = value; + return this; + } + + public OfflinePaymentMethodBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public OfflinePaymentMethodBuilder in(String value) { + this.in = value; + return this; + } + + public OfflinePaymentMethodBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public OfflinePaymentMethodParams build() { + return new OfflinePaymentMethodParams(this); + } + } + + public enum Is { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AutoCloseInvoicesParams { + + private final Is is; + + private AutoCloseInvoicesParams(AutoCloseInvoicesBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for AutoCloseInvoicesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AutoCloseInvoicesBuilder builder() { + return new AutoCloseInvoicesBuilder(); + } + + public static final class AutoCloseInvoicesBuilder { + + private Is is; + + private AutoCloseInvoicesBuilder() {} + + public AutoCloseInvoicesBuilder is(Is value) { + this.is = value; + return this; + } + + public AutoCloseInvoicesParams build() { + return new AutoCloseInvoicesParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ChannelParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ChannelParams(ChannelBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ChannelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChannelBuilder builder() { + return new ChannelBuilder(); + } + + public static final class ChannelBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ChannelBuilder() {} + + public ChannelBuilder is(Is value) { + this.is = value; + return this; + } + + public ChannelBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ChannelBuilder in(String value) { + this.in = value; + return this; + } + + public ChannelBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ChannelParams build() { + return new ChannelParams(this); + } + } + + public enum Is { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class RelationshipParams { + + private final ParentIdParams parentId; + + private final PaymentOwnerIdParams paymentOwnerId; + + private final InvoiceOwnerIdParams invoiceOwnerId; + + private RelationshipParams(RelationshipBuilder builder) { + + this.parentId = builder.parentId; + + this.paymentOwnerId = builder.paymentOwnerId; + + this.invoiceOwnerId = builder.invoiceOwnerId; + } + + public ParentIdParams getParentId() { + return parentId; + } + + public PaymentOwnerIdParams getPaymentOwnerId() { + return paymentOwnerId; + } + + public InvoiceOwnerIdParams getInvoiceOwnerId() { + return invoiceOwnerId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.parentId != null) { + + // Single object + Map nestedData = this.parentId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "parent_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentOwnerId != null) { + + // Single object + Map nestedData = this.paymentOwnerId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_owner_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.invoiceOwnerId != null) { + + // Single object + Map nestedData = this.invoiceOwnerId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "invoice_owner_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for RelationshipParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RelationshipBuilder builder() { + return new RelationshipBuilder(); + } + + public static final class RelationshipBuilder { + + private ParentIdParams parentId; + + private PaymentOwnerIdParams paymentOwnerId; + + private InvoiceOwnerIdParams invoiceOwnerId; + + private RelationshipBuilder() {} + + public RelationshipBuilder parentId(ParentIdParams value) { + this.parentId = value; + return this; + } + + public RelationshipBuilder paymentOwnerId(PaymentOwnerIdParams value) { + this.paymentOwnerId = value; + return this; + } + + public RelationshipBuilder invoiceOwnerId(InvoiceOwnerIdParams value) { + this.invoiceOwnerId = value; + return this; + } + + public RelationshipParams build() { + return new RelationshipParams(this); + } + } + } + + public static final class ParentIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private ParentIdParams(ParentIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for ParentIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ParentIdBuilder builder() { + return new ParentIdBuilder(); + } + + public static final class ParentIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private ParentIdBuilder() {} + + public ParentIdBuilder is(String value) { + this.is = value; + return this; + } + + public ParentIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ParentIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ParentIdParams build() { + return new ParentIdParams(this); + } + } + } + + public static final class PaymentOwnerIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private PaymentOwnerIdParams(PaymentOwnerIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for PaymentOwnerIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentOwnerIdBuilder builder() { + return new PaymentOwnerIdBuilder(); + } + + public static final class PaymentOwnerIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private PaymentOwnerIdBuilder() {} + + public PaymentOwnerIdBuilder is(String value) { + this.is = value; + return this; + } + + public PaymentOwnerIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PaymentOwnerIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public PaymentOwnerIdParams build() { + return new PaymentOwnerIdParams(this); + } + } + } + + public static final class InvoiceOwnerIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private InvoiceOwnerIdParams(InvoiceOwnerIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for InvoiceOwnerIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceOwnerIdBuilder builder() { + return new InvoiceOwnerIdBuilder(); + } + + public static final class InvoiceOwnerIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private InvoiceOwnerIdBuilder() {} + + public InvoiceOwnerIdBuilder is(String value) { + this.is = value; + return this; + } + + public InvoiceOwnerIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public InvoiceOwnerIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public InvoiceOwnerIdParams build() { + return new InvoiceOwnerIdParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportDeferredRevenueParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportDeferredRevenueParams.java new file mode 100644 index 00000000..b167be82 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportDeferredRevenueParams.java @@ -0,0 +1,8574 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportDeferredRevenueParams { + + private final ReportBy reportBy; + + private final String currencyCode; + + private final Integer reportFromMonth; + + private final Integer reportFromYear; + + private final Integer reportToMonth; + + private final Integer reportToYear; + + private final Boolean includeDiscounts; + + private final PaymentOwnerParams paymentOwner; + + private final ItemIdParams itemId; + + private final ItemPriceIdParams itemPriceId; + + private final CancelReasonCodeParams cancelReasonCode; + + private final BusinessEntityIdParams businessEntityId; + + private final InvoiceParams invoice; + + private final SubscriptionParams subscription; + + private final CustomerParams customer; + + private final RelationshipParams relationship; + + private ExportDeferredRevenueParams(ExportDeferredRevenueBuilder builder) { + + this.reportBy = builder.reportBy; + + this.currencyCode = builder.currencyCode; + + this.reportFromMonth = builder.reportFromMonth; + + this.reportFromYear = builder.reportFromYear; + + this.reportToMonth = builder.reportToMonth; + + this.reportToYear = builder.reportToYear; + + this.includeDiscounts = builder.includeDiscounts; + + this.paymentOwner = builder.paymentOwner; + + this.itemId = builder.itemId; + + this.itemPriceId = builder.itemPriceId; + + this.cancelReasonCode = builder.cancelReasonCode; + + this.businessEntityId = builder.businessEntityId; + + this.invoice = builder.invoice; + + this.subscription = builder.subscription; + + this.customer = builder.customer; + + this.relationship = builder.relationship; + } + + public ReportBy getReportBy() { + return reportBy; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public Integer getReportFromMonth() { + return reportFromMonth; + } + + public Integer getReportFromYear() { + return reportFromYear; + } + + public Integer getReportToMonth() { + return reportToMonth; + } + + public Integer getReportToYear() { + return reportToYear; + } + + public Boolean getIncludeDiscounts() { + return includeDiscounts; + } + + public PaymentOwnerParams getPaymentOwner() { + return paymentOwner; + } + + public ItemIdParams getItemId() { + return itemId; + } + + public ItemPriceIdParams getItemPriceId() { + return itemPriceId; + } + + public CancelReasonCodeParams getCancelReasonCode() { + return cancelReasonCode; + } + + public BusinessEntityIdParams getBusinessEntityId() { + return businessEntityId; + } + + public InvoiceParams getInvoice() { + return invoice; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public CustomerParams getCustomer() { + return customer; + } + + public RelationshipParams getRelationship() { + return relationship; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.reportBy != null) { + + formData.put("report_by", this.reportBy); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.reportFromMonth != null) { + + formData.put("report_from_month", this.reportFromMonth); + } + + if (this.reportFromYear != null) { + + formData.put("report_from_year", this.reportFromYear); + } + + if (this.reportToMonth != null) { + + formData.put("report_to_month", this.reportToMonth); + } + + if (this.reportToYear != null) { + + formData.put("report_to_year", this.reportToYear); + } + + if (this.includeDiscounts != null) { + + formData.put("include_discounts", this.includeDiscounts); + } + + if (this.paymentOwner != null) { + + // Single object + Map nestedData = this.paymentOwner.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_owner[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemId != null) { + + // Single object + Map nestedData = this.itemId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemPriceId != null) { + + // Single object + Map nestedData = this.itemPriceId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_price_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.cancelReasonCode != null) { + + // Single object + Map nestedData = this.cancelReasonCode.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "cancel_reason_code[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.businessEntityId != null) { + + // Single object + Map nestedData = this.businessEntityId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "business_entity_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.invoice != null) { + + // Single object + Map nestedData = this.invoice.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "invoice[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.relationship != null) { + + // Single object + Map nestedData = this.relationship.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "relationship[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportDeferredRevenueParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportDeferredRevenueBuilder builder() { + return new ExportDeferredRevenueBuilder(); + } + + public static final class ExportDeferredRevenueBuilder { + + private ReportBy reportBy; + + private String currencyCode; + + private Integer reportFromMonth; + + private Integer reportFromYear; + + private Integer reportToMonth; + + private Integer reportToYear; + + private Boolean includeDiscounts; + + private PaymentOwnerParams paymentOwner; + + private ItemIdParams itemId; + + private ItemPriceIdParams itemPriceId; + + private CancelReasonCodeParams cancelReasonCode; + + private BusinessEntityIdParams businessEntityId; + + private InvoiceParams invoice; + + private SubscriptionParams subscription; + + private CustomerParams customer; + + private RelationshipParams relationship; + + private ExportDeferredRevenueBuilder() {} + + public ExportDeferredRevenueBuilder reportBy(ReportBy value) { + this.reportBy = value; + return this; + } + + public ExportDeferredRevenueBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public ExportDeferredRevenueBuilder reportFromMonth(Integer value) { + this.reportFromMonth = value; + return this; + } + + public ExportDeferredRevenueBuilder reportFromYear(Integer value) { + this.reportFromYear = value; + return this; + } + + public ExportDeferredRevenueBuilder reportToMonth(Integer value) { + this.reportToMonth = value; + return this; + } + + public ExportDeferredRevenueBuilder reportToYear(Integer value) { + this.reportToYear = value; + return this; + } + + public ExportDeferredRevenueBuilder includeDiscounts(Boolean value) { + this.includeDiscounts = value; + return this; + } + + public ExportDeferredRevenueBuilder paymentOwner(PaymentOwnerParams value) { + this.paymentOwner = value; + return this; + } + + public ExportDeferredRevenueBuilder itemId(ItemIdParams value) { + this.itemId = value; + return this; + } + + public ExportDeferredRevenueBuilder itemPriceId(ItemPriceIdParams value) { + this.itemPriceId = value; + return this; + } + + public ExportDeferredRevenueBuilder cancelReasonCode(CancelReasonCodeParams value) { + this.cancelReasonCode = value; + return this; + } + + public ExportDeferredRevenueBuilder businessEntityId(BusinessEntityIdParams value) { + this.businessEntityId = value; + return this; + } + + public ExportDeferredRevenueBuilder invoice(InvoiceParams value) { + this.invoice = value; + return this; + } + + public ExportDeferredRevenueBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public ExportDeferredRevenueBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public ExportDeferredRevenueBuilder relationship(RelationshipParams value) { + this.relationship = value; + return this; + } + + public ExportDeferredRevenueParams build() { + return new ExportDeferredRevenueParams(this); + } + } + + public enum ReportBy { + CUSTOMER("customer"), + + INVOICE("invoice"), + + PRODUCT("product"), + + SUBSCRIPTION("subscription"), + + /** An enum member indicating that ReportBy was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ReportBy(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ReportBy fromString(String value) { + if (value == null) return _UNKNOWN; + for (ReportBy enumValue : ReportBy.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class PaymentOwnerParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private PaymentOwnerParams(PaymentOwnerBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PaymentOwnerParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentOwnerBuilder builder() { + return new PaymentOwnerBuilder(); + } + + public static final class PaymentOwnerBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private PaymentOwnerBuilder() {} + + public PaymentOwnerBuilder is(String value) { + this.is = value; + return this; + } + + public PaymentOwnerBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PaymentOwnerBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public PaymentOwnerBuilder in(String value) { + this.in = value; + return this; + } + + public PaymentOwnerBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PaymentOwnerParams build() { + return new PaymentOwnerParams(this); + } + } + } + + public static final class ItemIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ItemIdParams(ItemIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ItemIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemIdBuilder builder() { + return new ItemIdBuilder(); + } + + public static final class ItemIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ItemIdBuilder() {} + + public ItemIdBuilder is(String value) { + this.is = value; + return this; + } + + public ItemIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ItemIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ItemIdBuilder in(String value) { + this.in = value; + return this; + } + + public ItemIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ItemIdParams build() { + return new ItemIdParams(this); + } + } + } + + public static final class ItemPriceIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ItemPriceIdParams(ItemPriceIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ItemPriceIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemPriceIdBuilder builder() { + return new ItemPriceIdBuilder(); + } + + public static final class ItemPriceIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ItemPriceIdBuilder() {} + + public ItemPriceIdBuilder is(String value) { + this.is = value; + return this; + } + + public ItemPriceIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ItemPriceIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ItemPriceIdBuilder in(String value) { + this.in = value; + return this; + } + + public ItemPriceIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ItemPriceIdParams build() { + return new ItemPriceIdParams(this); + } + } + } + + public static final class CancelReasonCodeParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private CancelReasonCodeParams(CancelReasonCodeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for CancelReasonCodeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CancelReasonCodeBuilder builder() { + return new CancelReasonCodeBuilder(); + } + + public static final class CancelReasonCodeBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private CancelReasonCodeBuilder() {} + + public CancelReasonCodeBuilder is(String value) { + this.is = value; + return this; + } + + public CancelReasonCodeBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CancelReasonCodeBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CancelReasonCodeBuilder in(String value) { + this.in = value; + return this; + } + + public CancelReasonCodeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CancelReasonCodeParams build() { + return new CancelReasonCodeParams(this); + } + } + } + + public static final class BusinessEntityIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private BusinessEntityIdParams(BusinessEntityIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for BusinessEntityIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessEntityIdBuilder builder() { + return new BusinessEntityIdBuilder(); + } + + public static final class BusinessEntityIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private BusinessEntityIdBuilder() {} + + public BusinessEntityIdBuilder is(String value) { + this.is = value; + return this; + } + + public BusinessEntityIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public BusinessEntityIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public BusinessEntityIdParams build() { + return new BusinessEntityIdParams(this); + } + } + } + + public static final class InvoiceParams { + + private final IdParams id; + + private final RecurringParams recurring; + + private final StatusParams status; + + private final PriceTypeParams priceType; + + private final DateParams date; + + private final PaidAtParams paidAt; + + private final TotalParams total; + + private final AmountPaidParams amountPaid; + + private final AmountAdjustedParams amountAdjusted; + + private final CreditsAppliedParams creditsApplied; + + private final AmountDueParams amountDue; + + private final DunningStatusParams dunningStatus; + + private final UpdatedAtParams updatedAt; + + private final ChannelParams channel; + + private InvoiceParams(InvoiceBuilder builder) { + + this.id = builder.id; + + this.recurring = builder.recurring; + + this.status = builder.status; + + this.priceType = builder.priceType; + + this.date = builder.date; + + this.paidAt = builder.paidAt; + + this.total = builder.total; + + this.amountPaid = builder.amountPaid; + + this.amountAdjusted = builder.amountAdjusted; + + this.creditsApplied = builder.creditsApplied; + + this.amountDue = builder.amountDue; + + this.dunningStatus = builder.dunningStatus; + + this.updatedAt = builder.updatedAt; + + this.channel = builder.channel; + } + + public IdParams getId() { + return id; + } + + public RecurringParams getRecurring() { + return recurring; + } + + public StatusParams getStatus() { + return status; + } + + public PriceTypeParams getPriceType() { + return priceType; + } + + public DateParams getDate() { + return date; + } + + public PaidAtParams getPaidAt() { + return paidAt; + } + + public TotalParams getTotal() { + return total; + } + + public AmountPaidParams getAmountPaid() { + return amountPaid; + } + + public AmountAdjustedParams getAmountAdjusted() { + return amountAdjusted; + } + + public CreditsAppliedParams getCreditsApplied() { + return creditsApplied; + } + + public AmountDueParams getAmountDue() { + return amountDue; + } + + public DunningStatusParams getDunningStatus() { + return dunningStatus; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + public ChannelParams getChannel() { + return channel; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.recurring != null) { + + // Single object + Map nestedData = this.recurring.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "recurring[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.status != null) { + + // Single object + Map nestedData = this.status.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.priceType != null) { + + // Single object + Map nestedData = this.priceType.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "price_type[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.date != null) { + + // Single object + Map nestedData = this.date.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "date[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paidAt != null) { + + // Single object + Map nestedData = this.paidAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "paid_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.total != null) { + + // Single object + Map nestedData = this.total.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "total[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.amountPaid != null) { + + // Single object + Map nestedData = this.amountPaid.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "amount_paid[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.amountAdjusted != null) { + + // Single object + Map nestedData = this.amountAdjusted.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "amount_adjusted[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.creditsApplied != null) { + + // Single object + Map nestedData = this.creditsApplied.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "credits_applied[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.amountDue != null) { + + // Single object + Map nestedData = this.amountDue.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "amount_due[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.dunningStatus != null) { + + // Single object + Map nestedData = this.dunningStatus.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "dunning_status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.channel != null) { + + // Single object + Map nestedData = this.channel.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "channel[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for InvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceBuilder builder() { + return new InvoiceBuilder(); + } + + public static final class InvoiceBuilder { + + private IdParams id; + + private RecurringParams recurring; + + private StatusParams status; + + private PriceTypeParams priceType; + + private DateParams date; + + private PaidAtParams paidAt; + + private TotalParams total; + + private AmountPaidParams amountPaid; + + private AmountAdjustedParams amountAdjusted; + + private CreditsAppliedParams creditsApplied; + + private AmountDueParams amountDue; + + private DunningStatusParams dunningStatus; + + private UpdatedAtParams updatedAt; + + private ChannelParams channel; + + private InvoiceBuilder() {} + + public InvoiceBuilder id(IdParams value) { + this.id = value; + return this; + } + + public InvoiceBuilder recurring(RecurringParams value) { + this.recurring = value; + return this; + } + + public InvoiceBuilder status(StatusParams value) { + this.status = value; + return this; + } + + public InvoiceBuilder priceType(PriceTypeParams value) { + this.priceType = value; + return this; + } + + public InvoiceBuilder date(DateParams value) { + this.date = value; + return this; + } + + public InvoiceBuilder paidAt(PaidAtParams value) { + this.paidAt = value; + return this; + } + + public InvoiceBuilder total(TotalParams value) { + this.total = value; + return this; + } + + public InvoiceBuilder amountPaid(AmountPaidParams value) { + this.amountPaid = value; + return this; + } + + public InvoiceBuilder amountAdjusted(AmountAdjustedParams value) { + this.amountAdjusted = value; + return this; + } + + public InvoiceBuilder creditsApplied(CreditsAppliedParams value) { + this.creditsApplied = value; + return this; + } + + public InvoiceBuilder amountDue(AmountDueParams value) { + this.amountDue = value; + return this; + } + + public InvoiceBuilder dunningStatus(DunningStatusParams value) { + this.dunningStatus = value; + return this; + } + + public InvoiceBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public InvoiceBuilder channel(ChannelParams value) { + this.channel = value; + return this; + } + + public InvoiceParams build() { + return new InvoiceParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class RecurringParams { + + private final Is is; + + private RecurringParams(RecurringBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for RecurringParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RecurringBuilder builder() { + return new RecurringBuilder(); + } + + public static final class RecurringBuilder { + + private Is is; + + private RecurringBuilder() {} + + public RecurringBuilder is(Is value) { + this.is = value; + return this; + } + + public RecurringParams build() { + return new RecurringParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class StatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private StatusParams(StatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for StatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatusBuilder builder() { + return new StatusBuilder(); + } + + public static final class StatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private StatusBuilder() {} + + public StatusBuilder is(Is value) { + this.is = value; + return this; + } + + public StatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public StatusBuilder in(String value) { + this.in = value; + return this; + } + + public StatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public StatusParams build() { + return new StatusParams(this); + } + } + + public enum Is { + PAID("paid"), + + POSTED("posted"), + + PAYMENT_DUE("payment_due"), + + NOT_PAID("not_paid"), + + VOIDED("voided"), + + PENDING("pending"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + PAID("paid"), + + POSTED("posted"), + + PAYMENT_DUE("payment_due"), + + NOT_PAID("not_paid"), + + VOIDED("voided"), + + PENDING("pending"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PriceTypeParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private PriceTypeParams(PriceTypeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PriceTypeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PriceTypeBuilder builder() { + return new PriceTypeBuilder(); + } + + public static final class PriceTypeBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private PriceTypeBuilder() {} + + public PriceTypeBuilder is(Is value) { + this.is = value; + return this; + } + + public PriceTypeBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public PriceTypeBuilder in(String value) { + this.in = value; + return this; + } + + public PriceTypeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PriceTypeParams build() { + return new PriceTypeParams(this); + } + } + + public enum Is { + TAX_EXCLUSIVE("tax_exclusive"), + + TAX_INCLUSIVE("tax_inclusive"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + TAX_EXCLUSIVE("tax_exclusive"), + + TAX_INCLUSIVE("tax_inclusive"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DateParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private DateParams(DateBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for DateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DateBuilder builder() { + return new DateBuilder(); + } + + public static final class DateBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private DateBuilder() {} + + public DateBuilder after(String value) { + this.after = value; + return this; + } + + public DateBuilder before(String value) { + this.before = value; + return this; + } + + public DateBuilder on(String value) { + this.on = value; + return this; + } + + public DateBuilder between(String value) { + this.between = value; + return this; + } + + public DateParams build() { + return new DateParams(this); + } + } + } + + public static final class PaidAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private PaidAtParams(PaidAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for PaidAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaidAtBuilder builder() { + return new PaidAtBuilder(); + } + + public static final class PaidAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private PaidAtBuilder() {} + + public PaidAtBuilder after(String value) { + this.after = value; + return this; + } + + public PaidAtBuilder before(String value) { + this.before = value; + return this; + } + + public PaidAtBuilder on(String value) { + this.on = value; + return this; + } + + public PaidAtBuilder between(String value) { + this.between = value; + return this; + } + + public PaidAtParams build() { + return new PaidAtParams(this); + } + } + } + + public static final class TotalParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private TotalParams(TotalBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for TotalParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TotalBuilder builder() { + return new TotalBuilder(); + } + + public static final class TotalBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private TotalBuilder() {} + + public TotalBuilder is(String value) { + this.is = value; + return this; + } + + public TotalBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public TotalBuilder lt(String value) { + this.lt = value; + return this; + } + + public TotalBuilder lte(String value) { + this.lte = value; + return this; + } + + public TotalBuilder gt(String value) { + this.gt = value; + return this; + } + + public TotalBuilder gte(String value) { + this.gte = value; + return this; + } + + public TotalBuilder between(String value) { + this.between = value; + return this; + } + + public TotalParams build() { + return new TotalParams(this); + } + } + } + + public static final class AmountPaidParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private AmountPaidParams(AmountPaidBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for AmountPaidParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AmountPaidBuilder builder() { + return new AmountPaidBuilder(); + } + + public static final class AmountPaidBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private AmountPaidBuilder() {} + + public AmountPaidBuilder is(String value) { + this.is = value; + return this; + } + + public AmountPaidBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public AmountPaidBuilder lt(String value) { + this.lt = value; + return this; + } + + public AmountPaidBuilder lte(String value) { + this.lte = value; + return this; + } + + public AmountPaidBuilder gt(String value) { + this.gt = value; + return this; + } + + public AmountPaidBuilder gte(String value) { + this.gte = value; + return this; + } + + public AmountPaidBuilder between(String value) { + this.between = value; + return this; + } + + public AmountPaidParams build() { + return new AmountPaidParams(this); + } + } + } + + public static final class AmountAdjustedParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private AmountAdjustedParams(AmountAdjustedBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for AmountAdjustedParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AmountAdjustedBuilder builder() { + return new AmountAdjustedBuilder(); + } + + public static final class AmountAdjustedBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private AmountAdjustedBuilder() {} + + public AmountAdjustedBuilder is(String value) { + this.is = value; + return this; + } + + public AmountAdjustedBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public AmountAdjustedBuilder lt(String value) { + this.lt = value; + return this; + } + + public AmountAdjustedBuilder lte(String value) { + this.lte = value; + return this; + } + + public AmountAdjustedBuilder gt(String value) { + this.gt = value; + return this; + } + + public AmountAdjustedBuilder gte(String value) { + this.gte = value; + return this; + } + + public AmountAdjustedBuilder between(String value) { + this.between = value; + return this; + } + + public AmountAdjustedParams build() { + return new AmountAdjustedParams(this); + } + } + } + + public static final class CreditsAppliedParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private CreditsAppliedParams(CreditsAppliedBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for CreditsAppliedParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditsAppliedBuilder builder() { + return new CreditsAppliedBuilder(); + } + + public static final class CreditsAppliedBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private CreditsAppliedBuilder() {} + + public CreditsAppliedBuilder is(String value) { + this.is = value; + return this; + } + + public CreditsAppliedBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CreditsAppliedBuilder lt(String value) { + this.lt = value; + return this; + } + + public CreditsAppliedBuilder lte(String value) { + this.lte = value; + return this; + } + + public CreditsAppliedBuilder gt(String value) { + this.gt = value; + return this; + } + + public CreditsAppliedBuilder gte(String value) { + this.gte = value; + return this; + } + + public CreditsAppliedBuilder between(String value) { + this.between = value; + return this; + } + + public CreditsAppliedParams build() { + return new CreditsAppliedParams(this); + } + } + } + + public static final class AmountDueParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private AmountDueParams(AmountDueBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for AmountDueParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AmountDueBuilder builder() { + return new AmountDueBuilder(); + } + + public static final class AmountDueBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private AmountDueBuilder() {} + + public AmountDueBuilder is(String value) { + this.is = value; + return this; + } + + public AmountDueBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public AmountDueBuilder lt(String value) { + this.lt = value; + return this; + } + + public AmountDueBuilder lte(String value) { + this.lte = value; + return this; + } + + public AmountDueBuilder gt(String value) { + this.gt = value; + return this; + } + + public AmountDueBuilder gte(String value) { + this.gte = value; + return this; + } + + public AmountDueBuilder between(String value) { + this.between = value; + return this; + } + + public AmountDueParams build() { + return new AmountDueParams(this); + } + } + } + + public static final class DunningStatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private final IsPresent isPresent; + + private DunningStatusParams(DunningStatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + + this.isPresent = builder.isPresent; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for DunningStatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DunningStatusBuilder builder() { + return new DunningStatusBuilder(); + } + + public static final class DunningStatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private IsPresent isPresent; + + private DunningStatusBuilder() {} + + public DunningStatusBuilder is(Is value) { + this.is = value; + return this; + } + + public DunningStatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public DunningStatusBuilder in(String value) { + this.in = value; + return this; + } + + public DunningStatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public DunningStatusBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public DunningStatusParams build() { + return new DunningStatusParams(this); + } + } + + public enum Is { + IN_PROGRESS("in_progress"), + + EXHAUSTED("exhausted"), + + STOPPED("stopped"), + + SUCCESS("success"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + IN_PROGRESS("in_progress"), + + EXHAUSTED("exhausted"), + + STOPPED("stopped"), + + SUCCESS("success"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } + + public static final class ChannelParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ChannelParams(ChannelBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ChannelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChannelBuilder builder() { + return new ChannelBuilder(); + } + + public static final class ChannelBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ChannelBuilder() {} + + public ChannelBuilder is(Is value) { + this.is = value; + return this; + } + + public ChannelBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ChannelBuilder in(String value) { + this.in = value; + return this; + } + + public ChannelBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ChannelParams build() { + return new ChannelParams(this); + } + } + + public enum Is { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class SubscriptionParams { + + private final ExportIdParams id; + + private final CustomerIdParams customerId; + + private final ExportStatusParams status; + + private final CancelReasonParams cancelReason; + + private final RemainingBillingCyclesParams remainingBillingCycles; + + private final CreatedAtParams createdAt; + + private final ActivatedAtParams activatedAt; + + private final NextBillingAtParams nextBillingAt; + + private final CancelledAtParams cancelledAt; + + private final HasScheduledChangesParams hasScheduledChanges; + + private final ExportUpdatedAtParams updatedAt; + + private final OfflinePaymentMethodParams offlinePaymentMethod; + + private final AutoCloseInvoicesParams autoCloseInvoices; + + private final ExportChannelParams channel; + + private final PlanIdParams planId; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.customerId = builder.customerId; + + this.status = builder.status; + + this.cancelReason = builder.cancelReason; + + this.remainingBillingCycles = builder.remainingBillingCycles; + + this.createdAt = builder.createdAt; + + this.activatedAt = builder.activatedAt; + + this.nextBillingAt = builder.nextBillingAt; + + this.cancelledAt = builder.cancelledAt; + + this.hasScheduledChanges = builder.hasScheduledChanges; + + this.updatedAt = builder.updatedAt; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.autoCloseInvoices = builder.autoCloseInvoices; + + this.channel = builder.channel; + + this.planId = builder.planId; + } + + public ExportIdParams getId() { + return id; + } + + public CustomerIdParams getCustomerId() { + return customerId; + } + + public ExportStatusParams getStatus() { + return status; + } + + public CancelReasonParams getCancelReason() { + return cancelReason; + } + + public RemainingBillingCyclesParams getRemainingBillingCycles() { + return remainingBillingCycles; + } + + public CreatedAtParams getCreatedAt() { + return createdAt; + } + + public ActivatedAtParams getActivatedAt() { + return activatedAt; + } + + public NextBillingAtParams getNextBillingAt() { + return nextBillingAt; + } + + public CancelledAtParams getCancelledAt() { + return cancelledAt; + } + + public HasScheduledChangesParams getHasScheduledChanges() { + return hasScheduledChanges; + } + + public ExportUpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + public OfflinePaymentMethodParams getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public AutoCloseInvoicesParams getAutoCloseInvoices() { + return autoCloseInvoices; + } + + public ExportChannelParams getChannel() { + return channel; + } + + public PlanIdParams getPlanId() { + return planId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.customerId != null) { + + // Single object + Map nestedData = this.customerId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "customer_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.status != null) { + + // Single object + Map nestedData = this.status.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.cancelReason != null) { + + // Single object + Map nestedData = this.cancelReason.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "cancel_reason[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.remainingBillingCycles != null) { + + // Single object + Map nestedData = this.remainingBillingCycles.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "remaining_billing_cycles[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.createdAt != null) { + + // Single object + Map nestedData = this.createdAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "created_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.activatedAt != null) { + + // Single object + Map nestedData = this.activatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "activated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.nextBillingAt != null) { + + // Single object + Map nestedData = this.nextBillingAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "next_billing_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.cancelledAt != null) { + + // Single object + Map nestedData = this.cancelledAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "cancelled_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.hasScheduledChanges != null) { + + // Single object + Map nestedData = this.hasScheduledChanges.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "has_scheduled_changes[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.offlinePaymentMethod != null) { + + // Single object + Map nestedData = this.offlinePaymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "offline_payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.autoCloseInvoices != null) { + + // Single object + Map nestedData = this.autoCloseInvoices.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "auto_close_invoices[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.channel != null) { + + // Single object + Map nestedData = this.channel.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "channel[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.planId != null) { + + // Single object + Map nestedData = this.planId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "plan_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private ExportIdParams id; + + private CustomerIdParams customerId; + + private ExportStatusParams status; + + private CancelReasonParams cancelReason; + + private RemainingBillingCyclesParams remainingBillingCycles; + + private CreatedAtParams createdAt; + + private ActivatedAtParams activatedAt; + + private NextBillingAtParams nextBillingAt; + + private CancelledAtParams cancelledAt; + + private HasScheduledChangesParams hasScheduledChanges; + + private ExportUpdatedAtParams updatedAt; + + private OfflinePaymentMethodParams offlinePaymentMethod; + + private AutoCloseInvoicesParams autoCloseInvoices; + + private ExportChannelParams channel; + + private PlanIdParams planId; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(ExportIdParams value) { + this.id = value; + return this; + } + + public SubscriptionBuilder customerId(CustomerIdParams value) { + this.customerId = value; + return this; + } + + public SubscriptionBuilder status(ExportStatusParams value) { + this.status = value; + return this; + } + + public SubscriptionBuilder cancelReason(CancelReasonParams value) { + this.cancelReason = value; + return this; + } + + public SubscriptionBuilder remainingBillingCycles(RemainingBillingCyclesParams value) { + this.remainingBillingCycles = value; + return this; + } + + public SubscriptionBuilder createdAt(CreatedAtParams value) { + this.createdAt = value; + return this; + } + + public SubscriptionBuilder activatedAt(ActivatedAtParams value) { + this.activatedAt = value; + return this; + } + + public SubscriptionBuilder nextBillingAt(NextBillingAtParams value) { + this.nextBillingAt = value; + return this; + } + + public SubscriptionBuilder cancelledAt(CancelledAtParams value) { + this.cancelledAt = value; + return this; + } + + public SubscriptionBuilder hasScheduledChanges(HasScheduledChangesParams value) { + this.hasScheduledChanges = value; + return this; + } + + public SubscriptionBuilder updatedAt(ExportUpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethodParams value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder autoCloseInvoices(AutoCloseInvoicesParams value) { + this.autoCloseInvoices = value; + return this; + } + + public SubscriptionBuilder channel(ExportChannelParams value) { + this.channel = value; + return this; + } + + public SubscriptionBuilder planId(PlanIdParams value) { + this.planId = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + } + + public static final class ExportIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ExportIdParams(ExportIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ExportIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportIdBuilder builder() { + return new ExportIdBuilder(); + } + + public static final class ExportIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ExportIdBuilder() {} + + public ExportIdBuilder is(String value) { + this.is = value; + return this; + } + + public ExportIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ExportIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ExportIdBuilder in(String value) { + this.in = value; + return this; + } + + public ExportIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ExportIdParams build() { + return new ExportIdParams(this); + } + } + } + + public static final class CustomerIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private CustomerIdParams(CustomerIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for CustomerIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerIdBuilder builder() { + return new CustomerIdBuilder(); + } + + public static final class CustomerIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private CustomerIdBuilder() {} + + public CustomerIdBuilder is(String value) { + this.is = value; + return this; + } + + public CustomerIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CustomerIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CustomerIdBuilder in(String value) { + this.in = value; + return this; + } + + public CustomerIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CustomerIdParams build() { + return new CustomerIdParams(this); + } + } + } + + public static final class ExportStatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ExportStatusParams(ExportStatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ExportStatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportStatusBuilder builder() { + return new ExportStatusBuilder(); + } + + public static final class ExportStatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ExportStatusBuilder() {} + + public ExportStatusBuilder is(Is value) { + this.is = value; + return this; + } + + public ExportStatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ExportStatusBuilder in(String value) { + this.in = value; + return this; + } + + public ExportStatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ExportStatusParams build() { + return new ExportStatusParams(this); + } + } + + public enum Is { + FUTURE("future"), + + IN_TRIAL("in_trial"), + + ACTIVE("active"), + + NON_RENEWING("non_renewing"), + + PAUSED("paused"), + + CANCELLED("cancelled"), + + TRANSFERRED("transferred"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + FUTURE("future"), + + IN_TRIAL("in_trial"), + + ACTIVE("active"), + + NON_RENEWING("non_renewing"), + + PAUSED("paused"), + + CANCELLED("cancelled"), + + TRANSFERRED("transferred"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CancelReasonParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private final IsPresent isPresent; + + private CancelReasonParams(CancelReasonBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + + this.isPresent = builder.isPresent; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for CancelReasonParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CancelReasonBuilder builder() { + return new CancelReasonBuilder(); + } + + public static final class CancelReasonBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private IsPresent isPresent; + + private CancelReasonBuilder() {} + + public CancelReasonBuilder is(Is value) { + this.is = value; + return this; + } + + public CancelReasonBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public CancelReasonBuilder in(String value) { + this.in = value; + return this; + } + + public CancelReasonBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CancelReasonBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public CancelReasonParams build() { + return new CancelReasonParams(this); + } + } + + public enum Is { + NOT_PAID("not_paid"), + + NO_CARD("no_card"), + + FRAUD_REVIEW_FAILED("fraud_review_failed"), + + NON_COMPLIANT_EU_CUSTOMER("non_compliant_eu_customer"), + + TAX_CALCULATION_FAILED("tax_calculation_failed"), + + CURRENCY_INCOMPATIBLE_WITH_GATEWAY("currency_incompatible_with_gateway"), + + NON_COMPLIANT_CUSTOMER("non_compliant_customer"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + NOT_PAID("not_paid"), + + NO_CARD("no_card"), + + FRAUD_REVIEW_FAILED("fraud_review_failed"), + + NON_COMPLIANT_EU_CUSTOMER("non_compliant_eu_customer"), + + TAX_CALCULATION_FAILED("tax_calculation_failed"), + + CURRENCY_INCOMPATIBLE_WITH_GATEWAY("currency_incompatible_with_gateway"), + + NON_COMPLIANT_CUSTOMER("non_compliant_customer"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class RemainingBillingCyclesParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private final IsPresent isPresent; + + private RemainingBillingCyclesParams(RemainingBillingCyclesBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for RemainingBillingCyclesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RemainingBillingCyclesBuilder builder() { + return new RemainingBillingCyclesBuilder(); + } + + public static final class RemainingBillingCyclesBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private IsPresent isPresent; + + private RemainingBillingCyclesBuilder() {} + + public RemainingBillingCyclesBuilder is(String value) { + this.is = value; + return this; + } + + public RemainingBillingCyclesBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public RemainingBillingCyclesBuilder lt(String value) { + this.lt = value; + return this; + } + + public RemainingBillingCyclesBuilder lte(String value) { + this.lte = value; + return this; + } + + public RemainingBillingCyclesBuilder gt(String value) { + this.gt = value; + return this; + } + + public RemainingBillingCyclesBuilder gte(String value) { + this.gte = value; + return this; + } + + public RemainingBillingCyclesBuilder between(String value) { + this.between = value; + return this; + } + + public RemainingBillingCyclesBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public RemainingBillingCyclesParams build() { + return new RemainingBillingCyclesParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CreatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private CreatedAtParams(CreatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for CreatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreatedAtBuilder builder() { + return new CreatedAtBuilder(); + } + + public static final class CreatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private CreatedAtBuilder() {} + + public CreatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public CreatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public CreatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public CreatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public CreatedAtParams build() { + return new CreatedAtParams(this); + } + } + } + + public static final class ActivatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private final IsPresent isPresent; + + private ActivatedAtParams(ActivatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + + this.isPresent = builder.isPresent; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for ActivatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ActivatedAtBuilder builder() { + return new ActivatedAtBuilder(); + } + + public static final class ActivatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private IsPresent isPresent; + + private ActivatedAtBuilder() {} + + public ActivatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public ActivatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public ActivatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public ActivatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public ActivatedAtBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public ActivatedAtParams build() { + return new ActivatedAtParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class NextBillingAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private NextBillingAtParams(NextBillingAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for NextBillingAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NextBillingAtBuilder builder() { + return new NextBillingAtBuilder(); + } + + public static final class NextBillingAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private NextBillingAtBuilder() {} + + public NextBillingAtBuilder after(String value) { + this.after = value; + return this; + } + + public NextBillingAtBuilder before(String value) { + this.before = value; + return this; + } + + public NextBillingAtBuilder on(String value) { + this.on = value; + return this; + } + + public NextBillingAtBuilder between(String value) { + this.between = value; + return this; + } + + public NextBillingAtParams build() { + return new NextBillingAtParams(this); + } + } + } + + public static final class CancelledAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private CancelledAtParams(CancelledAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for CancelledAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CancelledAtBuilder builder() { + return new CancelledAtBuilder(); + } + + public static final class CancelledAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private CancelledAtBuilder() {} + + public CancelledAtBuilder after(String value) { + this.after = value; + return this; + } + + public CancelledAtBuilder before(String value) { + this.before = value; + return this; + } + + public CancelledAtBuilder on(String value) { + this.on = value; + return this; + } + + public CancelledAtBuilder between(String value) { + this.between = value; + return this; + } + + public CancelledAtParams build() { + return new CancelledAtParams(this); + } + } + } + + public static final class HasScheduledChangesParams { + + private final Is is; + + private HasScheduledChangesParams(HasScheduledChangesBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for HasScheduledChangesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HasScheduledChangesBuilder builder() { + return new HasScheduledChangesBuilder(); + } + + public static final class HasScheduledChangesBuilder { + + private Is is; + + private HasScheduledChangesBuilder() {} + + public HasScheduledChangesBuilder is(Is value) { + this.is = value; + return this; + } + + public HasScheduledChangesParams build() { + return new HasScheduledChangesParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ExportUpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private ExportUpdatedAtParams(ExportUpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for ExportUpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportUpdatedAtBuilder builder() { + return new ExportUpdatedAtBuilder(); + } + + public static final class ExportUpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private ExportUpdatedAtBuilder() {} + + public ExportUpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public ExportUpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public ExportUpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public ExportUpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public ExportUpdatedAtParams build() { + return new ExportUpdatedAtParams(this); + } + } + } + + public static final class OfflinePaymentMethodParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private OfflinePaymentMethodParams(OfflinePaymentMethodBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for OfflinePaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OfflinePaymentMethodBuilder builder() { + return new OfflinePaymentMethodBuilder(); + } + + public static final class OfflinePaymentMethodBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private OfflinePaymentMethodBuilder() {} + + public OfflinePaymentMethodBuilder is(Is value) { + this.is = value; + return this; + } + + public OfflinePaymentMethodBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public OfflinePaymentMethodBuilder in(String value) { + this.in = value; + return this; + } + + public OfflinePaymentMethodBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public OfflinePaymentMethodParams build() { + return new OfflinePaymentMethodParams(this); + } + } + + public enum Is { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AutoCloseInvoicesParams { + + private final Is is; + + private AutoCloseInvoicesParams(AutoCloseInvoicesBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for AutoCloseInvoicesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AutoCloseInvoicesBuilder builder() { + return new AutoCloseInvoicesBuilder(); + } + + public static final class AutoCloseInvoicesBuilder { + + private Is is; + + private AutoCloseInvoicesBuilder() {} + + public AutoCloseInvoicesBuilder is(Is value) { + this.is = value; + return this; + } + + public AutoCloseInvoicesParams build() { + return new AutoCloseInvoicesParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ExportChannelParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ExportChannelParams(ExportChannelBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ExportChannelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportChannelBuilder builder() { + return new ExportChannelBuilder(); + } + + public static final class ExportChannelBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ExportChannelBuilder() {} + + public ExportChannelBuilder is(Is value) { + this.is = value; + return this; + } + + public ExportChannelBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ExportChannelBuilder in(String value) { + this.in = value; + return this; + } + + public ExportChannelBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ExportChannelParams build() { + return new ExportChannelParams(this); + } + } + + public enum Is { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PlanIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private PlanIdParams(PlanIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PlanIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PlanIdBuilder builder() { + return new PlanIdBuilder(); + } + + public static final class PlanIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private PlanIdBuilder() {} + + public PlanIdBuilder is(String value) { + this.is = value; + return this; + } + + public PlanIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PlanIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public PlanIdBuilder in(String value) { + this.in = value; + return this; + } + + public PlanIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PlanIdParams build() { + return new PlanIdParams(this); + } + } + } + + public static final class CustomerParams { + + private final ExportId2Params id; + + private final FirstNameParams firstName; + + private final LastNameParams lastName; + + private final EmailParams email; + + private final CompanyParams company; + + private final PhoneParams phone; + + private final AutoCollectionParams autoCollection; + + private final TaxabilityParams taxability; + + private final ExportCreatedAtParams createdAt; + + private final ExportUpdatedAt2Params updatedAt; + + private final ExportOfflinePaymentMethodParams offlinePaymentMethod; + + private final ExportAutoCloseInvoicesParams autoCloseInvoices; + + private final ExportChannel2Params channel; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.autoCollection = builder.autoCollection; + + this.taxability = builder.taxability; + + this.createdAt = builder.createdAt; + + this.updatedAt = builder.updatedAt; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.autoCloseInvoices = builder.autoCloseInvoices; + + this.channel = builder.channel; + } + + public ExportId2Params getId() { + return id; + } + + public FirstNameParams getFirstName() { + return firstName; + } + + public LastNameParams getLastName() { + return lastName; + } + + public EmailParams getEmail() { + return email; + } + + public CompanyParams getCompany() { + return company; + } + + public PhoneParams getPhone() { + return phone; + } + + public AutoCollectionParams getAutoCollection() { + return autoCollection; + } + + public TaxabilityParams getTaxability() { + return taxability; + } + + public ExportCreatedAtParams getCreatedAt() { + return createdAt; + } + + public ExportUpdatedAt2Params getUpdatedAt() { + return updatedAt; + } + + public ExportOfflinePaymentMethodParams getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public ExportAutoCloseInvoicesParams getAutoCloseInvoices() { + return autoCloseInvoices; + } + + public ExportChannel2Params getChannel() { + return channel; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.firstName != null) { + + // Single object + Map nestedData = this.firstName.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "first_name[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.lastName != null) { + + // Single object + Map nestedData = this.lastName.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "last_name[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.email != null) { + + // Single object + Map nestedData = this.email.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "email[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.company != null) { + + // Single object + Map nestedData = this.company.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "company[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.phone != null) { + + // Single object + Map nestedData = this.phone.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "phone[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.autoCollection != null) { + + // Single object + Map nestedData = this.autoCollection.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "auto_collection[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.taxability != null) { + + // Single object + Map nestedData = this.taxability.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "taxability[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.createdAt != null) { + + // Single object + Map nestedData = this.createdAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "created_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.offlinePaymentMethod != null) { + + // Single object + Map nestedData = this.offlinePaymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "offline_payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.autoCloseInvoices != null) { + + // Single object + Map nestedData = this.autoCloseInvoices.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "auto_close_invoices[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.channel != null) { + + // Single object + Map nestedData = this.channel.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "channel[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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 ExportId2Params id; + + private FirstNameParams firstName; + + private LastNameParams lastName; + + private EmailParams email; + + private CompanyParams company; + + private PhoneParams phone; + + private AutoCollectionParams autoCollection; + + private TaxabilityParams taxability; + + private ExportCreatedAtParams createdAt; + + private ExportUpdatedAt2Params updatedAt; + + private ExportOfflinePaymentMethodParams offlinePaymentMethod; + + private ExportAutoCloseInvoicesParams autoCloseInvoices; + + private ExportChannel2Params channel; + + private CustomerBuilder() {} + + public CustomerBuilder id(ExportId2Params value) { + this.id = value; + return this; + } + + public CustomerBuilder firstName(FirstNameParams value) { + this.firstName = value; + return this; + } + + public CustomerBuilder lastName(LastNameParams value) { + this.lastName = value; + return this; + } + + public CustomerBuilder email(EmailParams value) { + this.email = value; + return this; + } + + public CustomerBuilder company(CompanyParams value) { + this.company = value; + return this; + } + + public CustomerBuilder phone(PhoneParams value) { + this.phone = value; + return this; + } + + public CustomerBuilder autoCollection(AutoCollectionParams value) { + this.autoCollection = value; + return this; + } + + public CustomerBuilder taxability(TaxabilityParams value) { + this.taxability = value; + return this; + } + + public CustomerBuilder createdAt(ExportCreatedAtParams value) { + this.createdAt = value; + return this; + } + + public CustomerBuilder updatedAt(ExportUpdatedAt2Params value) { + this.updatedAt = value; + return this; + } + + public CustomerBuilder offlinePaymentMethod(ExportOfflinePaymentMethodParams value) { + this.offlinePaymentMethod = value; + return this; + } + + public CustomerBuilder autoCloseInvoices(ExportAutoCloseInvoicesParams value) { + this.autoCloseInvoices = value; + return this; + } + + public CustomerBuilder channel(ExportChannel2Params value) { + this.channel = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } + + public static final class ExportId2Params { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ExportId2Params(ExportId2Builder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ExportId2Params. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportId2Builder builder() { + return new ExportId2Builder(); + } + + public static final class ExportId2Builder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ExportId2Builder() {} + + public ExportId2Builder is(String value) { + this.is = value; + return this; + } + + public ExportId2Builder isNot(String value) { + this.isNot = value; + return this; + } + + public ExportId2Builder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ExportId2Builder in(String value) { + this.in = value; + return this; + } + + public ExportId2Builder notIn(String value) { + this.notIn = value; + return this; + } + + public ExportId2Params build() { + return new ExportId2Params(this); + } + } + } + + public static final class FirstNameParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private FirstNameParams(FirstNameBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for FirstNameParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static FirstNameBuilder builder() { + return new FirstNameBuilder(); + } + + public static final class FirstNameBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private FirstNameBuilder() {} + + public FirstNameBuilder is(String value) { + this.is = value; + return this; + } + + public FirstNameBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public FirstNameBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public FirstNameBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public FirstNameParams build() { + return new FirstNameParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class LastNameParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private LastNameParams(LastNameBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for LastNameParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static LastNameBuilder builder() { + return new LastNameBuilder(); + } + + public static final class LastNameBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private LastNameBuilder() {} + + public LastNameBuilder is(String value) { + this.is = value; + return this; + } + + public LastNameBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public LastNameBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public LastNameBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public LastNameParams build() { + return new LastNameParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class EmailParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private EmailParams(EmailBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for EmailParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EmailBuilder builder() { + return new EmailBuilder(); + } + + public static final class EmailBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private EmailBuilder() {} + + public EmailBuilder is(String value) { + this.is = value; + return this; + } + + public EmailBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public EmailBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public EmailBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public EmailParams build() { + return new EmailParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CompanyParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private CompanyParams(CompanyBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for CompanyParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CompanyBuilder builder() { + return new CompanyBuilder(); + } + + public static final class CompanyBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private CompanyBuilder() {} + + public CompanyBuilder is(String value) { + this.is = value; + return this; + } + + public CompanyBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CompanyBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CompanyBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public CompanyParams build() { + return new CompanyParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PhoneParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private PhoneParams(PhoneBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for PhoneParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PhoneBuilder builder() { + return new PhoneBuilder(); + } + + public static final class PhoneBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private PhoneBuilder() {} + + public PhoneBuilder is(String value) { + this.is = value; + return this; + } + + public PhoneBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PhoneBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public PhoneBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public PhoneParams build() { + return new PhoneParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AutoCollectionParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private AutoCollectionParams(AutoCollectionBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for AutoCollectionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AutoCollectionBuilder builder() { + return new AutoCollectionBuilder(); + } + + public static final class AutoCollectionBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private AutoCollectionBuilder() {} + + public AutoCollectionBuilder is(Is value) { + this.is = value; + return this; + } + + public AutoCollectionBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public AutoCollectionBuilder in(String value) { + this.in = value; + return this; + } + + public AutoCollectionBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public AutoCollectionParams build() { + return new AutoCollectionParams(this); + } + } + + public enum Is { + ON("on"), + + OFF("off"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + ON("on"), + + OFF("off"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TaxabilityParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private TaxabilityParams(TaxabilityBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for TaxabilityParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxabilityBuilder builder() { + return new TaxabilityBuilder(); + } + + public static final class TaxabilityBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private TaxabilityBuilder() {} + + public TaxabilityBuilder is(Is value) { + this.is = value; + return this; + } + + public TaxabilityBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public TaxabilityBuilder in(String value) { + this.in = value; + return this; + } + + public TaxabilityBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public TaxabilityParams build() { + return new TaxabilityParams(this); + } + } + + public enum Is { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ExportCreatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private ExportCreatedAtParams(ExportCreatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for ExportCreatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportCreatedAtBuilder builder() { + return new ExportCreatedAtBuilder(); + } + + public static final class ExportCreatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private ExportCreatedAtBuilder() {} + + public ExportCreatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public ExportCreatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public ExportCreatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public ExportCreatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public ExportCreatedAtParams build() { + return new ExportCreatedAtParams(this); + } + } + } + + public static final class ExportUpdatedAt2Params { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private ExportUpdatedAt2Params(ExportUpdatedAt2Builder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for ExportUpdatedAt2Params. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportUpdatedAt2Builder builder() { + return new ExportUpdatedAt2Builder(); + } + + public static final class ExportUpdatedAt2Builder { + + private String after; + + private String before; + + private String on; + + private String between; + + private ExportUpdatedAt2Builder() {} + + public ExportUpdatedAt2Builder after(String value) { + this.after = value; + return this; + } + + public ExportUpdatedAt2Builder before(String value) { + this.before = value; + return this; + } + + public ExportUpdatedAt2Builder on(String value) { + this.on = value; + return this; + } + + public ExportUpdatedAt2Builder between(String value) { + this.between = value; + return this; + } + + public ExportUpdatedAt2Params build() { + return new ExportUpdatedAt2Params(this); + } + } + } + + public static final class ExportOfflinePaymentMethodParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ExportOfflinePaymentMethodParams(ExportOfflinePaymentMethodBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ExportOfflinePaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportOfflinePaymentMethodBuilder builder() { + return new ExportOfflinePaymentMethodBuilder(); + } + + public static final class ExportOfflinePaymentMethodBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ExportOfflinePaymentMethodBuilder() {} + + public ExportOfflinePaymentMethodBuilder is(Is value) { + this.is = value; + return this; + } + + public ExportOfflinePaymentMethodBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ExportOfflinePaymentMethodBuilder in(String value) { + this.in = value; + return this; + } + + public ExportOfflinePaymentMethodBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ExportOfflinePaymentMethodParams build() { + return new ExportOfflinePaymentMethodParams(this); + } + } + + public enum Is { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ExportAutoCloseInvoicesParams { + + private final Is is; + + private ExportAutoCloseInvoicesParams(ExportAutoCloseInvoicesBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for ExportAutoCloseInvoicesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportAutoCloseInvoicesBuilder builder() { + return new ExportAutoCloseInvoicesBuilder(); + } + + public static final class ExportAutoCloseInvoicesBuilder { + + private Is is; + + private ExportAutoCloseInvoicesBuilder() {} + + public ExportAutoCloseInvoicesBuilder is(Is value) { + this.is = value; + return this; + } + + public ExportAutoCloseInvoicesParams build() { + return new ExportAutoCloseInvoicesParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ExportChannel2Params { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ExportChannel2Params(ExportChannel2Builder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ExportChannel2Params. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportChannel2Builder builder() { + return new ExportChannel2Builder(); + } + + public static final class ExportChannel2Builder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ExportChannel2Builder() {} + + public ExportChannel2Builder is(Is value) { + this.is = value; + return this; + } + + public ExportChannel2Builder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ExportChannel2Builder in(String value) { + this.in = value; + return this; + } + + public ExportChannel2Builder notIn(String value) { + this.notIn = value; + return this; + } + + public ExportChannel2Params build() { + return new ExportChannel2Params(this); + } + } + + public enum Is { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class RelationshipParams { + + private final ParentIdParams parentId; + + private final PaymentOwnerIdParams paymentOwnerId; + + private final InvoiceOwnerIdParams invoiceOwnerId; + + private RelationshipParams(RelationshipBuilder builder) { + + this.parentId = builder.parentId; + + this.paymentOwnerId = builder.paymentOwnerId; + + this.invoiceOwnerId = builder.invoiceOwnerId; + } + + public ParentIdParams getParentId() { + return parentId; + } + + public PaymentOwnerIdParams getPaymentOwnerId() { + return paymentOwnerId; + } + + public InvoiceOwnerIdParams getInvoiceOwnerId() { + return invoiceOwnerId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.parentId != null) { + + // Single object + Map nestedData = this.parentId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "parent_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentOwnerId != null) { + + // Single object + Map nestedData = this.paymentOwnerId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_owner_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.invoiceOwnerId != null) { + + // Single object + Map nestedData = this.invoiceOwnerId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "invoice_owner_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for RelationshipParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RelationshipBuilder builder() { + return new RelationshipBuilder(); + } + + public static final class RelationshipBuilder { + + private ParentIdParams parentId; + + private PaymentOwnerIdParams paymentOwnerId; + + private InvoiceOwnerIdParams invoiceOwnerId; + + private RelationshipBuilder() {} + + public RelationshipBuilder parentId(ParentIdParams value) { + this.parentId = value; + return this; + } + + public RelationshipBuilder paymentOwnerId(PaymentOwnerIdParams value) { + this.paymentOwnerId = value; + return this; + } + + public RelationshipBuilder invoiceOwnerId(InvoiceOwnerIdParams value) { + this.invoiceOwnerId = value; + return this; + } + + public RelationshipParams build() { + return new RelationshipParams(this); + } + } + } + + public static final class ParentIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private ParentIdParams(ParentIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for ParentIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ParentIdBuilder builder() { + return new ParentIdBuilder(); + } + + public static final class ParentIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private ParentIdBuilder() {} + + public ParentIdBuilder is(String value) { + this.is = value; + return this; + } + + public ParentIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ParentIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ParentIdParams build() { + return new ParentIdParams(this); + } + } + } + + public static final class PaymentOwnerIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private PaymentOwnerIdParams(PaymentOwnerIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for PaymentOwnerIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentOwnerIdBuilder builder() { + return new PaymentOwnerIdBuilder(); + } + + public static final class PaymentOwnerIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private PaymentOwnerIdBuilder() {} + + public PaymentOwnerIdBuilder is(String value) { + this.is = value; + return this; + } + + public PaymentOwnerIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PaymentOwnerIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public PaymentOwnerIdParams build() { + return new PaymentOwnerIdParams(this); + } + } + } + + public static final class InvoiceOwnerIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private InvoiceOwnerIdParams(InvoiceOwnerIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for InvoiceOwnerIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceOwnerIdBuilder builder() { + return new InvoiceOwnerIdBuilder(); + } + + public static final class InvoiceOwnerIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private InvoiceOwnerIdBuilder() {} + + public InvoiceOwnerIdBuilder is(String value) { + this.is = value; + return this; + } + + public InvoiceOwnerIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public InvoiceOwnerIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public InvoiceOwnerIdParams build() { + return new InvoiceOwnerIdParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportDifferentialPricesParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportDifferentialPricesParams.java new file mode 100644 index 00000000..893540ae --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportDifferentialPricesParams.java @@ -0,0 +1,705 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportDifferentialPricesParams { + + private final ItemIdParams itemId; + + private final DifferentialPriceParams differentialPrice; + + private ExportDifferentialPricesParams(ExportDifferentialPricesBuilder builder) { + + this.itemId = builder.itemId; + + this.differentialPrice = builder.differentialPrice; + } + + public ItemIdParams getItemId() { + return itemId; + } + + public DifferentialPriceParams getDifferentialPrice() { + return differentialPrice; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemId != null) { + + // Single object + Map nestedData = this.itemId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.differentialPrice != null) { + + // Single object + Map nestedData = this.differentialPrice.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "differential_price[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportDifferentialPricesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportDifferentialPricesBuilder builder() { + return new ExportDifferentialPricesBuilder(); + } + + public static final class ExportDifferentialPricesBuilder { + + private ItemIdParams itemId; + + private DifferentialPriceParams differentialPrice; + + private ExportDifferentialPricesBuilder() {} + + public ExportDifferentialPricesBuilder itemId(ItemIdParams value) { + this.itemId = value; + return this; + } + + public ExportDifferentialPricesBuilder differentialPrice(DifferentialPriceParams value) { + this.differentialPrice = value; + return this; + } + + public ExportDifferentialPricesParams build() { + return new ExportDifferentialPricesParams(this); + } + } + + public static final class ItemIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ItemIdParams(ItemIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ItemIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemIdBuilder builder() { + return new ItemIdBuilder(); + } + + public static final class ItemIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ItemIdBuilder() {} + + public ItemIdBuilder is(String value) { + this.is = value; + return this; + } + + public ItemIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ItemIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ItemIdBuilder in(String value) { + this.in = value; + return this; + } + + public ItemIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ItemIdParams build() { + return new ItemIdParams(this); + } + } + } + + public static final class DifferentialPriceParams { + + private final ItemPriceIdParams itemPriceId; + + private final IdParams id; + + private final ParentItemIdParams parentItemId; + + private DifferentialPriceParams(DifferentialPriceBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.id = builder.id; + + this.parentItemId = builder.parentItemId; + } + + public ItemPriceIdParams getItemPriceId() { + return itemPriceId; + } + + public IdParams getId() { + return id; + } + + public ParentItemIdParams getParentItemId() { + return parentItemId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + // Single object + Map nestedData = this.itemPriceId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_price_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.parentItemId != null) { + + // Single object + Map nestedData = this.parentItemId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "parent_item_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for DifferentialPriceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DifferentialPriceBuilder builder() { + return new DifferentialPriceBuilder(); + } + + public static final class DifferentialPriceBuilder { + + private ItemPriceIdParams itemPriceId; + + private IdParams id; + + private ParentItemIdParams parentItemId; + + private DifferentialPriceBuilder() {} + + public DifferentialPriceBuilder itemPriceId(ItemPriceIdParams value) { + this.itemPriceId = value; + return this; + } + + public DifferentialPriceBuilder id(IdParams value) { + this.id = value; + return this; + } + + public DifferentialPriceBuilder parentItemId(ParentItemIdParams value) { + this.parentItemId = value; + return this; + } + + public DifferentialPriceParams build() { + return new DifferentialPriceParams(this); + } + } + } + + public static final class ItemPriceIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ItemPriceIdParams(ItemPriceIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ItemPriceIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemPriceIdBuilder builder() { + return new ItemPriceIdBuilder(); + } + + public static final class ItemPriceIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ItemPriceIdBuilder() {} + + public ItemPriceIdBuilder is(String value) { + this.is = value; + return this; + } + + public ItemPriceIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ItemPriceIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ItemPriceIdBuilder in(String value) { + this.in = value; + return this; + } + + public ItemPriceIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ItemPriceIdParams build() { + return new ItemPriceIdParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class ParentItemIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ParentItemIdParams(ParentItemIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ParentItemIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ParentItemIdBuilder builder() { + return new ParentItemIdBuilder(); + } + + public static final class ParentItemIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ParentItemIdBuilder() {} + + public ParentItemIdBuilder is(String value) { + this.is = value; + return this; + } + + public ParentItemIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ParentItemIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ParentItemIdBuilder in(String value) { + this.in = value; + return this; + } + + public ParentItemIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ParentItemIdParams build() { + return new ParentItemIdParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportInvoicesParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportInvoicesParams.java new file mode 100644 index 00000000..f903598e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportInvoicesParams.java @@ -0,0 +1,3050 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportInvoicesParams { + + private final PaymentOwnerParams paymentOwner; + + private final InvoiceParams invoice; + + private ExportInvoicesParams(ExportInvoicesBuilder builder) { + + this.paymentOwner = builder.paymentOwner; + + this.invoice = builder.invoice; + } + + public PaymentOwnerParams getPaymentOwner() { + return paymentOwner; + } + + public InvoiceParams getInvoice() { + return invoice; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.paymentOwner != null) { + + // Single object + Map nestedData = this.paymentOwner.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_owner[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.invoice != null) { + + // Single object + Map nestedData = this.invoice.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "invoice[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportInvoicesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportInvoicesBuilder builder() { + return new ExportInvoicesBuilder(); + } + + public static final class ExportInvoicesBuilder { + + private PaymentOwnerParams paymentOwner; + + private InvoiceParams invoice; + + private ExportInvoicesBuilder() {} + + public ExportInvoicesBuilder paymentOwner(PaymentOwnerParams value) { + this.paymentOwner = value; + return this; + } + + public ExportInvoicesBuilder invoice(InvoiceParams value) { + this.invoice = value; + return this; + } + + public ExportInvoicesParams build() { + return new ExportInvoicesParams(this); + } + } + + public static final class PaymentOwnerParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private PaymentOwnerParams(PaymentOwnerBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PaymentOwnerParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentOwnerBuilder builder() { + return new PaymentOwnerBuilder(); + } + + public static final class PaymentOwnerBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private PaymentOwnerBuilder() {} + + public PaymentOwnerBuilder is(String value) { + this.is = value; + return this; + } + + public PaymentOwnerBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PaymentOwnerBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public PaymentOwnerBuilder in(String value) { + this.in = value; + return this; + } + + public PaymentOwnerBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PaymentOwnerParams build() { + return new PaymentOwnerParams(this); + } + } + } + + public static final class InvoiceParams { + + private final IdParams id; + + private final SubscriptionIdParams subscriptionId; + + private final CustomerIdParams customerId; + + private final RecurringParams recurring; + + private final StatusParams status; + + private final PriceTypeParams priceType; + + private final DateParams date; + + private final PaidAtParams paidAt; + + private final TotalParams total; + + private final AmountPaidParams amountPaid; + + private final AmountAdjustedParams amountAdjusted; + + private final CreditsAppliedParams creditsApplied; + + private final AmountDueParams amountDue; + + private final DunningStatusParams dunningStatus; + + private final UpdatedAtParams updatedAt; + + private final ChannelParams channel; + + private InvoiceParams(InvoiceBuilder builder) { + + this.id = builder.id; + + this.subscriptionId = builder.subscriptionId; + + this.customerId = builder.customerId; + + this.recurring = builder.recurring; + + this.status = builder.status; + + this.priceType = builder.priceType; + + this.date = builder.date; + + this.paidAt = builder.paidAt; + + this.total = builder.total; + + this.amountPaid = builder.amountPaid; + + this.amountAdjusted = builder.amountAdjusted; + + this.creditsApplied = builder.creditsApplied; + + this.amountDue = builder.amountDue; + + this.dunningStatus = builder.dunningStatus; + + this.updatedAt = builder.updatedAt; + + this.channel = builder.channel; + } + + public IdParams getId() { + return id; + } + + public SubscriptionIdParams getSubscriptionId() { + return subscriptionId; + } + + public CustomerIdParams getCustomerId() { + return customerId; + } + + public RecurringParams getRecurring() { + return recurring; + } + + public StatusParams getStatus() { + return status; + } + + public PriceTypeParams getPriceType() { + return priceType; + } + + public DateParams getDate() { + return date; + } + + public PaidAtParams getPaidAt() { + return paidAt; + } + + public TotalParams getTotal() { + return total; + } + + public AmountPaidParams getAmountPaid() { + return amountPaid; + } + + public AmountAdjustedParams getAmountAdjusted() { + return amountAdjusted; + } + + public CreditsAppliedParams getCreditsApplied() { + return creditsApplied; + } + + public AmountDueParams getAmountDue() { + return amountDue; + } + + public DunningStatusParams getDunningStatus() { + return dunningStatus; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + public ChannelParams getChannel() { + return channel; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionId != null) { + + // Single object + Map nestedData = this.subscriptionId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.customerId != null) { + + // Single object + Map nestedData = this.customerId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "customer_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.recurring != null) { + + // Single object + Map nestedData = this.recurring.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "recurring[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.status != null) { + + // Single object + Map nestedData = this.status.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.priceType != null) { + + // Single object + Map nestedData = this.priceType.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "price_type[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.date != null) { + + // Single object + Map nestedData = this.date.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "date[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paidAt != null) { + + // Single object + Map nestedData = this.paidAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "paid_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.total != null) { + + // Single object + Map nestedData = this.total.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "total[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.amountPaid != null) { + + // Single object + Map nestedData = this.amountPaid.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "amount_paid[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.amountAdjusted != null) { + + // Single object + Map nestedData = this.amountAdjusted.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "amount_adjusted[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.creditsApplied != null) { + + // Single object + Map nestedData = this.creditsApplied.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "credits_applied[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.amountDue != null) { + + // Single object + Map nestedData = this.amountDue.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "amount_due[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.dunningStatus != null) { + + // Single object + Map nestedData = this.dunningStatus.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "dunning_status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.channel != null) { + + // Single object + Map nestedData = this.channel.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "channel[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for InvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceBuilder builder() { + return new InvoiceBuilder(); + } + + public static final class InvoiceBuilder { + + private IdParams id; + + private SubscriptionIdParams subscriptionId; + + private CustomerIdParams customerId; + + private RecurringParams recurring; + + private StatusParams status; + + private PriceTypeParams priceType; + + private DateParams date; + + private PaidAtParams paidAt; + + private TotalParams total; + + private AmountPaidParams amountPaid; + + private AmountAdjustedParams amountAdjusted; + + private CreditsAppliedParams creditsApplied; + + private AmountDueParams amountDue; + + private DunningStatusParams dunningStatus; + + private UpdatedAtParams updatedAt; + + private ChannelParams channel; + + private InvoiceBuilder() {} + + public InvoiceBuilder id(IdParams value) { + this.id = value; + return this; + } + + public InvoiceBuilder subscriptionId(SubscriptionIdParams value) { + this.subscriptionId = value; + return this; + } + + public InvoiceBuilder customerId(CustomerIdParams value) { + this.customerId = value; + return this; + } + + public InvoiceBuilder recurring(RecurringParams value) { + this.recurring = value; + return this; + } + + public InvoiceBuilder status(StatusParams value) { + this.status = value; + return this; + } + + public InvoiceBuilder priceType(PriceTypeParams value) { + this.priceType = value; + return this; + } + + public InvoiceBuilder date(DateParams value) { + this.date = value; + return this; + } + + public InvoiceBuilder paidAt(PaidAtParams value) { + this.paidAt = value; + return this; + } + + public InvoiceBuilder total(TotalParams value) { + this.total = value; + return this; + } + + public InvoiceBuilder amountPaid(AmountPaidParams value) { + this.amountPaid = value; + return this; + } + + public InvoiceBuilder amountAdjusted(AmountAdjustedParams value) { + this.amountAdjusted = value; + return this; + } + + public InvoiceBuilder creditsApplied(CreditsAppliedParams value) { + this.creditsApplied = value; + return this; + } + + public InvoiceBuilder amountDue(AmountDueParams value) { + this.amountDue = value; + return this; + } + + public InvoiceBuilder dunningStatus(DunningStatusParams value) { + this.dunningStatus = value; + return this; + } + + public InvoiceBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public InvoiceBuilder channel(ChannelParams value) { + this.channel = value; + return this; + } + + public InvoiceParams build() { + return new InvoiceParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class SubscriptionIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private final String in; + + private final String notIn; + + private SubscriptionIdParams(SubscriptionIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for SubscriptionIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionIdBuilder builder() { + return new SubscriptionIdBuilder(); + } + + public static final class SubscriptionIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private String in; + + private String notIn; + + private SubscriptionIdBuilder() {} + + public SubscriptionIdBuilder is(String value) { + this.is = value; + return this; + } + + public SubscriptionIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public SubscriptionIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public SubscriptionIdBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public SubscriptionIdBuilder in(String value) { + this.in = value; + return this; + } + + public SubscriptionIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public SubscriptionIdParams build() { + return new SubscriptionIdParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CustomerIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private CustomerIdParams(CustomerIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for CustomerIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerIdBuilder builder() { + return new CustomerIdBuilder(); + } + + public static final class CustomerIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private CustomerIdBuilder() {} + + public CustomerIdBuilder is(String value) { + this.is = value; + return this; + } + + public CustomerIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CustomerIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CustomerIdBuilder in(String value) { + this.in = value; + return this; + } + + public CustomerIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CustomerIdParams build() { + return new CustomerIdParams(this); + } + } + } + + public static final class RecurringParams { + + private final Is is; + + private RecurringParams(RecurringBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for RecurringParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RecurringBuilder builder() { + return new RecurringBuilder(); + } + + public static final class RecurringBuilder { + + private Is is; + + private RecurringBuilder() {} + + public RecurringBuilder is(Is value) { + this.is = value; + return this; + } + + public RecurringParams build() { + return new RecurringParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class StatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private StatusParams(StatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for StatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatusBuilder builder() { + return new StatusBuilder(); + } + + public static final class StatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private StatusBuilder() {} + + public StatusBuilder is(Is value) { + this.is = value; + return this; + } + + public StatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public StatusBuilder in(String value) { + this.in = value; + return this; + } + + public StatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public StatusParams build() { + return new StatusParams(this); + } + } + + public enum Is { + PAID("paid"), + + POSTED("posted"), + + PAYMENT_DUE("payment_due"), + + NOT_PAID("not_paid"), + + VOIDED("voided"), + + PENDING("pending"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + PAID("paid"), + + POSTED("posted"), + + PAYMENT_DUE("payment_due"), + + NOT_PAID("not_paid"), + + VOIDED("voided"), + + PENDING("pending"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PriceTypeParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private PriceTypeParams(PriceTypeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PriceTypeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PriceTypeBuilder builder() { + return new PriceTypeBuilder(); + } + + public static final class PriceTypeBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private PriceTypeBuilder() {} + + public PriceTypeBuilder is(Is value) { + this.is = value; + return this; + } + + public PriceTypeBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public PriceTypeBuilder in(String value) { + this.in = value; + return this; + } + + public PriceTypeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PriceTypeParams build() { + return new PriceTypeParams(this); + } + } + + public enum Is { + TAX_EXCLUSIVE("tax_exclusive"), + + TAX_INCLUSIVE("tax_inclusive"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + TAX_EXCLUSIVE("tax_exclusive"), + + TAX_INCLUSIVE("tax_inclusive"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DateParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private DateParams(DateBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for DateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DateBuilder builder() { + return new DateBuilder(); + } + + public static final class DateBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private DateBuilder() {} + + public DateBuilder after(String value) { + this.after = value; + return this; + } + + public DateBuilder before(String value) { + this.before = value; + return this; + } + + public DateBuilder on(String value) { + this.on = value; + return this; + } + + public DateBuilder between(String value) { + this.between = value; + return this; + } + + public DateParams build() { + return new DateParams(this); + } + } + } + + public static final class PaidAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private PaidAtParams(PaidAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for PaidAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaidAtBuilder builder() { + return new PaidAtBuilder(); + } + + public static final class PaidAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private PaidAtBuilder() {} + + public PaidAtBuilder after(String value) { + this.after = value; + return this; + } + + public PaidAtBuilder before(String value) { + this.before = value; + return this; + } + + public PaidAtBuilder on(String value) { + this.on = value; + return this; + } + + public PaidAtBuilder between(String value) { + this.between = value; + return this; + } + + public PaidAtParams build() { + return new PaidAtParams(this); + } + } + } + + public static final class TotalParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private TotalParams(TotalBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for TotalParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TotalBuilder builder() { + return new TotalBuilder(); + } + + public static final class TotalBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private TotalBuilder() {} + + public TotalBuilder is(String value) { + this.is = value; + return this; + } + + public TotalBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public TotalBuilder lt(String value) { + this.lt = value; + return this; + } + + public TotalBuilder lte(String value) { + this.lte = value; + return this; + } + + public TotalBuilder gt(String value) { + this.gt = value; + return this; + } + + public TotalBuilder gte(String value) { + this.gte = value; + return this; + } + + public TotalBuilder between(String value) { + this.between = value; + return this; + } + + public TotalParams build() { + return new TotalParams(this); + } + } + } + + public static final class AmountPaidParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private AmountPaidParams(AmountPaidBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for AmountPaidParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AmountPaidBuilder builder() { + return new AmountPaidBuilder(); + } + + public static final class AmountPaidBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private AmountPaidBuilder() {} + + public AmountPaidBuilder is(String value) { + this.is = value; + return this; + } + + public AmountPaidBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public AmountPaidBuilder lt(String value) { + this.lt = value; + return this; + } + + public AmountPaidBuilder lte(String value) { + this.lte = value; + return this; + } + + public AmountPaidBuilder gt(String value) { + this.gt = value; + return this; + } + + public AmountPaidBuilder gte(String value) { + this.gte = value; + return this; + } + + public AmountPaidBuilder between(String value) { + this.between = value; + return this; + } + + public AmountPaidParams build() { + return new AmountPaidParams(this); + } + } + } + + public static final class AmountAdjustedParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private AmountAdjustedParams(AmountAdjustedBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for AmountAdjustedParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AmountAdjustedBuilder builder() { + return new AmountAdjustedBuilder(); + } + + public static final class AmountAdjustedBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private AmountAdjustedBuilder() {} + + public AmountAdjustedBuilder is(String value) { + this.is = value; + return this; + } + + public AmountAdjustedBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public AmountAdjustedBuilder lt(String value) { + this.lt = value; + return this; + } + + public AmountAdjustedBuilder lte(String value) { + this.lte = value; + return this; + } + + public AmountAdjustedBuilder gt(String value) { + this.gt = value; + return this; + } + + public AmountAdjustedBuilder gte(String value) { + this.gte = value; + return this; + } + + public AmountAdjustedBuilder between(String value) { + this.between = value; + return this; + } + + public AmountAdjustedParams build() { + return new AmountAdjustedParams(this); + } + } + } + + public static final class CreditsAppliedParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private CreditsAppliedParams(CreditsAppliedBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for CreditsAppliedParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditsAppliedBuilder builder() { + return new CreditsAppliedBuilder(); + } + + public static final class CreditsAppliedBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private CreditsAppliedBuilder() {} + + public CreditsAppliedBuilder is(String value) { + this.is = value; + return this; + } + + public CreditsAppliedBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CreditsAppliedBuilder lt(String value) { + this.lt = value; + return this; + } + + public CreditsAppliedBuilder lte(String value) { + this.lte = value; + return this; + } + + public CreditsAppliedBuilder gt(String value) { + this.gt = value; + return this; + } + + public CreditsAppliedBuilder gte(String value) { + this.gte = value; + return this; + } + + public CreditsAppliedBuilder between(String value) { + this.between = value; + return this; + } + + public CreditsAppliedParams build() { + return new CreditsAppliedParams(this); + } + } + } + + public static final class AmountDueParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private AmountDueParams(AmountDueBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for AmountDueParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AmountDueBuilder builder() { + return new AmountDueBuilder(); + } + + public static final class AmountDueBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private AmountDueBuilder() {} + + public AmountDueBuilder is(String value) { + this.is = value; + return this; + } + + public AmountDueBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public AmountDueBuilder lt(String value) { + this.lt = value; + return this; + } + + public AmountDueBuilder lte(String value) { + this.lte = value; + return this; + } + + public AmountDueBuilder gt(String value) { + this.gt = value; + return this; + } + + public AmountDueBuilder gte(String value) { + this.gte = value; + return this; + } + + public AmountDueBuilder between(String value) { + this.between = value; + return this; + } + + public AmountDueParams build() { + return new AmountDueParams(this); + } + } + } + + public static final class DunningStatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private final IsPresent isPresent; + + private DunningStatusParams(DunningStatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + + this.isPresent = builder.isPresent; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for DunningStatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DunningStatusBuilder builder() { + return new DunningStatusBuilder(); + } + + public static final class DunningStatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private IsPresent isPresent; + + private DunningStatusBuilder() {} + + public DunningStatusBuilder is(Is value) { + this.is = value; + return this; + } + + public DunningStatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public DunningStatusBuilder in(String value) { + this.in = value; + return this; + } + + public DunningStatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public DunningStatusBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public DunningStatusParams build() { + return new DunningStatusParams(this); + } + } + + public enum Is { + IN_PROGRESS("in_progress"), + + EXHAUSTED("exhausted"), + + STOPPED("stopped"), + + SUCCESS("success"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + IN_PROGRESS("in_progress"), + + EXHAUSTED("exhausted"), + + STOPPED("stopped"), + + SUCCESS("success"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } + + public static final class ChannelParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ChannelParams(ChannelBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ChannelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChannelBuilder builder() { + return new ChannelBuilder(); + } + + public static final class ChannelBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ChannelBuilder() {} + + public ChannelBuilder is(Is value) { + this.is = value; + return this; + } + + public ChannelBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ChannelBuilder in(String value) { + this.in = value; + return this; + } + + public ChannelBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ChannelParams build() { + return new ChannelParams(this); + } + } + + public enum Is { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportItemFamiliesParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportItemFamiliesParams.java new file mode 100644 index 00000000..5ac5bfe2 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportItemFamiliesParams.java @@ -0,0 +1,715 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportItemFamiliesParams { + + private final BusinessEntityIdParams businessEntityId; + + private final IncludeSiteLevelResourcesParams includeSiteLevelResources; + + private final ItemFamilyParams itemFamily; + + private ExportItemFamiliesParams(ExportItemFamiliesBuilder builder) { + + this.businessEntityId = builder.businessEntityId; + + this.includeSiteLevelResources = builder.includeSiteLevelResources; + + this.itemFamily = builder.itemFamily; + } + + public BusinessEntityIdParams getBusinessEntityId() { + return businessEntityId; + } + + public IncludeSiteLevelResourcesParams getIncludeSiteLevelResources() { + return includeSiteLevelResources; + } + + public ItemFamilyParams getItemFamily() { + return itemFamily; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.businessEntityId != null) { + + // Single object + Map nestedData = this.businessEntityId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "business_entity_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.includeSiteLevelResources != null) { + + // Single object + Map nestedData = this.includeSiteLevelResources.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "include_site_level_resources[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemFamily != null) { + + // Single object + Map nestedData = this.itemFamily.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_family[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportItemFamiliesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportItemFamiliesBuilder builder() { + return new ExportItemFamiliesBuilder(); + } + + public static final class ExportItemFamiliesBuilder { + + private BusinessEntityIdParams businessEntityId; + + private IncludeSiteLevelResourcesParams includeSiteLevelResources; + + private ItemFamilyParams itemFamily; + + private ExportItemFamiliesBuilder() {} + + public ExportItemFamiliesBuilder businessEntityId(BusinessEntityIdParams value) { + this.businessEntityId = value; + return this; + } + + public ExportItemFamiliesBuilder includeSiteLevelResources( + IncludeSiteLevelResourcesParams value) { + this.includeSiteLevelResources = value; + return this; + } + + public ExportItemFamiliesBuilder itemFamily(ItemFamilyParams value) { + this.itemFamily = value; + return this; + } + + public ExportItemFamiliesParams build() { + return new ExportItemFamiliesParams(this); + } + } + + public static final class BusinessEntityIdParams { + + private final IsPresent isPresent; + + private final String is; + + private BusinessEntityIdParams(BusinessEntityIdBuilder builder) { + + this.isPresent = builder.isPresent; + + this.is = builder.is; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + public String getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for BusinessEntityIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessEntityIdBuilder builder() { + return new BusinessEntityIdBuilder(); + } + + public static final class BusinessEntityIdBuilder { + + private IsPresent isPresent; + + private String is; + + private BusinessEntityIdBuilder() {} + + public BusinessEntityIdBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public BusinessEntityIdBuilder is(String value) { + this.is = value; + return this; + } + + public BusinessEntityIdParams build() { + return new BusinessEntityIdParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class IncludeSiteLevelResourcesParams { + + private final Is is; + + private IncludeSiteLevelResourcesParams(IncludeSiteLevelResourcesBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for IncludeSiteLevelResourcesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IncludeSiteLevelResourcesBuilder builder() { + return new IncludeSiteLevelResourcesBuilder(); + } + + public static final class IncludeSiteLevelResourcesBuilder { + + private Is is; + + private IncludeSiteLevelResourcesBuilder() {} + + public IncludeSiteLevelResourcesBuilder is(Is value) { + this.is = value; + return this; + } + + public IncludeSiteLevelResourcesParams build() { + return new IncludeSiteLevelResourcesParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemFamilyParams { + + private final IdParams id; + + private final NameParams name; + + private final UpdatedAtParams updatedAt; + + private ItemFamilyParams(ItemFamilyBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.updatedAt = builder.updatedAt; + } + + public IdParams getId() { + return id; + } + + public NameParams getName() { + return name; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.name != null) { + + // Single object + Map nestedData = this.name.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "name[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ItemFamilyParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemFamilyBuilder builder() { + return new ItemFamilyBuilder(); + } + + public static final class ItemFamilyBuilder { + + private IdParams id; + + private NameParams name; + + private UpdatedAtParams updatedAt; + + private ItemFamilyBuilder() {} + + public ItemFamilyBuilder id(IdParams value) { + this.id = value; + return this; + } + + public ItemFamilyBuilder name(NameParams value) { + this.name = value; + return this; + } + + public ItemFamilyBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public ItemFamilyParams build() { + return new ItemFamilyParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class NameParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private NameParams(NameBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for NameParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NameBuilder builder() { + return new NameBuilder(); + } + + public static final class NameBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private NameBuilder() {} + + public NameBuilder is(String value) { + this.is = value; + return this; + } + + public NameBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public NameBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public NameParams build() { + return new NameParams(this); + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportItemPricesParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportItemPricesParams.java new file mode 100644 index 00000000..c1956ce0 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportItemPricesParams.java @@ -0,0 +1,2919 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportItemPricesParams { + + private final ItemFamilyIdParams itemFamilyId; + + private final ItemTypeParams itemType; + + private final CurrencyCodeParams currencyCode; + + private final BusinessEntityIdParams businessEntityId; + + private final IncludeSiteLevelResourcesParams includeSiteLevelResources; + + private final ItemPriceParams itemPrice; + + private ExportItemPricesParams(ExportItemPricesBuilder builder) { + + this.itemFamilyId = builder.itemFamilyId; + + this.itemType = builder.itemType; + + this.currencyCode = builder.currencyCode; + + this.businessEntityId = builder.businessEntityId; + + this.includeSiteLevelResources = builder.includeSiteLevelResources; + + this.itemPrice = builder.itemPrice; + } + + public ItemFamilyIdParams getItemFamilyId() { + return itemFamilyId; + } + + public ItemTypeParams getItemType() { + return itemType; + } + + public CurrencyCodeParams getCurrencyCode() { + return currencyCode; + } + + public BusinessEntityIdParams getBusinessEntityId() { + return businessEntityId; + } + + public IncludeSiteLevelResourcesParams getIncludeSiteLevelResources() { + return includeSiteLevelResources; + } + + public ItemPriceParams getItemPrice() { + return itemPrice; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemFamilyId != null) { + + // Single object + Map nestedData = this.itemFamilyId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_family_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemType != null) { + + // Single object + Map nestedData = this.itemType.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_type[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.currencyCode != null) { + + // Single object + Map nestedData = this.currencyCode.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "currency_code[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.businessEntityId != null) { + + // Single object + Map nestedData = this.businessEntityId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "business_entity_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.includeSiteLevelResources != null) { + + // Single object + Map nestedData = this.includeSiteLevelResources.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "include_site_level_resources[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemPrice != null) { + + // Single object + Map nestedData = this.itemPrice.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_price[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportItemPricesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportItemPricesBuilder builder() { + return new ExportItemPricesBuilder(); + } + + public static final class ExportItemPricesBuilder { + + private ItemFamilyIdParams itemFamilyId; + + private ItemTypeParams itemType; + + private CurrencyCodeParams currencyCode; + + private BusinessEntityIdParams businessEntityId; + + private IncludeSiteLevelResourcesParams includeSiteLevelResources; + + private ItemPriceParams itemPrice; + + private ExportItemPricesBuilder() {} + + public ExportItemPricesBuilder itemFamilyId(ItemFamilyIdParams value) { + this.itemFamilyId = value; + return this; + } + + public ExportItemPricesBuilder itemType(ItemTypeParams value) { + this.itemType = value; + return this; + } + + public ExportItemPricesBuilder currencyCode(CurrencyCodeParams value) { + this.currencyCode = value; + return this; + } + + public ExportItemPricesBuilder businessEntityId(BusinessEntityIdParams value) { + this.businessEntityId = value; + return this; + } + + public ExportItemPricesBuilder includeSiteLevelResources( + IncludeSiteLevelResourcesParams value) { + this.includeSiteLevelResources = value; + return this; + } + + public ExportItemPricesBuilder itemPrice(ItemPriceParams value) { + this.itemPrice = value; + return this; + } + + public ExportItemPricesParams build() { + return new ExportItemPricesParams(this); + } + } + + public static final class ItemFamilyIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ItemFamilyIdParams(ItemFamilyIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ItemFamilyIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemFamilyIdBuilder builder() { + return new ItemFamilyIdBuilder(); + } + + public static final class ItemFamilyIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ItemFamilyIdBuilder() {} + + public ItemFamilyIdBuilder is(String value) { + this.is = value; + return this; + } + + public ItemFamilyIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ItemFamilyIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ItemFamilyIdBuilder in(String value) { + this.in = value; + return this; + } + + public ItemFamilyIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ItemFamilyIdParams build() { + return new ItemFamilyIdParams(this); + } + } + } + + public static final class ItemTypeParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ItemTypeParams(ItemTypeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ItemTypeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTypeBuilder builder() { + return new ItemTypeBuilder(); + } + + public static final class ItemTypeBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ItemTypeBuilder() {} + + public ItemTypeBuilder is(Is value) { + this.is = value; + return this; + } + + public ItemTypeBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ItemTypeBuilder in(String value) { + this.in = value; + return this; + } + + public ItemTypeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ItemTypeParams build() { + return new ItemTypeParams(this); + } + } + + public enum Is { + PLAN("plan"), + + ADDON("addon"), + + CHARGE("charge"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + PLAN("plan"), + + ADDON("addon"), + + CHARGE("charge"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CurrencyCodeParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private CurrencyCodeParams(CurrencyCodeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for CurrencyCodeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CurrencyCodeBuilder builder() { + return new CurrencyCodeBuilder(); + } + + public static final class CurrencyCodeBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private CurrencyCodeBuilder() {} + + public CurrencyCodeBuilder is(String value) { + this.is = value; + return this; + } + + public CurrencyCodeBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CurrencyCodeBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CurrencyCodeBuilder in(String value) { + this.in = value; + return this; + } + + public CurrencyCodeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CurrencyCodeParams build() { + return new CurrencyCodeParams(this); + } + } + } + + public static final class BusinessEntityIdParams { + + private final IsPresent isPresent; + + private final String is; + + private BusinessEntityIdParams(BusinessEntityIdBuilder builder) { + + this.isPresent = builder.isPresent; + + this.is = builder.is; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + public String getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for BusinessEntityIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessEntityIdBuilder builder() { + return new BusinessEntityIdBuilder(); + } + + public static final class BusinessEntityIdBuilder { + + private IsPresent isPresent; + + private String is; + + private BusinessEntityIdBuilder() {} + + public BusinessEntityIdBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public BusinessEntityIdBuilder is(String value) { + this.is = value; + return this; + } + + public BusinessEntityIdParams build() { + return new BusinessEntityIdParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class IncludeSiteLevelResourcesParams { + + private final Is is; + + private IncludeSiteLevelResourcesParams(IncludeSiteLevelResourcesBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for IncludeSiteLevelResourcesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IncludeSiteLevelResourcesBuilder builder() { + return new IncludeSiteLevelResourcesBuilder(); + } + + public static final class IncludeSiteLevelResourcesBuilder { + + private Is is; + + private IncludeSiteLevelResourcesBuilder() {} + + public IncludeSiteLevelResourcesBuilder is(Is value) { + this.is = value; + return this; + } + + public IncludeSiteLevelResourcesParams build() { + return new IncludeSiteLevelResourcesParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemPriceParams { + + private final IdParams id; + + private final NameParams name; + + private final PricingModelParams pricingModel; + + private final ItemIdParams itemId; + + private final PriceVariantIdParams priceVariantId; + + private final TrialPeriodParams trialPeriod; + + private final TrialPeriodUnitParams trialPeriodUnit; + + private final StatusParams status; + + private final UpdatedAtParams updatedAt; + + private final PeriodUnitParams periodUnit; + + private final PeriodParams period; + + private final ChannelParams channel; + + private ItemPriceParams(ItemPriceBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.pricingModel = builder.pricingModel; + + this.itemId = builder.itemId; + + this.priceVariantId = builder.priceVariantId; + + this.trialPeriod = builder.trialPeriod; + + this.trialPeriodUnit = builder.trialPeriodUnit; + + this.status = builder.status; + + this.updatedAt = builder.updatedAt; + + this.periodUnit = builder.periodUnit; + + this.period = builder.period; + + this.channel = builder.channel; + } + + public IdParams getId() { + return id; + } + + public NameParams getName() { + return name; + } + + public PricingModelParams getPricingModel() { + return pricingModel; + } + + public ItemIdParams getItemId() { + return itemId; + } + + public PriceVariantIdParams getPriceVariantId() { + return priceVariantId; + } + + public TrialPeriodParams getTrialPeriod() { + return trialPeriod; + } + + public TrialPeriodUnitParams getTrialPeriodUnit() { + return trialPeriodUnit; + } + + public StatusParams getStatus() { + return status; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + public PeriodUnitParams getPeriodUnit() { + return periodUnit; + } + + public PeriodParams getPeriod() { + return period; + } + + public ChannelParams getChannel() { + return channel; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.name != null) { + + // Single object + Map nestedData = this.name.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "name[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.pricingModel != null) { + + // Single object + Map nestedData = this.pricingModel.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "pricing_model[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemId != null) { + + // Single object + Map nestedData = this.itemId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.priceVariantId != null) { + + // Single object + Map nestedData = this.priceVariantId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "price_variant_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.trialPeriod != null) { + + // Single object + Map nestedData = this.trialPeriod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "trial_period[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.trialPeriodUnit != null) { + + // Single object + Map nestedData = this.trialPeriodUnit.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "trial_period_unit[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.status != null) { + + // Single object + Map nestedData = this.status.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.periodUnit != null) { + + // Single object + Map nestedData = this.periodUnit.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "period_unit[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.period != null) { + + // Single object + Map nestedData = this.period.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "period[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.channel != null) { + + // Single object + Map nestedData = this.channel.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "channel[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ItemPriceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemPriceBuilder builder() { + return new ItemPriceBuilder(); + } + + public static final class ItemPriceBuilder { + + private IdParams id; + + private NameParams name; + + private PricingModelParams pricingModel; + + private ItemIdParams itemId; + + private PriceVariantIdParams priceVariantId; + + private TrialPeriodParams trialPeriod; + + private TrialPeriodUnitParams trialPeriodUnit; + + private StatusParams status; + + private UpdatedAtParams updatedAt; + + private PeriodUnitParams periodUnit; + + private PeriodParams period; + + private ChannelParams channel; + + private ItemPriceBuilder() {} + + public ItemPriceBuilder id(IdParams value) { + this.id = value; + return this; + } + + public ItemPriceBuilder name(NameParams value) { + this.name = value; + return this; + } + + public ItemPriceBuilder pricingModel(PricingModelParams value) { + this.pricingModel = value; + return this; + } + + public ItemPriceBuilder itemId(ItemIdParams value) { + this.itemId = value; + return this; + } + + public ItemPriceBuilder priceVariantId(PriceVariantIdParams value) { + this.priceVariantId = value; + return this; + } + + public ItemPriceBuilder trialPeriod(TrialPeriodParams value) { + this.trialPeriod = value; + return this; + } + + public ItemPriceBuilder trialPeriodUnit(TrialPeriodUnitParams value) { + this.trialPeriodUnit = value; + return this; + } + + public ItemPriceBuilder status(StatusParams value) { + this.status = value; + return this; + } + + public ItemPriceBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public ItemPriceBuilder periodUnit(PeriodUnitParams value) { + this.periodUnit = value; + return this; + } + + public ItemPriceBuilder period(PeriodParams value) { + this.period = value; + return this; + } + + public ItemPriceBuilder channel(ChannelParams value) { + this.channel = value; + return this; + } + + public ItemPriceParams build() { + return new ItemPriceParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class NameParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private NameParams(NameBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for NameParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NameBuilder builder() { + return new NameBuilder(); + } + + public static final class NameBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private NameBuilder() {} + + public NameBuilder is(String value) { + this.is = value; + return this; + } + + public NameBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public NameBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public NameBuilder in(String value) { + this.in = value; + return this; + } + + public NameBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public NameParams build() { + return new NameParams(this); + } + } + } + + public static final class PricingModelParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private PricingModelParams(PricingModelBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PricingModelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PricingModelBuilder builder() { + return new PricingModelBuilder(); + } + + public static final class PricingModelBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private PricingModelBuilder() {} + + public PricingModelBuilder is(Is value) { + this.is = value; + return this; + } + + public PricingModelBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public PricingModelBuilder in(String value) { + this.in = value; + return this; + } + + public PricingModelBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PricingModelParams build() { + return new PricingModelParams(this); + } + } + + public enum Is { + FLAT_FEE("flat_fee"), + + PER_UNIT("per_unit"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + FLAT_FEE("flat_fee"), + + PER_UNIT("per_unit"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ItemIdParams(ItemIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ItemIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemIdBuilder builder() { + return new ItemIdBuilder(); + } + + public static final class ItemIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ItemIdBuilder() {} + + public ItemIdBuilder is(String value) { + this.is = value; + return this; + } + + public ItemIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ItemIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ItemIdBuilder in(String value) { + this.in = value; + return this; + } + + public ItemIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ItemIdParams build() { + return new ItemIdParams(this); + } + } + } + + public static final class PriceVariantIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private PriceVariantIdParams(PriceVariantIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PriceVariantIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PriceVariantIdBuilder builder() { + return new PriceVariantIdBuilder(); + } + + public static final class PriceVariantIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private PriceVariantIdBuilder() {} + + public PriceVariantIdBuilder is(String value) { + this.is = value; + return this; + } + + public PriceVariantIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PriceVariantIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public PriceVariantIdBuilder in(String value) { + this.in = value; + return this; + } + + public PriceVariantIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PriceVariantIdParams build() { + return new PriceVariantIdParams(this); + } + } + } + + public static final class TrialPeriodParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private TrialPeriodParams(TrialPeriodBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for TrialPeriodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TrialPeriodBuilder builder() { + return new TrialPeriodBuilder(); + } + + public static final class TrialPeriodBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private TrialPeriodBuilder() {} + + public TrialPeriodBuilder is(String value) { + this.is = value; + return this; + } + + public TrialPeriodBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public TrialPeriodBuilder lt(String value) { + this.lt = value; + return this; + } + + public TrialPeriodBuilder lte(String value) { + this.lte = value; + return this; + } + + public TrialPeriodBuilder gt(String value) { + this.gt = value; + return this; + } + + public TrialPeriodBuilder gte(String value) { + this.gte = value; + return this; + } + + public TrialPeriodBuilder between(String value) { + this.between = value; + return this; + } + + public TrialPeriodParams build() { + return new TrialPeriodParams(this); + } + } + } + + public static final class TrialPeriodUnitParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private TrialPeriodUnitParams(TrialPeriodUnitBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for TrialPeriodUnitParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TrialPeriodUnitBuilder builder() { + return new TrialPeriodUnitBuilder(); + } + + public static final class TrialPeriodUnitBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private TrialPeriodUnitBuilder() {} + + public TrialPeriodUnitBuilder is(Is value) { + this.is = value; + return this; + } + + public TrialPeriodUnitBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public TrialPeriodUnitBuilder in(String value) { + this.in = value; + return this; + } + + public TrialPeriodUnitBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public TrialPeriodUnitParams build() { + return new TrialPeriodUnitParams(this); + } + } + + public enum Is { + DAY("day"), + + MONTH("month"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + DAY("day"), + + MONTH("month"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class StatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private StatusParams(StatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for StatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatusBuilder builder() { + return new StatusBuilder(); + } + + public static final class StatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private StatusBuilder() {} + + public StatusBuilder is(Is value) { + this.is = value; + return this; + } + + public StatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public StatusBuilder in(String value) { + this.in = value; + return this; + } + + public StatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public StatusParams build() { + return new StatusParams(this); + } + } + + public enum Is { + ACTIVE("active"), + + ARCHIVED("archived"), + + DELETED("deleted"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + ACTIVE("active"), + + ARCHIVED("archived"), + + DELETED("deleted"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } + + public static final class PeriodUnitParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private PeriodUnitParams(PeriodUnitBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PeriodUnitParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PeriodUnitBuilder builder() { + return new PeriodUnitBuilder(); + } + + public static final class PeriodUnitBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private PeriodUnitBuilder() {} + + public PeriodUnitBuilder is(Is value) { + this.is = value; + return this; + } + + public PeriodUnitBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public PeriodUnitBuilder in(String value) { + this.in = value; + return this; + } + + public PeriodUnitBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PeriodUnitParams build() { + return new PeriodUnitParams(this); + } + } + + public enum Is { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PeriodParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private PeriodParams(PeriodBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for PeriodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PeriodBuilder builder() { + return new PeriodBuilder(); + } + + public static final class PeriodBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private PeriodBuilder() {} + + public PeriodBuilder is(String value) { + this.is = value; + return this; + } + + public PeriodBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PeriodBuilder lt(String value) { + this.lt = value; + return this; + } + + public PeriodBuilder lte(String value) { + this.lte = value; + return this; + } + + public PeriodBuilder gt(String value) { + this.gt = value; + return this; + } + + public PeriodBuilder gte(String value) { + this.gte = value; + return this; + } + + public PeriodBuilder between(String value) { + this.between = value; + return this; + } + + public PeriodParams build() { + return new PeriodParams(this); + } + } + } + + public static final class ChannelParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ChannelParams(ChannelBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ChannelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChannelBuilder builder() { + return new ChannelBuilder(); + } + + public static final class ChannelBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ChannelBuilder() {} + + public ChannelBuilder is(Is value) { + this.is = value; + return this; + } + + public ChannelBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ChannelBuilder in(String value) { + this.in = value; + return this; + } + + public ChannelBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ChannelParams build() { + return new ChannelParams(this); + } + } + + public enum Is { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportItemsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportItemsParams.java new file mode 100644 index 00000000..7f3d7407 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportItemsParams.java @@ -0,0 +1,2232 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportItemsParams { + + private final BusinessEntityIdParams businessEntityId; + + private final IncludeSiteLevelResourcesParams includeSiteLevelResources; + + private final ItemParams item; + + private ExportItemsParams(ExportItemsBuilder builder) { + + this.businessEntityId = builder.businessEntityId; + + this.includeSiteLevelResources = builder.includeSiteLevelResources; + + this.item = builder.item; + } + + public BusinessEntityIdParams getBusinessEntityId() { + return businessEntityId; + } + + public IncludeSiteLevelResourcesParams getIncludeSiteLevelResources() { + return includeSiteLevelResources; + } + + public ItemParams getItem() { + return item; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.businessEntityId != null) { + + // Single object + Map nestedData = this.businessEntityId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "business_entity_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.includeSiteLevelResources != null) { + + // Single object + Map nestedData = this.includeSiteLevelResources.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "include_site_level_resources[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.item != null) { + + // Single object + Map nestedData = this.item.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportItemsBuilder builder() { + return new ExportItemsBuilder(); + } + + public static final class ExportItemsBuilder { + + private BusinessEntityIdParams businessEntityId; + + private IncludeSiteLevelResourcesParams includeSiteLevelResources; + + private ItemParams item; + + private ExportItemsBuilder() {} + + public ExportItemsBuilder businessEntityId(BusinessEntityIdParams value) { + this.businessEntityId = value; + return this; + } + + public ExportItemsBuilder includeSiteLevelResources(IncludeSiteLevelResourcesParams value) { + this.includeSiteLevelResources = value; + return this; + } + + public ExportItemsBuilder item(ItemParams value) { + this.item = value; + return this; + } + + public ExportItemsParams build() { + return new ExportItemsParams(this); + } + } + + public static final class BusinessEntityIdParams { + + private final IsPresent isPresent; + + private final String is; + + private BusinessEntityIdParams(BusinessEntityIdBuilder builder) { + + this.isPresent = builder.isPresent; + + this.is = builder.is; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + public String getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for BusinessEntityIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessEntityIdBuilder builder() { + return new BusinessEntityIdBuilder(); + } + + public static final class BusinessEntityIdBuilder { + + private IsPresent isPresent; + + private String is; + + private BusinessEntityIdBuilder() {} + + public BusinessEntityIdBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public BusinessEntityIdBuilder is(String value) { + this.is = value; + return this; + } + + public BusinessEntityIdParams build() { + return new BusinessEntityIdParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class IncludeSiteLevelResourcesParams { + + private final Is is; + + private IncludeSiteLevelResourcesParams(IncludeSiteLevelResourcesBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for IncludeSiteLevelResourcesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IncludeSiteLevelResourcesBuilder builder() { + return new IncludeSiteLevelResourcesBuilder(); + } + + public static final class IncludeSiteLevelResourcesBuilder { + + private Is is; + + private IncludeSiteLevelResourcesBuilder() {} + + public IncludeSiteLevelResourcesBuilder is(Is value) { + this.is = value; + return this; + } + + public IncludeSiteLevelResourcesParams build() { + return new IncludeSiteLevelResourcesParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemParams { + + private final IdParams id; + + private final ItemFamilyIdParams itemFamilyId; + + private final TypeParams type; + + private final NameParams name; + + private final ItemApplicabilityParams itemApplicability; + + private final StatusParams status; + + private final IsGiftableParams isGiftable; + + private final UpdatedAtParams updatedAt; + + private final EnabledForCheckoutParams enabledForCheckout; + + private final EnabledInPortalParams enabledInPortal; + + private final MeteredParams metered; + + private final UsageCalculationParams usageCalculation; + + private final ChannelParams channel; + + private ItemParams(ItemBuilder builder) { + + this.id = builder.id; + + this.itemFamilyId = builder.itemFamilyId; + + this.type = builder.type; + + this.name = builder.name; + + this.itemApplicability = builder.itemApplicability; + + this.status = builder.status; + + this.isGiftable = builder.isGiftable; + + this.updatedAt = builder.updatedAt; + + this.enabledForCheckout = builder.enabledForCheckout; + + this.enabledInPortal = builder.enabledInPortal; + + this.metered = builder.metered; + + this.usageCalculation = builder.usageCalculation; + + this.channel = builder.channel; + } + + public IdParams getId() { + return id; + } + + public ItemFamilyIdParams getItemFamilyId() { + return itemFamilyId; + } + + public TypeParams getType() { + return type; + } + + public NameParams getName() { + return name; + } + + public ItemApplicabilityParams getItemApplicability() { + return itemApplicability; + } + + public StatusParams getStatus() { + return status; + } + + public IsGiftableParams getIsGiftable() { + return isGiftable; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + public EnabledForCheckoutParams getEnabledForCheckout() { + return enabledForCheckout; + } + + public EnabledInPortalParams getEnabledInPortal() { + return enabledInPortal; + } + + public MeteredParams getMetered() { + return metered; + } + + public UsageCalculationParams getUsageCalculation() { + return usageCalculation; + } + + public ChannelParams getChannel() { + return channel; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemFamilyId != null) { + + // Single object + Map nestedData = this.itemFamilyId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_family_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.type != null) { + + // Single object + Map nestedData = this.type.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "type[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.name != null) { + + // Single object + Map nestedData = this.name.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "name[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemApplicability != null) { + + // Single object + Map nestedData = this.itemApplicability.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_applicability[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.status != null) { + + // Single object + Map nestedData = this.status.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.isGiftable != null) { + + // Single object + Map nestedData = this.isGiftable.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "is_giftable[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.enabledForCheckout != null) { + + // Single object + Map nestedData = this.enabledForCheckout.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "enabled_for_checkout[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.enabledInPortal != null) { + + // Single object + Map nestedData = this.enabledInPortal.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "enabled_in_portal[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.metered != null) { + + // Single object + Map nestedData = this.metered.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "metered[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.usageCalculation != null) { + + // Single object + Map nestedData = this.usageCalculation.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "usage_calculation[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.channel != null) { + + // Single object + Map nestedData = this.channel.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "channel[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ItemParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemBuilder builder() { + return new ItemBuilder(); + } + + public static final class ItemBuilder { + + private IdParams id; + + private ItemFamilyIdParams itemFamilyId; + + private TypeParams type; + + private NameParams name; + + private ItemApplicabilityParams itemApplicability; + + private StatusParams status; + + private IsGiftableParams isGiftable; + + private UpdatedAtParams updatedAt; + + private EnabledForCheckoutParams enabledForCheckout; + + private EnabledInPortalParams enabledInPortal; + + private MeteredParams metered; + + private UsageCalculationParams usageCalculation; + + private ChannelParams channel; + + private ItemBuilder() {} + + public ItemBuilder id(IdParams value) { + this.id = value; + return this; + } + + public ItemBuilder itemFamilyId(ItemFamilyIdParams value) { + this.itemFamilyId = value; + return this; + } + + public ItemBuilder type(TypeParams value) { + this.type = value; + return this; + } + + public ItemBuilder name(NameParams value) { + this.name = value; + return this; + } + + public ItemBuilder itemApplicability(ItemApplicabilityParams value) { + this.itemApplicability = value; + return this; + } + + public ItemBuilder status(StatusParams value) { + this.status = value; + return this; + } + + public ItemBuilder isGiftable(IsGiftableParams value) { + this.isGiftable = value; + return this; + } + + public ItemBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public ItemBuilder enabledForCheckout(EnabledForCheckoutParams value) { + this.enabledForCheckout = value; + return this; + } + + public ItemBuilder enabledInPortal(EnabledInPortalParams value) { + this.enabledInPortal = value; + return this; + } + + public ItemBuilder metered(MeteredParams value) { + this.metered = value; + return this; + } + + public ItemBuilder usageCalculation(UsageCalculationParams value) { + this.usageCalculation = value; + return this; + } + + public ItemBuilder channel(ChannelParams value) { + this.channel = value; + return this; + } + + public ItemParams build() { + return new ItemParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class ItemFamilyIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ItemFamilyIdParams(ItemFamilyIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ItemFamilyIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemFamilyIdBuilder builder() { + return new ItemFamilyIdBuilder(); + } + + public static final class ItemFamilyIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ItemFamilyIdBuilder() {} + + public ItemFamilyIdBuilder is(String value) { + this.is = value; + return this; + } + + public ItemFamilyIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ItemFamilyIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ItemFamilyIdBuilder in(String value) { + this.in = value; + return this; + } + + public ItemFamilyIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ItemFamilyIdParams build() { + return new ItemFamilyIdParams(this); + } + } + } + + public static final class TypeParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private TypeParams(TypeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for TypeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TypeBuilder builder() { + return new TypeBuilder(); + } + + public static final class TypeBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private TypeBuilder() {} + + public TypeBuilder is(Is value) { + this.is = value; + return this; + } + + public TypeBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public TypeBuilder in(String value) { + this.in = value; + return this; + } + + public TypeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public TypeParams build() { + return new TypeParams(this); + } + } + + public enum Is { + PLAN("plan"), + + ADDON("addon"), + + CHARGE("charge"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + PLAN("plan"), + + ADDON("addon"), + + CHARGE("charge"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class NameParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private NameParams(NameBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for NameParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NameBuilder builder() { + return new NameBuilder(); + } + + public static final class NameBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private NameBuilder() {} + + public NameBuilder is(String value) { + this.is = value; + return this; + } + + public NameBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public NameBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public NameParams build() { + return new NameParams(this); + } + } + } + + public static final class ItemApplicabilityParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ItemApplicabilityParams(ItemApplicabilityBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ItemApplicabilityParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemApplicabilityBuilder builder() { + return new ItemApplicabilityBuilder(); + } + + public static final class ItemApplicabilityBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ItemApplicabilityBuilder() {} + + public ItemApplicabilityBuilder is(Is value) { + this.is = value; + return this; + } + + public ItemApplicabilityBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ItemApplicabilityBuilder in(String value) { + this.in = value; + return this; + } + + public ItemApplicabilityBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ItemApplicabilityParams build() { + return new ItemApplicabilityParams(this); + } + } + + public enum Is { + ALL("all"), + + RESTRICTED("restricted"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + ALL("all"), + + RESTRICTED("restricted"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class StatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private StatusParams(StatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for StatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatusBuilder builder() { + return new StatusBuilder(); + } + + public static final class StatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private StatusBuilder() {} + + public StatusBuilder is(Is value) { + this.is = value; + return this; + } + + public StatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public StatusBuilder in(String value) { + this.in = value; + return this; + } + + public StatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public StatusParams build() { + return new StatusParams(this); + } + } + + public enum Is { + ACTIVE("active"), + + ARCHIVED("archived"), + + DELETED("deleted"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + ACTIVE("active"), + + ARCHIVED("archived"), + + DELETED("deleted"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class IsGiftableParams { + + private final Is is; + + private IsGiftableParams(IsGiftableBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for IsGiftableParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IsGiftableBuilder builder() { + return new IsGiftableBuilder(); + } + + public static final class IsGiftableBuilder { + + private Is is; + + private IsGiftableBuilder() {} + + public IsGiftableBuilder is(Is value) { + this.is = value; + return this; + } + + public IsGiftableParams build() { + return new IsGiftableParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } + + public static final class EnabledForCheckoutParams { + + private final Is is; + + private EnabledForCheckoutParams(EnabledForCheckoutBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for EnabledForCheckoutParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EnabledForCheckoutBuilder builder() { + return new EnabledForCheckoutBuilder(); + } + + public static final class EnabledForCheckoutBuilder { + + private Is is; + + private EnabledForCheckoutBuilder() {} + + public EnabledForCheckoutBuilder is(Is value) { + this.is = value; + return this; + } + + public EnabledForCheckoutParams build() { + return new EnabledForCheckoutParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class EnabledInPortalParams { + + private final Is is; + + private EnabledInPortalParams(EnabledInPortalBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for EnabledInPortalParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EnabledInPortalBuilder builder() { + return new EnabledInPortalBuilder(); + } + + public static final class EnabledInPortalBuilder { + + private Is is; + + private EnabledInPortalBuilder() {} + + public EnabledInPortalBuilder is(Is value) { + this.is = value; + return this; + } + + public EnabledInPortalParams build() { + return new EnabledInPortalParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class MeteredParams { + + private final Is is; + + private MeteredParams(MeteredBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for MeteredParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static MeteredBuilder builder() { + return new MeteredBuilder(); + } + + public static final class MeteredBuilder { + + private Is is; + + private MeteredBuilder() {} + + public MeteredBuilder is(Is value) { + this.is = value; + return this; + } + + public MeteredParams build() { + return new MeteredParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class UsageCalculationParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private UsageCalculationParams(UsageCalculationBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for UsageCalculationParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UsageCalculationBuilder builder() { + return new UsageCalculationBuilder(); + } + + public static final class UsageCalculationBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private UsageCalculationBuilder() {} + + public UsageCalculationBuilder is(Is value) { + this.is = value; + return this; + } + + public UsageCalculationBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public UsageCalculationBuilder in(String value) { + this.in = value; + return this; + } + + public UsageCalculationBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public UsageCalculationParams build() { + return new UsageCalculationParams(this); + } + } + + public enum Is { + SUM_OF_USAGES("sum_of_usages"), + + LAST_USAGE("last_usage"), + + MAX_USAGE("max_usage"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + SUM_OF_USAGES("sum_of_usages"), + + LAST_USAGE("last_usage"), + + MAX_USAGE("max_usage"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ChannelParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ChannelParams(ChannelBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ChannelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChannelBuilder builder() { + return new ChannelBuilder(); + } + + public static final class ChannelBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ChannelBuilder() {} + + public ChannelBuilder is(Is value) { + this.is = value; + return this; + } + + public ChannelBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ChannelBuilder in(String value) { + this.in = value; + return this; + } + + public ChannelBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ChannelParams build() { + return new ChannelParams(this); + } + } + + public enum Is { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportOrdersParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportOrdersParams.java new file mode 100644 index 00000000..cde89a44 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportOrdersParams.java @@ -0,0 +1,2991 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportOrdersParams { + + private final TotalParams total; + + private final OrderParams order; + + private ExportOrdersParams(ExportOrdersBuilder builder) { + + this.total = builder.total; + + this.order = builder.order; + } + + public TotalParams getTotal() { + return total; + } + + public OrderParams getOrder() { + return order; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.total != null) { + + // Single object + Map nestedData = this.total.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "total[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.order != null) { + + // Single object + Map nestedData = this.order.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "order[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportOrdersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportOrdersBuilder builder() { + return new ExportOrdersBuilder(); + } + + public static final class ExportOrdersBuilder { + + private TotalParams total; + + private OrderParams order; + + private ExportOrdersBuilder() {} + + public ExportOrdersBuilder total(TotalParams value) { + this.total = value; + return this; + } + + public ExportOrdersBuilder order(OrderParams value) { + this.order = value; + return this; + } + + public ExportOrdersParams build() { + return new ExportOrdersParams(this); + } + } + + public static final class TotalParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private TotalParams(TotalBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for TotalParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TotalBuilder builder() { + return new TotalBuilder(); + } + + public static final class TotalBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private TotalBuilder() {} + + public TotalBuilder is(String value) { + this.is = value; + return this; + } + + public TotalBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public TotalBuilder lt(String value) { + this.lt = value; + return this; + } + + public TotalBuilder lte(String value) { + this.lte = value; + return this; + } + + public TotalBuilder gt(String value) { + this.gt = value; + return this; + } + + public TotalBuilder gte(String value) { + this.gte = value; + return this; + } + + public TotalBuilder between(String value) { + this.between = value; + return this; + } + + public TotalParams build() { + return new TotalParams(this); + } + } + } + + public static final class OrderParams { + + private final IdParams id; + + private final SubscriptionIdParams subscriptionId; + + private final CustomerIdParams customerId; + + private final StatusParams status; + + private final PriceTypeParams priceType; + + private final OrderDateParams orderDate; + + private final ShippingDateParams shippingDate; + + private final ShippedAtParams shippedAt; + + private final DeliveredAtParams deliveredAt; + + private final CancelledAtParams cancelledAt; + + private final AmountPaidParams amountPaid; + + private final RefundableCreditsParams refundableCredits; + + private final RefundableCreditsIssuedParams refundableCreditsIssued; + + private final UpdatedAtParams updatedAt; + + private final ResentStatusParams resentStatus; + + private final IsResentParams isResent; + + private final OriginalOrderIdParams originalOrderId; + + private OrderParams(OrderBuilder builder) { + + this.id = builder.id; + + this.subscriptionId = builder.subscriptionId; + + this.customerId = builder.customerId; + + this.status = builder.status; + + this.priceType = builder.priceType; + + this.orderDate = builder.orderDate; + + this.shippingDate = builder.shippingDate; + + this.shippedAt = builder.shippedAt; + + this.deliveredAt = builder.deliveredAt; + + this.cancelledAt = builder.cancelledAt; + + this.amountPaid = builder.amountPaid; + + this.refundableCredits = builder.refundableCredits; + + this.refundableCreditsIssued = builder.refundableCreditsIssued; + + this.updatedAt = builder.updatedAt; + + this.resentStatus = builder.resentStatus; + + this.isResent = builder.isResent; + + this.originalOrderId = builder.originalOrderId; + } + + public IdParams getId() { + return id; + } + + public SubscriptionIdParams getSubscriptionId() { + return subscriptionId; + } + + public CustomerIdParams getCustomerId() { + return customerId; + } + + public StatusParams getStatus() { + return status; + } + + public PriceTypeParams getPriceType() { + return priceType; + } + + public OrderDateParams getOrderDate() { + return orderDate; + } + + public ShippingDateParams getShippingDate() { + return shippingDate; + } + + public ShippedAtParams getShippedAt() { + return shippedAt; + } + + public DeliveredAtParams getDeliveredAt() { + return deliveredAt; + } + + public CancelledAtParams getCancelledAt() { + return cancelledAt; + } + + public AmountPaidParams getAmountPaid() { + return amountPaid; + } + + public RefundableCreditsParams getRefundableCredits() { + return refundableCredits; + } + + public RefundableCreditsIssuedParams getRefundableCreditsIssued() { + return refundableCreditsIssued; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + public ResentStatusParams getResentStatus() { + return resentStatus; + } + + public IsResentParams getIsResent() { + return isResent; + } + + public OriginalOrderIdParams getOriginalOrderId() { + return originalOrderId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionId != null) { + + // Single object + Map nestedData = this.subscriptionId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.customerId != null) { + + // Single object + Map nestedData = this.customerId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "customer_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.status != null) { + + // Single object + Map nestedData = this.status.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.priceType != null) { + + // Single object + Map nestedData = this.priceType.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "price_type[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.orderDate != null) { + + // Single object + Map nestedData = this.orderDate.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "order_date[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingDate != null) { + + // Single object + Map nestedData = this.shippingDate.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_date[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippedAt != null) { + + // Single object + Map nestedData = this.shippedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipped_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.deliveredAt != null) { + + // Single object + Map nestedData = this.deliveredAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "delivered_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.cancelledAt != null) { + + // Single object + Map nestedData = this.cancelledAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "cancelled_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.amountPaid != null) { + + // Single object + Map nestedData = this.amountPaid.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "amount_paid[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.refundableCredits != null) { + + // Single object + Map nestedData = this.refundableCredits.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "refundable_credits[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.refundableCreditsIssued != null) { + + // Single object + Map nestedData = this.refundableCreditsIssued.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "refundable_credits_issued[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.resentStatus != null) { + + // Single object + Map nestedData = this.resentStatus.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "resent_status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.isResent != null) { + + // Single object + Map nestedData = this.isResent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "is_resent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.originalOrderId != null) { + + // Single object + Map nestedData = this.originalOrderId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "original_order_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for OrderParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OrderBuilder builder() { + return new OrderBuilder(); + } + + public static final class OrderBuilder { + + private IdParams id; + + private SubscriptionIdParams subscriptionId; + + private CustomerIdParams customerId; + + private StatusParams status; + + private PriceTypeParams priceType; + + private OrderDateParams orderDate; + + private ShippingDateParams shippingDate; + + private ShippedAtParams shippedAt; + + private DeliveredAtParams deliveredAt; + + private CancelledAtParams cancelledAt; + + private AmountPaidParams amountPaid; + + private RefundableCreditsParams refundableCredits; + + private RefundableCreditsIssuedParams refundableCreditsIssued; + + private UpdatedAtParams updatedAt; + + private ResentStatusParams resentStatus; + + private IsResentParams isResent; + + private OriginalOrderIdParams originalOrderId; + + private OrderBuilder() {} + + public OrderBuilder id(IdParams value) { + this.id = value; + return this; + } + + public OrderBuilder subscriptionId(SubscriptionIdParams value) { + this.subscriptionId = value; + return this; + } + + public OrderBuilder customerId(CustomerIdParams value) { + this.customerId = value; + return this; + } + + public OrderBuilder status(StatusParams value) { + this.status = value; + return this; + } + + public OrderBuilder priceType(PriceTypeParams value) { + this.priceType = value; + return this; + } + + public OrderBuilder orderDate(OrderDateParams value) { + this.orderDate = value; + return this; + } + + public OrderBuilder shippingDate(ShippingDateParams value) { + this.shippingDate = value; + return this; + } + + public OrderBuilder shippedAt(ShippedAtParams value) { + this.shippedAt = value; + return this; + } + + public OrderBuilder deliveredAt(DeliveredAtParams value) { + this.deliveredAt = value; + return this; + } + + public OrderBuilder cancelledAt(CancelledAtParams value) { + this.cancelledAt = value; + return this; + } + + public OrderBuilder amountPaid(AmountPaidParams value) { + this.amountPaid = value; + return this; + } + + public OrderBuilder refundableCredits(RefundableCreditsParams value) { + this.refundableCredits = value; + return this; + } + + public OrderBuilder refundableCreditsIssued(RefundableCreditsIssuedParams value) { + this.refundableCreditsIssued = value; + return this; + } + + public OrderBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public OrderBuilder resentStatus(ResentStatusParams value) { + this.resentStatus = value; + return this; + } + + public OrderBuilder isResent(IsResentParams value) { + this.isResent = value; + return this; + } + + public OrderBuilder originalOrderId(OriginalOrderIdParams value) { + this.originalOrderId = value; + return this; + } + + public OrderParams build() { + return new OrderParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class SubscriptionIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private final String in; + + private final String notIn; + + private SubscriptionIdParams(SubscriptionIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for SubscriptionIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionIdBuilder builder() { + return new SubscriptionIdBuilder(); + } + + public static final class SubscriptionIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private String in; + + private String notIn; + + private SubscriptionIdBuilder() {} + + public SubscriptionIdBuilder is(String value) { + this.is = value; + return this; + } + + public SubscriptionIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public SubscriptionIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public SubscriptionIdBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public SubscriptionIdBuilder in(String value) { + this.in = value; + return this; + } + + public SubscriptionIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public SubscriptionIdParams build() { + return new SubscriptionIdParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CustomerIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private CustomerIdParams(CustomerIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for CustomerIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerIdBuilder builder() { + return new CustomerIdBuilder(); + } + + public static final class CustomerIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private CustomerIdBuilder() {} + + public CustomerIdBuilder is(String value) { + this.is = value; + return this; + } + + public CustomerIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CustomerIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CustomerIdBuilder in(String value) { + this.in = value; + return this; + } + + public CustomerIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CustomerIdParams build() { + return new CustomerIdParams(this); + } + } + } + + public static final class StatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private StatusParams(StatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for StatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatusBuilder builder() { + return new StatusBuilder(); + } + + public static final class StatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private StatusBuilder() {} + + public StatusBuilder is(Is value) { + this.is = value; + return this; + } + + public StatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public StatusBuilder in(String value) { + this.in = value; + return this; + } + + public StatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public StatusParams build() { + return new StatusParams(this); + } + } + + public enum Is { + NEW("new"), + + PROCESSING("processing"), + + COMPLETE("complete"), + + CANCELLED("cancelled"), + + VOIDED("voided"), + + QUEUED("queued"), + + AWAITING_SHIPMENT("awaiting_shipment"), + + ON_HOLD("on_hold"), + + DELIVERED("delivered"), + + SHIPPED("shipped"), + + PARTIALLY_DELIVERED("partially_delivered"), + + RETURNED("returned"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + NEW("new"), + + PROCESSING("processing"), + + COMPLETE("complete"), + + CANCELLED("cancelled"), + + VOIDED("voided"), + + QUEUED("queued"), + + AWAITING_SHIPMENT("awaiting_shipment"), + + ON_HOLD("on_hold"), + + DELIVERED("delivered"), + + SHIPPED("shipped"), + + PARTIALLY_DELIVERED("partially_delivered"), + + RETURNED("returned"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PriceTypeParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private PriceTypeParams(PriceTypeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PriceTypeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PriceTypeBuilder builder() { + return new PriceTypeBuilder(); + } + + public static final class PriceTypeBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private PriceTypeBuilder() {} + + public PriceTypeBuilder is(Is value) { + this.is = value; + return this; + } + + public PriceTypeBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public PriceTypeBuilder in(String value) { + this.in = value; + return this; + } + + public PriceTypeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PriceTypeParams build() { + return new PriceTypeParams(this); + } + } + + public enum Is { + TAX_EXCLUSIVE("tax_exclusive"), + + TAX_INCLUSIVE("tax_inclusive"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + TAX_EXCLUSIVE("tax_exclusive"), + + TAX_INCLUSIVE("tax_inclusive"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class OrderDateParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private OrderDateParams(OrderDateBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for OrderDateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OrderDateBuilder builder() { + return new OrderDateBuilder(); + } + + public static final class OrderDateBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private OrderDateBuilder() {} + + public OrderDateBuilder after(String value) { + this.after = value; + return this; + } + + public OrderDateBuilder before(String value) { + this.before = value; + return this; + } + + public OrderDateBuilder on(String value) { + this.on = value; + return this; + } + + public OrderDateBuilder between(String value) { + this.between = value; + return this; + } + + public OrderDateParams build() { + return new OrderDateParams(this); + } + } + } + + public static final class ShippingDateParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private ShippingDateParams(ShippingDateBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for ShippingDateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingDateBuilder builder() { + return new ShippingDateBuilder(); + } + + public static final class ShippingDateBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private ShippingDateBuilder() {} + + public ShippingDateBuilder after(String value) { + this.after = value; + return this; + } + + public ShippingDateBuilder before(String value) { + this.before = value; + return this; + } + + public ShippingDateBuilder on(String value) { + this.on = value; + return this; + } + + public ShippingDateBuilder between(String value) { + this.between = value; + return this; + } + + public ShippingDateParams build() { + return new ShippingDateParams(this); + } + } + } + + public static final class ShippedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private ShippedAtParams(ShippedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for ShippedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippedAtBuilder builder() { + return new ShippedAtBuilder(); + } + + public static final class ShippedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private ShippedAtBuilder() {} + + public ShippedAtBuilder after(String value) { + this.after = value; + return this; + } + + public ShippedAtBuilder before(String value) { + this.before = value; + return this; + } + + public ShippedAtBuilder on(String value) { + this.on = value; + return this; + } + + public ShippedAtBuilder between(String value) { + this.between = value; + return this; + } + + public ShippedAtParams build() { + return new ShippedAtParams(this); + } + } + } + + public static final class DeliveredAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private DeliveredAtParams(DeliveredAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for DeliveredAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DeliveredAtBuilder builder() { + return new DeliveredAtBuilder(); + } + + public static final class DeliveredAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private DeliveredAtBuilder() {} + + public DeliveredAtBuilder after(String value) { + this.after = value; + return this; + } + + public DeliveredAtBuilder before(String value) { + this.before = value; + return this; + } + + public DeliveredAtBuilder on(String value) { + this.on = value; + return this; + } + + public DeliveredAtBuilder between(String value) { + this.between = value; + return this; + } + + public DeliveredAtParams build() { + return new DeliveredAtParams(this); + } + } + } + + public static final class CancelledAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private CancelledAtParams(CancelledAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for CancelledAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CancelledAtBuilder builder() { + return new CancelledAtBuilder(); + } + + public static final class CancelledAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private CancelledAtBuilder() {} + + public CancelledAtBuilder after(String value) { + this.after = value; + return this; + } + + public CancelledAtBuilder before(String value) { + this.before = value; + return this; + } + + public CancelledAtBuilder on(String value) { + this.on = value; + return this; + } + + public CancelledAtBuilder between(String value) { + this.between = value; + return this; + } + + public CancelledAtParams build() { + return new CancelledAtParams(this); + } + } + } + + public static final class AmountPaidParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private AmountPaidParams(AmountPaidBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for AmountPaidParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AmountPaidBuilder builder() { + return new AmountPaidBuilder(); + } + + public static final class AmountPaidBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private AmountPaidBuilder() {} + + public AmountPaidBuilder is(String value) { + this.is = value; + return this; + } + + public AmountPaidBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public AmountPaidBuilder lt(String value) { + this.lt = value; + return this; + } + + public AmountPaidBuilder lte(String value) { + this.lte = value; + return this; + } + + public AmountPaidBuilder gt(String value) { + this.gt = value; + return this; + } + + public AmountPaidBuilder gte(String value) { + this.gte = value; + return this; + } + + public AmountPaidBuilder between(String value) { + this.between = value; + return this; + } + + public AmountPaidParams build() { + return new AmountPaidParams(this); + } + } + } + + public static final class RefundableCreditsParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private RefundableCreditsParams(RefundableCreditsBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for RefundableCreditsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RefundableCreditsBuilder builder() { + return new RefundableCreditsBuilder(); + } + + public static final class RefundableCreditsBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private RefundableCreditsBuilder() {} + + public RefundableCreditsBuilder is(String value) { + this.is = value; + return this; + } + + public RefundableCreditsBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public RefundableCreditsBuilder lt(String value) { + this.lt = value; + return this; + } + + public RefundableCreditsBuilder lte(String value) { + this.lte = value; + return this; + } + + public RefundableCreditsBuilder gt(String value) { + this.gt = value; + return this; + } + + public RefundableCreditsBuilder gte(String value) { + this.gte = value; + return this; + } + + public RefundableCreditsBuilder between(String value) { + this.between = value; + return this; + } + + public RefundableCreditsParams build() { + return new RefundableCreditsParams(this); + } + } + } + + public static final class RefundableCreditsIssuedParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private RefundableCreditsIssuedParams(RefundableCreditsIssuedBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for RefundableCreditsIssuedParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RefundableCreditsIssuedBuilder builder() { + return new RefundableCreditsIssuedBuilder(); + } + + public static final class RefundableCreditsIssuedBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private RefundableCreditsIssuedBuilder() {} + + public RefundableCreditsIssuedBuilder is(String value) { + this.is = value; + return this; + } + + public RefundableCreditsIssuedBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public RefundableCreditsIssuedBuilder lt(String value) { + this.lt = value; + return this; + } + + public RefundableCreditsIssuedBuilder lte(String value) { + this.lte = value; + return this; + } + + public RefundableCreditsIssuedBuilder gt(String value) { + this.gt = value; + return this; + } + + public RefundableCreditsIssuedBuilder gte(String value) { + this.gte = value; + return this; + } + + public RefundableCreditsIssuedBuilder between(String value) { + this.between = value; + return this; + } + + public RefundableCreditsIssuedParams build() { + return new RefundableCreditsIssuedParams(this); + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } + + public static final class ResentStatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ResentStatusParams(ResentStatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ResentStatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ResentStatusBuilder builder() { + return new ResentStatusBuilder(); + } + + public static final class ResentStatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ResentStatusBuilder() {} + + public ResentStatusBuilder is(Is value) { + this.is = value; + return this; + } + + public ResentStatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ResentStatusBuilder in(String value) { + this.in = value; + return this; + } + + public ResentStatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ResentStatusParams build() { + return new ResentStatusParams(this); + } + } + + public enum Is { + FULLY_RESENT("fully_resent"), + + PARTIALLY_RESENT("partially_resent"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + FULLY_RESENT("fully_resent"), + + PARTIALLY_RESENT("partially_resent"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class IsResentParams { + + private final Is is; + + private IsResentParams(IsResentBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for IsResentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IsResentBuilder builder() { + return new IsResentBuilder(); + } + + public static final class IsResentBuilder { + + private Is is; + + private IsResentBuilder() {} + + public IsResentBuilder is(Is value) { + this.is = value; + return this; + } + + public IsResentParams build() { + return new IsResentParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class OriginalOrderIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private OriginalOrderIdParams(OriginalOrderIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for OriginalOrderIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OriginalOrderIdBuilder builder() { + return new OriginalOrderIdBuilder(); + } + + public static final class OriginalOrderIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private OriginalOrderIdBuilder() {} + + public OriginalOrderIdBuilder is(String value) { + this.is = value; + return this; + } + + public OriginalOrderIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public OriginalOrderIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public OriginalOrderIdParams build() { + return new OriginalOrderIdParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportPlansParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportPlansParams.java new file mode 100644 index 00000000..8c9f2c59 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportPlansParams.java @@ -0,0 +1,2374 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportPlansParams { + + private final CurrencyCodeParams currencyCode; + + private final PlanParams plan; + + private ExportPlansParams(ExportPlansBuilder builder) { + + this.currencyCode = builder.currencyCode; + + this.plan = builder.plan; + } + + public CurrencyCodeParams getCurrencyCode() { + return currencyCode; + } + + public PlanParams getPlan() { + return plan; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.currencyCode != null) { + + // Single object + Map nestedData = this.currencyCode.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "currency_code[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.plan != null) { + + // Single object + Map nestedData = this.plan.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "plan[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportPlansParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportPlansBuilder builder() { + return new ExportPlansBuilder(); + } + + public static final class ExportPlansBuilder { + + private CurrencyCodeParams currencyCode; + + private PlanParams plan; + + private ExportPlansBuilder() {} + + public ExportPlansBuilder currencyCode(CurrencyCodeParams value) { + this.currencyCode = value; + return this; + } + + public ExportPlansBuilder plan(PlanParams value) { + this.plan = value; + return this; + } + + public ExportPlansParams build() { + return new ExportPlansParams(this); + } + } + + public static final class CurrencyCodeParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private CurrencyCodeParams(CurrencyCodeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for CurrencyCodeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CurrencyCodeBuilder builder() { + return new CurrencyCodeBuilder(); + } + + public static final class CurrencyCodeBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private CurrencyCodeBuilder() {} + + public CurrencyCodeBuilder is(String value) { + this.is = value; + return this; + } + + public CurrencyCodeBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CurrencyCodeBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CurrencyCodeBuilder in(String value) { + this.in = value; + return this; + } + + public CurrencyCodeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CurrencyCodeParams build() { + return new CurrencyCodeParams(this); + } + } + } + + public static final class PlanParams { + + private final IdParams id; + + private final NameParams name; + + private final PriceParams price; + + private final PeriodParams period; + + private final PeriodUnitParams periodUnit; + + private final TrialPeriodParams trialPeriod; + + private final TrialPeriodUnitParams trialPeriodUnit; + + private final AddonApplicabilityParams addonApplicability; + + private final GiftableParams giftable; + + private final StatusParams status; + + private final UpdatedAtParams updatedAt; + + private final ChannelParams channel; + + private PlanParams(PlanBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.price = builder.price; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.trialPeriod = builder.trialPeriod; + + this.trialPeriodUnit = builder.trialPeriodUnit; + + this.addonApplicability = builder.addonApplicability; + + this.giftable = builder.giftable; + + this.status = builder.status; + + this.updatedAt = builder.updatedAt; + + this.channel = builder.channel; + } + + public IdParams getId() { + return id; + } + + public NameParams getName() { + return name; + } + + public PriceParams getPrice() { + return price; + } + + public PeriodParams getPeriod() { + return period; + } + + public PeriodUnitParams getPeriodUnit() { + return periodUnit; + } + + public TrialPeriodParams getTrialPeriod() { + return trialPeriod; + } + + public TrialPeriodUnitParams getTrialPeriodUnit() { + return trialPeriodUnit; + } + + public AddonApplicabilityParams getAddonApplicability() { + return addonApplicability; + } + + public GiftableParams getGiftable() { + return giftable; + } + + public StatusParams getStatus() { + return status; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + public ChannelParams getChannel() { + return channel; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.name != null) { + + // Single object + Map nestedData = this.name.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "name[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.price != null) { + + // Single object + Map nestedData = this.price.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "price[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.period != null) { + + // Single object + Map nestedData = this.period.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "period[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.periodUnit != null) { + + // Single object + Map nestedData = this.periodUnit.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "period_unit[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.trialPeriod != null) { + + // Single object + Map nestedData = this.trialPeriod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "trial_period[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.trialPeriodUnit != null) { + + // Single object + Map nestedData = this.trialPeriodUnit.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "trial_period_unit[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addonApplicability != null) { + + // Single object + Map nestedData = this.addonApplicability.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "addon_applicability[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.giftable != null) { + + // Single object + Map nestedData = this.giftable.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "giftable[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.status != null) { + + // Single object + Map nestedData = this.status.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.channel != null) { + + // Single object + Map nestedData = this.channel.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "channel[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for PlanParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PlanBuilder builder() { + return new PlanBuilder(); + } + + public static final class PlanBuilder { + + private IdParams id; + + private NameParams name; + + private PriceParams price; + + private PeriodParams period; + + private PeriodUnitParams periodUnit; + + private TrialPeriodParams trialPeriod; + + private TrialPeriodUnitParams trialPeriodUnit; + + private AddonApplicabilityParams addonApplicability; + + private GiftableParams giftable; + + private StatusParams status; + + private UpdatedAtParams updatedAt; + + private ChannelParams channel; + + private PlanBuilder() {} + + public PlanBuilder id(IdParams value) { + this.id = value; + return this; + } + + public PlanBuilder name(NameParams value) { + this.name = value; + return this; + } + + public PlanBuilder price(PriceParams value) { + this.price = value; + return this; + } + + public PlanBuilder period(PeriodParams value) { + this.period = value; + return this; + } + + public PlanBuilder periodUnit(PeriodUnitParams value) { + this.periodUnit = value; + return this; + } + + public PlanBuilder trialPeriod(TrialPeriodParams value) { + this.trialPeriod = value; + return this; + } + + public PlanBuilder trialPeriodUnit(TrialPeriodUnitParams value) { + this.trialPeriodUnit = value; + return this; + } + + public PlanBuilder addonApplicability(AddonApplicabilityParams value) { + this.addonApplicability = value; + return this; + } + + public PlanBuilder giftable(GiftableParams value) { + this.giftable = value; + return this; + } + + public PlanBuilder status(StatusParams value) { + this.status = value; + return this; + } + + public PlanBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public PlanBuilder channel(ChannelParams value) { + this.channel = value; + return this; + } + + public PlanParams build() { + return new PlanParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class NameParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private NameParams(NameBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for NameParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NameBuilder builder() { + return new NameBuilder(); + } + + public static final class NameBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private NameBuilder() {} + + public NameBuilder is(String value) { + this.is = value; + return this; + } + + public NameBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public NameBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public NameBuilder in(String value) { + this.in = value; + return this; + } + + public NameBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public NameParams build() { + return new NameParams(this); + } + } + } + + public static final class PriceParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private PriceParams(PriceBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for PriceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PriceBuilder builder() { + return new PriceBuilder(); + } + + public static final class PriceBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private PriceBuilder() {} + + public PriceBuilder is(String value) { + this.is = value; + return this; + } + + public PriceBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PriceBuilder lt(String value) { + this.lt = value; + return this; + } + + public PriceBuilder lte(String value) { + this.lte = value; + return this; + } + + public PriceBuilder gt(String value) { + this.gt = value; + return this; + } + + public PriceBuilder gte(String value) { + this.gte = value; + return this; + } + + public PriceBuilder between(String value) { + this.between = value; + return this; + } + + public PriceParams build() { + return new PriceParams(this); + } + } + } + + public static final class PeriodParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private PeriodParams(PeriodBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for PeriodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PeriodBuilder builder() { + return new PeriodBuilder(); + } + + public static final class PeriodBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private PeriodBuilder() {} + + public PeriodBuilder is(String value) { + this.is = value; + return this; + } + + public PeriodBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PeriodBuilder lt(String value) { + this.lt = value; + return this; + } + + public PeriodBuilder lte(String value) { + this.lte = value; + return this; + } + + public PeriodBuilder gt(String value) { + this.gt = value; + return this; + } + + public PeriodBuilder gte(String value) { + this.gte = value; + return this; + } + + public PeriodBuilder between(String value) { + this.between = value; + return this; + } + + public PeriodParams build() { + return new PeriodParams(this); + } + } + } + + public static final class PeriodUnitParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private PeriodUnitParams(PeriodUnitBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PeriodUnitParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PeriodUnitBuilder builder() { + return new PeriodUnitBuilder(); + } + + public static final class PeriodUnitBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private PeriodUnitBuilder() {} + + public PeriodUnitBuilder is(Is value) { + this.is = value; + return this; + } + + public PeriodUnitBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public PeriodUnitBuilder in(String value) { + this.in = value; + return this; + } + + public PeriodUnitBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PeriodUnitParams build() { + return new PeriodUnitParams(this); + } + } + + public enum Is { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TrialPeriodParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private final IsPresent isPresent; + + private TrialPeriodParams(TrialPeriodBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for TrialPeriodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TrialPeriodBuilder builder() { + return new TrialPeriodBuilder(); + } + + public static final class TrialPeriodBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private IsPresent isPresent; + + private TrialPeriodBuilder() {} + + public TrialPeriodBuilder is(String value) { + this.is = value; + return this; + } + + public TrialPeriodBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public TrialPeriodBuilder lt(String value) { + this.lt = value; + return this; + } + + public TrialPeriodBuilder lte(String value) { + this.lte = value; + return this; + } + + public TrialPeriodBuilder gt(String value) { + this.gt = value; + return this; + } + + public TrialPeriodBuilder gte(String value) { + this.gte = value; + return this; + } + + public TrialPeriodBuilder between(String value) { + this.between = value; + return this; + } + + public TrialPeriodBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public TrialPeriodParams build() { + return new TrialPeriodParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TrialPeriodUnitParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private TrialPeriodUnitParams(TrialPeriodUnitBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for TrialPeriodUnitParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TrialPeriodUnitBuilder builder() { + return new TrialPeriodUnitBuilder(); + } + + public static final class TrialPeriodUnitBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private TrialPeriodUnitBuilder() {} + + public TrialPeriodUnitBuilder is(Is value) { + this.is = value; + return this; + } + + public TrialPeriodUnitBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public TrialPeriodUnitBuilder in(String value) { + this.in = value; + return this; + } + + public TrialPeriodUnitBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public TrialPeriodUnitParams build() { + return new TrialPeriodUnitParams(this); + } + } + + public enum Is { + DAY("day"), + + MONTH("month"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + DAY("day"), + + MONTH("month"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AddonApplicabilityParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private AddonApplicabilityParams(AddonApplicabilityBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for AddonApplicabilityParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonApplicabilityBuilder builder() { + return new AddonApplicabilityBuilder(); + } + + public static final class AddonApplicabilityBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private AddonApplicabilityBuilder() {} + + public AddonApplicabilityBuilder is(Is value) { + this.is = value; + return this; + } + + public AddonApplicabilityBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public AddonApplicabilityBuilder in(String value) { + this.in = value; + return this; + } + + public AddonApplicabilityBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public AddonApplicabilityParams build() { + return new AddonApplicabilityParams(this); + } + } + + public enum Is { + ALL("all"), + + RESTRICTED("restricted"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + ALL("all"), + + RESTRICTED("restricted"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class GiftableParams { + + private final Is is; + + private GiftableParams(GiftableBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for GiftableParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GiftableBuilder builder() { + return new GiftableBuilder(); + } + + public static final class GiftableBuilder { + + private Is is; + + private GiftableBuilder() {} + + public GiftableBuilder is(Is value) { + this.is = value; + return this; + } + + public GiftableParams build() { + return new GiftableParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class StatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private StatusParams(StatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for StatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatusBuilder builder() { + return new StatusBuilder(); + } + + public static final class StatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private StatusBuilder() {} + + public StatusBuilder is(Is value) { + this.is = value; + return this; + } + + public StatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public StatusBuilder in(String value) { + this.in = value; + return this; + } + + public StatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public StatusParams build() { + return new StatusParams(this); + } + } + + public enum Is { + ACTIVE("active"), + + ARCHIVED("archived"), + + DELETED("deleted"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + ACTIVE("active"), + + ARCHIVED("archived"), + + DELETED("deleted"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } + + public static final class ChannelParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ChannelParams(ChannelBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ChannelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChannelBuilder builder() { + return new ChannelBuilder(); + } + + public static final class ChannelBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ChannelBuilder() {} + + public ChannelBuilder is(Is value) { + this.is = value; + return this; + } + + public ChannelBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ChannelBuilder in(String value) { + this.in = value; + return this; + } + + public ChannelBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ChannelParams build() { + return new ChannelParams(this); + } + } + + public enum Is { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportPriceVariantsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportPriceVariantsParams.java new file mode 100644 index 00000000..2c7604c9 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportPriceVariantsParams.java @@ -0,0 +1,1077 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportPriceVariantsParams { + + private final BusinessEntityIdParams businessEntityId; + + private final IncludeSiteLevelResourcesParams includeSiteLevelResources; + + private final PriceVariantParams priceVariant; + + private ExportPriceVariantsParams(ExportPriceVariantsBuilder builder) { + + this.businessEntityId = builder.businessEntityId; + + this.includeSiteLevelResources = builder.includeSiteLevelResources; + + this.priceVariant = builder.priceVariant; + } + + public BusinessEntityIdParams getBusinessEntityId() { + return businessEntityId; + } + + public IncludeSiteLevelResourcesParams getIncludeSiteLevelResources() { + return includeSiteLevelResources; + } + + public PriceVariantParams getPriceVariant() { + return priceVariant; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.businessEntityId != null) { + + // Single object + Map nestedData = this.businessEntityId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "business_entity_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.includeSiteLevelResources != null) { + + // Single object + Map nestedData = this.includeSiteLevelResources.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "include_site_level_resources[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.priceVariant != null) { + + // Single object + Map nestedData = this.priceVariant.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "price_variant[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportPriceVariantsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportPriceVariantsBuilder builder() { + return new ExportPriceVariantsBuilder(); + } + + public static final class ExportPriceVariantsBuilder { + + private BusinessEntityIdParams businessEntityId; + + private IncludeSiteLevelResourcesParams includeSiteLevelResources; + + private PriceVariantParams priceVariant; + + private ExportPriceVariantsBuilder() {} + + public ExportPriceVariantsBuilder businessEntityId(BusinessEntityIdParams value) { + this.businessEntityId = value; + return this; + } + + public ExportPriceVariantsBuilder includeSiteLevelResources( + IncludeSiteLevelResourcesParams value) { + this.includeSiteLevelResources = value; + return this; + } + + public ExportPriceVariantsBuilder priceVariant(PriceVariantParams value) { + this.priceVariant = value; + return this; + } + + public ExportPriceVariantsParams build() { + return new ExportPriceVariantsParams(this); + } + } + + public static final class BusinessEntityIdParams { + + private final IsPresent isPresent; + + private final String is; + + private BusinessEntityIdParams(BusinessEntityIdBuilder builder) { + + this.isPresent = builder.isPresent; + + this.is = builder.is; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + public String getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for BusinessEntityIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessEntityIdBuilder builder() { + return new BusinessEntityIdBuilder(); + } + + public static final class BusinessEntityIdBuilder { + + private IsPresent isPresent; + + private String is; + + private BusinessEntityIdBuilder() {} + + public BusinessEntityIdBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public BusinessEntityIdBuilder is(String value) { + this.is = value; + return this; + } + + public BusinessEntityIdParams build() { + return new BusinessEntityIdParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class IncludeSiteLevelResourcesParams { + + private final Is is; + + private IncludeSiteLevelResourcesParams(IncludeSiteLevelResourcesBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for IncludeSiteLevelResourcesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IncludeSiteLevelResourcesBuilder builder() { + return new IncludeSiteLevelResourcesBuilder(); + } + + public static final class IncludeSiteLevelResourcesBuilder { + + private Is is; + + private IncludeSiteLevelResourcesBuilder() {} + + public IncludeSiteLevelResourcesBuilder is(Is value) { + this.is = value; + return this; + } + + public IncludeSiteLevelResourcesParams build() { + return new IncludeSiteLevelResourcesParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PriceVariantParams { + + private final IdParams id; + + private final NameParams name; + + private final StatusParams status; + + private final UpdatedAtParams updatedAt; + + private final CreatedAtParams createdAt; + + private PriceVariantParams(PriceVariantBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.status = builder.status; + + this.updatedAt = builder.updatedAt; + + this.createdAt = builder.createdAt; + } + + public IdParams getId() { + return id; + } + + public NameParams getName() { + return name; + } + + public StatusParams getStatus() { + return status; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + public CreatedAtParams getCreatedAt() { + return createdAt; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.name != null) { + + // Single object + Map nestedData = this.name.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "name[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.status != null) { + + // Single object + Map nestedData = this.status.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.createdAt != null) { + + // Single object + Map nestedData = this.createdAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "created_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for PriceVariantParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PriceVariantBuilder builder() { + return new PriceVariantBuilder(); + } + + public static final class PriceVariantBuilder { + + private IdParams id; + + private NameParams name; + + private StatusParams status; + + private UpdatedAtParams updatedAt; + + private CreatedAtParams createdAt; + + private PriceVariantBuilder() {} + + public PriceVariantBuilder id(IdParams value) { + this.id = value; + return this; + } + + public PriceVariantBuilder name(NameParams value) { + this.name = value; + return this; + } + + public PriceVariantBuilder status(StatusParams value) { + this.status = value; + return this; + } + + public PriceVariantBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public PriceVariantBuilder createdAt(CreatedAtParams value) { + this.createdAt = value; + return this; + } + + public PriceVariantParams build() { + return new PriceVariantParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class NameParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private NameParams(NameBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for NameParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NameBuilder builder() { + return new NameBuilder(); + } + + public static final class NameBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private NameBuilder() {} + + public NameBuilder is(String value) { + this.is = value; + return this; + } + + public NameBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public NameBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public NameBuilder in(String value) { + this.in = value; + return this; + } + + public NameBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public NameParams build() { + return new NameParams(this); + } + } + } + + public static final class StatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private StatusParams(StatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for StatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatusBuilder builder() { + return new StatusBuilder(); + } + + public static final class StatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private StatusBuilder() {} + + public StatusBuilder is(Is value) { + this.is = value; + return this; + } + + public StatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public StatusBuilder in(String value) { + this.in = value; + return this; + } + + public StatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public StatusParams build() { + return new StatusParams(this); + } + } + + public enum Is { + ACTIVE("active"), + + ARCHIVED("archived"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + ACTIVE("active"), + + ARCHIVED("archived"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } + + public static final class CreatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private CreatedAtParams(CreatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for CreatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreatedAtBuilder builder() { + return new CreatedAtBuilder(); + } + + public static final class CreatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private CreatedAtBuilder() {} + + public CreatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public CreatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public CreatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public CreatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public CreatedAtParams build() { + return new CreatedAtParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/export/params/ExportRetrieveParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/export/params/ExportRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/export/params/ExportRetrieveParams.java index 2935fe83..325d4488 100644 --- a/src/main/java/com/chargebee/v4/core/models/export/params/ExportRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.export.params; +package com.chargebee.v4.models.export.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportRevenueRecognitionParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportRevenueRecognitionParams.java new file mode 100644 index 00000000..dc4994c4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportRevenueRecognitionParams.java @@ -0,0 +1,8574 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportRevenueRecognitionParams { + + private final ReportBy reportBy; + + private final String currencyCode; + + private final Integer reportFromMonth; + + private final Integer reportFromYear; + + private final Integer reportToMonth; + + private final Integer reportToYear; + + private final Boolean includeDiscounts; + + private final PaymentOwnerParams paymentOwner; + + private final ItemIdParams itemId; + + private final ItemPriceIdParams itemPriceId; + + private final CancelReasonCodeParams cancelReasonCode; + + private final BusinessEntityIdParams businessEntityId; + + private final InvoiceParams invoice; + + private final SubscriptionParams subscription; + + private final CustomerParams customer; + + private final RelationshipParams relationship; + + private ExportRevenueRecognitionParams(ExportRevenueRecognitionBuilder builder) { + + this.reportBy = builder.reportBy; + + this.currencyCode = builder.currencyCode; + + this.reportFromMonth = builder.reportFromMonth; + + this.reportFromYear = builder.reportFromYear; + + this.reportToMonth = builder.reportToMonth; + + this.reportToYear = builder.reportToYear; + + this.includeDiscounts = builder.includeDiscounts; + + this.paymentOwner = builder.paymentOwner; + + this.itemId = builder.itemId; + + this.itemPriceId = builder.itemPriceId; + + this.cancelReasonCode = builder.cancelReasonCode; + + this.businessEntityId = builder.businessEntityId; + + this.invoice = builder.invoice; + + this.subscription = builder.subscription; + + this.customer = builder.customer; + + this.relationship = builder.relationship; + } + + public ReportBy getReportBy() { + return reportBy; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public Integer getReportFromMonth() { + return reportFromMonth; + } + + public Integer getReportFromYear() { + return reportFromYear; + } + + public Integer getReportToMonth() { + return reportToMonth; + } + + public Integer getReportToYear() { + return reportToYear; + } + + public Boolean getIncludeDiscounts() { + return includeDiscounts; + } + + public PaymentOwnerParams getPaymentOwner() { + return paymentOwner; + } + + public ItemIdParams getItemId() { + return itemId; + } + + public ItemPriceIdParams getItemPriceId() { + return itemPriceId; + } + + public CancelReasonCodeParams getCancelReasonCode() { + return cancelReasonCode; + } + + public BusinessEntityIdParams getBusinessEntityId() { + return businessEntityId; + } + + public InvoiceParams getInvoice() { + return invoice; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public CustomerParams getCustomer() { + return customer; + } + + public RelationshipParams getRelationship() { + return relationship; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.reportBy != null) { + + formData.put("report_by", this.reportBy); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.reportFromMonth != null) { + + formData.put("report_from_month", this.reportFromMonth); + } + + if (this.reportFromYear != null) { + + formData.put("report_from_year", this.reportFromYear); + } + + if (this.reportToMonth != null) { + + formData.put("report_to_month", this.reportToMonth); + } + + if (this.reportToYear != null) { + + formData.put("report_to_year", this.reportToYear); + } + + if (this.includeDiscounts != null) { + + formData.put("include_discounts", this.includeDiscounts); + } + + if (this.paymentOwner != null) { + + // Single object + Map nestedData = this.paymentOwner.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_owner[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemId != null) { + + // Single object + Map nestedData = this.itemId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemPriceId != null) { + + // Single object + Map nestedData = this.itemPriceId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_price_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.cancelReasonCode != null) { + + // Single object + Map nestedData = this.cancelReasonCode.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "cancel_reason_code[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.businessEntityId != null) { + + // Single object + Map nestedData = this.businessEntityId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "business_entity_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.invoice != null) { + + // Single object + Map nestedData = this.invoice.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "invoice[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.relationship != null) { + + // Single object + Map nestedData = this.relationship.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "relationship[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportRevenueRecognitionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportRevenueRecognitionBuilder builder() { + return new ExportRevenueRecognitionBuilder(); + } + + public static final class ExportRevenueRecognitionBuilder { + + private ReportBy reportBy; + + private String currencyCode; + + private Integer reportFromMonth; + + private Integer reportFromYear; + + private Integer reportToMonth; + + private Integer reportToYear; + + private Boolean includeDiscounts; + + private PaymentOwnerParams paymentOwner; + + private ItemIdParams itemId; + + private ItemPriceIdParams itemPriceId; + + private CancelReasonCodeParams cancelReasonCode; + + private BusinessEntityIdParams businessEntityId; + + private InvoiceParams invoice; + + private SubscriptionParams subscription; + + private CustomerParams customer; + + private RelationshipParams relationship; + + private ExportRevenueRecognitionBuilder() {} + + public ExportRevenueRecognitionBuilder reportBy(ReportBy value) { + this.reportBy = value; + return this; + } + + public ExportRevenueRecognitionBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public ExportRevenueRecognitionBuilder reportFromMonth(Integer value) { + this.reportFromMonth = value; + return this; + } + + public ExportRevenueRecognitionBuilder reportFromYear(Integer value) { + this.reportFromYear = value; + return this; + } + + public ExportRevenueRecognitionBuilder reportToMonth(Integer value) { + this.reportToMonth = value; + return this; + } + + public ExportRevenueRecognitionBuilder reportToYear(Integer value) { + this.reportToYear = value; + return this; + } + + public ExportRevenueRecognitionBuilder includeDiscounts(Boolean value) { + this.includeDiscounts = value; + return this; + } + + public ExportRevenueRecognitionBuilder paymentOwner(PaymentOwnerParams value) { + this.paymentOwner = value; + return this; + } + + public ExportRevenueRecognitionBuilder itemId(ItemIdParams value) { + this.itemId = value; + return this; + } + + public ExportRevenueRecognitionBuilder itemPriceId(ItemPriceIdParams value) { + this.itemPriceId = value; + return this; + } + + public ExportRevenueRecognitionBuilder cancelReasonCode(CancelReasonCodeParams value) { + this.cancelReasonCode = value; + return this; + } + + public ExportRevenueRecognitionBuilder businessEntityId(BusinessEntityIdParams value) { + this.businessEntityId = value; + return this; + } + + public ExportRevenueRecognitionBuilder invoice(InvoiceParams value) { + this.invoice = value; + return this; + } + + public ExportRevenueRecognitionBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public ExportRevenueRecognitionBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public ExportRevenueRecognitionBuilder relationship(RelationshipParams value) { + this.relationship = value; + return this; + } + + public ExportRevenueRecognitionParams build() { + return new ExportRevenueRecognitionParams(this); + } + } + + public enum ReportBy { + CUSTOMER("customer"), + + INVOICE("invoice"), + + PRODUCT("product"), + + SUBSCRIPTION("subscription"), + + /** An enum member indicating that ReportBy was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ReportBy(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ReportBy fromString(String value) { + if (value == null) return _UNKNOWN; + for (ReportBy enumValue : ReportBy.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class PaymentOwnerParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private PaymentOwnerParams(PaymentOwnerBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PaymentOwnerParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentOwnerBuilder builder() { + return new PaymentOwnerBuilder(); + } + + public static final class PaymentOwnerBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private PaymentOwnerBuilder() {} + + public PaymentOwnerBuilder is(String value) { + this.is = value; + return this; + } + + public PaymentOwnerBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PaymentOwnerBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public PaymentOwnerBuilder in(String value) { + this.in = value; + return this; + } + + public PaymentOwnerBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PaymentOwnerParams build() { + return new PaymentOwnerParams(this); + } + } + } + + public static final class ItemIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ItemIdParams(ItemIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ItemIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemIdBuilder builder() { + return new ItemIdBuilder(); + } + + public static final class ItemIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ItemIdBuilder() {} + + public ItemIdBuilder is(String value) { + this.is = value; + return this; + } + + public ItemIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ItemIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ItemIdBuilder in(String value) { + this.in = value; + return this; + } + + public ItemIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ItemIdParams build() { + return new ItemIdParams(this); + } + } + } + + public static final class ItemPriceIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ItemPriceIdParams(ItemPriceIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ItemPriceIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemPriceIdBuilder builder() { + return new ItemPriceIdBuilder(); + } + + public static final class ItemPriceIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ItemPriceIdBuilder() {} + + public ItemPriceIdBuilder is(String value) { + this.is = value; + return this; + } + + public ItemPriceIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ItemPriceIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ItemPriceIdBuilder in(String value) { + this.in = value; + return this; + } + + public ItemPriceIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ItemPriceIdParams build() { + return new ItemPriceIdParams(this); + } + } + } + + public static final class CancelReasonCodeParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private CancelReasonCodeParams(CancelReasonCodeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for CancelReasonCodeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CancelReasonCodeBuilder builder() { + return new CancelReasonCodeBuilder(); + } + + public static final class CancelReasonCodeBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private CancelReasonCodeBuilder() {} + + public CancelReasonCodeBuilder is(String value) { + this.is = value; + return this; + } + + public CancelReasonCodeBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CancelReasonCodeBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CancelReasonCodeBuilder in(String value) { + this.in = value; + return this; + } + + public CancelReasonCodeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CancelReasonCodeParams build() { + return new CancelReasonCodeParams(this); + } + } + } + + public static final class BusinessEntityIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private BusinessEntityIdParams(BusinessEntityIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for BusinessEntityIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessEntityIdBuilder builder() { + return new BusinessEntityIdBuilder(); + } + + public static final class BusinessEntityIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private BusinessEntityIdBuilder() {} + + public BusinessEntityIdBuilder is(String value) { + this.is = value; + return this; + } + + public BusinessEntityIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public BusinessEntityIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public BusinessEntityIdParams build() { + return new BusinessEntityIdParams(this); + } + } + } + + public static final class InvoiceParams { + + private final IdParams id; + + private final RecurringParams recurring; + + private final StatusParams status; + + private final PriceTypeParams priceType; + + private final DateParams date; + + private final PaidAtParams paidAt; + + private final TotalParams total; + + private final AmountPaidParams amountPaid; + + private final AmountAdjustedParams amountAdjusted; + + private final CreditsAppliedParams creditsApplied; + + private final AmountDueParams amountDue; + + private final DunningStatusParams dunningStatus; + + private final UpdatedAtParams updatedAt; + + private final ChannelParams channel; + + private InvoiceParams(InvoiceBuilder builder) { + + this.id = builder.id; + + this.recurring = builder.recurring; + + this.status = builder.status; + + this.priceType = builder.priceType; + + this.date = builder.date; + + this.paidAt = builder.paidAt; + + this.total = builder.total; + + this.amountPaid = builder.amountPaid; + + this.amountAdjusted = builder.amountAdjusted; + + this.creditsApplied = builder.creditsApplied; + + this.amountDue = builder.amountDue; + + this.dunningStatus = builder.dunningStatus; + + this.updatedAt = builder.updatedAt; + + this.channel = builder.channel; + } + + public IdParams getId() { + return id; + } + + public RecurringParams getRecurring() { + return recurring; + } + + public StatusParams getStatus() { + return status; + } + + public PriceTypeParams getPriceType() { + return priceType; + } + + public DateParams getDate() { + return date; + } + + public PaidAtParams getPaidAt() { + return paidAt; + } + + public TotalParams getTotal() { + return total; + } + + public AmountPaidParams getAmountPaid() { + return amountPaid; + } + + public AmountAdjustedParams getAmountAdjusted() { + return amountAdjusted; + } + + public CreditsAppliedParams getCreditsApplied() { + return creditsApplied; + } + + public AmountDueParams getAmountDue() { + return amountDue; + } + + public DunningStatusParams getDunningStatus() { + return dunningStatus; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + public ChannelParams getChannel() { + return channel; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.recurring != null) { + + // Single object + Map nestedData = this.recurring.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "recurring[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.status != null) { + + // Single object + Map nestedData = this.status.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.priceType != null) { + + // Single object + Map nestedData = this.priceType.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "price_type[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.date != null) { + + // Single object + Map nestedData = this.date.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "date[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paidAt != null) { + + // Single object + Map nestedData = this.paidAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "paid_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.total != null) { + + // Single object + Map nestedData = this.total.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "total[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.amountPaid != null) { + + // Single object + Map nestedData = this.amountPaid.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "amount_paid[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.amountAdjusted != null) { + + // Single object + Map nestedData = this.amountAdjusted.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "amount_adjusted[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.creditsApplied != null) { + + // Single object + Map nestedData = this.creditsApplied.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "credits_applied[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.amountDue != null) { + + // Single object + Map nestedData = this.amountDue.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "amount_due[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.dunningStatus != null) { + + // Single object + Map nestedData = this.dunningStatus.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "dunning_status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.channel != null) { + + // Single object + Map nestedData = this.channel.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "channel[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for InvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceBuilder builder() { + return new InvoiceBuilder(); + } + + public static final class InvoiceBuilder { + + private IdParams id; + + private RecurringParams recurring; + + private StatusParams status; + + private PriceTypeParams priceType; + + private DateParams date; + + private PaidAtParams paidAt; + + private TotalParams total; + + private AmountPaidParams amountPaid; + + private AmountAdjustedParams amountAdjusted; + + private CreditsAppliedParams creditsApplied; + + private AmountDueParams amountDue; + + private DunningStatusParams dunningStatus; + + private UpdatedAtParams updatedAt; + + private ChannelParams channel; + + private InvoiceBuilder() {} + + public InvoiceBuilder id(IdParams value) { + this.id = value; + return this; + } + + public InvoiceBuilder recurring(RecurringParams value) { + this.recurring = value; + return this; + } + + public InvoiceBuilder status(StatusParams value) { + this.status = value; + return this; + } + + public InvoiceBuilder priceType(PriceTypeParams value) { + this.priceType = value; + return this; + } + + public InvoiceBuilder date(DateParams value) { + this.date = value; + return this; + } + + public InvoiceBuilder paidAt(PaidAtParams value) { + this.paidAt = value; + return this; + } + + public InvoiceBuilder total(TotalParams value) { + this.total = value; + return this; + } + + public InvoiceBuilder amountPaid(AmountPaidParams value) { + this.amountPaid = value; + return this; + } + + public InvoiceBuilder amountAdjusted(AmountAdjustedParams value) { + this.amountAdjusted = value; + return this; + } + + public InvoiceBuilder creditsApplied(CreditsAppliedParams value) { + this.creditsApplied = value; + return this; + } + + public InvoiceBuilder amountDue(AmountDueParams value) { + this.amountDue = value; + return this; + } + + public InvoiceBuilder dunningStatus(DunningStatusParams value) { + this.dunningStatus = value; + return this; + } + + public InvoiceBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public InvoiceBuilder channel(ChannelParams value) { + this.channel = value; + return this; + } + + public InvoiceParams build() { + return new InvoiceParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class RecurringParams { + + private final Is is; + + private RecurringParams(RecurringBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for RecurringParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RecurringBuilder builder() { + return new RecurringBuilder(); + } + + public static final class RecurringBuilder { + + private Is is; + + private RecurringBuilder() {} + + public RecurringBuilder is(Is value) { + this.is = value; + return this; + } + + public RecurringParams build() { + return new RecurringParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class StatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private StatusParams(StatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for StatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatusBuilder builder() { + return new StatusBuilder(); + } + + public static final class StatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private StatusBuilder() {} + + public StatusBuilder is(Is value) { + this.is = value; + return this; + } + + public StatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public StatusBuilder in(String value) { + this.in = value; + return this; + } + + public StatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public StatusParams build() { + return new StatusParams(this); + } + } + + public enum Is { + PAID("paid"), + + POSTED("posted"), + + PAYMENT_DUE("payment_due"), + + NOT_PAID("not_paid"), + + VOIDED("voided"), + + PENDING("pending"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + PAID("paid"), + + POSTED("posted"), + + PAYMENT_DUE("payment_due"), + + NOT_PAID("not_paid"), + + VOIDED("voided"), + + PENDING("pending"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PriceTypeParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private PriceTypeParams(PriceTypeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PriceTypeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PriceTypeBuilder builder() { + return new PriceTypeBuilder(); + } + + public static final class PriceTypeBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private PriceTypeBuilder() {} + + public PriceTypeBuilder is(Is value) { + this.is = value; + return this; + } + + public PriceTypeBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public PriceTypeBuilder in(String value) { + this.in = value; + return this; + } + + public PriceTypeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PriceTypeParams build() { + return new PriceTypeParams(this); + } + } + + public enum Is { + TAX_EXCLUSIVE("tax_exclusive"), + + TAX_INCLUSIVE("tax_inclusive"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + TAX_EXCLUSIVE("tax_exclusive"), + + TAX_INCLUSIVE("tax_inclusive"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DateParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private DateParams(DateBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for DateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DateBuilder builder() { + return new DateBuilder(); + } + + public static final class DateBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private DateBuilder() {} + + public DateBuilder after(String value) { + this.after = value; + return this; + } + + public DateBuilder before(String value) { + this.before = value; + return this; + } + + public DateBuilder on(String value) { + this.on = value; + return this; + } + + public DateBuilder between(String value) { + this.between = value; + return this; + } + + public DateParams build() { + return new DateParams(this); + } + } + } + + public static final class PaidAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private PaidAtParams(PaidAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for PaidAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaidAtBuilder builder() { + return new PaidAtBuilder(); + } + + public static final class PaidAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private PaidAtBuilder() {} + + public PaidAtBuilder after(String value) { + this.after = value; + return this; + } + + public PaidAtBuilder before(String value) { + this.before = value; + return this; + } + + public PaidAtBuilder on(String value) { + this.on = value; + return this; + } + + public PaidAtBuilder between(String value) { + this.between = value; + return this; + } + + public PaidAtParams build() { + return new PaidAtParams(this); + } + } + } + + public static final class TotalParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private TotalParams(TotalBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for TotalParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TotalBuilder builder() { + return new TotalBuilder(); + } + + public static final class TotalBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private TotalBuilder() {} + + public TotalBuilder is(String value) { + this.is = value; + return this; + } + + public TotalBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public TotalBuilder lt(String value) { + this.lt = value; + return this; + } + + public TotalBuilder lte(String value) { + this.lte = value; + return this; + } + + public TotalBuilder gt(String value) { + this.gt = value; + return this; + } + + public TotalBuilder gte(String value) { + this.gte = value; + return this; + } + + public TotalBuilder between(String value) { + this.between = value; + return this; + } + + public TotalParams build() { + return new TotalParams(this); + } + } + } + + public static final class AmountPaidParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private AmountPaidParams(AmountPaidBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for AmountPaidParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AmountPaidBuilder builder() { + return new AmountPaidBuilder(); + } + + public static final class AmountPaidBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private AmountPaidBuilder() {} + + public AmountPaidBuilder is(String value) { + this.is = value; + return this; + } + + public AmountPaidBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public AmountPaidBuilder lt(String value) { + this.lt = value; + return this; + } + + public AmountPaidBuilder lte(String value) { + this.lte = value; + return this; + } + + public AmountPaidBuilder gt(String value) { + this.gt = value; + return this; + } + + public AmountPaidBuilder gte(String value) { + this.gte = value; + return this; + } + + public AmountPaidBuilder between(String value) { + this.between = value; + return this; + } + + public AmountPaidParams build() { + return new AmountPaidParams(this); + } + } + } + + public static final class AmountAdjustedParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private AmountAdjustedParams(AmountAdjustedBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for AmountAdjustedParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AmountAdjustedBuilder builder() { + return new AmountAdjustedBuilder(); + } + + public static final class AmountAdjustedBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private AmountAdjustedBuilder() {} + + public AmountAdjustedBuilder is(String value) { + this.is = value; + return this; + } + + public AmountAdjustedBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public AmountAdjustedBuilder lt(String value) { + this.lt = value; + return this; + } + + public AmountAdjustedBuilder lte(String value) { + this.lte = value; + return this; + } + + public AmountAdjustedBuilder gt(String value) { + this.gt = value; + return this; + } + + public AmountAdjustedBuilder gte(String value) { + this.gte = value; + return this; + } + + public AmountAdjustedBuilder between(String value) { + this.between = value; + return this; + } + + public AmountAdjustedParams build() { + return new AmountAdjustedParams(this); + } + } + } + + public static final class CreditsAppliedParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private CreditsAppliedParams(CreditsAppliedBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for CreditsAppliedParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditsAppliedBuilder builder() { + return new CreditsAppliedBuilder(); + } + + public static final class CreditsAppliedBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private CreditsAppliedBuilder() {} + + public CreditsAppliedBuilder is(String value) { + this.is = value; + return this; + } + + public CreditsAppliedBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CreditsAppliedBuilder lt(String value) { + this.lt = value; + return this; + } + + public CreditsAppliedBuilder lte(String value) { + this.lte = value; + return this; + } + + public CreditsAppliedBuilder gt(String value) { + this.gt = value; + return this; + } + + public CreditsAppliedBuilder gte(String value) { + this.gte = value; + return this; + } + + public CreditsAppliedBuilder between(String value) { + this.between = value; + return this; + } + + public CreditsAppliedParams build() { + return new CreditsAppliedParams(this); + } + } + } + + public static final class AmountDueParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private AmountDueParams(AmountDueBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for AmountDueParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AmountDueBuilder builder() { + return new AmountDueBuilder(); + } + + public static final class AmountDueBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private AmountDueBuilder() {} + + public AmountDueBuilder is(String value) { + this.is = value; + return this; + } + + public AmountDueBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public AmountDueBuilder lt(String value) { + this.lt = value; + return this; + } + + public AmountDueBuilder lte(String value) { + this.lte = value; + return this; + } + + public AmountDueBuilder gt(String value) { + this.gt = value; + return this; + } + + public AmountDueBuilder gte(String value) { + this.gte = value; + return this; + } + + public AmountDueBuilder between(String value) { + this.between = value; + return this; + } + + public AmountDueParams build() { + return new AmountDueParams(this); + } + } + } + + public static final class DunningStatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private final IsPresent isPresent; + + private DunningStatusParams(DunningStatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + + this.isPresent = builder.isPresent; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for DunningStatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DunningStatusBuilder builder() { + return new DunningStatusBuilder(); + } + + public static final class DunningStatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private IsPresent isPresent; + + private DunningStatusBuilder() {} + + public DunningStatusBuilder is(Is value) { + this.is = value; + return this; + } + + public DunningStatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public DunningStatusBuilder in(String value) { + this.in = value; + return this; + } + + public DunningStatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public DunningStatusBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public DunningStatusParams build() { + return new DunningStatusParams(this); + } + } + + public enum Is { + IN_PROGRESS("in_progress"), + + EXHAUSTED("exhausted"), + + STOPPED("stopped"), + + SUCCESS("success"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + IN_PROGRESS("in_progress"), + + EXHAUSTED("exhausted"), + + STOPPED("stopped"), + + SUCCESS("success"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } + + public static final class ChannelParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ChannelParams(ChannelBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ChannelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChannelBuilder builder() { + return new ChannelBuilder(); + } + + public static final class ChannelBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ChannelBuilder() {} + + public ChannelBuilder is(Is value) { + this.is = value; + return this; + } + + public ChannelBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ChannelBuilder in(String value) { + this.in = value; + return this; + } + + public ChannelBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ChannelParams build() { + return new ChannelParams(this); + } + } + + public enum Is { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class SubscriptionParams { + + private final ExportIdParams id; + + private final CustomerIdParams customerId; + + private final ExportStatusParams status; + + private final CancelReasonParams cancelReason; + + private final RemainingBillingCyclesParams remainingBillingCycles; + + private final CreatedAtParams createdAt; + + private final ActivatedAtParams activatedAt; + + private final NextBillingAtParams nextBillingAt; + + private final CancelledAtParams cancelledAt; + + private final HasScheduledChangesParams hasScheduledChanges; + + private final ExportUpdatedAtParams updatedAt; + + private final OfflinePaymentMethodParams offlinePaymentMethod; + + private final AutoCloseInvoicesParams autoCloseInvoices; + + private final ExportChannelParams channel; + + private final PlanIdParams planId; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.customerId = builder.customerId; + + this.status = builder.status; + + this.cancelReason = builder.cancelReason; + + this.remainingBillingCycles = builder.remainingBillingCycles; + + this.createdAt = builder.createdAt; + + this.activatedAt = builder.activatedAt; + + this.nextBillingAt = builder.nextBillingAt; + + this.cancelledAt = builder.cancelledAt; + + this.hasScheduledChanges = builder.hasScheduledChanges; + + this.updatedAt = builder.updatedAt; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.autoCloseInvoices = builder.autoCloseInvoices; + + this.channel = builder.channel; + + this.planId = builder.planId; + } + + public ExportIdParams getId() { + return id; + } + + public CustomerIdParams getCustomerId() { + return customerId; + } + + public ExportStatusParams getStatus() { + return status; + } + + public CancelReasonParams getCancelReason() { + return cancelReason; + } + + public RemainingBillingCyclesParams getRemainingBillingCycles() { + return remainingBillingCycles; + } + + public CreatedAtParams getCreatedAt() { + return createdAt; + } + + public ActivatedAtParams getActivatedAt() { + return activatedAt; + } + + public NextBillingAtParams getNextBillingAt() { + return nextBillingAt; + } + + public CancelledAtParams getCancelledAt() { + return cancelledAt; + } + + public HasScheduledChangesParams getHasScheduledChanges() { + return hasScheduledChanges; + } + + public ExportUpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + public OfflinePaymentMethodParams getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public AutoCloseInvoicesParams getAutoCloseInvoices() { + return autoCloseInvoices; + } + + public ExportChannelParams getChannel() { + return channel; + } + + public PlanIdParams getPlanId() { + return planId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.customerId != null) { + + // Single object + Map nestedData = this.customerId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "customer_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.status != null) { + + // Single object + Map nestedData = this.status.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.cancelReason != null) { + + // Single object + Map nestedData = this.cancelReason.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "cancel_reason[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.remainingBillingCycles != null) { + + // Single object + Map nestedData = this.remainingBillingCycles.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "remaining_billing_cycles[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.createdAt != null) { + + // Single object + Map nestedData = this.createdAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "created_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.activatedAt != null) { + + // Single object + Map nestedData = this.activatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "activated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.nextBillingAt != null) { + + // Single object + Map nestedData = this.nextBillingAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "next_billing_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.cancelledAt != null) { + + // Single object + Map nestedData = this.cancelledAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "cancelled_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.hasScheduledChanges != null) { + + // Single object + Map nestedData = this.hasScheduledChanges.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "has_scheduled_changes[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.offlinePaymentMethod != null) { + + // Single object + Map nestedData = this.offlinePaymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "offline_payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.autoCloseInvoices != null) { + + // Single object + Map nestedData = this.autoCloseInvoices.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "auto_close_invoices[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.channel != null) { + + // Single object + Map nestedData = this.channel.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "channel[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.planId != null) { + + // Single object + Map nestedData = this.planId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "plan_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private ExportIdParams id; + + private CustomerIdParams customerId; + + private ExportStatusParams status; + + private CancelReasonParams cancelReason; + + private RemainingBillingCyclesParams remainingBillingCycles; + + private CreatedAtParams createdAt; + + private ActivatedAtParams activatedAt; + + private NextBillingAtParams nextBillingAt; + + private CancelledAtParams cancelledAt; + + private HasScheduledChangesParams hasScheduledChanges; + + private ExportUpdatedAtParams updatedAt; + + private OfflinePaymentMethodParams offlinePaymentMethod; + + private AutoCloseInvoicesParams autoCloseInvoices; + + private ExportChannelParams channel; + + private PlanIdParams planId; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(ExportIdParams value) { + this.id = value; + return this; + } + + public SubscriptionBuilder customerId(CustomerIdParams value) { + this.customerId = value; + return this; + } + + public SubscriptionBuilder status(ExportStatusParams value) { + this.status = value; + return this; + } + + public SubscriptionBuilder cancelReason(CancelReasonParams value) { + this.cancelReason = value; + return this; + } + + public SubscriptionBuilder remainingBillingCycles(RemainingBillingCyclesParams value) { + this.remainingBillingCycles = value; + return this; + } + + public SubscriptionBuilder createdAt(CreatedAtParams value) { + this.createdAt = value; + return this; + } + + public SubscriptionBuilder activatedAt(ActivatedAtParams value) { + this.activatedAt = value; + return this; + } + + public SubscriptionBuilder nextBillingAt(NextBillingAtParams value) { + this.nextBillingAt = value; + return this; + } + + public SubscriptionBuilder cancelledAt(CancelledAtParams value) { + this.cancelledAt = value; + return this; + } + + public SubscriptionBuilder hasScheduledChanges(HasScheduledChangesParams value) { + this.hasScheduledChanges = value; + return this; + } + + public SubscriptionBuilder updatedAt(ExportUpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethodParams value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder autoCloseInvoices(AutoCloseInvoicesParams value) { + this.autoCloseInvoices = value; + return this; + } + + public SubscriptionBuilder channel(ExportChannelParams value) { + this.channel = value; + return this; + } + + public SubscriptionBuilder planId(PlanIdParams value) { + this.planId = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + } + + public static final class ExportIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ExportIdParams(ExportIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ExportIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportIdBuilder builder() { + return new ExportIdBuilder(); + } + + public static final class ExportIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ExportIdBuilder() {} + + public ExportIdBuilder is(String value) { + this.is = value; + return this; + } + + public ExportIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ExportIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ExportIdBuilder in(String value) { + this.in = value; + return this; + } + + public ExportIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ExportIdParams build() { + return new ExportIdParams(this); + } + } + } + + public static final class CustomerIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private CustomerIdParams(CustomerIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for CustomerIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerIdBuilder builder() { + return new CustomerIdBuilder(); + } + + public static final class CustomerIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private CustomerIdBuilder() {} + + public CustomerIdBuilder is(String value) { + this.is = value; + return this; + } + + public CustomerIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CustomerIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CustomerIdBuilder in(String value) { + this.in = value; + return this; + } + + public CustomerIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CustomerIdParams build() { + return new CustomerIdParams(this); + } + } + } + + public static final class ExportStatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ExportStatusParams(ExportStatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ExportStatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportStatusBuilder builder() { + return new ExportStatusBuilder(); + } + + public static final class ExportStatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ExportStatusBuilder() {} + + public ExportStatusBuilder is(Is value) { + this.is = value; + return this; + } + + public ExportStatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ExportStatusBuilder in(String value) { + this.in = value; + return this; + } + + public ExportStatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ExportStatusParams build() { + return new ExportStatusParams(this); + } + } + + public enum Is { + FUTURE("future"), + + IN_TRIAL("in_trial"), + + ACTIVE("active"), + + NON_RENEWING("non_renewing"), + + PAUSED("paused"), + + CANCELLED("cancelled"), + + TRANSFERRED("transferred"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + FUTURE("future"), + + IN_TRIAL("in_trial"), + + ACTIVE("active"), + + NON_RENEWING("non_renewing"), + + PAUSED("paused"), + + CANCELLED("cancelled"), + + TRANSFERRED("transferred"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CancelReasonParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private final IsPresent isPresent; + + private CancelReasonParams(CancelReasonBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + + this.isPresent = builder.isPresent; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for CancelReasonParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CancelReasonBuilder builder() { + return new CancelReasonBuilder(); + } + + public static final class CancelReasonBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private IsPresent isPresent; + + private CancelReasonBuilder() {} + + public CancelReasonBuilder is(Is value) { + this.is = value; + return this; + } + + public CancelReasonBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public CancelReasonBuilder in(String value) { + this.in = value; + return this; + } + + public CancelReasonBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CancelReasonBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public CancelReasonParams build() { + return new CancelReasonParams(this); + } + } + + public enum Is { + NOT_PAID("not_paid"), + + NO_CARD("no_card"), + + FRAUD_REVIEW_FAILED("fraud_review_failed"), + + NON_COMPLIANT_EU_CUSTOMER("non_compliant_eu_customer"), + + TAX_CALCULATION_FAILED("tax_calculation_failed"), + + CURRENCY_INCOMPATIBLE_WITH_GATEWAY("currency_incompatible_with_gateway"), + + NON_COMPLIANT_CUSTOMER("non_compliant_customer"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + NOT_PAID("not_paid"), + + NO_CARD("no_card"), + + FRAUD_REVIEW_FAILED("fraud_review_failed"), + + NON_COMPLIANT_EU_CUSTOMER("non_compliant_eu_customer"), + + TAX_CALCULATION_FAILED("tax_calculation_failed"), + + CURRENCY_INCOMPATIBLE_WITH_GATEWAY("currency_incompatible_with_gateway"), + + NON_COMPLIANT_CUSTOMER("non_compliant_customer"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class RemainingBillingCyclesParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private final IsPresent isPresent; + + private RemainingBillingCyclesParams(RemainingBillingCyclesBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for RemainingBillingCyclesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RemainingBillingCyclesBuilder builder() { + return new RemainingBillingCyclesBuilder(); + } + + public static final class RemainingBillingCyclesBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private IsPresent isPresent; + + private RemainingBillingCyclesBuilder() {} + + public RemainingBillingCyclesBuilder is(String value) { + this.is = value; + return this; + } + + public RemainingBillingCyclesBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public RemainingBillingCyclesBuilder lt(String value) { + this.lt = value; + return this; + } + + public RemainingBillingCyclesBuilder lte(String value) { + this.lte = value; + return this; + } + + public RemainingBillingCyclesBuilder gt(String value) { + this.gt = value; + return this; + } + + public RemainingBillingCyclesBuilder gte(String value) { + this.gte = value; + return this; + } + + public RemainingBillingCyclesBuilder between(String value) { + this.between = value; + return this; + } + + public RemainingBillingCyclesBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public RemainingBillingCyclesParams build() { + return new RemainingBillingCyclesParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CreatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private CreatedAtParams(CreatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for CreatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreatedAtBuilder builder() { + return new CreatedAtBuilder(); + } + + public static final class CreatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private CreatedAtBuilder() {} + + public CreatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public CreatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public CreatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public CreatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public CreatedAtParams build() { + return new CreatedAtParams(this); + } + } + } + + public static final class ActivatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private final IsPresent isPresent; + + private ActivatedAtParams(ActivatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + + this.isPresent = builder.isPresent; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for ActivatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ActivatedAtBuilder builder() { + return new ActivatedAtBuilder(); + } + + public static final class ActivatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private IsPresent isPresent; + + private ActivatedAtBuilder() {} + + public ActivatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public ActivatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public ActivatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public ActivatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public ActivatedAtBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public ActivatedAtParams build() { + return new ActivatedAtParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class NextBillingAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private NextBillingAtParams(NextBillingAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for NextBillingAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NextBillingAtBuilder builder() { + return new NextBillingAtBuilder(); + } + + public static final class NextBillingAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private NextBillingAtBuilder() {} + + public NextBillingAtBuilder after(String value) { + this.after = value; + return this; + } + + public NextBillingAtBuilder before(String value) { + this.before = value; + return this; + } + + public NextBillingAtBuilder on(String value) { + this.on = value; + return this; + } + + public NextBillingAtBuilder between(String value) { + this.between = value; + return this; + } + + public NextBillingAtParams build() { + return new NextBillingAtParams(this); + } + } + } + + public static final class CancelledAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private CancelledAtParams(CancelledAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for CancelledAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CancelledAtBuilder builder() { + return new CancelledAtBuilder(); + } + + public static final class CancelledAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private CancelledAtBuilder() {} + + public CancelledAtBuilder after(String value) { + this.after = value; + return this; + } + + public CancelledAtBuilder before(String value) { + this.before = value; + return this; + } + + public CancelledAtBuilder on(String value) { + this.on = value; + return this; + } + + public CancelledAtBuilder between(String value) { + this.between = value; + return this; + } + + public CancelledAtParams build() { + return new CancelledAtParams(this); + } + } + } + + public static final class HasScheduledChangesParams { + + private final Is is; + + private HasScheduledChangesParams(HasScheduledChangesBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for HasScheduledChangesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HasScheduledChangesBuilder builder() { + return new HasScheduledChangesBuilder(); + } + + public static final class HasScheduledChangesBuilder { + + private Is is; + + private HasScheduledChangesBuilder() {} + + public HasScheduledChangesBuilder is(Is value) { + this.is = value; + return this; + } + + public HasScheduledChangesParams build() { + return new HasScheduledChangesParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ExportUpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private ExportUpdatedAtParams(ExportUpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for ExportUpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportUpdatedAtBuilder builder() { + return new ExportUpdatedAtBuilder(); + } + + public static final class ExportUpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private ExportUpdatedAtBuilder() {} + + public ExportUpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public ExportUpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public ExportUpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public ExportUpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public ExportUpdatedAtParams build() { + return new ExportUpdatedAtParams(this); + } + } + } + + public static final class OfflinePaymentMethodParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private OfflinePaymentMethodParams(OfflinePaymentMethodBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for OfflinePaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OfflinePaymentMethodBuilder builder() { + return new OfflinePaymentMethodBuilder(); + } + + public static final class OfflinePaymentMethodBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private OfflinePaymentMethodBuilder() {} + + public OfflinePaymentMethodBuilder is(Is value) { + this.is = value; + return this; + } + + public OfflinePaymentMethodBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public OfflinePaymentMethodBuilder in(String value) { + this.in = value; + return this; + } + + public OfflinePaymentMethodBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public OfflinePaymentMethodParams build() { + return new OfflinePaymentMethodParams(this); + } + } + + public enum Is { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AutoCloseInvoicesParams { + + private final Is is; + + private AutoCloseInvoicesParams(AutoCloseInvoicesBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for AutoCloseInvoicesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AutoCloseInvoicesBuilder builder() { + return new AutoCloseInvoicesBuilder(); + } + + public static final class AutoCloseInvoicesBuilder { + + private Is is; + + private AutoCloseInvoicesBuilder() {} + + public AutoCloseInvoicesBuilder is(Is value) { + this.is = value; + return this; + } + + public AutoCloseInvoicesParams build() { + return new AutoCloseInvoicesParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ExportChannelParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ExportChannelParams(ExportChannelBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ExportChannelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportChannelBuilder builder() { + return new ExportChannelBuilder(); + } + + public static final class ExportChannelBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ExportChannelBuilder() {} + + public ExportChannelBuilder is(Is value) { + this.is = value; + return this; + } + + public ExportChannelBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ExportChannelBuilder in(String value) { + this.in = value; + return this; + } + + public ExportChannelBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ExportChannelParams build() { + return new ExportChannelParams(this); + } + } + + public enum Is { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PlanIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private PlanIdParams(PlanIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PlanIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PlanIdBuilder builder() { + return new PlanIdBuilder(); + } + + public static final class PlanIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private PlanIdBuilder() {} + + public PlanIdBuilder is(String value) { + this.is = value; + return this; + } + + public PlanIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PlanIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public PlanIdBuilder in(String value) { + this.in = value; + return this; + } + + public PlanIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PlanIdParams build() { + return new PlanIdParams(this); + } + } + } + + public static final class CustomerParams { + + private final ExportId2Params id; + + private final FirstNameParams firstName; + + private final LastNameParams lastName; + + private final EmailParams email; + + private final CompanyParams company; + + private final PhoneParams phone; + + private final AutoCollectionParams autoCollection; + + private final TaxabilityParams taxability; + + private final ExportCreatedAtParams createdAt; + + private final ExportUpdatedAt2Params updatedAt; + + private final ExportOfflinePaymentMethodParams offlinePaymentMethod; + + private final ExportAutoCloseInvoicesParams autoCloseInvoices; + + private final ExportChannel2Params channel; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.autoCollection = builder.autoCollection; + + this.taxability = builder.taxability; + + this.createdAt = builder.createdAt; + + this.updatedAt = builder.updatedAt; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.autoCloseInvoices = builder.autoCloseInvoices; + + this.channel = builder.channel; + } + + public ExportId2Params getId() { + return id; + } + + public FirstNameParams getFirstName() { + return firstName; + } + + public LastNameParams getLastName() { + return lastName; + } + + public EmailParams getEmail() { + return email; + } + + public CompanyParams getCompany() { + return company; + } + + public PhoneParams getPhone() { + return phone; + } + + public AutoCollectionParams getAutoCollection() { + return autoCollection; + } + + public TaxabilityParams getTaxability() { + return taxability; + } + + public ExportCreatedAtParams getCreatedAt() { + return createdAt; + } + + public ExportUpdatedAt2Params getUpdatedAt() { + return updatedAt; + } + + public ExportOfflinePaymentMethodParams getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public ExportAutoCloseInvoicesParams getAutoCloseInvoices() { + return autoCloseInvoices; + } + + public ExportChannel2Params getChannel() { + return channel; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.firstName != null) { + + // Single object + Map nestedData = this.firstName.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "first_name[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.lastName != null) { + + // Single object + Map nestedData = this.lastName.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "last_name[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.email != null) { + + // Single object + Map nestedData = this.email.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "email[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.company != null) { + + // Single object + Map nestedData = this.company.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "company[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.phone != null) { + + // Single object + Map nestedData = this.phone.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "phone[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.autoCollection != null) { + + // Single object + Map nestedData = this.autoCollection.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "auto_collection[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.taxability != null) { + + // Single object + Map nestedData = this.taxability.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "taxability[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.createdAt != null) { + + // Single object + Map nestedData = this.createdAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "created_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.offlinePaymentMethod != null) { + + // Single object + Map nestedData = this.offlinePaymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "offline_payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.autoCloseInvoices != null) { + + // Single object + Map nestedData = this.autoCloseInvoices.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "auto_close_invoices[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.channel != null) { + + // Single object + Map nestedData = this.channel.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "channel[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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 ExportId2Params id; + + private FirstNameParams firstName; + + private LastNameParams lastName; + + private EmailParams email; + + private CompanyParams company; + + private PhoneParams phone; + + private AutoCollectionParams autoCollection; + + private TaxabilityParams taxability; + + private ExportCreatedAtParams createdAt; + + private ExportUpdatedAt2Params updatedAt; + + private ExportOfflinePaymentMethodParams offlinePaymentMethod; + + private ExportAutoCloseInvoicesParams autoCloseInvoices; + + private ExportChannel2Params channel; + + private CustomerBuilder() {} + + public CustomerBuilder id(ExportId2Params value) { + this.id = value; + return this; + } + + public CustomerBuilder firstName(FirstNameParams value) { + this.firstName = value; + return this; + } + + public CustomerBuilder lastName(LastNameParams value) { + this.lastName = value; + return this; + } + + public CustomerBuilder email(EmailParams value) { + this.email = value; + return this; + } + + public CustomerBuilder company(CompanyParams value) { + this.company = value; + return this; + } + + public CustomerBuilder phone(PhoneParams value) { + this.phone = value; + return this; + } + + public CustomerBuilder autoCollection(AutoCollectionParams value) { + this.autoCollection = value; + return this; + } + + public CustomerBuilder taxability(TaxabilityParams value) { + this.taxability = value; + return this; + } + + public CustomerBuilder createdAt(ExportCreatedAtParams value) { + this.createdAt = value; + return this; + } + + public CustomerBuilder updatedAt(ExportUpdatedAt2Params value) { + this.updatedAt = value; + return this; + } + + public CustomerBuilder offlinePaymentMethod(ExportOfflinePaymentMethodParams value) { + this.offlinePaymentMethod = value; + return this; + } + + public CustomerBuilder autoCloseInvoices(ExportAutoCloseInvoicesParams value) { + this.autoCloseInvoices = value; + return this; + } + + public CustomerBuilder channel(ExportChannel2Params value) { + this.channel = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } + + public static final class ExportId2Params { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ExportId2Params(ExportId2Builder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ExportId2Params. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportId2Builder builder() { + return new ExportId2Builder(); + } + + public static final class ExportId2Builder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ExportId2Builder() {} + + public ExportId2Builder is(String value) { + this.is = value; + return this; + } + + public ExportId2Builder isNot(String value) { + this.isNot = value; + return this; + } + + public ExportId2Builder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ExportId2Builder in(String value) { + this.in = value; + return this; + } + + public ExportId2Builder notIn(String value) { + this.notIn = value; + return this; + } + + public ExportId2Params build() { + return new ExportId2Params(this); + } + } + } + + public static final class FirstNameParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private FirstNameParams(FirstNameBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for FirstNameParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static FirstNameBuilder builder() { + return new FirstNameBuilder(); + } + + public static final class FirstNameBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private FirstNameBuilder() {} + + public FirstNameBuilder is(String value) { + this.is = value; + return this; + } + + public FirstNameBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public FirstNameBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public FirstNameBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public FirstNameParams build() { + return new FirstNameParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class LastNameParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private LastNameParams(LastNameBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for LastNameParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static LastNameBuilder builder() { + return new LastNameBuilder(); + } + + public static final class LastNameBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private LastNameBuilder() {} + + public LastNameBuilder is(String value) { + this.is = value; + return this; + } + + public LastNameBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public LastNameBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public LastNameBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public LastNameParams build() { + return new LastNameParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class EmailParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private EmailParams(EmailBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for EmailParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EmailBuilder builder() { + return new EmailBuilder(); + } + + public static final class EmailBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private EmailBuilder() {} + + public EmailBuilder is(String value) { + this.is = value; + return this; + } + + public EmailBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public EmailBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public EmailBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public EmailParams build() { + return new EmailParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CompanyParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private CompanyParams(CompanyBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for CompanyParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CompanyBuilder builder() { + return new CompanyBuilder(); + } + + public static final class CompanyBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private CompanyBuilder() {} + + public CompanyBuilder is(String value) { + this.is = value; + return this; + } + + public CompanyBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CompanyBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CompanyBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public CompanyParams build() { + return new CompanyParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PhoneParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private PhoneParams(PhoneBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for PhoneParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PhoneBuilder builder() { + return new PhoneBuilder(); + } + + public static final class PhoneBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private PhoneBuilder() {} + + public PhoneBuilder is(String value) { + this.is = value; + return this; + } + + public PhoneBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PhoneBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public PhoneBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public PhoneParams build() { + return new PhoneParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AutoCollectionParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private AutoCollectionParams(AutoCollectionBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for AutoCollectionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AutoCollectionBuilder builder() { + return new AutoCollectionBuilder(); + } + + public static final class AutoCollectionBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private AutoCollectionBuilder() {} + + public AutoCollectionBuilder is(Is value) { + this.is = value; + return this; + } + + public AutoCollectionBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public AutoCollectionBuilder in(String value) { + this.in = value; + return this; + } + + public AutoCollectionBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public AutoCollectionParams build() { + return new AutoCollectionParams(this); + } + } + + public enum Is { + ON("on"), + + OFF("off"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + ON("on"), + + OFF("off"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TaxabilityParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private TaxabilityParams(TaxabilityBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for TaxabilityParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxabilityBuilder builder() { + return new TaxabilityBuilder(); + } + + public static final class TaxabilityBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private TaxabilityBuilder() {} + + public TaxabilityBuilder is(Is value) { + this.is = value; + return this; + } + + public TaxabilityBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public TaxabilityBuilder in(String value) { + this.in = value; + return this; + } + + public TaxabilityBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public TaxabilityParams build() { + return new TaxabilityParams(this); + } + } + + public enum Is { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ExportCreatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private ExportCreatedAtParams(ExportCreatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for ExportCreatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportCreatedAtBuilder builder() { + return new ExportCreatedAtBuilder(); + } + + public static final class ExportCreatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private ExportCreatedAtBuilder() {} + + public ExportCreatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public ExportCreatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public ExportCreatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public ExportCreatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public ExportCreatedAtParams build() { + return new ExportCreatedAtParams(this); + } + } + } + + public static final class ExportUpdatedAt2Params { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private ExportUpdatedAt2Params(ExportUpdatedAt2Builder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for ExportUpdatedAt2Params. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportUpdatedAt2Builder builder() { + return new ExportUpdatedAt2Builder(); + } + + public static final class ExportUpdatedAt2Builder { + + private String after; + + private String before; + + private String on; + + private String between; + + private ExportUpdatedAt2Builder() {} + + public ExportUpdatedAt2Builder after(String value) { + this.after = value; + return this; + } + + public ExportUpdatedAt2Builder before(String value) { + this.before = value; + return this; + } + + public ExportUpdatedAt2Builder on(String value) { + this.on = value; + return this; + } + + public ExportUpdatedAt2Builder between(String value) { + this.between = value; + return this; + } + + public ExportUpdatedAt2Params build() { + return new ExportUpdatedAt2Params(this); + } + } + } + + public static final class ExportOfflinePaymentMethodParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ExportOfflinePaymentMethodParams(ExportOfflinePaymentMethodBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ExportOfflinePaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportOfflinePaymentMethodBuilder builder() { + return new ExportOfflinePaymentMethodBuilder(); + } + + public static final class ExportOfflinePaymentMethodBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ExportOfflinePaymentMethodBuilder() {} + + public ExportOfflinePaymentMethodBuilder is(Is value) { + this.is = value; + return this; + } + + public ExportOfflinePaymentMethodBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ExportOfflinePaymentMethodBuilder in(String value) { + this.in = value; + return this; + } + + public ExportOfflinePaymentMethodBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ExportOfflinePaymentMethodParams build() { + return new ExportOfflinePaymentMethodParams(this); + } + } + + public enum Is { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ExportAutoCloseInvoicesParams { + + private final Is is; + + private ExportAutoCloseInvoicesParams(ExportAutoCloseInvoicesBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for ExportAutoCloseInvoicesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportAutoCloseInvoicesBuilder builder() { + return new ExportAutoCloseInvoicesBuilder(); + } + + public static final class ExportAutoCloseInvoicesBuilder { + + private Is is; + + private ExportAutoCloseInvoicesBuilder() {} + + public ExportAutoCloseInvoicesBuilder is(Is value) { + this.is = value; + return this; + } + + public ExportAutoCloseInvoicesParams build() { + return new ExportAutoCloseInvoicesParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ExportChannel2Params { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ExportChannel2Params(ExportChannel2Builder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ExportChannel2Params. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportChannel2Builder builder() { + return new ExportChannel2Builder(); + } + + public static final class ExportChannel2Builder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ExportChannel2Builder() {} + + public ExportChannel2Builder is(Is value) { + this.is = value; + return this; + } + + public ExportChannel2Builder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ExportChannel2Builder in(String value) { + this.in = value; + return this; + } + + public ExportChannel2Builder notIn(String value) { + this.notIn = value; + return this; + } + + public ExportChannel2Params build() { + return new ExportChannel2Params(this); + } + } + + public enum Is { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class RelationshipParams { + + private final ParentIdParams parentId; + + private final PaymentOwnerIdParams paymentOwnerId; + + private final InvoiceOwnerIdParams invoiceOwnerId; + + private RelationshipParams(RelationshipBuilder builder) { + + this.parentId = builder.parentId; + + this.paymentOwnerId = builder.paymentOwnerId; + + this.invoiceOwnerId = builder.invoiceOwnerId; + } + + public ParentIdParams getParentId() { + return parentId; + } + + public PaymentOwnerIdParams getPaymentOwnerId() { + return paymentOwnerId; + } + + public InvoiceOwnerIdParams getInvoiceOwnerId() { + return invoiceOwnerId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.parentId != null) { + + // Single object + Map nestedData = this.parentId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "parent_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentOwnerId != null) { + + // Single object + Map nestedData = this.paymentOwnerId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_owner_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.invoiceOwnerId != null) { + + // Single object + Map nestedData = this.invoiceOwnerId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "invoice_owner_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for RelationshipParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RelationshipBuilder builder() { + return new RelationshipBuilder(); + } + + public static final class RelationshipBuilder { + + private ParentIdParams parentId; + + private PaymentOwnerIdParams paymentOwnerId; + + private InvoiceOwnerIdParams invoiceOwnerId; + + private RelationshipBuilder() {} + + public RelationshipBuilder parentId(ParentIdParams value) { + this.parentId = value; + return this; + } + + public RelationshipBuilder paymentOwnerId(PaymentOwnerIdParams value) { + this.paymentOwnerId = value; + return this; + } + + public RelationshipBuilder invoiceOwnerId(InvoiceOwnerIdParams value) { + this.invoiceOwnerId = value; + return this; + } + + public RelationshipParams build() { + return new RelationshipParams(this); + } + } + } + + public static final class ParentIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private ParentIdParams(ParentIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for ParentIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ParentIdBuilder builder() { + return new ParentIdBuilder(); + } + + public static final class ParentIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private ParentIdBuilder() {} + + public ParentIdBuilder is(String value) { + this.is = value; + return this; + } + + public ParentIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ParentIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ParentIdParams build() { + return new ParentIdParams(this); + } + } + } + + public static final class PaymentOwnerIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private PaymentOwnerIdParams(PaymentOwnerIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for PaymentOwnerIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentOwnerIdBuilder builder() { + return new PaymentOwnerIdBuilder(); + } + + public static final class PaymentOwnerIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private PaymentOwnerIdBuilder() {} + + public PaymentOwnerIdBuilder is(String value) { + this.is = value; + return this; + } + + public PaymentOwnerIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PaymentOwnerIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public PaymentOwnerIdParams build() { + return new PaymentOwnerIdParams(this); + } + } + } + + public static final class InvoiceOwnerIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private InvoiceOwnerIdParams(InvoiceOwnerIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for InvoiceOwnerIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceOwnerIdBuilder builder() { + return new InvoiceOwnerIdBuilder(); + } + + public static final class InvoiceOwnerIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private InvoiceOwnerIdBuilder() {} + + public InvoiceOwnerIdBuilder is(String value) { + this.is = value; + return this; + } + + public InvoiceOwnerIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public InvoiceOwnerIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public InvoiceOwnerIdParams build() { + return new InvoiceOwnerIdParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportSubscriptionsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportSubscriptionsParams.java new file mode 100644 index 00000000..e06164b8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportSubscriptionsParams.java @@ -0,0 +1,3107 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportSubscriptionsParams { + + private final ExportType exportType; + + private final ItemIdParams itemId; + + private final ItemPriceIdParams itemPriceId; + + private final CancelReasonCodeParams cancelReasonCode; + + private final SubscriptionParams subscription; + + private ExportSubscriptionsParams(ExportSubscriptionsBuilder builder) { + + this.exportType = builder.exportType; + + this.itemId = builder.itemId; + + this.itemPriceId = builder.itemPriceId; + + this.cancelReasonCode = builder.cancelReasonCode; + + this.subscription = builder.subscription; + } + + public ExportType getExportType() { + return exportType; + } + + public ItemIdParams getItemId() { + return itemId; + } + + public ItemPriceIdParams getItemPriceId() { + return itemPriceId; + } + + public CancelReasonCodeParams getCancelReasonCode() { + return cancelReasonCode; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.exportType != null) { + + formData.put("export_type", this.exportType); + } + + if (this.itemId != null) { + + // Single object + Map nestedData = this.itemId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemPriceId != null) { + + // Single object + Map nestedData = this.itemPriceId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_price_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.cancelReasonCode != null) { + + // Single object + Map nestedData = this.cancelReasonCode.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "cancel_reason_code[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportSubscriptionsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportSubscriptionsBuilder builder() { + return new ExportSubscriptionsBuilder(); + } + + public static final class ExportSubscriptionsBuilder { + + private ExportType exportType; + + private ItemIdParams itemId; + + private ItemPriceIdParams itemPriceId; + + private CancelReasonCodeParams cancelReasonCode; + + private SubscriptionParams subscription; + + private ExportSubscriptionsBuilder() {} + + public ExportSubscriptionsBuilder exportType(ExportType value) { + this.exportType = value; + return this; + } + + public ExportSubscriptionsBuilder itemId(ItemIdParams value) { + this.itemId = value; + return this; + } + + public ExportSubscriptionsBuilder itemPriceId(ItemPriceIdParams value) { + this.itemPriceId = value; + return this; + } + + public ExportSubscriptionsBuilder cancelReasonCode(CancelReasonCodeParams value) { + this.cancelReasonCode = value; + return this; + } + + public ExportSubscriptionsBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public ExportSubscriptionsParams build() { + return new ExportSubscriptionsParams(this); + } + } + + public enum ExportType { + DATA("data"), + + IMPORT_FRIENDLY_DATA("import_friendly_data"), + + /** An enum member indicating that ExportType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ExportType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ExportType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ExportType enumValue : ExportType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class ItemIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ItemIdParams(ItemIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ItemIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemIdBuilder builder() { + return new ItemIdBuilder(); + } + + public static final class ItemIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ItemIdBuilder() {} + + public ItemIdBuilder is(String value) { + this.is = value; + return this; + } + + public ItemIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ItemIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ItemIdBuilder in(String value) { + this.in = value; + return this; + } + + public ItemIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ItemIdParams build() { + return new ItemIdParams(this); + } + } + } + + public static final class ItemPriceIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private ItemPriceIdParams(ItemPriceIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ItemPriceIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemPriceIdBuilder builder() { + return new ItemPriceIdBuilder(); + } + + public static final class ItemPriceIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private ItemPriceIdBuilder() {} + + public ItemPriceIdBuilder is(String value) { + this.is = value; + return this; + } + + public ItemPriceIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ItemPriceIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ItemPriceIdBuilder in(String value) { + this.in = value; + return this; + } + + public ItemPriceIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ItemPriceIdParams build() { + return new ItemPriceIdParams(this); + } + } + } + + public static final class CancelReasonCodeParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private CancelReasonCodeParams(CancelReasonCodeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for CancelReasonCodeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CancelReasonCodeBuilder builder() { + return new CancelReasonCodeBuilder(); + } + + public static final class CancelReasonCodeBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private CancelReasonCodeBuilder() {} + + public CancelReasonCodeBuilder is(String value) { + this.is = value; + return this; + } + + public CancelReasonCodeBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CancelReasonCodeBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CancelReasonCodeBuilder in(String value) { + this.in = value; + return this; + } + + public CancelReasonCodeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CancelReasonCodeParams build() { + return new CancelReasonCodeParams(this); + } + } + } + + public static final class SubscriptionParams { + + private final IdParams id; + + private final CustomerIdParams customerId; + + private final StatusParams status; + + private final CancelReasonParams cancelReason; + + private final RemainingBillingCyclesParams remainingBillingCycles; + + private final CreatedAtParams createdAt; + + private final ActivatedAtParams activatedAt; + + private final NextBillingAtParams nextBillingAt; + + private final CancelledAtParams cancelledAt; + + private final HasScheduledChangesParams hasScheduledChanges; + + private final UpdatedAtParams updatedAt; + + private final OfflinePaymentMethodParams offlinePaymentMethod; + + private final AutoCloseInvoicesParams autoCloseInvoices; + + private final ChannelParams channel; + + private final PlanIdParams planId; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.customerId = builder.customerId; + + this.status = builder.status; + + this.cancelReason = builder.cancelReason; + + this.remainingBillingCycles = builder.remainingBillingCycles; + + this.createdAt = builder.createdAt; + + this.activatedAt = builder.activatedAt; + + this.nextBillingAt = builder.nextBillingAt; + + this.cancelledAt = builder.cancelledAt; + + this.hasScheduledChanges = builder.hasScheduledChanges; + + this.updatedAt = builder.updatedAt; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.autoCloseInvoices = builder.autoCloseInvoices; + + this.channel = builder.channel; + + this.planId = builder.planId; + } + + public IdParams getId() { + return id; + } + + public CustomerIdParams getCustomerId() { + return customerId; + } + + public StatusParams getStatus() { + return status; + } + + public CancelReasonParams getCancelReason() { + return cancelReason; + } + + public RemainingBillingCyclesParams getRemainingBillingCycles() { + return remainingBillingCycles; + } + + public CreatedAtParams getCreatedAt() { + return createdAt; + } + + public ActivatedAtParams getActivatedAt() { + return activatedAt; + } + + public NextBillingAtParams getNextBillingAt() { + return nextBillingAt; + } + + public CancelledAtParams getCancelledAt() { + return cancelledAt; + } + + public HasScheduledChangesParams getHasScheduledChanges() { + return hasScheduledChanges; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + public OfflinePaymentMethodParams getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public AutoCloseInvoicesParams getAutoCloseInvoices() { + return autoCloseInvoices; + } + + public ChannelParams getChannel() { + return channel; + } + + public PlanIdParams getPlanId() { + return planId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.customerId != null) { + + // Single object + Map nestedData = this.customerId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "customer_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.status != null) { + + // Single object + Map nestedData = this.status.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.cancelReason != null) { + + // Single object + Map nestedData = this.cancelReason.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "cancel_reason[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.remainingBillingCycles != null) { + + // Single object + Map nestedData = this.remainingBillingCycles.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "remaining_billing_cycles[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.createdAt != null) { + + // Single object + Map nestedData = this.createdAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "created_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.activatedAt != null) { + + // Single object + Map nestedData = this.activatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "activated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.nextBillingAt != null) { + + // Single object + Map nestedData = this.nextBillingAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "next_billing_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.cancelledAt != null) { + + // Single object + Map nestedData = this.cancelledAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "cancelled_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.hasScheduledChanges != null) { + + // Single object + Map nestedData = this.hasScheduledChanges.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "has_scheduled_changes[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.offlinePaymentMethod != null) { + + // Single object + Map nestedData = this.offlinePaymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "offline_payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.autoCloseInvoices != null) { + + // Single object + Map nestedData = this.autoCloseInvoices.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "auto_close_invoices[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.channel != null) { + + // Single object + Map nestedData = this.channel.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "channel[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.planId != null) { + + // Single object + Map nestedData = this.planId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "plan_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private IdParams id; + + private CustomerIdParams customerId; + + private StatusParams status; + + private CancelReasonParams cancelReason; + + private RemainingBillingCyclesParams remainingBillingCycles; + + private CreatedAtParams createdAt; + + private ActivatedAtParams activatedAt; + + private NextBillingAtParams nextBillingAt; + + private CancelledAtParams cancelledAt; + + private HasScheduledChangesParams hasScheduledChanges; + + private UpdatedAtParams updatedAt; + + private OfflinePaymentMethodParams offlinePaymentMethod; + + private AutoCloseInvoicesParams autoCloseInvoices; + + private ChannelParams channel; + + private PlanIdParams planId; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(IdParams value) { + this.id = value; + return this; + } + + public SubscriptionBuilder customerId(CustomerIdParams value) { + this.customerId = value; + return this; + } + + public SubscriptionBuilder status(StatusParams value) { + this.status = value; + return this; + } + + public SubscriptionBuilder cancelReason(CancelReasonParams value) { + this.cancelReason = value; + return this; + } + + public SubscriptionBuilder remainingBillingCycles(RemainingBillingCyclesParams value) { + this.remainingBillingCycles = value; + return this; + } + + public SubscriptionBuilder createdAt(CreatedAtParams value) { + this.createdAt = value; + return this; + } + + public SubscriptionBuilder activatedAt(ActivatedAtParams value) { + this.activatedAt = value; + return this; + } + + public SubscriptionBuilder nextBillingAt(NextBillingAtParams value) { + this.nextBillingAt = value; + return this; + } + + public SubscriptionBuilder cancelledAt(CancelledAtParams value) { + this.cancelledAt = value; + return this; + } + + public SubscriptionBuilder hasScheduledChanges(HasScheduledChangesParams value) { + this.hasScheduledChanges = value; + return this; + } + + public SubscriptionBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethodParams value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder autoCloseInvoices(AutoCloseInvoicesParams value) { + this.autoCloseInvoices = value; + return this; + } + + public SubscriptionBuilder channel(ChannelParams value) { + this.channel = value; + return this; + } + + public SubscriptionBuilder planId(PlanIdParams value) { + this.planId = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class CustomerIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private CustomerIdParams(CustomerIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for CustomerIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerIdBuilder builder() { + return new CustomerIdBuilder(); + } + + public static final class CustomerIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private CustomerIdBuilder() {} + + public CustomerIdBuilder is(String value) { + this.is = value; + return this; + } + + public CustomerIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CustomerIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CustomerIdBuilder in(String value) { + this.in = value; + return this; + } + + public CustomerIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CustomerIdParams build() { + return new CustomerIdParams(this); + } + } + } + + public static final class StatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private StatusParams(StatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for StatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatusBuilder builder() { + return new StatusBuilder(); + } + + public static final class StatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private StatusBuilder() {} + + public StatusBuilder is(Is value) { + this.is = value; + return this; + } + + public StatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public StatusBuilder in(String value) { + this.in = value; + return this; + } + + public StatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public StatusParams build() { + return new StatusParams(this); + } + } + + public enum Is { + FUTURE("future"), + + IN_TRIAL("in_trial"), + + ACTIVE("active"), + + NON_RENEWING("non_renewing"), + + PAUSED("paused"), + + CANCELLED("cancelled"), + + TRANSFERRED("transferred"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + FUTURE("future"), + + IN_TRIAL("in_trial"), + + ACTIVE("active"), + + NON_RENEWING("non_renewing"), + + PAUSED("paused"), + + CANCELLED("cancelled"), + + TRANSFERRED("transferred"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CancelReasonParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private final IsPresent isPresent; + + private CancelReasonParams(CancelReasonBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + + this.isPresent = builder.isPresent; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for CancelReasonParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CancelReasonBuilder builder() { + return new CancelReasonBuilder(); + } + + public static final class CancelReasonBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private IsPresent isPresent; + + private CancelReasonBuilder() {} + + public CancelReasonBuilder is(Is value) { + this.is = value; + return this; + } + + public CancelReasonBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public CancelReasonBuilder in(String value) { + this.in = value; + return this; + } + + public CancelReasonBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CancelReasonBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public CancelReasonParams build() { + return new CancelReasonParams(this); + } + } + + public enum Is { + NOT_PAID("not_paid"), + + NO_CARD("no_card"), + + FRAUD_REVIEW_FAILED("fraud_review_failed"), + + NON_COMPLIANT_EU_CUSTOMER("non_compliant_eu_customer"), + + TAX_CALCULATION_FAILED("tax_calculation_failed"), + + CURRENCY_INCOMPATIBLE_WITH_GATEWAY("currency_incompatible_with_gateway"), + + NON_COMPLIANT_CUSTOMER("non_compliant_customer"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + NOT_PAID("not_paid"), + + NO_CARD("no_card"), + + FRAUD_REVIEW_FAILED("fraud_review_failed"), + + NON_COMPLIANT_EU_CUSTOMER("non_compliant_eu_customer"), + + TAX_CALCULATION_FAILED("tax_calculation_failed"), + + CURRENCY_INCOMPATIBLE_WITH_GATEWAY("currency_incompatible_with_gateway"), + + NON_COMPLIANT_CUSTOMER("non_compliant_customer"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class RemainingBillingCyclesParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private final IsPresent isPresent; + + private RemainingBillingCyclesParams(RemainingBillingCyclesBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for RemainingBillingCyclesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RemainingBillingCyclesBuilder builder() { + return new RemainingBillingCyclesBuilder(); + } + + public static final class RemainingBillingCyclesBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private IsPresent isPresent; + + private RemainingBillingCyclesBuilder() {} + + public RemainingBillingCyclesBuilder is(String value) { + this.is = value; + return this; + } + + public RemainingBillingCyclesBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public RemainingBillingCyclesBuilder lt(String value) { + this.lt = value; + return this; + } + + public RemainingBillingCyclesBuilder lte(String value) { + this.lte = value; + return this; + } + + public RemainingBillingCyclesBuilder gt(String value) { + this.gt = value; + return this; + } + + public RemainingBillingCyclesBuilder gte(String value) { + this.gte = value; + return this; + } + + public RemainingBillingCyclesBuilder between(String value) { + this.between = value; + return this; + } + + public RemainingBillingCyclesBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public RemainingBillingCyclesParams build() { + return new RemainingBillingCyclesParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CreatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private CreatedAtParams(CreatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for CreatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreatedAtBuilder builder() { + return new CreatedAtBuilder(); + } + + public static final class CreatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private CreatedAtBuilder() {} + + public CreatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public CreatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public CreatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public CreatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public CreatedAtParams build() { + return new CreatedAtParams(this); + } + } + } + + public static final class ActivatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private final IsPresent isPresent; + + private ActivatedAtParams(ActivatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + + this.isPresent = builder.isPresent; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for ActivatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ActivatedAtBuilder builder() { + return new ActivatedAtBuilder(); + } + + public static final class ActivatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private IsPresent isPresent; + + private ActivatedAtBuilder() {} + + public ActivatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public ActivatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public ActivatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public ActivatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public ActivatedAtBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public ActivatedAtParams build() { + return new ActivatedAtParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class NextBillingAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private NextBillingAtParams(NextBillingAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for NextBillingAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NextBillingAtBuilder builder() { + return new NextBillingAtBuilder(); + } + + public static final class NextBillingAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private NextBillingAtBuilder() {} + + public NextBillingAtBuilder after(String value) { + this.after = value; + return this; + } + + public NextBillingAtBuilder before(String value) { + this.before = value; + return this; + } + + public NextBillingAtBuilder on(String value) { + this.on = value; + return this; + } + + public NextBillingAtBuilder between(String value) { + this.between = value; + return this; + } + + public NextBillingAtParams build() { + return new NextBillingAtParams(this); + } + } + } + + public static final class CancelledAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private CancelledAtParams(CancelledAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for CancelledAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CancelledAtBuilder builder() { + return new CancelledAtBuilder(); + } + + public static final class CancelledAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private CancelledAtBuilder() {} + + public CancelledAtBuilder after(String value) { + this.after = value; + return this; + } + + public CancelledAtBuilder before(String value) { + this.before = value; + return this; + } + + public CancelledAtBuilder on(String value) { + this.on = value; + return this; + } + + public CancelledAtBuilder between(String value) { + this.between = value; + return this; + } + + public CancelledAtParams build() { + return new CancelledAtParams(this); + } + } + } + + public static final class HasScheduledChangesParams { + + private final Is is; + + private HasScheduledChangesParams(HasScheduledChangesBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for HasScheduledChangesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HasScheduledChangesBuilder builder() { + return new HasScheduledChangesBuilder(); + } + + public static final class HasScheduledChangesBuilder { + + private Is is; + + private HasScheduledChangesBuilder() {} + + public HasScheduledChangesBuilder is(Is value) { + this.is = value; + return this; + } + + public HasScheduledChangesParams build() { + return new HasScheduledChangesParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } + + public static final class OfflinePaymentMethodParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private OfflinePaymentMethodParams(OfflinePaymentMethodBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for OfflinePaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OfflinePaymentMethodBuilder builder() { + return new OfflinePaymentMethodBuilder(); + } + + public static final class OfflinePaymentMethodBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private OfflinePaymentMethodBuilder() {} + + public OfflinePaymentMethodBuilder is(Is value) { + this.is = value; + return this; + } + + public OfflinePaymentMethodBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public OfflinePaymentMethodBuilder in(String value) { + this.in = value; + return this; + } + + public OfflinePaymentMethodBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public OfflinePaymentMethodParams build() { + return new OfflinePaymentMethodParams(this); + } + } + + public enum Is { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AutoCloseInvoicesParams { + + private final Is is; + + private AutoCloseInvoicesParams(AutoCloseInvoicesBuilder builder) { + + this.is = builder.is; + } + + public Is getIs() { + return is; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + return formData; + } + + /** Create a new builder for AutoCloseInvoicesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AutoCloseInvoicesBuilder builder() { + return new AutoCloseInvoicesBuilder(); + } + + public static final class AutoCloseInvoicesBuilder { + + private Is is; + + private AutoCloseInvoicesBuilder() {} + + public AutoCloseInvoicesBuilder is(Is value) { + this.is = value; + return this; + } + + public AutoCloseInvoicesParams build() { + return new AutoCloseInvoicesParams(this); + } + } + + public enum Is { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ChannelParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private ChannelParams(ChannelBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for ChannelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChannelBuilder builder() { + return new ChannelBuilder(); + } + + public static final class ChannelBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private ChannelBuilder() {} + + public ChannelBuilder is(Is value) { + this.is = value; + return this; + } + + public ChannelBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public ChannelBuilder in(String value) { + this.in = value; + return this; + } + + public ChannelBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public ChannelParams build() { + return new ChannelParams(this); + } + } + + public enum Is { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PlanIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private PlanIdParams(PlanIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PlanIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PlanIdBuilder builder() { + return new PlanIdBuilder(); + } + + public static final class PlanIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private PlanIdBuilder() {} + + public PlanIdBuilder is(String value) { + this.is = value; + return this; + } + + public PlanIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PlanIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public PlanIdBuilder in(String value) { + this.in = value; + return this; + } + + public PlanIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PlanIdParams build() { + return new PlanIdParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportTransactionsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportTransactionsParams.java new file mode 100644 index 00000000..96b45123 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportTransactionsParams.java @@ -0,0 +1,3084 @@ +/* + * 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.export.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportTransactionsParams { + + private final TransactionParams transaction; + + private ExportTransactionsParams(ExportTransactionsBuilder builder) { + + this.transaction = builder.transaction; + } + + public TransactionParams getTransaction() { + return transaction; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.transaction != null) { + + // Single object + Map nestedData = this.transaction.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "transaction[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportTransactionsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportTransactionsBuilder builder() { + return new ExportTransactionsBuilder(); + } + + public static final class ExportTransactionsBuilder { + + private TransactionParams transaction; + + private ExportTransactionsBuilder() {} + + public ExportTransactionsBuilder transaction(TransactionParams value) { + this.transaction = value; + return this; + } + + public ExportTransactionsParams build() { + return new ExportTransactionsParams(this); + } + } + + public static final class TransactionParams { + + private final IdParams id; + + private final CustomerIdParams customerId; + + private final SubscriptionIdParams subscriptionId; + + private final PaymentSourceIdParams paymentSourceId; + + private final PaymentMethodParams paymentMethod; + + private final GatewayParams gateway; + + private final GatewayAccountIdParams gatewayAccountId; + + private final IdAtGatewayParams idAtGateway; + + private final ReferenceNumberParams referenceNumber; + + private final TypeParams type; + + private final DateParams date; + + private final AmountParams amount; + + private final AmountCapturableParams amountCapturable; + + private final StatusParams status; + + private final UpdatedAtParams updatedAt; + + private TransactionParams(TransactionBuilder builder) { + + this.id = builder.id; + + this.customerId = builder.customerId; + + this.subscriptionId = builder.subscriptionId; + + this.paymentSourceId = builder.paymentSourceId; + + this.paymentMethod = builder.paymentMethod; + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.idAtGateway = builder.idAtGateway; + + this.referenceNumber = builder.referenceNumber; + + this.type = builder.type; + + this.date = builder.date; + + this.amount = builder.amount; + + this.amountCapturable = builder.amountCapturable; + + this.status = builder.status; + + this.updatedAt = builder.updatedAt; + } + + public IdParams getId() { + return id; + } + + public CustomerIdParams getCustomerId() { + return customerId; + } + + public SubscriptionIdParams getSubscriptionId() { + return subscriptionId; + } + + public PaymentSourceIdParams getPaymentSourceId() { + return paymentSourceId; + } + + public PaymentMethodParams getPaymentMethod() { + return paymentMethod; + } + + public GatewayParams getGateway() { + return gateway; + } + + public GatewayAccountIdParams getGatewayAccountId() { + return gatewayAccountId; + } + + public IdAtGatewayParams getIdAtGateway() { + return idAtGateway; + } + + public ReferenceNumberParams getReferenceNumber() { + return referenceNumber; + } + + public TypeParams getType() { + return type; + } + + public DateParams getDate() { + return date; + } + + public AmountParams getAmount() { + return amount; + } + + public AmountCapturableParams getAmountCapturable() { + return amountCapturable; + } + + public StatusParams getStatus() { + return status; + } + + public UpdatedAtParams getUpdatedAt() { + return updatedAt; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + // Single object + Map nestedData = this.id.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.customerId != null) { + + // Single object + Map nestedData = this.customerId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "customer_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionId != null) { + + // Single object + Map nestedData = this.subscriptionId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentSourceId != null) { + + // Single object + Map nestedData = this.paymentSourceId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_source_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentMethod != null) { + + // Single object + Map nestedData = this.paymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.gateway != null) { + + // Single object + Map nestedData = this.gateway.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "gateway[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.gatewayAccountId != null) { + + // Single object + Map nestedData = this.gatewayAccountId.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "gateway_account_id[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.idAtGateway != null) { + + // Single object + Map nestedData = this.idAtGateway.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "id_at_gateway[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.referenceNumber != null) { + + // Single object + Map nestedData = this.referenceNumber.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "reference_number[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.type != null) { + + // Single object + Map nestedData = this.type.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "type[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.date != null) { + + // Single object + Map nestedData = this.date.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "date[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.amount != null) { + + // Single object + Map nestedData = this.amount.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "amount[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.amountCapturable != null) { + + // Single object + Map nestedData = this.amountCapturable.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "amount_capturable[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.status != null) { + + // Single object + Map nestedData = this.status.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "status[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.updatedAt != null) { + + // Single object + Map nestedData = this.updatedAt.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "updated_at[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for TransactionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionBuilder builder() { + return new TransactionBuilder(); + } + + public static final class TransactionBuilder { + + private IdParams id; + + private CustomerIdParams customerId; + + private SubscriptionIdParams subscriptionId; + + private PaymentSourceIdParams paymentSourceId; + + private PaymentMethodParams paymentMethod; + + private GatewayParams gateway; + + private GatewayAccountIdParams gatewayAccountId; + + private IdAtGatewayParams idAtGateway; + + private ReferenceNumberParams referenceNumber; + + private TypeParams type; + + private DateParams date; + + private AmountParams amount; + + private AmountCapturableParams amountCapturable; + + private StatusParams status; + + private UpdatedAtParams updatedAt; + + private TransactionBuilder() {} + + public TransactionBuilder id(IdParams value) { + this.id = value; + return this; + } + + public TransactionBuilder customerId(CustomerIdParams value) { + this.customerId = value; + return this; + } + + public TransactionBuilder subscriptionId(SubscriptionIdParams value) { + this.subscriptionId = value; + return this; + } + + public TransactionBuilder paymentSourceId(PaymentSourceIdParams value) { + this.paymentSourceId = value; + return this; + } + + public TransactionBuilder paymentMethod(PaymentMethodParams value) { + this.paymentMethod = value; + return this; + } + + public TransactionBuilder gateway(GatewayParams value) { + this.gateway = value; + return this; + } + + public TransactionBuilder gatewayAccountId(GatewayAccountIdParams value) { + this.gatewayAccountId = value; + return this; + } + + public TransactionBuilder idAtGateway(IdAtGatewayParams value) { + this.idAtGateway = value; + return this; + } + + public TransactionBuilder referenceNumber(ReferenceNumberParams value) { + this.referenceNumber = value; + return this; + } + + public TransactionBuilder type(TypeParams value) { + this.type = value; + return this; + } + + public TransactionBuilder date(DateParams value) { + this.date = value; + return this; + } + + public TransactionBuilder amount(AmountParams value) { + this.amount = value; + return this; + } + + public TransactionBuilder amountCapturable(AmountCapturableParams value) { + this.amountCapturable = value; + return this; + } + + public TransactionBuilder status(StatusParams value) { + this.status = value; + return this; + } + + public TransactionBuilder updatedAt(UpdatedAtParams value) { + this.updatedAt = value; + return this; + } + + public TransactionParams build() { + return new TransactionParams(this); + } + } + } + + public static final class IdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private IdParams(IdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for IdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdBuilder builder() { + return new IdBuilder(); + } + + public static final class IdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private IdBuilder() {} + + public IdBuilder is(String value) { + this.is = value; + return this; + } + + public IdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdBuilder in(String value) { + this.in = value; + return this; + } + + public IdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public IdParams build() { + return new IdParams(this); + } + } + } + + public static final class CustomerIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private final String in; + + private final String notIn; + + private CustomerIdParams(CustomerIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for CustomerIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerIdBuilder builder() { + return new CustomerIdBuilder(); + } + + public static final class CustomerIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private String in; + + private String notIn; + + private CustomerIdBuilder() {} + + public CustomerIdBuilder is(String value) { + this.is = value; + return this; + } + + public CustomerIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public CustomerIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public CustomerIdBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public CustomerIdBuilder in(String value) { + this.in = value; + return this; + } + + public CustomerIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public CustomerIdParams build() { + return new CustomerIdParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class SubscriptionIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private final String in; + + private final String notIn; + + private SubscriptionIdParams(SubscriptionIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for SubscriptionIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionIdBuilder builder() { + return new SubscriptionIdBuilder(); + } + + public static final class SubscriptionIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private String in; + + private String notIn; + + private SubscriptionIdBuilder() {} + + public SubscriptionIdBuilder is(String value) { + this.is = value; + return this; + } + + public SubscriptionIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public SubscriptionIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public SubscriptionIdBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public SubscriptionIdBuilder in(String value) { + this.in = value; + return this; + } + + public SubscriptionIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public SubscriptionIdParams build() { + return new SubscriptionIdParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PaymentSourceIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private final String in; + + private final String notIn; + + private PaymentSourceIdParams(PaymentSourceIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PaymentSourceIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentSourceIdBuilder builder() { + return new PaymentSourceIdBuilder(); + } + + public static final class PaymentSourceIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private String in; + + private String notIn; + + private PaymentSourceIdBuilder() {} + + public PaymentSourceIdBuilder is(String value) { + this.is = value; + return this; + } + + public PaymentSourceIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public PaymentSourceIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public PaymentSourceIdBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public PaymentSourceIdBuilder in(String value) { + this.in = value; + return this; + } + + public PaymentSourceIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PaymentSourceIdParams build() { + return new PaymentSourceIdParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PaymentMethodParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private PaymentMethodParams(PaymentMethodBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for PaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentMethodBuilder builder() { + return new PaymentMethodBuilder(); + } + + public static final class PaymentMethodBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private PaymentMethodBuilder() {} + + public PaymentMethodBuilder is(Is value) { + this.is = value; + return this; + } + + public PaymentMethodBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public PaymentMethodBuilder in(String value) { + this.in = value; + return this; + } + + public PaymentMethodBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public PaymentMethodParams build() { + return new PaymentMethodParams(this); + } + } + + public enum Is { + CARD("card"), + + CASH("cash"), + + CHECK("check"), + + CHARGEBACK("chargeback"), + + BANK_TRANSFER("bank_transfer"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + ALIPAY("alipay"), + + UNIONPAY("unionpay"), + + APPLE_PAY("apple_pay"), + + WECHAT_PAY("wechat_pay"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + IDEAL("ideal"), + + GOOGLE_PAY("google_pay"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GIROPAY("giropay"), + + DOTPAY("dotpay"), + + OTHER("other"), + + APP_STORE("app_store"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PLAY_STORE("play_store"), + + CUSTOM("custom"), + + BOLETO("boleto"), + + VENMO("venmo"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + CARD("card"), + + CASH("cash"), + + CHECK("check"), + + CHARGEBACK("chargeback"), + + BANK_TRANSFER("bank_transfer"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + ALIPAY("alipay"), + + UNIONPAY("unionpay"), + + APPLE_PAY("apple_pay"), + + WECHAT_PAY("wechat_pay"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + IDEAL("ideal"), + + GOOGLE_PAY("google_pay"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GIROPAY("giropay"), + + DOTPAY("dotpay"), + + OTHER("other"), + + APP_STORE("app_store"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PLAY_STORE("play_store"), + + CUSTOM("custom"), + + BOLETO("boleto"), + + VENMO("venmo"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class GatewayParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private GatewayParams(GatewayBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for GatewayParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GatewayBuilder builder() { + return new GatewayBuilder(); + } + + public static final class GatewayBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private GatewayBuilder() {} + + public GatewayBuilder is(Is value) { + this.is = value; + return this; + } + + public GatewayBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public GatewayBuilder in(String value) { + this.in = value; + return this; + } + + public GatewayBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public GatewayParams build() { + return new GatewayParams(this); + } + } + + public enum Is { + 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"), + + GOCARDLESS("gocardless"), + + 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"), + + NOT_APPLICABLE("not_applicable"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + 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"), + + GOCARDLESS("gocardless"), + + 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"), + + NOT_APPLICABLE("not_applicable"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class GatewayAccountIdParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final String in; + + private final String notIn; + + private GatewayAccountIdParams(GatewayAccountIdBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for GatewayAccountIdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GatewayAccountIdBuilder builder() { + return new GatewayAccountIdBuilder(); + } + + public static final class GatewayAccountIdBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private String in; + + private String notIn; + + private GatewayAccountIdBuilder() {} + + public GatewayAccountIdBuilder is(String value) { + this.is = value; + return this; + } + + public GatewayAccountIdBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public GatewayAccountIdBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public GatewayAccountIdBuilder in(String value) { + this.in = value; + return this; + } + + public GatewayAccountIdBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public GatewayAccountIdParams build() { + return new GatewayAccountIdParams(this); + } + } + } + + public static final class IdAtGatewayParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private IdAtGatewayParams(IdAtGatewayBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + return formData; + } + + /** Create a new builder for IdAtGatewayParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static IdAtGatewayBuilder builder() { + return new IdAtGatewayBuilder(); + } + + public static final class IdAtGatewayBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IdAtGatewayBuilder() {} + + public IdAtGatewayBuilder is(String value) { + this.is = value; + return this; + } + + public IdAtGatewayBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public IdAtGatewayBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public IdAtGatewayParams build() { + return new IdAtGatewayParams(this); + } + } + } + + public static final class ReferenceNumberParams { + + private final String is; + + private final String isNot; + + private final String startsWith; + + private final IsPresent isPresent; + + private ReferenceNumberParams(ReferenceNumberBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.startsWith = builder.startsWith; + + this.isPresent = builder.isPresent; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getStartsWith() { + return startsWith; + } + + public IsPresent getIsPresent() { + return isPresent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.startsWith != null) { + + formData.put("starts_with", this.startsWith); + } + + if (this.isPresent != null) { + + formData.put("is_present", this.isPresent); + } + + return formData; + } + + /** Create a new builder for ReferenceNumberParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ReferenceNumberBuilder builder() { + return new ReferenceNumberBuilder(); + } + + public static final class ReferenceNumberBuilder { + + private String is; + + private String isNot; + + private String startsWith; + + private IsPresent isPresent; + + private ReferenceNumberBuilder() {} + + public ReferenceNumberBuilder is(String value) { + this.is = value; + return this; + } + + public ReferenceNumberBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public ReferenceNumberBuilder startsWith(String value) { + this.startsWith = value; + return this; + } + + public ReferenceNumberBuilder isPresent(IsPresent value) { + this.isPresent = value; + return this; + } + + public ReferenceNumberParams build() { + return new ReferenceNumberParams(this); + } + } + + public enum IsPresent { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that IsPresent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsPresent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsPresent fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsPresent enumValue : IsPresent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TypeParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private TypeParams(TypeBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for TypeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TypeBuilder builder() { + return new TypeBuilder(); + } + + public static final class TypeBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private TypeBuilder() {} + + public TypeBuilder is(Is value) { + this.is = value; + return this; + } + + public TypeBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public TypeBuilder in(String value) { + this.in = value; + return this; + } + + public TypeBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public TypeParams build() { + return new TypeParams(this); + } + } + + public enum Is { + AUTHORIZATION("authorization"), + + PAYMENT("payment"), + + REFUND("refund"), + + PAYMENT_REVERSAL("payment_reversal"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + AUTHORIZATION("authorization"), + + PAYMENT("payment"), + + REFUND("refund"), + + PAYMENT_REVERSAL("payment_reversal"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DateParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private DateParams(DateBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for DateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DateBuilder builder() { + return new DateBuilder(); + } + + public static final class DateBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private DateBuilder() {} + + public DateBuilder after(String value) { + this.after = value; + return this; + } + + public DateBuilder before(String value) { + this.before = value; + return this; + } + + public DateBuilder on(String value) { + this.on = value; + return this; + } + + public DateBuilder between(String value) { + this.between = value; + return this; + } + + public DateParams build() { + return new DateParams(this); + } + } + } + + public static final class AmountParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private AmountParams(AmountBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for AmountParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AmountBuilder builder() { + return new AmountBuilder(); + } + + public static final class AmountBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private AmountBuilder() {} + + public AmountBuilder is(String value) { + this.is = value; + return this; + } + + public AmountBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public AmountBuilder lt(String value) { + this.lt = value; + return this; + } + + public AmountBuilder lte(String value) { + this.lte = value; + return this; + } + + public AmountBuilder gt(String value) { + this.gt = value; + return this; + } + + public AmountBuilder gte(String value) { + this.gte = value; + return this; + } + + public AmountBuilder between(String value) { + this.between = value; + return this; + } + + public AmountParams build() { + return new AmountParams(this); + } + } + } + + public static final class AmountCapturableParams { + + private final String is; + + private final String isNot; + + private final String lt; + + private final String lte; + + private final String gt; + + private final String gte; + + private final String between; + + private AmountCapturableParams(AmountCapturableBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.lt = builder.lt; + + this.lte = builder.lte; + + this.gt = builder.gt; + + this.gte = builder.gte; + + this.between = builder.between; + } + + public String getIs() { + return is; + } + + public String getIsNot() { + return isNot; + } + + public String getLt() { + return lt; + } + + public String getLte() { + return lte; + } + + public String getGt() { + return gt; + } + + public String getGte() { + return gte; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.lt != null) { + + formData.put("lt", this.lt); + } + + if (this.lte != null) { + + formData.put("lte", this.lte); + } + + if (this.gt != null) { + + formData.put("gt", this.gt); + } + + if (this.gte != null) { + + formData.put("gte", this.gte); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for AmountCapturableParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AmountCapturableBuilder builder() { + return new AmountCapturableBuilder(); + } + + public static final class AmountCapturableBuilder { + + private String is; + + private String isNot; + + private String lt; + + private String lte; + + private String gt; + + private String gte; + + private String between; + + private AmountCapturableBuilder() {} + + public AmountCapturableBuilder is(String value) { + this.is = value; + return this; + } + + public AmountCapturableBuilder isNot(String value) { + this.isNot = value; + return this; + } + + public AmountCapturableBuilder lt(String value) { + this.lt = value; + return this; + } + + public AmountCapturableBuilder lte(String value) { + this.lte = value; + return this; + } + + public AmountCapturableBuilder gt(String value) { + this.gt = value; + return this; + } + + public AmountCapturableBuilder gte(String value) { + this.gte = value; + return this; + } + + public AmountCapturableBuilder between(String value) { + this.between = value; + return this; + } + + public AmountCapturableParams build() { + return new AmountCapturableParams(this); + } + } + } + + public static final class StatusParams { + + private final Is is; + + private final IsNot isNot; + + private final String in; + + private final String notIn; + + private StatusParams(StatusBuilder builder) { + + this.is = builder.is; + + this.isNot = builder.isNot; + + this.in = builder.in; + + this.notIn = builder.notIn; + } + + public Is getIs() { + return is; + } + + public IsNot getIsNot() { + return isNot; + } + + public String getIn() { + return in; + } + + public String getNotIn() { + return notIn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.is != null) { + + formData.put("is", this.is); + } + + if (this.isNot != null) { + + formData.put("is_not", this.isNot); + } + + if (this.in != null) { + + formData.put("in", this.in); + } + + if (this.notIn != null) { + + formData.put("not_in", this.notIn); + } + + return formData; + } + + /** Create a new builder for StatusParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatusBuilder builder() { + return new StatusBuilder(); + } + + public static final class StatusBuilder { + + private Is is; + + private IsNot isNot; + + private String in; + + private String notIn; + + private StatusBuilder() {} + + public StatusBuilder is(Is value) { + this.is = value; + return this; + } + + public StatusBuilder isNot(IsNot value) { + this.isNot = value; + return this; + } + + public StatusBuilder in(String value) { + this.in = value; + return this; + } + + public StatusBuilder notIn(String value) { + this.notIn = value; + return this; + } + + public StatusParams build() { + return new StatusParams(this); + } + } + + public enum Is { + IN_PROGRESS("in_progress"), + + SUCCESS("success"), + + VOIDED("voided"), + + FAILURE("failure"), + + TIMEOUT("timeout"), + + NEEDS_ATTENTION("needs_attention"), + + LATE_FAILURE("late_failure"), + + /** An enum member indicating that Is was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Is(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Is fromString(String value) { + if (value == null) return _UNKNOWN; + for (Is enumValue : Is.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum IsNot { + IN_PROGRESS("in_progress"), + + SUCCESS("success"), + + VOIDED("voided"), + + FAILURE("failure"), + + TIMEOUT("timeout"), + + NEEDS_ATTENTION("needs_attention"), + + LATE_FAILURE("late_failure"), + + /** An enum member indicating that IsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + IsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static IsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (IsNot enumValue : IsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class UpdatedAtParams { + + private final String after; + + private final String before; + + private final String on; + + private final String between; + + private UpdatedAtParams(UpdatedAtBuilder builder) { + + this.after = builder.after; + + this.before = builder.before; + + this.on = builder.on; + + this.between = builder.between; + } + + public String getAfter() { + return after; + } + + public String getBefore() { + return before; + } + + public String getOn() { + return on; + } + + public String getBetween() { + return between; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.after != null) { + + formData.put("after", this.after); + } + + if (this.before != null) { + + formData.put("before", this.before); + } + + if (this.on != null) { + + formData.put("on", this.on); + } + + if (this.between != null) { + + formData.put("between", this.between); + } + + return formData; + } + + /** Create a new builder for UpdatedAtParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdatedAtBuilder builder() { + return new UpdatedAtBuilder(); + } + + public static final class UpdatedAtBuilder { + + private String after; + + private String before; + + private String on; + + private String between; + + private UpdatedAtBuilder() {} + + public UpdatedAtBuilder after(String value) { + this.after = value; + return this; + } + + public UpdatedAtBuilder before(String value) { + this.before = value; + return this; + } + + public UpdatedAtBuilder on(String value) { + this.on = value; + return this; + } + + public UpdatedAtBuilder between(String value) { + this.between = value; + return this; + } + + public UpdatedAtParams build() { + return new UpdatedAtParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportAddonsResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportAddonsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportAddonsResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportAddonsResponse.java index 1b48185c..90a2f993 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportAddonsResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportAddonsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportAttachedItemsResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportAttachedItemsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportAttachedItemsResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportAttachedItemsResponse.java index 338af510..7eaa3b9f 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportAttachedItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportAttachedItemsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportCouponsResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportCouponsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportCouponsResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportCouponsResponse.java index a237dd2e..535465ba 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportCouponsResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportCouponsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportCreditNotesResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportCreditNotesResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportCreditNotesResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportCreditNotesResponse.java index 0fa65929..da8f1173 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportCreditNotesResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportCreditNotesResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportCustomersResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportCustomersResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportCustomersResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportCustomersResponse.java index 529868b2..bc9c1e1c 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportCustomersResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportCustomersResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportDeferredRevenueResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportDeferredRevenueResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportDeferredRevenueResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportDeferredRevenueResponse.java index f1ce2826..2149807a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportDeferredRevenueResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportDeferredRevenueResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportDifferentialPricesResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportDifferentialPricesResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportDifferentialPricesResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportDifferentialPricesResponse.java index 0b1432d9..017a0e61 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportDifferentialPricesResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportDifferentialPricesResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportInvoicesResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportInvoicesResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportInvoicesResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportInvoicesResponse.java index 52bc4f42..f4769bcf 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportInvoicesResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportInvoicesResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportItemFamiliesResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportItemFamiliesResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportItemFamiliesResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportItemFamiliesResponse.java index 9cc4eb85..29ea0b80 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportItemFamiliesResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportItemFamiliesResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportItemPricesResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportItemPricesResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportItemPricesResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportItemPricesResponse.java index 35dbb616..b43a4945 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportItemPricesResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportItemPricesResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportItemsResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportItemsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportItemsResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportItemsResponse.java index f6e490f1..da9b2ca3 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportItemsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportOrdersResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportOrdersResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportOrdersResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportOrdersResponse.java index 991d647d..0868e166 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportOrdersResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportOrdersResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportPlansResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportPlansResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportPlansResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportPlansResponse.java index 4a39be1f..083fd62e 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportPlansResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportPlansResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportPriceVariantsResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportPriceVariantsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportPriceVariantsResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportPriceVariantsResponse.java index 13d773ab..57abf578 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportPriceVariantsResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportPriceVariantsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/export/responses/ExportRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportRetrieveResponse.java new file mode 100644 index 00000000..e4512ddb --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.export.responses; + +import com.chargebee.v4.models.export.Export; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ExportRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class ExportRetrieveResponse extends BaseResponse { + private final Export export; + + private ExportRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.export = builder.export; + } + + /** Parse JSON response into ExportRetrieveResponse object. */ + public static ExportRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ExportRetrieveResponse object with HTTP response. */ + public static ExportRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __exportJson = JsonUtil.getObject(json, "export"); + if (__exportJson != null) { + builder.export(Export.fromJson(__exportJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ExportRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for ExportRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ExportRetrieveResponse. */ + public static class Builder { + + private Export export; + + private Response httpResponse; + + private Builder() {} + + public Builder export(Export export) { + this.export = export; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ExportRetrieveResponse build() { + return new ExportRetrieveResponse(this); + } + } + + /** Get the export from the response. */ + public Export getExport() { + return export; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportRevenueRecognitionResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportRevenueRecognitionResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportRevenueRecognitionResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportRevenueRecognitionResponse.java index b21b706e..5cb5dfb2 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportRevenueRecognitionResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportRevenueRecognitionResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportSubscriptionsResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportSubscriptionsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportSubscriptionsResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportSubscriptionsResponse.java index 5bd71e12..ee83676b 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportSubscriptionsResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportSubscriptionsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/export/ExportTransactionsResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportTransactionsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/export/ExportTransactionsResponse.java rename to src/main/java/com/chargebee/v4/models/export/responses/ExportTransactionsResponse.java index 1f318641..ffdd1263 100644 --- a/src/main/java/com/chargebee/v4/core/responses/export/ExportTransactionsResponse.java +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportTransactionsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.export; +package com.chargebee.v4.models.export.responses; -import com.chargebee.v4.core.models.export.Export; +import com.chargebee.v4.models.export.Export; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/feature/Feature.java b/src/main/java/com/chargebee/v4/models/feature/Feature.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/models/feature/Feature.java rename to src/main/java/com/chargebee/v4/models/feature/Feature.java index 234878e5..5984578c 100644 --- a/src/main/java/com/chargebee/v4/core/models/feature/Feature.java +++ b/src/main/java/com/chargebee/v4/models/feature/Feature.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.feature; +package com.chargebee.v4.models.feature; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; @@ -24,7 +24,7 @@ public class Feature { private Timestamp createdAt; private List levels; - private java.util.Map customFields = new java.util.HashMap<>(); + private java.util.Map customFields = new java.util.HashMap<>(); public String getId() { return id; @@ -72,7 +72,7 @@ public List getLevels() { * * @return map containing all custom fields */ - public java.util.Map getCustomFields() { + public java.util.Map getCustomFields() { return customFields; } @@ -82,7 +82,7 @@ public java.util.Map getCustomFields() { * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") * @return the value of the custom field, or null if not present */ - public Object getCustomField(String fieldName) { + public String getCustomField(String fieldName) { return customFields.get(fieldName); } @@ -151,7 +151,7 @@ public static Type fromString(String value) { public static Feature fromJson(String json) { Feature obj = new Feature(); - // Parse JSON to extract all keys + // Parse JSON to extract all keys for custom field extraction java.util.Set knownFields = new java.util.HashSet<>(); knownFields.add("id"); @@ -211,9 +211,9 @@ public static Feature fromJson(String json) { * @param knownFields set of known field names * @return map of custom fields */ - private static java.util.Map extractCustomFields( + private static java.util.Map extractCustomFields( String json, java.util.Set knownFields) { - java.util.Map customFields = new java.util.HashMap<>(); + java.util.Map customFields = new java.util.HashMap<>(); try { // Parse the entire JSON as a map java.util.Map allFields = JsonUtil.parseJsonObjectToMap(json); @@ -222,7 +222,8 @@ private static java.util.Map extractCustomFields( String key = entry.getKey(); // Include fields that start with "cf_" and are not in knownFields if (key != null && key.startsWith("cf_") && !knownFields.contains(key)) { - customFields.put(key, entry.getValue()); + customFields.put( + key, entry.getValue() != null ? String.valueOf(entry.getValue()) : null); } } } diff --git a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureActivateParams.java b/src/main/java/com/chargebee/v4/models/feature/params/FeatureActivateParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/feature/params/FeatureActivateParams.java rename to src/main/java/com/chargebee/v4/models/feature/params/FeatureActivateParams.java index b65f25c1..f99288ff 100644 --- a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureActivateParams.java +++ b/src/main/java/com/chargebee/v4/models/feature/params/FeatureActivateParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.feature.params; +package com.chargebee.v4.models.feature.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class FeatureActivateParams { - private final Map formData; - - private FeatureActivateParams(FeatureActivateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private FeatureActivateParams(FeatureActivateBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static FeatureActivateBuilder builder() { } public static final class FeatureActivateBuilder { - private final Map formData = new LinkedHashMap<>(); private FeatureActivateBuilder() {} diff --git a/src/main/java/com/chargebee/v4/models/feature/params/FeatureArchiveParams.java b/src/main/java/com/chargebee/v4/models/feature/params/FeatureArchiveParams.java new file mode 100644 index 00000000..0cff933d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/feature/params/FeatureArchiveParams.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.feature.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class FeatureArchiveParams { + + private FeatureArchiveParams(FeatureArchiveBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for FeatureArchiveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static FeatureArchiveBuilder builder() { + return new FeatureArchiveBuilder(); + } + + public static final class FeatureArchiveBuilder { + + private FeatureArchiveBuilder() {} + + public FeatureArchiveParams build() { + return new FeatureArchiveParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/feature/params/FeatureCreateParams.java b/src/main/java/com/chargebee/v4/models/feature/params/FeatureCreateParams.java new file mode 100644 index 00000000..cceefe75 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/feature/params/FeatureCreateParams.java @@ -0,0 +1,363 @@ +/* + * 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.feature.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class FeatureCreateParams { + + private final String id; + + private final String name; + + private final String description; + + private final Type type; + + private final String unit; + + private final List levels; + + private final Map customFields; + + private FeatureCreateParams(FeatureCreateBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.description = builder.description; + + this.type = builder.type; + + this.unit = builder.unit; + + this.levels = builder.levels; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public Type getType() { + return type; + } + + public String getUnit() { + return unit; + } + + public List getLevels() { + return levels; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.unit != null) { + + formData.put("unit", this.unit); + } + + if (this.levels != null) { + + // List of objects + for (int i = 0; i < this.levels.size(); i++) { + LevelsParams item = this.levels.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "levels[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for FeatureCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static FeatureCreateBuilder builder() { + return new FeatureCreateBuilder(); + } + + public static final class FeatureCreateBuilder { + + private String id; + + private String name; + + private String description; + + private Type type; + + private String unit; + + private List levels; + + private Map customFields = new LinkedHashMap<>(); + + private FeatureCreateBuilder() {} + + public FeatureCreateBuilder id(String value) { + this.id = value; + return this; + } + + public FeatureCreateBuilder name(String value) { + this.name = value; + return this; + } + + public FeatureCreateBuilder description(String value) { + this.description = value; + return this; + } + + public FeatureCreateBuilder type(Type value) { + this.type = value; + return this; + } + + public FeatureCreateBuilder unit(String value) { + this.unit = value; + return this; + } + + public FeatureCreateBuilder levels(List value) { + this.levels = 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 FeatureCreateBuilder 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 FeatureCreateBuilder 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 FeatureCreateParams build() { + return new FeatureCreateParams(this); + } + } + + public enum Type { + SWITCH("switch"), + + CUSTOM("custom"), + + QUANTITY("quantity"), + + RANGE("range"), + + /** 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 static final class LevelsParams { + + private final String name; + + private final String value; + + private final Boolean isUnlimited; + + private final Integer level; + + private LevelsParams(LevelsBuilder builder) { + + this.name = builder.name; + + this.value = builder.value; + + this.isUnlimited = builder.isUnlimited; + + this.level = builder.level; + } + + public String getName() { + return name; + } + + public String getValue() { + return value; + } + + public Boolean getIsUnlimited() { + return isUnlimited; + } + + public Integer getLevel() { + return level; + } + + /** 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.value != null) { + + formData.put("value", this.value); + } + + if (this.isUnlimited != null) { + + formData.put("is_unlimited", this.isUnlimited); + } + + if (this.level != null) { + + formData.put("level", this.level); + } + + return formData; + } + + /** Create a new builder for LevelsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static LevelsBuilder builder() { + return new LevelsBuilder(); + } + + public static final class LevelsBuilder { + + private String name; + + private String value; + + private Boolean isUnlimited; + + private Integer level; + + private LevelsBuilder() {} + + public LevelsBuilder name(String value) { + this.name = value; + return this; + } + + public LevelsBuilder value(String value) { + this.value = value; + return this; + } + + public LevelsBuilder isUnlimited(Boolean value) { + this.isUnlimited = value; + return this; + } + + public LevelsBuilder level(Integer value) { + this.level = value; + return this; + } + + public LevelsParams build() { + return new LevelsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/feature/params/FeatureDeleteParams.java b/src/main/java/com/chargebee/v4/models/feature/params/FeatureDeleteParams.java new file mode 100644 index 00000000..3178152d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/feature/params/FeatureDeleteParams.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.feature.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class FeatureDeleteParams { + + private FeatureDeleteParams(FeatureDeleteBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for FeatureDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static FeatureDeleteBuilder builder() { + return new FeatureDeleteBuilder(); + } + + public static final class FeatureDeleteBuilder { + + private FeatureDeleteBuilder() {} + + public FeatureDeleteParams build() { + return new FeatureDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureListParams.java b/src/main/java/com/chargebee/v4/models/feature/params/FeatureListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/feature/params/FeatureListParams.java rename to src/main/java/com/chargebee/v4/models/feature/params/FeatureListParams.java index c44eaab4..aca8b522 100644 --- a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureListParams.java +++ b/src/main/java/com/chargebee/v4/models/feature/params/FeatureListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.feature.params; +package com.chargebee.v4.models.feature.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureReactivateParams.java b/src/main/java/com/chargebee/v4/models/feature/params/FeatureReactivateParams.java similarity index 77% rename from src/main/java/com/chargebee/v4/core/models/feature/params/FeatureReactivateParams.java rename to src/main/java/com/chargebee/v4/models/feature/params/FeatureReactivateParams.java index e4e59c01..4df5a476 100644 --- a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureReactivateParams.java +++ b/src/main/java/com/chargebee/v4/models/feature/params/FeatureReactivateParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.feature.params; +package com.chargebee.v4.models.feature.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class FeatureReactivateParams { - private final Map formData; - - private FeatureReactivateParams(FeatureReactivateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private FeatureReactivateParams(FeatureReactivateBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static FeatureReactivateBuilder builder() { } public static final class FeatureReactivateBuilder { - private final Map formData = new LinkedHashMap<>(); private FeatureReactivateBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureRetrieveParams.java b/src/main/java/com/chargebee/v4/models/feature/params/FeatureRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/feature/params/FeatureRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/feature/params/FeatureRetrieveParams.java index 74a7cd20..f2a35e6c 100644 --- a/src/main/java/com/chargebee/v4/core/models/feature/params/FeatureRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/feature/params/FeatureRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.feature.params; +package com.chargebee.v4.models.feature.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/feature/params/FeatureUpdateParams.java b/src/main/java/com/chargebee/v4/models/feature/params/FeatureUpdateParams.java new file mode 100644 index 00000000..9fcab768 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/feature/params/FeatureUpdateParams.java @@ -0,0 +1,291 @@ +/* + * 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.feature.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class FeatureUpdateParams { + + private final String name; + + private final String description; + + private final String unit; + + private final List levels; + + private final Map customFields; + + private FeatureUpdateParams(FeatureUpdateBuilder builder) { + + this.name = builder.name; + + this.description = builder.description; + + this.unit = builder.unit; + + this.levels = builder.levels; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public String getUnit() { + return unit; + } + + public List getLevels() { + return levels; + } + + 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.description != null) { + + formData.put("description", this.description); + } + + if (this.unit != null) { + + formData.put("unit", this.unit); + } + + if (this.levels != null) { + + // List of objects + for (int i = 0; i < this.levels.size(); i++) { + LevelsParams item = this.levels.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "levels[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for FeatureUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static FeatureUpdateBuilder builder() { + return new FeatureUpdateBuilder(); + } + + public static final class FeatureUpdateBuilder { + + private String name; + + private String description; + + private String unit; + + private List levels; + + private Map customFields = new LinkedHashMap<>(); + + private FeatureUpdateBuilder() {} + + public FeatureUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public FeatureUpdateBuilder description(String value) { + this.description = value; + return this; + } + + public FeatureUpdateBuilder unit(String value) { + this.unit = value; + return this; + } + + public FeatureUpdateBuilder levels(List value) { + this.levels = 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 FeatureUpdateBuilder 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 FeatureUpdateBuilder 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 FeatureUpdateParams build() { + return new FeatureUpdateParams(this); + } + } + + public static final class LevelsParams { + + private final String name; + + private final String value; + + private final Boolean isUnlimited; + + private final Integer level; + + private LevelsParams(LevelsBuilder builder) { + + this.name = builder.name; + + this.value = builder.value; + + this.isUnlimited = builder.isUnlimited; + + this.level = builder.level; + } + + public String getName() { + return name; + } + + public String getValue() { + return value; + } + + public Boolean getIsUnlimited() { + return isUnlimited; + } + + public Integer getLevel() { + return level; + } + + /** 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.value != null) { + + formData.put("value", this.value); + } + + if (this.isUnlimited != null) { + + formData.put("is_unlimited", this.isUnlimited); + } + + if (this.level != null) { + + formData.put("level", this.level); + } + + return formData; + } + + /** Create a new builder for LevelsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static LevelsBuilder builder() { + return new LevelsBuilder(); + } + + public static final class LevelsBuilder { + + private String name; + + private String value; + + private Boolean isUnlimited; + + private Integer level; + + private LevelsBuilder() {} + + public LevelsBuilder name(String value) { + this.name = value; + return this; + } + + public LevelsBuilder value(String value) { + this.value = value; + return this; + } + + public LevelsBuilder isUnlimited(Boolean value) { + this.isUnlimited = value; + return this; + } + + public LevelsBuilder level(Integer value) { + this.level = value; + return this; + } + + public LevelsParams build() { + return new LevelsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureActivateResponse.java b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureActivateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/feature/FeatureActivateResponse.java rename to src/main/java/com/chargebee/v4/models/feature/responses/FeatureActivateResponse.java index 7f1aef90..67b4455a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureActivateResponse.java +++ b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureActivateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.feature; +package com.chargebee.v4.models.feature.responses; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.feature.Feature; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureArchiveResponse.java b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureArchiveResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/feature/FeatureArchiveResponse.java rename to src/main/java/com/chargebee/v4/models/feature/responses/FeatureArchiveResponse.java index 6bf46e6d..6b6e660b 100644 --- a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureArchiveResponse.java +++ b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureArchiveResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.feature; +package com.chargebee.v4.models.feature.responses; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.feature.Feature; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureCreateResponse.java b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/feature/FeatureCreateResponse.java rename to src/main/java/com/chargebee/v4/models/feature/responses/FeatureCreateResponse.java index 448885a6..63e79399 100644 --- a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.feature; +package com.chargebee.v4.models.feature.responses; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.feature.Feature; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureDeleteResponse.java b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/feature/FeatureDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/feature/responses/FeatureDeleteResponse.java index 04a78ae3..fd291c94 100644 --- a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.feature; +package com.chargebee.v4.models.feature.responses; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.feature.Feature; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureListResponse.java b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureListResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/feature/FeatureListResponse.java rename to src/main/java/com/chargebee/v4/models/feature/responses/FeatureListResponse.java index faca6d61..0b93136a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureListResponse.java +++ b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.feature; +package com.chargebee.v4.models.feature.responses; import java.util.List; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.feature.Feature; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.FeatureService; -import com.chargebee.v4.core.models.feature.params.FeatureListParams; +import com.chargebee.v4.services.FeatureService; +import com.chargebee.v4.models.feature.params.FeatureListParams; /** Immutable response object for FeatureList operation. Contains paginated list data. */ public final class FeatureListResponse { @@ -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 FeatureListResponse nextPage() throws Exception { + public FeatureListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureReactivateResponse.java b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureReactivateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/feature/FeatureReactivateResponse.java rename to src/main/java/com/chargebee/v4/models/feature/responses/FeatureReactivateResponse.java index 847287fc..b3599ad9 100644 --- a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureReactivateResponse.java +++ b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureReactivateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.feature; +package com.chargebee.v4.models.feature.responses; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.feature.Feature; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/feature/responses/FeatureRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureRetrieveResponse.java new file mode 100644 index 00000000..67d23900 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.feature.responses; + +import com.chargebee.v4.models.feature.Feature; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for FeatureRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class FeatureRetrieveResponse extends BaseResponse { + private final Feature feature; + + private FeatureRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.feature = builder.feature; + } + + /** Parse JSON response into FeatureRetrieveResponse object. */ + public static FeatureRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into FeatureRetrieveResponse object with HTTP response. */ + public static FeatureRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __featureJson = JsonUtil.getObject(json, "feature"); + if (__featureJson != null) { + builder.feature(Feature.fromJson(__featureJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse FeatureRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for FeatureRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for FeatureRetrieveResponse. */ + public static class Builder { + + private Feature feature; + + private Response httpResponse; + + private Builder() {} + + public Builder feature(Feature feature) { + this.feature = feature; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public FeatureRetrieveResponse build() { + return new FeatureRetrieveResponse(this); + } + } + + /** Get the feature from the response. */ + public Feature getFeature() { + return feature; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureUpdateResponse.java b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/feature/FeatureUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/feature/responses/FeatureUpdateResponse.java index 06b73aac..8350aa08 100644 --- a/src/main/java/com/chargebee/v4/core/responses/feature/FeatureUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/feature/responses/FeatureUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.feature; +package com.chargebee.v4.models.feature.responses; -import com.chargebee.v4.core.models.feature.Feature; +import com.chargebee.v4.models.feature.Feature; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/fullExport/params/FullExportStatusParams.java b/src/main/java/com/chargebee/v4/models/fullExport/params/FullExportStatusParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/fullExport/params/FullExportStatusParams.java rename to src/main/java/com/chargebee/v4/models/fullExport/params/FullExportStatusParams.java index 0e9b737e..4e451af0 100644 --- a/src/main/java/com/chargebee/v4/core/models/fullExport/params/FullExportStatusParams.java +++ b/src/main/java/com/chargebee/v4/models/fullExport/params/FullExportStatusParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.fullExport.params; +package com.chargebee.v4.models.fullExport.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/fullExport/responses/FullExportStatusResponse.java b/src/main/java/com/chargebee/v4/models/fullExport/responses/FullExportStatusResponse.java new file mode 100644 index 00000000..6b27039e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/fullExport/responses/FullExportStatusResponse.java @@ -0,0 +1,72 @@ +package com.chargebee.v4.models.fullExport.responses; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for FullExportStatus operation. Contains the response data from a + * single resource get operation. + */ +public final class FullExportStatusResponse extends BaseResponse { + private final Object fullExport; + + private FullExportStatusResponse(Builder builder) { + super(builder.httpResponse); + + this.fullExport = builder.fullExport; + } + + /** Parse JSON response into FullExportStatusResponse object. */ + public static FullExportStatusResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into FullExportStatusResponse object with HTTP response. */ + public static FullExportStatusResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + builder.fullExport(JsonUtil.getObject(json, "full_export")); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse FullExportStatusResponse from JSON", e); + } + } + + /** Create a new builder for FullExportStatusResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for FullExportStatusResponse. */ + public static class Builder { + + private Object fullExport; + + private Response httpResponse; + + private Builder() {} + + public Builder fullExport(Object fullExport) { + this.fullExport = fullExport; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public FullExportStatusResponse build() { + return new FullExportStatusResponse(this); + } + } + + /** Get the fullExport from the response. */ + public Object getFullExport() { + return fullExport; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/gatewayErrorDetail/GatewayErrorDetail.java b/src/main/java/com/chargebee/v4/models/gatewayErrorDetail/GatewayErrorDetail.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/gatewayErrorDetail/GatewayErrorDetail.java rename to src/main/java/com/chargebee/v4/models/gatewayErrorDetail/GatewayErrorDetail.java index bfb2f77d..276ee194 100644 --- a/src/main/java/com/chargebee/v4/core/models/gatewayErrorDetail/GatewayErrorDetail.java +++ b/src/main/java/com/chargebee/v4/models/gatewayErrorDetail/GatewayErrorDetail.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.gatewayErrorDetail; +package com.chargebee.v4.models.gatewayErrorDetail; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/core/models/gift/Gift.java b/src/main/java/com/chargebee/v4/models/gift/Gift.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/gift/Gift.java rename to src/main/java/com/chargebee/v4/models/gift/Gift.java index e9ea9c11..9e32fa4b 100644 --- a/src/main/java/com/chargebee/v4/core/models/gift/Gift.java +++ b/src/main/java/com/chargebee/v4/models/gift/Gift.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.gift; +package com.chargebee.v4.models.gift; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/gift/params/GiftCancelParams.java b/src/main/java/com/chargebee/v4/models/gift/params/GiftCancelParams.java new file mode 100644 index 00000000..07894bde --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/gift/params/GiftCancelParams.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.gift.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class GiftCancelParams { + + private GiftCancelParams(GiftCancelBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for GiftCancelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GiftCancelBuilder builder() { + return new GiftCancelBuilder(); + } + + public static final class GiftCancelBuilder { + + private GiftCancelBuilder() {} + + public GiftCancelParams build() { + return new GiftCancelParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/gift/params/GiftClaimParams.java b/src/main/java/com/chargebee/v4/models/gift/params/GiftClaimParams.java new file mode 100644 index 00000000..40be4041 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/gift/params/GiftClaimParams.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.gift.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class GiftClaimParams { + + private GiftClaimParams(GiftClaimBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for GiftClaimParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GiftClaimBuilder builder() { + return new GiftClaimBuilder(); + } + + public static final class GiftClaimBuilder { + + private GiftClaimBuilder() {} + + public GiftClaimParams build() { + return new GiftClaimParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateForItemsParams.java b/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateForItemsParams.java new file mode 100644 index 00000000..be7fc109 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateForItemsParams.java @@ -0,0 +1,1422 @@ +/* + * 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.gift.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class GiftCreateForItemsParams { + + private final Timestamp scheduledAt; + + private final Boolean autoClaim; + + private final Boolean noExpiry; + + private final Timestamp claimExpiryDate; + + private final List couponIds; + + private final java.util.Map metaData; + + private final GifterParams gifter; + + private final GiftReceiverParams giftReceiver; + + private final PaymentIntentParams paymentIntent; + + private final ShippingAddressParams shippingAddress; + + private final List subscriptionItems; + + private final List itemTiers; + + private GiftCreateForItemsParams(GiftCreateForItemsBuilder builder) { + + this.scheduledAt = builder.scheduledAt; + + this.autoClaim = builder.autoClaim; + + this.noExpiry = builder.noExpiry; + + this.claimExpiryDate = builder.claimExpiryDate; + + this.couponIds = builder.couponIds; + + this.metaData = builder.metaData; + + this.gifter = builder.gifter; + + this.giftReceiver = builder.giftReceiver; + + this.paymentIntent = builder.paymentIntent; + + this.shippingAddress = builder.shippingAddress; + + this.subscriptionItems = builder.subscriptionItems; + + this.itemTiers = builder.itemTiers; + } + + public Timestamp getScheduledAt() { + return scheduledAt; + } + + public Boolean getAutoClaim() { + return autoClaim; + } + + public Boolean getNoExpiry() { + return noExpiry; + } + + public Timestamp getClaimExpiryDate() { + return claimExpiryDate; + } + + public List getCouponIds() { + return couponIds; + } + + public java.util.Map getMetaData() { + return metaData; + } + + public GifterParams getGifter() { + return gifter; + } + + public GiftReceiverParams getGiftReceiver() { + return giftReceiver; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + public List getItemTiers() { + return itemTiers; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.scheduledAt != null) { + + formData.put("scheduled_at", this.scheduledAt); + } + + if (this.autoClaim != null) { + + formData.put("auto_claim", this.autoClaim); + } + + if (this.noExpiry != null) { + + formData.put("no_expiry", this.noExpiry); + } + + if (this.claimExpiryDate != null) { + + formData.put("claim_expiry_date", this.claimExpiryDate); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + if (this.gifter != null) { + + // Single object + Map nestedData = this.gifter.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "gifter[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.giftReceiver != null) { + + // Single object + Map nestedData = this.giftReceiver.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "gift_receiver[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for GiftCreateForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GiftCreateForItemsBuilder builder() { + return new GiftCreateForItemsBuilder(); + } + + public static final class GiftCreateForItemsBuilder { + + private Timestamp scheduledAt; + + private Boolean autoClaim; + + private Boolean noExpiry; + + private Timestamp claimExpiryDate; + + private List couponIds; + + private java.util.Map metaData; + + private GifterParams gifter; + + private GiftReceiverParams giftReceiver; + + private PaymentIntentParams paymentIntent; + + private ShippingAddressParams shippingAddress; + + private List subscriptionItems; + + private List itemTiers; + + private GiftCreateForItemsBuilder() {} + + public GiftCreateForItemsBuilder scheduledAt(Timestamp value) { + this.scheduledAt = value; + return this; + } + + public GiftCreateForItemsBuilder autoClaim(Boolean value) { + this.autoClaim = value; + return this; + } + + public GiftCreateForItemsBuilder noExpiry(Boolean value) { + this.noExpiry = value; + return this; + } + + public GiftCreateForItemsBuilder claimExpiryDate(Timestamp value) { + this.claimExpiryDate = value; + return this; + } + + public GiftCreateForItemsBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public GiftCreateForItemsBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public GiftCreateForItemsBuilder gifter(GifterParams value) { + this.gifter = value; + return this; + } + + public GiftCreateForItemsBuilder giftReceiver(GiftReceiverParams value) { + this.giftReceiver = value; + return this; + } + + public GiftCreateForItemsBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public GiftCreateForItemsBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public GiftCreateForItemsBuilder subscriptionItems(List value) { + this.subscriptionItems = value; + return this; + } + + public GiftCreateForItemsBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public GiftCreateForItemsParams build() { + return new GiftCreateForItemsParams(this); + } + } + + public static final class GifterParams { + + private final String customerId; + + private final String signature; + + private final String note; + + private final String paymentSrcId; + + private GifterParams(GifterBuilder builder) { + + this.customerId = builder.customerId; + + this.signature = builder.signature; + + this.note = builder.note; + + this.paymentSrcId = builder.paymentSrcId; + } + + public String getCustomerId() { + return customerId; + } + + public String getSignature() { + return signature; + } + + public String getNote() { + return note; + } + + public String getPaymentSrcId() { + return paymentSrcId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.signature != null) { + + formData.put("signature", this.signature); + } + + if (this.note != null) { + + formData.put("note", this.note); + } + + if (this.paymentSrcId != null) { + + formData.put("payment_src_id", this.paymentSrcId); + } + + return formData; + } + + /** Create a new builder for GifterParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GifterBuilder builder() { + return new GifterBuilder(); + } + + public static final class GifterBuilder { + + private String customerId; + + private String signature; + + private String note; + + private String paymentSrcId; + + private GifterBuilder() {} + + public GifterBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public GifterBuilder signature(String value) { + this.signature = value; + return this; + } + + public GifterBuilder note(String value) { + this.note = value; + return this; + } + + public GifterBuilder paymentSrcId(String value) { + this.paymentSrcId = value; + return this; + } + + public GifterParams build() { + return new GifterParams(this); + } + } + } + + public static final class GiftReceiverParams { + + private final String customerId; + + private final String firstName; + + private final String lastName; + + private final String email; + + private GiftReceiverParams(GiftReceiverBuilder builder) { + + this.customerId = builder.customerId; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + } + + public String getCustomerId() { + return customerId; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getEmail() { + return email; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + 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); + } + + return formData; + } + + /** Create a new builder for GiftReceiverParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GiftReceiverBuilder builder() { + return new GiftReceiverBuilder(); + } + + public static final class GiftReceiverBuilder { + + private String customerId; + + private String firstName; + + private String lastName; + + private String email; + + private GiftReceiverBuilder() {} + + public GiftReceiverBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public GiftReceiverBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public GiftReceiverBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public GiftReceiverBuilder email(String value) { + this.email = value; + return this; + } + + public GiftReceiverParams build() { + return new GiftReceiverParams(this); + } + } + } + + public static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateParams.java b/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateParams.java new file mode 100644 index 00000000..427fc417 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateParams.java @@ -0,0 +1,1277 @@ +/* + * 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.gift.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class GiftCreateParams { + + private final Timestamp scheduledAt; + + private final Boolean autoClaim; + + private final Boolean noExpiry; + + private final Timestamp claimExpiryDate; + + private final List couponIds; + + private final GifterParams gifter; + + private final GiftReceiverParams giftReceiver; + + private final PaymentIntentParams paymentIntent; + + private final ShippingAddressParams shippingAddress; + + private final SubscriptionParams subscription; + + private final List addons; + + private GiftCreateParams(GiftCreateBuilder builder) { + + this.scheduledAt = builder.scheduledAt; + + this.autoClaim = builder.autoClaim; + + this.noExpiry = builder.noExpiry; + + this.claimExpiryDate = builder.claimExpiryDate; + + this.couponIds = builder.couponIds; + + this.gifter = builder.gifter; + + this.giftReceiver = builder.giftReceiver; + + this.paymentIntent = builder.paymentIntent; + + this.shippingAddress = builder.shippingAddress; + + this.subscription = builder.subscription; + + this.addons = builder.addons; + } + + public Timestamp getScheduledAt() { + return scheduledAt; + } + + public Boolean getAutoClaim() { + return autoClaim; + } + + public Boolean getNoExpiry() { + return noExpiry; + } + + public Timestamp getClaimExpiryDate() { + return claimExpiryDate; + } + + public List getCouponIds() { + return couponIds; + } + + public GifterParams getGifter() { + return gifter; + } + + public GiftReceiverParams getGiftReceiver() { + return giftReceiver; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public List getAddons() { + return addons; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.scheduledAt != null) { + + formData.put("scheduled_at", this.scheduledAt); + } + + if (this.autoClaim != null) { + + formData.put("auto_claim", this.autoClaim); + } + + if (this.noExpiry != null) { + + formData.put("no_expiry", this.noExpiry); + } + + if (this.claimExpiryDate != null) { + + formData.put("claim_expiry_date", this.claimExpiryDate); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.gifter != null) { + + // Single object + Map nestedData = this.gifter.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "gifter[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.giftReceiver != null) { + + // Single object + Map nestedData = this.giftReceiver.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "gift_receiver[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for GiftCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GiftCreateBuilder builder() { + return new GiftCreateBuilder(); + } + + public static final class GiftCreateBuilder { + + private Timestamp scheduledAt; + + private Boolean autoClaim; + + private Boolean noExpiry; + + private Timestamp claimExpiryDate; + + private List couponIds; + + private GifterParams gifter; + + private GiftReceiverParams giftReceiver; + + private PaymentIntentParams paymentIntent; + + private ShippingAddressParams shippingAddress; + + private SubscriptionParams subscription; + + private List addons; + + private GiftCreateBuilder() {} + + public GiftCreateBuilder scheduledAt(Timestamp value) { + this.scheduledAt = value; + return this; + } + + public GiftCreateBuilder autoClaim(Boolean value) { + this.autoClaim = value; + return this; + } + + public GiftCreateBuilder noExpiry(Boolean value) { + this.noExpiry = value; + return this; + } + + public GiftCreateBuilder claimExpiryDate(Timestamp value) { + this.claimExpiryDate = value; + return this; + } + + public GiftCreateBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public GiftCreateBuilder gifter(GifterParams value) { + this.gifter = value; + return this; + } + + public GiftCreateBuilder giftReceiver(GiftReceiverParams value) { + this.giftReceiver = value; + return this; + } + + public GiftCreateBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public GiftCreateBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public GiftCreateBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public GiftCreateBuilder addons(List value) { + this.addons = value; + return this; + } + + public GiftCreateParams build() { + return new GiftCreateParams(this); + } + } + + public static final class GifterParams { + + private final String customerId; + + private final String signature; + + private final String note; + + private final String paymentSrcId; + + private GifterParams(GifterBuilder builder) { + + this.customerId = builder.customerId; + + this.signature = builder.signature; + + this.note = builder.note; + + this.paymentSrcId = builder.paymentSrcId; + } + + public String getCustomerId() { + return customerId; + } + + public String getSignature() { + return signature; + } + + public String getNote() { + return note; + } + + public String getPaymentSrcId() { + return paymentSrcId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.signature != null) { + + formData.put("signature", this.signature); + } + + if (this.note != null) { + + formData.put("note", this.note); + } + + if (this.paymentSrcId != null) { + + formData.put("payment_src_id", this.paymentSrcId); + } + + return formData; + } + + /** Create a new builder for GifterParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GifterBuilder builder() { + return new GifterBuilder(); + } + + public static final class GifterBuilder { + + private String customerId; + + private String signature; + + private String note; + + private String paymentSrcId; + + private GifterBuilder() {} + + public GifterBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public GifterBuilder signature(String value) { + this.signature = value; + return this; + } + + public GifterBuilder note(String value) { + this.note = value; + return this; + } + + public GifterBuilder paymentSrcId(String value) { + this.paymentSrcId = value; + return this; + } + + public GifterParams build() { + return new GifterParams(this); + } + } + } + + public static final class GiftReceiverParams { + + private final String customerId; + + private final String firstName; + + private final String lastName; + + private final String email; + + private GiftReceiverParams(GiftReceiverBuilder builder) { + + this.customerId = builder.customerId; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + } + + public String getCustomerId() { + return customerId; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getEmail() { + return email; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + 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); + } + + return formData; + } + + /** Create a new builder for GiftReceiverParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GiftReceiverBuilder builder() { + return new GiftReceiverBuilder(); + } + + public static final class GiftReceiverBuilder { + + private String customerId; + + private String firstName; + + private String lastName; + + private String email; + + private GiftReceiverBuilder() {} + + public GiftReceiverBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public GiftReceiverBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public GiftReceiverBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public GiftReceiverBuilder email(String value) { + this.email = value; + return this; + } + + public GiftReceiverParams build() { + return new GiftReceiverParams(this); + } + } + } + + public static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class SubscriptionParams { + + private final String planId; + + private final Integer planQuantity; + + private final String planQuantityInDecimal; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String planId; + + private Integer planQuantity; + + private String planQuantityInDecimal; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder planId(String value) { + this.planId = value; + return this; + } + + public SubscriptionBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public SubscriptionBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/gift/params/GiftListParams.java b/src/main/java/com/chargebee/v4/models/gift/params/GiftListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/gift/params/GiftListParams.java rename to src/main/java/com/chargebee/v4/models/gift/params/GiftListParams.java index 217b7898..a4452175 100644 --- a/src/main/java/com/chargebee/v4/core/models/gift/params/GiftListParams.java +++ b/src/main/java/com/chargebee/v4/models/gift/params/GiftListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.gift.params; +package com.chargebee.v4.models.gift.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/gift/params/GiftRetrieveParams.java b/src/main/java/com/chargebee/v4/models/gift/params/GiftRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/gift/params/GiftRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/gift/params/GiftRetrieveParams.java index 7f3b6c2c..d9fb6f75 100644 --- a/src/main/java/com/chargebee/v4/core/models/gift/params/GiftRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/gift/params/GiftRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.gift.params; +package com.chargebee.v4.models.gift.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/gift/params/UpdateGiftParams.java b/src/main/java/com/chargebee/v4/models/gift/params/UpdateGiftParams.java new file mode 100644 index 00000000..93715faf --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/gift/params/UpdateGiftParams.java @@ -0,0 +1,81 @@ +/* + * 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.gift.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class UpdateGiftParams { + + private final Timestamp scheduledAt; + + private final String comment; + + private UpdateGiftParams(UpdateGiftBuilder builder) { + + this.scheduledAt = builder.scheduledAt; + + this.comment = builder.comment; + } + + public Timestamp getScheduledAt() { + return scheduledAt; + } + + public String getComment() { + return comment; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.scheduledAt != null) { + + formData.put("scheduled_at", this.scheduledAt); + } + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + return formData; + } + + /** Create a new builder for UpdateGiftParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdateGiftBuilder builder() { + return new UpdateGiftBuilder(); + } + + public static final class UpdateGiftBuilder { + + private Timestamp scheduledAt; + + private String comment; + + private UpdateGiftBuilder() {} + + public UpdateGiftBuilder scheduledAt(Timestamp value) { + this.scheduledAt = value; + return this; + } + + public UpdateGiftBuilder comment(String value) { + this.comment = value; + return this; + } + + public UpdateGiftParams build() { + return new UpdateGiftParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/gift/GiftCancelResponse.java b/src/main/java/com/chargebee/v4/models/gift/responses/GiftCancelResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/gift/GiftCancelResponse.java rename to src/main/java/com/chargebee/v4/models/gift/responses/GiftCancelResponse.java index bba324fe..da96e8f0 100644 --- a/src/main/java/com/chargebee/v4/core/responses/gift/GiftCancelResponse.java +++ b/src/main/java/com/chargebee/v4/models/gift/responses/GiftCancelResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.gift; +package com.chargebee.v4.models.gift.responses; -import com.chargebee.v4.core.models.gift.Gift; +import com.chargebee.v4.models.gift.Gift; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/gift/GiftClaimResponse.java b/src/main/java/com/chargebee/v4/models/gift/responses/GiftClaimResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/gift/GiftClaimResponse.java rename to src/main/java/com/chargebee/v4/models/gift/responses/GiftClaimResponse.java index 152f028c..9d48cbeb 100644 --- a/src/main/java/com/chargebee/v4/core/responses/gift/GiftClaimResponse.java +++ b/src/main/java/com/chargebee/v4/models/gift/responses/GiftClaimResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.gift; +package com.chargebee.v4.models.gift.responses; -import com.chargebee.v4.core.models.gift.Gift; +import com.chargebee.v4.models.gift.Gift; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/gift/GiftCreateForItemsResponse.java b/src/main/java/com/chargebee/v4/models/gift/responses/GiftCreateForItemsResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/gift/GiftCreateForItemsResponse.java rename to src/main/java/com/chargebee/v4/models/gift/responses/GiftCreateForItemsResponse.java index 866969fd..e2462ee6 100644 --- a/src/main/java/com/chargebee/v4/core/responses/gift/GiftCreateForItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/gift/responses/GiftCreateForItemsResponse.java @@ -1,12 +1,12 @@ -package com.chargebee.v4.core.responses.gift; +package com.chargebee.v4.models.gift.responses; -import com.chargebee.v4.core.models.gift.Gift; +import com.chargebee.v4.models.gift.Gift; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/gift/GiftCreateResponse.java b/src/main/java/com/chargebee/v4/models/gift/responses/GiftCreateResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/gift/GiftCreateResponse.java rename to src/main/java/com/chargebee/v4/models/gift/responses/GiftCreateResponse.java index a4988033..40958573 100644 --- a/src/main/java/com/chargebee/v4/core/responses/gift/GiftCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/gift/responses/GiftCreateResponse.java @@ -1,12 +1,12 @@ -package com.chargebee.v4.core.responses.gift; +package com.chargebee.v4.models.gift.responses; -import com.chargebee.v4.core.models.gift.Gift; +import com.chargebee.v4.models.gift.Gift; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/gift/GiftListResponse.java b/src/main/java/com/chargebee/v4/models/gift/responses/GiftListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/gift/GiftListResponse.java rename to src/main/java/com/chargebee/v4/models/gift/responses/GiftListResponse.java index 42184e9f..c02e7b61 100644 --- a/src/main/java/com/chargebee/v4/core/responses/gift/GiftListResponse.java +++ b/src/main/java/com/chargebee/v4/models/gift/responses/GiftListResponse.java @@ -1,15 +1,16 @@ -package com.chargebee.v4.core.responses.gift; +package com.chargebee.v4.models.gift.responses; import java.util.List; -import com.chargebee.v4.core.models.gift.Gift; +import com.chargebee.v4.models.gift.Gift; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.GiftService; -import com.chargebee.v4.core.models.gift.params.GiftListParams; +import com.chargebee.v4.services.GiftService; +import com.chargebee.v4.models.gift.params.GiftListParams; /** Immutable response object for GiftList operation. Contains paginated list data. */ public final class GiftListResponse { @@ -97,9 +98,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 GiftListResponse nextPage() throws Exception { + public GiftListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/gift/responses/GiftRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/gift/responses/GiftRetrieveResponse.java new file mode 100644 index 00000000..d3be4f43 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/gift/responses/GiftRetrieveResponse.java @@ -0,0 +1,100 @@ +package com.chargebee.v4.models.gift.responses; + +import com.chargebee.v4.models.gift.Gift; + +import com.chargebee.v4.models.subscription.Subscription; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for GiftRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class GiftRetrieveResponse extends BaseResponse { + private final Gift gift; + + private final Subscription subscription; + + private GiftRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.gift = builder.gift; + + this.subscription = builder.subscription; + } + + /** Parse JSON response into GiftRetrieveResponse object. */ + public static GiftRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into GiftRetrieveResponse object with HTTP response. */ + public static GiftRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __giftJson = JsonUtil.getObject(json, "gift"); + if (__giftJson != null) { + builder.gift(Gift.fromJson(__giftJson)); + } + + String __subscriptionJson = JsonUtil.getObject(json, "subscription"); + if (__subscriptionJson != null) { + builder.subscription(Subscription.fromJson(__subscriptionJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse GiftRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for GiftRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for GiftRetrieveResponse. */ + public static class Builder { + + private Gift gift; + + private Subscription subscription; + + private Response httpResponse; + + private Builder() {} + + public Builder gift(Gift gift) { + this.gift = gift; + return this; + } + + public Builder subscription(Subscription subscription) { + this.subscription = subscription; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public GiftRetrieveResponse build() { + return new GiftRetrieveResponse(this); + } + } + + /** Get the gift from the response. */ + public Gift getGift() { + return gift; + } + + /** Get the subscription from the response. */ + public Subscription getSubscription() { + return subscription; + } +} diff --git a/src/main/java/com/chargebee/v4/models/gift/responses/UpdateGiftResponse.java b/src/main/java/com/chargebee/v4/models/gift/responses/UpdateGiftResponse.java new file mode 100644 index 00000000..b9e5b92e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/gift/responses/UpdateGiftResponse.java @@ -0,0 +1,97 @@ +package com.chargebee.v4.models.gift.responses; + +import com.chargebee.v4.models.gift.Gift; + +import com.chargebee.v4.models.subscription.Subscription; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** Immutable response object for UpdateGift operation. Contains the response data from the API. */ +public final class UpdateGiftResponse extends BaseResponse { + private final Gift gift; + + private final Subscription subscription; + + private UpdateGiftResponse(Builder builder) { + super(builder.httpResponse); + + this.gift = builder.gift; + + this.subscription = builder.subscription; + } + + /** Parse JSON response into UpdateGiftResponse object. */ + public static UpdateGiftResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into UpdateGiftResponse object with HTTP response. */ + public static UpdateGiftResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __giftJson = JsonUtil.getObject(json, "gift"); + if (__giftJson != null) { + builder.gift(Gift.fromJson(__giftJson)); + } + + String __subscriptionJson = JsonUtil.getObject(json, "subscription"); + if (__subscriptionJson != null) { + builder.subscription(Subscription.fromJson(__subscriptionJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse UpdateGiftResponse from JSON", e); + } + } + + /** Create a new builder for UpdateGiftResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UpdateGiftResponse. */ + public static class Builder { + + private Gift gift; + + private Subscription subscription; + + private Response httpResponse; + + private Builder() {} + + public Builder gift(Gift gift) { + this.gift = gift; + return this; + } + + public Builder subscription(Subscription subscription) { + this.subscription = subscription; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public UpdateGiftResponse build() { + return new UpdateGiftResponse(this); + } + } + + /** Get the gift from the response. */ + public Gift getGift() { + return gift; + } + + /** Get the subscription from the response. */ + public Subscription getSubscription() { + return subscription; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/hierarchy/Hierarchy.java b/src/main/java/com/chargebee/v4/models/hierarchy/Hierarchy.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/hierarchy/Hierarchy.java rename to src/main/java/com/chargebee/v4/models/hierarchy/Hierarchy.java index c4105915..e4398b47 100644 --- a/src/main/java/com/chargebee/v4/core/models/hierarchy/Hierarchy.java +++ b/src/main/java/com/chargebee/v4/models/hierarchy/Hierarchy.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.hierarchy; +package com.chargebee.v4.models.hierarchy; import com.chargebee.v4.internal.JsonUtil; import java.util.List; diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/HostedPage.java b/src/main/java/com/chargebee/v4/models/hostedPage/HostedPage.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/hostedPage/HostedPage.java rename to src/main/java/com/chargebee/v4/models/hostedPage/HostedPage.java index f2635c86..e1008152 100644 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/HostedPage.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/HostedPage.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.hostedPage; +package com.chargebee.v4.models.hostedPage; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageAcceptQuoteParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageAcceptQuoteParams.java new file mode 100644 index 00000000..2db144dc --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageAcceptQuoteParams.java @@ -0,0 +1,181 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class HostedPageAcceptQuoteParams { + + private final String redirectUrl; + + private final Layout layout; + + private final QuoteParams quote; + + private HostedPageAcceptQuoteParams(HostedPageAcceptQuoteBuilder builder) { + + this.redirectUrl = builder.redirectUrl; + + this.layout = builder.layout; + + this.quote = builder.quote; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public Layout getLayout() { + return layout; + } + + public QuoteParams getQuote() { + return quote; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.layout != null) { + + formData.put("layout", this.layout); + } + + if (this.quote != null) { + + // Single object + Map nestedData = this.quote.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "quote[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for HostedPageAcceptQuoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageAcceptQuoteBuilder builder() { + return new HostedPageAcceptQuoteBuilder(); + } + + public static final class HostedPageAcceptQuoteBuilder { + + private String redirectUrl; + + private Layout layout; + + private QuoteParams quote; + + private HostedPageAcceptQuoteBuilder() {} + + public HostedPageAcceptQuoteBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public HostedPageAcceptQuoteBuilder layout(Layout value) { + this.layout = value; + return this; + } + + public HostedPageAcceptQuoteBuilder quote(QuoteParams value) { + this.quote = value; + return this; + } + + public HostedPageAcceptQuoteParams build() { + return new HostedPageAcceptQuoteParams(this); + } + } + + public enum Layout { + IN_APP("in_app"), + + FULL_PAGE("full_page"), + + /** An enum member indicating that Layout was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Layout(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Layout fromString(String value) { + if (value == null) return _UNKNOWN; + for (Layout enumValue : Layout.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class QuoteParams { + + private final String id; + + private QuoteParams(QuoteBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for QuoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static QuoteBuilder builder() { + return new QuoteBuilder(); + } + + public static final class QuoteBuilder { + + private String id; + + private QuoteBuilder() {} + + public QuoteBuilder id(String value) { + this.id = value; + return this; + } + + public QuoteParams build() { + return new QuoteParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageAcknowledgeParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageAcknowledgeParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageAcknowledgeParams.java rename to src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageAcknowledgeParams.java index 9c788c9f..f665d1f4 100644 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageAcknowledgeParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageAcknowledgeParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.hostedPage.params; +package com.chargebee.v4.models.hostedPage.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class HostedPageAcknowledgeParams { - private final Map formData; - - private HostedPageAcknowledgeParams(HostedPageAcknowledgeBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private HostedPageAcknowledgeParams(HostedPageAcknowledgeBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static HostedPageAcknowledgeBuilder builder() { } public static final class HostedPageAcknowledgeBuilder { - private final Map formData = new LinkedHashMap<>(); private HostedPageAcknowledgeBuilder() {} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingForItemsParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingForItemsParams.java new file mode 100644 index 00000000..8f7fba70 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingForItemsParams.java @@ -0,0 +1,2556 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class HostedPageCheckoutExistingForItemsParams { + + private final Layout layout; + + private final List mandatoryItemsToRemove; + + private final Boolean replaceItemsList; + + private final Timestamp invoiceDate; + + private final Integer billingCycles; + + private final Integer termsToCharge; + + private final Timestamp reactivateFrom; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final Boolean replaceCouponList; + + private final Boolean reactivate; + + private final Boolean forceTermReset; + + private final ChangeOption changeOption; + + private final Timestamp changesScheduledAt; + + private final String redirectUrl; + + private final String cancelUrl; + + private final String passThruContent; + + private final Boolean allowOfflinePaymentMethods; + + private final SubscriptionParams subscription; + + private final CustomerParams customer; + + private final CardParams card; + + private final ContractTermParams contractTerm; + + private final List subscriptionItems; + + private final List discounts; + + private final List itemTiers; + + private final List entityIdentifiers; + + private HostedPageCheckoutExistingForItemsParams( + HostedPageCheckoutExistingForItemsBuilder builder) { + + this.layout = builder.layout; + + this.mandatoryItemsToRemove = builder.mandatoryItemsToRemove; + + this.replaceItemsList = builder.replaceItemsList; + + this.invoiceDate = builder.invoiceDate; + + this.billingCycles = builder.billingCycles; + + this.termsToCharge = builder.termsToCharge; + + this.reactivateFrom = builder.reactivateFrom; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.replaceCouponList = builder.replaceCouponList; + + this.reactivate = builder.reactivate; + + this.forceTermReset = builder.forceTermReset; + + this.changeOption = builder.changeOption; + + this.changesScheduledAt = builder.changesScheduledAt; + + this.redirectUrl = builder.redirectUrl; + + this.cancelUrl = builder.cancelUrl; + + this.passThruContent = builder.passThruContent; + + this.allowOfflinePaymentMethods = builder.allowOfflinePaymentMethods; + + this.subscription = builder.subscription; + + this.customer = builder.customer; + + this.card = builder.card; + + this.contractTerm = builder.contractTerm; + + this.subscriptionItems = builder.subscriptionItems; + + this.discounts = builder.discounts; + + this.itemTiers = builder.itemTiers; + + this.entityIdentifiers = builder.entityIdentifiers; + } + + public Layout getLayout() { + return layout; + } + + public List getMandatoryItemsToRemove() { + return mandatoryItemsToRemove; + } + + public Boolean getReplaceItemsList() { + return replaceItemsList; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Timestamp getReactivateFrom() { + return reactivateFrom; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public Boolean getReplaceCouponList() { + return replaceCouponList; + } + + public Boolean getReactivate() { + return reactivate; + } + + public Boolean getForceTermReset() { + return forceTermReset; + } + + public ChangeOption getChangeOption() { + return changeOption; + } + + public Timestamp getChangesScheduledAt() { + return changesScheduledAt; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public String getCancelUrl() { + return cancelUrl; + } + + public String getPassThruContent() { + return passThruContent; + } + + public Boolean getAllowOfflinePaymentMethods() { + return allowOfflinePaymentMethods; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public CustomerParams getCustomer() { + return customer; + } + + public CardParams getCard() { + return card; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + public List getDiscounts() { + return discounts; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getEntityIdentifiers() { + return entityIdentifiers; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.layout != null) { + + formData.put("layout", this.layout); + } + + if (this.mandatoryItemsToRemove != null) { + + formData.put("mandatory_items_to_remove", this.mandatoryItemsToRemove); + } + + if (this.replaceItemsList != null) { + + formData.put("replace_items_list", this.replaceItemsList); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.reactivateFrom != null) { + + formData.put("reactivate_from", this.reactivateFrom); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.replaceCouponList != null) { + + formData.put("replace_coupon_list", this.replaceCouponList); + } + + if (this.reactivate != null) { + + formData.put("reactivate", this.reactivate); + } + + if (this.forceTermReset != null) { + + formData.put("force_term_reset", this.forceTermReset); + } + + if (this.changeOption != null) { + + formData.put("change_option", this.changeOption); + } + + if (this.changesScheduledAt != null) { + + formData.put("changes_scheduled_at", this.changesScheduledAt); + } + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.cancelUrl != null) { + + formData.put("cancel_url", this.cancelUrl); + } + + if (this.passThruContent != null) { + + formData.put("pass_thru_content", this.passThruContent); + } + + if (this.allowOfflinePaymentMethods != null) { + + formData.put("allow_offline_payment_methods", this.allowOfflinePaymentMethods); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.entityIdentifiers != null) { + + // List of objects + for (int i = 0; i < this.entityIdentifiers.size(); i++) { + EntityIdentifiersParams item = this.entityIdentifiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "entity_identifiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for HostedPageCheckoutExistingForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageCheckoutExistingForItemsBuilder builder() { + return new HostedPageCheckoutExistingForItemsBuilder(); + } + + public static final class HostedPageCheckoutExistingForItemsBuilder { + + private Layout layout; + + private List mandatoryItemsToRemove; + + private Boolean replaceItemsList; + + private Timestamp invoiceDate; + + private Integer billingCycles; + + private Integer termsToCharge; + + private Timestamp reactivateFrom; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private Boolean replaceCouponList; + + private Boolean reactivate; + + private Boolean forceTermReset; + + private ChangeOption changeOption; + + private Timestamp changesScheduledAt; + + private String redirectUrl; + + private String cancelUrl; + + private String passThruContent; + + private Boolean allowOfflinePaymentMethods; + + private SubscriptionParams subscription; + + private CustomerParams customer; + + private CardParams card; + + private ContractTermParams contractTerm; + + private List subscriptionItems; + + private List discounts; + + private List itemTiers; + + private List entityIdentifiers; + + private HostedPageCheckoutExistingForItemsBuilder() {} + + public HostedPageCheckoutExistingForItemsBuilder layout(Layout value) { + this.layout = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder mandatoryItemsToRemove(List value) { + this.mandatoryItemsToRemove = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder replaceItemsList(Boolean value) { + this.replaceItemsList = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder reactivateFrom(Timestamp value) { + this.reactivateFrom = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder billingAlignmentMode( + BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder replaceCouponList(Boolean value) { + this.replaceCouponList = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder reactivate(Boolean value) { + this.reactivate = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder forceTermReset(Boolean value) { + this.forceTermReset = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder changeOption(ChangeOption value) { + this.changeOption = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder changesScheduledAt(Timestamp value) { + this.changesScheduledAt = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder cancelUrl(String value) { + this.cancelUrl = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder passThruContent(String value) { + this.passThruContent = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder allowOfflinePaymentMethods(Boolean value) { + this.allowOfflinePaymentMethods = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder card(CardParams value) { + this.card = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public HostedPageCheckoutExistingForItemsBuilder entityIdentifiers( + List value) { + this.entityIdentifiers = value; + return this; + } + + public HostedPageCheckoutExistingForItemsParams build() { + return new HostedPageCheckoutExistingForItemsParams(this); + } + } + + public enum Layout { + IN_APP("in_app"), + + FULL_PAGE("full_page"), + + /** An enum member indicating that Layout was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Layout(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Layout fromString(String value) { + if (value == null) return _UNKNOWN; + for (Layout enumValue : Layout.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChangeOption { + IMMEDIATELY("immediately"), + + END_OF_TERM("end_of_term"), + + SPECIFIC_DATE("specific_date"), + + /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChangeOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChangeOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChangeOption enumValue : ChangeOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final Long setupFee; + + private final Timestamp startDate; + + private final Timestamp trialEnd; + + private final String coupon; + + private final AutoCollection autoCollection; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final String invoiceNotes; + + private final Integer contractTermBillingCycleOnRenewal; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.setupFee = builder.setupFee; + + this.startDate = builder.startDate; + + this.trialEnd = builder.trialEnd; + + this.coupon = builder.coupon; + + this.autoCollection = builder.autoCollection; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.invoiceNotes = builder.invoiceNotes; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + } + + public String getId() { + return id; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public String getCoupon() { + return coupon; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private Long setupFee; + + private Timestamp startDate; + + private Timestamp trialEnd; + + private String coupon; + + private AutoCollection autoCollection; + + private OfflinePaymentMethod offlinePaymentMethod; + + private String invoiceNotes; + + private Integer contractTermBillingCycleOnRenewal; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + @Deprecated + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + @Deprecated + public SubscriptionBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CustomerParams { + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final Boolean isEinvoiceEnabled; + + private final String entityIdentifierScheme; + + private final String entityIdentifierStandard; + + private CustomerParams(CustomerBuilder builder) { + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.isEinvoiceEnabled = builder.isEinvoiceEnabled; + + this.entityIdentifierScheme = builder.entityIdentifierScheme; + + this.entityIdentifierStandard = builder.entityIdentifierStandard; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public Boolean getIsEinvoiceEnabled() { + return isEinvoiceEnabled; + } + + public String getEntityIdentifierScheme() { + return entityIdentifierScheme; + } + + public String getEntityIdentifierStandard() { + return entityIdentifierStandard; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.isEinvoiceEnabled != null) { + + formData.put("is_einvoice_enabled", this.isEinvoiceEnabled); + } + + if (this.entityIdentifierScheme != null) { + + formData.put("entity_identifier_scheme", this.entityIdentifierScheme); + } + + if (this.entityIdentifierStandard != null) { + + formData.put("entity_identifier_standard", this.entityIdentifierStandard); + } + + 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 String vatNumberPrefix; + + private Boolean isEinvoiceEnabled; + + private String entityIdentifierScheme; + + private String entityIdentifierStandard; + + private CustomerBuilder() {} + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder isEinvoiceEnabled(Boolean value) { + this.isEinvoiceEnabled = value; + return this; + } + + public CustomerBuilder entityIdentifierScheme(String value) { + this.entityIdentifierScheme = value; + return this; + } + + public CustomerBuilder entityIdentifierStandard(String value) { + this.entityIdentifierStandard = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } + + public static final class CardParams { + + private final Gateway gateway; + + private final String gatewayAccountId; + + private CardParams(CardBuilder builder) { + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + /** 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); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + private Gateway gateway; + + private String gatewayAccountId; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public CardParams build() { + return new CardParams(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 static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ChargeOnOption chargeOnOption; + + private final ItemType itemType; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.chargeOnOption = builder.chargeOnOption; + + this.itemType = builder.itemType; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ChargeOnOption getChargeOnOption() { + return chargeOnOption; + } + + public ItemType getItemType() { + return itemType; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.chargeOnOption != null) { + + formData.put("charge_on_option", this.chargeOnOption); + } + + if (this.itemType != null) { + + formData.put("item_type", this.itemType); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ChargeOnOption chargeOnOption; + + private ItemType itemType; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionItemsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionItemsBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { + this.chargeOnOption = value; + return this; + } + + public SubscriptionItemsBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + + 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"), + + /** 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; + } + } + + public enum ChargeOnOption { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnOption enumValue : ChargeOnOption.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 DiscountsParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private final Integer quantity; + + private final OperationType operationType; + + private final String id; + + private DiscountsParams(DiscountsBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.operationType = builder.operationType; + + this.id = builder.id; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public OperationType getOperationType() { + return operationType; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.operationType != null) { + + formData.put("operation_type", this.operationType); + } + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private Integer quantity; + + private OperationType operationType; + + private String id; + + private DiscountsBuilder() {} + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder operationType(OperationType value) { + this.operationType = value; + return this; + } + + public DiscountsBuilder id(String value) { + this.id = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 enum OperationType { + ADD("add"), + + REMOVE("remove"), + + /** An enum member indicating that OperationType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OperationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OperationType fromString(String value) { + if (value == null) return _UNKNOWN; + for (OperationType enumValue : OperationType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class EntityIdentifiersParams { + + private final String id; + + private final String scheme; + + private final String value; + + private final Operation operation; + + private final String standard; + + private EntityIdentifiersParams(EntityIdentifiersBuilder builder) { + + this.id = builder.id; + + this.scheme = builder.scheme; + + this.value = builder.value; + + this.operation = builder.operation; + + this.standard = builder.standard; + } + + public String getId() { + return id; + } + + public String getScheme() { + return scheme; + } + + public String getValue() { + return value; + } + + public Operation getOperation() { + return operation; + } + + public String getStandard() { + return standard; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.scheme != null) { + + formData.put("scheme", this.scheme); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + if (this.operation != null) { + + formData.put("operation", this.operation); + } + + if (this.standard != null) { + + formData.put("standard", this.standard); + } + + return formData; + } + + /** Create a new builder for EntityIdentifiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EntityIdentifiersBuilder builder() { + return new EntityIdentifiersBuilder(); + } + + public static final class EntityIdentifiersBuilder { + + private String id; + + private String scheme; + + private String value; + + private Operation operation; + + private String standard; + + private EntityIdentifiersBuilder() {} + + public EntityIdentifiersBuilder id(String value) { + this.id = value; + return this; + } + + public EntityIdentifiersBuilder scheme(String value) { + this.scheme = value; + return this; + } + + public EntityIdentifiersBuilder value(String value) { + this.value = value; + return this; + } + + public EntityIdentifiersBuilder operation(Operation value) { + this.operation = value; + return this; + } + + public EntityIdentifiersBuilder standard(String value) { + this.standard = value; + return this; + } + + public EntityIdentifiersParams build() { + return new EntityIdentifiersParams(this); + } + } + + public enum Operation { + CREATE("create"), + + UPDATE("update"), + + DELETE("delete"), + + /** An enum member indicating that Operation was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Operation(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Operation fromString(String value) { + if (value == null) return _UNKNOWN; + for (Operation enumValue : Operation.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingParams.java new file mode 100644 index 00000000..d6f31cb7 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingParams.java @@ -0,0 +1,1749 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class HostedPageCheckoutExistingParams { + + private final Boolean replaceAddonList; + + private final List mandatoryAddonsToRemove; + + private final Timestamp invoiceDate; + + private final Integer billingCycles; + + private final Integer termsToCharge; + + private final Timestamp reactivateFrom; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final Boolean replaceCouponList; + + private final Boolean reactivate; + + private final Boolean forceTermReset; + + private final String redirectUrl; + + private final String cancelUrl; + + private final String passThruContent; + + private final Boolean embed; + + private final Boolean iframeMessaging; + + private final Boolean allowOfflinePaymentMethods; + + private final SubscriptionParams subscription; + + private final CustomerParams customer; + + private final CardParams card; + + private final ContractTermParams contractTerm; + + private final List addons; + + private final List eventBasedAddons; + + private HostedPageCheckoutExistingParams(HostedPageCheckoutExistingBuilder builder) { + + this.replaceAddonList = builder.replaceAddonList; + + this.mandatoryAddonsToRemove = builder.mandatoryAddonsToRemove; + + this.invoiceDate = builder.invoiceDate; + + this.billingCycles = builder.billingCycles; + + this.termsToCharge = builder.termsToCharge; + + this.reactivateFrom = builder.reactivateFrom; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.replaceCouponList = builder.replaceCouponList; + + this.reactivate = builder.reactivate; + + this.forceTermReset = builder.forceTermReset; + + this.redirectUrl = builder.redirectUrl; + + this.cancelUrl = builder.cancelUrl; + + this.passThruContent = builder.passThruContent; + + this.embed = builder.embed; + + this.iframeMessaging = builder.iframeMessaging; + + this.allowOfflinePaymentMethods = builder.allowOfflinePaymentMethods; + + this.subscription = builder.subscription; + + this.customer = builder.customer; + + this.card = builder.card; + + this.contractTerm = builder.contractTerm; + + this.addons = builder.addons; + + this.eventBasedAddons = builder.eventBasedAddons; + } + + public Boolean getReplaceAddonList() { + return replaceAddonList; + } + + public List getMandatoryAddonsToRemove() { + return mandatoryAddonsToRemove; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Timestamp getReactivateFrom() { + return reactivateFrom; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public Boolean getReplaceCouponList() { + return replaceCouponList; + } + + public Boolean getReactivate() { + return reactivate; + } + + public Boolean getForceTermReset() { + return forceTermReset; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public String getCancelUrl() { + return cancelUrl; + } + + public String getPassThruContent() { + return passThruContent; + } + + public Boolean getEmbed() { + return embed; + } + + public Boolean getIframeMessaging() { + return iframeMessaging; + } + + public Boolean getAllowOfflinePaymentMethods() { + return allowOfflinePaymentMethods; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public CustomerParams getCustomer() { + return customer; + } + + public CardParams getCard() { + return card; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getAddons() { + return addons; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.replaceAddonList != null) { + + formData.put("replace_addon_list", this.replaceAddonList); + } + + if (this.mandatoryAddonsToRemove != null) { + + formData.put("mandatory_addons_to_remove", this.mandatoryAddonsToRemove); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.reactivateFrom != null) { + + formData.put("reactivate_from", this.reactivateFrom); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.replaceCouponList != null) { + + formData.put("replace_coupon_list", this.replaceCouponList); + } + + if (this.reactivate != null) { + + formData.put("reactivate", this.reactivate); + } + + if (this.forceTermReset != null) { + + formData.put("force_term_reset", this.forceTermReset); + } + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.cancelUrl != null) { + + formData.put("cancel_url", this.cancelUrl); + } + + if (this.passThruContent != null) { + + formData.put("pass_thru_content", this.passThruContent); + } + + if (this.embed != null) { + + formData.put("embed", this.embed); + } + + if (this.iframeMessaging != null) { + + formData.put("iframe_messaging", this.iframeMessaging); + } + + if (this.allowOfflinePaymentMethods != null) { + + formData.put("allow_offline_payment_methods", this.allowOfflinePaymentMethods); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for HostedPageCheckoutExistingParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageCheckoutExistingBuilder builder() { + return new HostedPageCheckoutExistingBuilder(); + } + + public static final class HostedPageCheckoutExistingBuilder { + + private Boolean replaceAddonList; + + private List mandatoryAddonsToRemove; + + private Timestamp invoiceDate; + + private Integer billingCycles; + + private Integer termsToCharge; + + private Timestamp reactivateFrom; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private Boolean replaceCouponList; + + private Boolean reactivate; + + private Boolean forceTermReset; + + private String redirectUrl; + + private String cancelUrl; + + private String passThruContent; + + private Boolean embed; + + private Boolean iframeMessaging; + + private Boolean allowOfflinePaymentMethods; + + private SubscriptionParams subscription; + + private CustomerParams customer; + + private CardParams card; + + private ContractTermParams contractTerm; + + private List addons; + + private List eventBasedAddons; + + private HostedPageCheckoutExistingBuilder() {} + + public HostedPageCheckoutExistingBuilder replaceAddonList(Boolean value) { + this.replaceAddonList = value; + return this; + } + + public HostedPageCheckoutExistingBuilder mandatoryAddonsToRemove(List value) { + this.mandatoryAddonsToRemove = value; + return this; + } + + public HostedPageCheckoutExistingBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public HostedPageCheckoutExistingBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public HostedPageCheckoutExistingBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public HostedPageCheckoutExistingBuilder reactivateFrom(Timestamp value) { + this.reactivateFrom = value; + return this; + } + + public HostedPageCheckoutExistingBuilder billingAlignmentMode(BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public HostedPageCheckoutExistingBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public HostedPageCheckoutExistingBuilder replaceCouponList(Boolean value) { + this.replaceCouponList = value; + return this; + } + + public HostedPageCheckoutExistingBuilder reactivate(Boolean value) { + this.reactivate = value; + return this; + } + + public HostedPageCheckoutExistingBuilder forceTermReset(Boolean value) { + this.forceTermReset = value; + return this; + } + + public HostedPageCheckoutExistingBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public HostedPageCheckoutExistingBuilder cancelUrl(String value) { + this.cancelUrl = value; + return this; + } + + public HostedPageCheckoutExistingBuilder passThruContent(String value) { + this.passThruContent = value; + return this; + } + + public HostedPageCheckoutExistingBuilder embed(Boolean value) { + this.embed = value; + return this; + } + + public HostedPageCheckoutExistingBuilder iframeMessaging(Boolean value) { + this.iframeMessaging = value; + return this; + } + + public HostedPageCheckoutExistingBuilder allowOfflinePaymentMethods(Boolean value) { + this.allowOfflinePaymentMethods = value; + return this; + } + + public HostedPageCheckoutExistingBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public HostedPageCheckoutExistingBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public HostedPageCheckoutExistingBuilder card(CardParams value) { + this.card = value; + return this; + } + + public HostedPageCheckoutExistingBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public HostedPageCheckoutExistingBuilder addons(List value) { + this.addons = value; + return this; + } + + public HostedPageCheckoutExistingBuilder eventBasedAddons(List value) { + this.eventBasedAddons = value; + return this; + } + + public HostedPageCheckoutExistingParams build() { + return new HostedPageCheckoutExistingParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final String planId; + + private final Integer planQuantity; + + private final Long planUnitPrice; + + private final Long setupFee; + + private final String planQuantityInDecimal; + + private final String planUnitPriceInDecimal; + + private final Timestamp startDate; + + private final Timestamp trialEnd; + + private final String coupon; + + private final AutoCollection autoCollection; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final String invoiceNotes; + + private final Integer contractTermBillingCycleOnRenewal; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planUnitPrice = builder.planUnitPrice; + + this.setupFee = builder.setupFee; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + + this.planUnitPriceInDecimal = builder.planUnitPriceInDecimal; + + this.startDate = builder.startDate; + + this.trialEnd = builder.trialEnd; + + this.coupon = builder.coupon; + + this.autoCollection = builder.autoCollection; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.invoiceNotes = builder.invoiceNotes; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + } + + public String getId() { + return id; + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public Long getPlanUnitPrice() { + return planUnitPrice; + } + + public Long getSetupFee() { + return setupFee; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + public String getPlanUnitPriceInDecimal() { + return planUnitPriceInDecimal; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public String getCoupon() { + return coupon; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planUnitPrice != null) { + + formData.put("plan_unit_price", this.planUnitPrice); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + if (this.planUnitPriceInDecimal != null) { + + formData.put("plan_unit_price_in_decimal", this.planUnitPriceInDecimal); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private String planId; + + private Integer planQuantity; + + private Long planUnitPrice; + + private Long setupFee; + + private String planQuantityInDecimal; + + private String planUnitPriceInDecimal; + + private Timestamp startDate; + + private Timestamp trialEnd; + + private String coupon; + + private AutoCollection autoCollection; + + private OfflinePaymentMethod offlinePaymentMethod; + + private String invoiceNotes; + + private Integer contractTermBillingCycleOnRenewal; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionBuilder planId(String value) { + this.planId = value; + return this; + } + + public SubscriptionBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public SubscriptionBuilder planUnitPrice(Long value) { + this.planUnitPrice = value; + return this; + } + + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + public SubscriptionBuilder planUnitPriceInDecimal(String value) { + this.planUnitPriceInDecimal = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + @Deprecated + public SubscriptionBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CustomerParams { + + private final String vatNumber; + + private final String vatNumberPrefix; + + private CustomerParams(CustomerBuilder builder) { + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + 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 String vatNumberPrefix; + + private CustomerBuilder() {} + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } + + public static final class CardParams { + + private final Gateway gateway; + + private final String gatewayAccountId; + + private CardParams(CardBuilder builder) { + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + /** 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); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + private Gateway gateway; + + private String gatewayAccountId; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public CardParams build() { + return new CardParams(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 static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final Integer billingCycles; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.billingCycles = builder.billingCycles; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private Integer billingCycles; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final Integer servicePeriodInDays; + + private final ChargeOn chargeOn; + + private final OnEvent onEvent; + + private final Boolean chargeOnce; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.servicePeriodInDays = builder.servicePeriodInDays; + + this.chargeOn = builder.chargeOn; + + this.onEvent = builder.onEvent; + + this.chargeOnce = builder.chargeOnce; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public Integer getServicePeriodInDays() { + return servicePeriodInDays; + } + + public ChargeOn getChargeOn() { + return chargeOn; + } + + public OnEvent getOnEvent() { + return onEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.servicePeriodInDays != null) { + + formData.put("service_period_in_days", this.servicePeriodInDays); + } + + if (this.chargeOn != null) { + + formData.put("charge_on", this.chargeOn); + } + + if (this.onEvent != null) { + + formData.put("on_event", this.onEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private Integer servicePeriodInDays; + + private ChargeOn chargeOn; + + private OnEvent onEvent; + + private Boolean chargeOnce; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { + this.servicePeriodInDays = value; + return this; + } + + public EventBasedAddonsBuilder chargeOn(ChargeOn value) { + this.chargeOn = value; + return this; + } + + public EventBasedAddonsBuilder onEvent(OnEvent value) { + this.onEvent = value; + return this; + } + + public EventBasedAddonsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + + public enum ChargeOn { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOn fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOn enumValue : ChargeOn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** An enum member indicating that OnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (OnEvent enumValue : OnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutGiftForItemsParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutGiftForItemsParams.java new file mode 100644 index 00000000..ceca10ca --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutGiftForItemsParams.java @@ -0,0 +1,531 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class HostedPageCheckoutGiftForItemsParams { + + private final String businessEntityId; + + private final String redirectUrl; + + private final List couponIds; + + private final GifterParams gifter; + + private final List subscriptionItems; + + private final List itemTiers; + + private HostedPageCheckoutGiftForItemsParams(HostedPageCheckoutGiftForItemsBuilder builder) { + + this.businessEntityId = builder.businessEntityId; + + this.redirectUrl = builder.redirectUrl; + + this.couponIds = builder.couponIds; + + this.gifter = builder.gifter; + + this.subscriptionItems = builder.subscriptionItems; + + this.itemTiers = builder.itemTiers; + } + + public String getBusinessEntityId() { + return businessEntityId; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public List getCouponIds() { + return couponIds; + } + + public GifterParams getGifter() { + return gifter; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + public List getItemTiers() { + return itemTiers; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.businessEntityId != null) { + + formData.put("business_entity_id", this.businessEntityId); + } + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.gifter != null) { + + // Single object + Map nestedData = this.gifter.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "gifter[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for HostedPageCheckoutGiftForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageCheckoutGiftForItemsBuilder builder() { + return new HostedPageCheckoutGiftForItemsBuilder(); + } + + public static final class HostedPageCheckoutGiftForItemsBuilder { + + private String businessEntityId; + + private String redirectUrl; + + private List couponIds; + + private GifterParams gifter; + + private List subscriptionItems; + + private List itemTiers; + + private HostedPageCheckoutGiftForItemsBuilder() {} + + public HostedPageCheckoutGiftForItemsBuilder businessEntityId(String value) { + this.businessEntityId = value; + return this; + } + + public HostedPageCheckoutGiftForItemsBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public HostedPageCheckoutGiftForItemsBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public HostedPageCheckoutGiftForItemsBuilder gifter(GifterParams value) { + this.gifter = value; + return this; + } + + public HostedPageCheckoutGiftForItemsBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public HostedPageCheckoutGiftForItemsBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public HostedPageCheckoutGiftForItemsParams build() { + return new HostedPageCheckoutGiftForItemsParams(this); + } + } + + public static final class GifterParams { + + private final String customerId; + + private GifterParams(GifterBuilder builder) { + + this.customerId = builder.customerId; + } + + public String getCustomerId() { + return customerId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + return formData; + } + + /** Create a new builder for GifterParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GifterBuilder builder() { + return new GifterBuilder(); + } + + public static final class GifterBuilder { + + private String customerId; + + private GifterBuilder() {} + + public GifterBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public GifterParams build() { + return new GifterParams(this); + } + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutGiftParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutGiftParams.java new file mode 100644 index 00000000..3554a55a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutGiftParams.java @@ -0,0 +1,406 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class HostedPageCheckoutGiftParams { + + private final String redirectUrl; + + private final List couponIds; + + private final GifterParams gifter; + + private final SubscriptionParams subscription; + + private final List addons; + + private HostedPageCheckoutGiftParams(HostedPageCheckoutGiftBuilder builder) { + + this.redirectUrl = builder.redirectUrl; + + this.couponIds = builder.couponIds; + + this.gifter = builder.gifter; + + this.subscription = builder.subscription; + + this.addons = builder.addons; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public List getCouponIds() { + return couponIds; + } + + public GifterParams getGifter() { + return gifter; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public List getAddons() { + return addons; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.gifter != null) { + + // Single object + Map nestedData = this.gifter.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "gifter[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for HostedPageCheckoutGiftParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageCheckoutGiftBuilder builder() { + return new HostedPageCheckoutGiftBuilder(); + } + + public static final class HostedPageCheckoutGiftBuilder { + + private String redirectUrl; + + private List couponIds; + + private GifterParams gifter; + + private SubscriptionParams subscription; + + private List addons; + + private HostedPageCheckoutGiftBuilder() {} + + public HostedPageCheckoutGiftBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public HostedPageCheckoutGiftBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public HostedPageCheckoutGiftBuilder gifter(GifterParams value) { + this.gifter = value; + return this; + } + + public HostedPageCheckoutGiftBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public HostedPageCheckoutGiftBuilder addons(List value) { + this.addons = value; + return this; + } + + public HostedPageCheckoutGiftParams build() { + return new HostedPageCheckoutGiftParams(this); + } + } + + public static final class GifterParams { + + private final String customerId; + + private GifterParams(GifterBuilder builder) { + + this.customerId = builder.customerId; + } + + public String getCustomerId() { + return customerId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + return formData; + } + + /** Create a new builder for GifterParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GifterBuilder builder() { + return new GifterBuilder(); + } + + public static final class GifterBuilder { + + private String customerId; + + private GifterBuilder() {} + + public GifterBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public GifterParams build() { + return new GifterParams(this); + } + } + } + + public static final class SubscriptionParams { + + private final String planId; + + private final Integer planQuantity; + + private final String planQuantityInDecimal; + + private final String coupon; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + + this.coupon = builder.coupon; + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + public String getCoupon() { + return coupon; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String planId; + + private Integer planQuantity; + + private String planQuantityInDecimal; + + private String coupon; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder planId(String value) { + this.planId = value; + return this; + } + + public SubscriptionBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public SubscriptionBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + @Deprecated + public SubscriptionBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewForItemsParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewForItemsParams.java new file mode 100644 index 00000000..3ff6f71c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewForItemsParams.java @@ -0,0 +1,3303 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class HostedPageCheckoutNewForItemsParams { + + private final Layout layout; + + private final String businessEntityId; + + private final Integer billingCycles; + + private final List mandatoryItemsToRemove; + + private final Integer termsToCharge; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final String redirectUrl; + + private final String cancelUrl; + + private final String passThruContent; + + private final Boolean allowOfflinePaymentMethods; + + private final SubscriptionParams subscription; + + private final CustomerParams customer; + + private final CardParams card; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final ContractTermParams contractTerm; + + private final List subscriptionItems; + + private final List discounts; + + private final List itemTiers; + + private final List entityIdentifiers; + + private HostedPageCheckoutNewForItemsParams(HostedPageCheckoutNewForItemsBuilder builder) { + + this.layout = builder.layout; + + this.businessEntityId = builder.businessEntityId; + + this.billingCycles = builder.billingCycles; + + this.mandatoryItemsToRemove = builder.mandatoryItemsToRemove; + + this.termsToCharge = builder.termsToCharge; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.redirectUrl = builder.redirectUrl; + + this.cancelUrl = builder.cancelUrl; + + this.passThruContent = builder.passThruContent; + + this.allowOfflinePaymentMethods = builder.allowOfflinePaymentMethods; + + this.subscription = builder.subscription; + + this.customer = builder.customer; + + this.card = builder.card; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.contractTerm = builder.contractTerm; + + this.subscriptionItems = builder.subscriptionItems; + + this.discounts = builder.discounts; + + this.itemTiers = builder.itemTiers; + + this.entityIdentifiers = builder.entityIdentifiers; + } + + public Layout getLayout() { + return layout; + } + + public String getBusinessEntityId() { + return businessEntityId; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public List getMandatoryItemsToRemove() { + return mandatoryItemsToRemove; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public String getCancelUrl() { + return cancelUrl; + } + + public String getPassThruContent() { + return passThruContent; + } + + public Boolean getAllowOfflinePaymentMethods() { + return allowOfflinePaymentMethods; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public CustomerParams getCustomer() { + return customer; + } + + public CardParams getCard() { + return card; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + public List getDiscounts() { + return discounts; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getEntityIdentifiers() { + return entityIdentifiers; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.layout != null) { + + formData.put("layout", this.layout); + } + + if (this.businessEntityId != null) { + + formData.put("business_entity_id", this.businessEntityId); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.mandatoryItemsToRemove != null) { + + formData.put("mandatory_items_to_remove", this.mandatoryItemsToRemove); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.cancelUrl != null) { + + formData.put("cancel_url", this.cancelUrl); + } + + if (this.passThruContent != null) { + + formData.put("pass_thru_content", this.passThruContent); + } + + if (this.allowOfflinePaymentMethods != null) { + + formData.put("allow_offline_payment_methods", this.allowOfflinePaymentMethods); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.entityIdentifiers != null) { + + // List of objects + for (int i = 0; i < this.entityIdentifiers.size(); i++) { + EntityIdentifiersParams item = this.entityIdentifiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "entity_identifiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for HostedPageCheckoutNewForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageCheckoutNewForItemsBuilder builder() { + return new HostedPageCheckoutNewForItemsBuilder(); + } + + public static final class HostedPageCheckoutNewForItemsBuilder { + + private Layout layout; + + private String businessEntityId; + + private Integer billingCycles; + + private List mandatoryItemsToRemove; + + private Integer termsToCharge; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private String redirectUrl; + + private String cancelUrl; + + private String passThruContent; + + private Boolean allowOfflinePaymentMethods; + + private SubscriptionParams subscription; + + private CustomerParams customer; + + private CardParams card; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private ContractTermParams contractTerm; + + private List subscriptionItems; + + private List discounts; + + private List itemTiers; + + private List entityIdentifiers; + + private HostedPageCheckoutNewForItemsBuilder() {} + + public HostedPageCheckoutNewForItemsBuilder layout(Layout value) { + this.layout = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder businessEntityId(String value) { + this.businessEntityId = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder mandatoryItemsToRemove(List value) { + this.mandatoryItemsToRemove = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder billingAlignmentMode(BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder cancelUrl(String value) { + this.cancelUrl = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder passThruContent(String value) { + this.passThruContent = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder allowOfflinePaymentMethods(Boolean value) { + this.allowOfflinePaymentMethods = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder card(CardParams value) { + this.card = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public HostedPageCheckoutNewForItemsBuilder entityIdentifiers( + List value) { + this.entityIdentifiers = value; + return this; + } + + public HostedPageCheckoutNewForItemsParams build() { + return new HostedPageCheckoutNewForItemsParams(this); + } + } + + public enum Layout { + IN_APP("in_app"), + + FULL_PAGE("full_page"), + + /** An enum member indicating that Layout was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Layout(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Layout fromString(String value) { + if (value == null) return _UNKNOWN; + for (Layout enumValue : Layout.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final Timestamp trialEnd; + + private final Long setupFee; + + private final Timestamp startDate; + + private final String coupon; + + private final AutoCollection autoCollection; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final String invoiceNotes; + + private final String poNumber; + + private final Integer contractTermBillingCycleOnRenewal; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.trialEnd = builder.trialEnd; + + this.setupFee = builder.setupFee; + + this.startDate = builder.startDate; + + this.coupon = builder.coupon; + + this.autoCollection = builder.autoCollection; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.invoiceNotes = builder.invoiceNotes; + + this.poNumber = builder.poNumber; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + } + + public String getId() { + return id; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getStartDate() { + return startDate; + } + + public String getCoupon() { + return coupon; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public String getPoNumber() { + return poNumber; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private Timestamp trialEnd; + + private Long setupFee; + + private Timestamp startDate; + + private String coupon; + + private AutoCollection autoCollection; + + private OfflinePaymentMethod offlinePaymentMethod; + + private String invoiceNotes; + + private String poNumber; + + private Integer contractTermBillingCycleOnRenewal; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + @Deprecated + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public SubscriptionBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CustomerParams { + + private final String id; + + private final String email; + + private final String firstName; + + private final String lastName; + + private final String company; + + private final String phone; + + private final String locale; + + private final Taxability taxability; + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final Boolean isEinvoiceEnabled; + + private final String entityIdentifierScheme; + + private final String entityIdentifierStandard; + + private final EinvoicingMethod einvoicingMethod; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.email = builder.email; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.company = builder.company; + + this.phone = builder.phone; + + this.locale = builder.locale; + + this.taxability = builder.taxability; + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.isEinvoiceEnabled = builder.isEinvoiceEnabled; + + this.entityIdentifierScheme = builder.entityIdentifierScheme; + + this.entityIdentifierStandard = builder.entityIdentifierStandard; + + this.einvoicingMethod = builder.einvoicingMethod; + } + + public String getId() { + return id; + } + + public String getEmail() { + return email; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getCompany() { + return company; + } + + public String getPhone() { + return phone; + } + + public String getLocale() { + return locale; + } + + public Taxability getTaxability() { + return taxability; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public Boolean getIsEinvoiceEnabled() { + return isEinvoiceEnabled; + } + + public String getEntityIdentifierScheme() { + return entityIdentifierScheme; + } + + public String getEntityIdentifierStandard() { + return entityIdentifierStandard; + } + + public EinvoicingMethod getEinvoicingMethod() { + return einvoicingMethod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + + if (this.company != null) { + + formData.put("company", this.company); + } + + if (this.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.locale != null) { + + formData.put("locale", this.locale); + } + + if (this.taxability != null) { + + formData.put("taxability", this.taxability); + } + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.isEinvoiceEnabled != null) { + + formData.put("is_einvoice_enabled", this.isEinvoiceEnabled); + } + + if (this.entityIdentifierScheme != null) { + + formData.put("entity_identifier_scheme", this.entityIdentifierScheme); + } + + if (this.entityIdentifierStandard != null) { + + formData.put("entity_identifier_standard", this.entityIdentifierStandard); + } + + if (this.einvoicingMethod != null) { + + formData.put("einvoicing_method", this.einvoicingMethod); + } + + 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 id; + + private String email; + + private String firstName; + + private String lastName; + + private String company; + + private String phone; + + private String locale; + + private Taxability taxability; + + private String vatNumber; + + private String vatNumberPrefix; + + private Boolean isEinvoiceEnabled; + + private String entityIdentifierScheme; + + private String entityIdentifierStandard; + + private EinvoicingMethod einvoicingMethod; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerBuilder email(String value) { + this.email = value; + return this; + } + + public CustomerBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CustomerBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CustomerBuilder company(String value) { + this.company = value; + return this; + } + + public CustomerBuilder phone(String value) { + this.phone = value; + return this; + } + + public CustomerBuilder locale(String value) { + this.locale = value; + return this; + } + + public CustomerBuilder taxability(Taxability value) { + this.taxability = value; + return this; + } + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder isEinvoiceEnabled(Boolean value) { + this.isEinvoiceEnabled = value; + return this; + } + + public CustomerBuilder entityIdentifierScheme(String value) { + this.entityIdentifierScheme = value; + return this; + } + + public CustomerBuilder entityIdentifierStandard(String value) { + this.entityIdentifierStandard = value; + return this; + } + + public CustomerBuilder einvoicingMethod(EinvoicingMethod value) { + this.einvoicingMethod = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + + public enum Taxability { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Taxability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Taxability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Taxability fromString(String value) { + if (value == null) return _UNKNOWN; + for (Taxability enumValue : Taxability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EinvoicingMethod { + AUTOMATIC("automatic"), + + MANUAL("manual"), + + SITE_DEFAULT("site_default"), + + /** An enum member indicating that EinvoicingMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EinvoicingMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EinvoicingMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (EinvoicingMethod enumValue : EinvoicingMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CardParams { + + private final Gateway gateway; + + private final String gatewayAccountId; + + private CardParams(CardBuilder builder) { + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + /** 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); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + private Gateway gateway; + + private String gatewayAccountId; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public CardParams build() { + return new CardParams(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 static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ItemType itemType; + + private final ChargeOnOption chargeOnOption; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.itemType = builder.itemType; + + this.chargeOnOption = builder.chargeOnOption; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ItemType getItemType() { + return itemType; + } + + public ChargeOnOption getChargeOnOption() { + return chargeOnOption; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.itemType != null) { + + formData.put("item_type", this.itemType); + } + + if (this.chargeOnOption != null) { + + formData.put("charge_on_option", this.chargeOnOption); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ItemType itemType; + + private ChargeOnOption chargeOnOption; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionItemsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionItemsBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public SubscriptionItemsBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { + this.chargeOnOption = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + + 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"), + + /** 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; + } + } + + 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 enum ChargeOnOption { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnOption enumValue : ChargeOnOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DiscountsParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private final Integer quantity; + + private DiscountsParams(DiscountsBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private Integer quantity; + + private DiscountsBuilder() {} + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class EntityIdentifiersParams { + + private final String id; + + private final String scheme; + + private final String value; + + private final Operation operation; + + private final String standard; + + private EntityIdentifiersParams(EntityIdentifiersBuilder builder) { + + this.id = builder.id; + + this.scheme = builder.scheme; + + this.value = builder.value; + + this.operation = builder.operation; + + this.standard = builder.standard; + } + + public String getId() { + return id; + } + + public String getScheme() { + return scheme; + } + + public String getValue() { + return value; + } + + public Operation getOperation() { + return operation; + } + + public String getStandard() { + return standard; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.scheme != null) { + + formData.put("scheme", this.scheme); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + if (this.operation != null) { + + formData.put("operation", this.operation); + } + + if (this.standard != null) { + + formData.put("standard", this.standard); + } + + return formData; + } + + /** Create a new builder for EntityIdentifiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EntityIdentifiersBuilder builder() { + return new EntityIdentifiersBuilder(); + } + + public static final class EntityIdentifiersBuilder { + + private String id; + + private String scheme; + + private String value; + + private Operation operation; + + private String standard; + + private EntityIdentifiersBuilder() {} + + public EntityIdentifiersBuilder id(String value) { + this.id = value; + return this; + } + + public EntityIdentifiersBuilder scheme(String value) { + this.scheme = value; + return this; + } + + public EntityIdentifiersBuilder value(String value) { + this.value = value; + return this; + } + + public EntityIdentifiersBuilder operation(Operation value) { + this.operation = value; + return this; + } + + public EntityIdentifiersBuilder standard(String value) { + this.standard = value; + return this; + } + + public EntityIdentifiersParams build() { + return new EntityIdentifiersParams(this); + } + } + + public enum Operation { + CREATE("create"), + + UPDATE("update"), + + DELETE("delete"), + + /** An enum member indicating that Operation was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Operation(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Operation fromString(String value) { + if (value == null) return _UNKNOWN; + for (Operation enumValue : Operation.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewParams.java new file mode 100644 index 00000000..2f7ddff3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewParams.java @@ -0,0 +1,2587 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class HostedPageCheckoutNewParams { + + private final Integer billingCycles; + + private final List mandatoryAddonsToRemove; + + private final Integer termsToCharge; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final String redirectUrl; + + private final String cancelUrl; + + private final String passThruContent; + + private final Boolean embed; + + private final Boolean iframeMessaging; + + private final Boolean allowOfflinePaymentMethods; + + private final SubscriptionParams subscription; + + private final CustomerParams customer; + + private final CardParams card; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final ContractTermParams contractTerm; + + private final List addons; + + private final List eventBasedAddons; + + private HostedPageCheckoutNewParams(HostedPageCheckoutNewBuilder builder) { + + this.billingCycles = builder.billingCycles; + + this.mandatoryAddonsToRemove = builder.mandatoryAddonsToRemove; + + this.termsToCharge = builder.termsToCharge; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.redirectUrl = builder.redirectUrl; + + this.cancelUrl = builder.cancelUrl; + + this.passThruContent = builder.passThruContent; + + this.embed = builder.embed; + + this.iframeMessaging = builder.iframeMessaging; + + this.allowOfflinePaymentMethods = builder.allowOfflinePaymentMethods; + + this.subscription = builder.subscription; + + this.customer = builder.customer; + + this.card = builder.card; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.contractTerm = builder.contractTerm; + + this.addons = builder.addons; + + this.eventBasedAddons = builder.eventBasedAddons; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public List getMandatoryAddonsToRemove() { + return mandatoryAddonsToRemove; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public String getCancelUrl() { + return cancelUrl; + } + + public String getPassThruContent() { + return passThruContent; + } + + public Boolean getEmbed() { + return embed; + } + + public Boolean getIframeMessaging() { + return iframeMessaging; + } + + public Boolean getAllowOfflinePaymentMethods() { + return allowOfflinePaymentMethods; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public CustomerParams getCustomer() { + return customer; + } + + public CardParams getCard() { + return card; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getAddons() { + return addons; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.mandatoryAddonsToRemove != null) { + + formData.put("mandatory_addons_to_remove", this.mandatoryAddonsToRemove); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.cancelUrl != null) { + + formData.put("cancel_url", this.cancelUrl); + } + + if (this.passThruContent != null) { + + formData.put("pass_thru_content", this.passThruContent); + } + + if (this.embed != null) { + + formData.put("embed", this.embed); + } + + if (this.iframeMessaging != null) { + + formData.put("iframe_messaging", this.iframeMessaging); + } + + if (this.allowOfflinePaymentMethods != null) { + + formData.put("allow_offline_payment_methods", this.allowOfflinePaymentMethods); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for HostedPageCheckoutNewParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageCheckoutNewBuilder builder() { + return new HostedPageCheckoutNewBuilder(); + } + + public static final class HostedPageCheckoutNewBuilder { + + private Integer billingCycles; + + private List mandatoryAddonsToRemove; + + private Integer termsToCharge; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private String redirectUrl; + + private String cancelUrl; + + private String passThruContent; + + private Boolean embed; + + private Boolean iframeMessaging; + + private Boolean allowOfflinePaymentMethods; + + private SubscriptionParams subscription; + + private CustomerParams customer; + + private CardParams card; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private ContractTermParams contractTerm; + + private List addons; + + private List eventBasedAddons; + + private HostedPageCheckoutNewBuilder() {} + + public HostedPageCheckoutNewBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public HostedPageCheckoutNewBuilder mandatoryAddonsToRemove(List value) { + this.mandatoryAddonsToRemove = value; + return this; + } + + public HostedPageCheckoutNewBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public HostedPageCheckoutNewBuilder billingAlignmentMode(BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public HostedPageCheckoutNewBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public HostedPageCheckoutNewBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public HostedPageCheckoutNewBuilder cancelUrl(String value) { + this.cancelUrl = value; + return this; + } + + public HostedPageCheckoutNewBuilder passThruContent(String value) { + this.passThruContent = value; + return this; + } + + public HostedPageCheckoutNewBuilder embed(Boolean value) { + this.embed = value; + return this; + } + + public HostedPageCheckoutNewBuilder iframeMessaging(Boolean value) { + this.iframeMessaging = value; + return this; + } + + public HostedPageCheckoutNewBuilder allowOfflinePaymentMethods(Boolean value) { + this.allowOfflinePaymentMethods = value; + return this; + } + + public HostedPageCheckoutNewBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public HostedPageCheckoutNewBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public HostedPageCheckoutNewBuilder card(CardParams value) { + this.card = value; + return this; + } + + public HostedPageCheckoutNewBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public HostedPageCheckoutNewBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public HostedPageCheckoutNewBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public HostedPageCheckoutNewBuilder addons(List value) { + this.addons = value; + return this; + } + + public HostedPageCheckoutNewBuilder eventBasedAddons(List value) { + this.eventBasedAddons = value; + return this; + } + + public HostedPageCheckoutNewParams build() { + return new HostedPageCheckoutNewParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final String planId; + + private final Integer planQuantity; + + private final String planQuantityInDecimal; + + private final Long planUnitPrice; + + private final String planUnitPriceInDecimal; + + private final Long setupFee; + + private final Timestamp trialEnd; + + private final Timestamp startDate; + + private final String coupon; + + private final AutoCollection autoCollection; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final String invoiceNotes; + + private final String affiliateToken; + + private final Integer contractTermBillingCycleOnRenewal; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + + this.planUnitPrice = builder.planUnitPrice; + + this.planUnitPriceInDecimal = builder.planUnitPriceInDecimal; + + this.setupFee = builder.setupFee; + + this.trialEnd = builder.trialEnd; + + this.startDate = builder.startDate; + + this.coupon = builder.coupon; + + this.autoCollection = builder.autoCollection; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.invoiceNotes = builder.invoiceNotes; + + this.affiliateToken = builder.affiliateToken; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + } + + public String getId() { + return id; + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + public Long getPlanUnitPrice() { + return planUnitPrice; + } + + public String getPlanUnitPriceInDecimal() { + return planUnitPriceInDecimal; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Timestamp getStartDate() { + return startDate; + } + + public String getCoupon() { + return coupon; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public String getAffiliateToken() { + return affiliateToken; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + if (this.planUnitPrice != null) { + + formData.put("plan_unit_price", this.planUnitPrice); + } + + if (this.planUnitPriceInDecimal != null) { + + formData.put("plan_unit_price_in_decimal", this.planUnitPriceInDecimal); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.affiliateToken != null) { + + formData.put("affiliate_token", this.affiliateToken); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private String planId; + + private Integer planQuantity; + + private String planQuantityInDecimal; + + private Long planUnitPrice; + + private String planUnitPriceInDecimal; + + private Long setupFee; + + private Timestamp trialEnd; + + private Timestamp startDate; + + private String coupon; + + private AutoCollection autoCollection; + + private OfflinePaymentMethod offlinePaymentMethod; + + private String invoiceNotes; + + private String affiliateToken; + + private Integer contractTermBillingCycleOnRenewal; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionBuilder planId(String value) { + this.planId = value; + return this; + } + + public SubscriptionBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public SubscriptionBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + public SubscriptionBuilder planUnitPrice(Long value) { + this.planUnitPrice = value; + return this; + } + + public SubscriptionBuilder planUnitPriceInDecimal(String value) { + this.planUnitPriceInDecimal = value; + return this; + } + + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + @Deprecated + public SubscriptionBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public SubscriptionBuilder affiliateToken(String value) { + this.affiliateToken = value; + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CustomerParams { + + private final String id; + + private final String email; + + private final String firstName; + + private final String lastName; + + private final String company; + + private final String phone; + + private final String locale; + + private final Taxability taxability; + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final Boolean consolidatedInvoicing; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.email = builder.email; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.company = builder.company; + + this.phone = builder.phone; + + this.locale = builder.locale; + + this.taxability = builder.taxability; + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.consolidatedInvoicing = builder.consolidatedInvoicing; + } + + public String getId() { + return id; + } + + public String getEmail() { + return email; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getCompany() { + return company; + } + + public String getPhone() { + return phone; + } + + public String getLocale() { + return locale; + } + + public Taxability getTaxability() { + return taxability; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public Boolean getConsolidatedInvoicing() { + return consolidatedInvoicing; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + + if (this.company != null) { + + formData.put("company", this.company); + } + + if (this.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.locale != null) { + + formData.put("locale", this.locale); + } + + if (this.taxability != null) { + + formData.put("taxability", this.taxability); + } + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.consolidatedInvoicing != null) { + + formData.put("consolidated_invoicing", this.consolidatedInvoicing); + } + + 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 id; + + private String email; + + private String firstName; + + private String lastName; + + private String company; + + private String phone; + + private String locale; + + private Taxability taxability; + + private String vatNumber; + + private String vatNumberPrefix; + + private Boolean consolidatedInvoicing; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerBuilder email(String value) { + this.email = value; + return this; + } + + public CustomerBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CustomerBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CustomerBuilder company(String value) { + this.company = value; + return this; + } + + public CustomerBuilder phone(String value) { + this.phone = value; + return this; + } + + public CustomerBuilder locale(String value) { + this.locale = value; + return this; + } + + public CustomerBuilder taxability(Taxability value) { + this.taxability = value; + return this; + } + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder consolidatedInvoicing(Boolean value) { + this.consolidatedInvoicing = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + + public enum Taxability { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Taxability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Taxability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Taxability fromString(String value) { + if (value == null) return _UNKNOWN; + for (Taxability enumValue : Taxability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CardParams { + + private final Gateway gateway; + + private final String gatewayAccountId; + + private CardParams(CardBuilder builder) { + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + /** 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); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + private Gateway gateway; + + private String gatewayAccountId; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public CardParams build() { + return new CardParams(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 static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private final Integer servicePeriodInDays; + + private final OnEvent onEvent; + + private final Boolean chargeOnce; + + private final ChargeOn chargeOn; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.servicePeriodInDays = builder.servicePeriodInDays; + + this.onEvent = builder.onEvent; + + this.chargeOnce = builder.chargeOnce; + + this.chargeOn = builder.chargeOn; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getServicePeriodInDays() { + return servicePeriodInDays; + } + + public OnEvent getOnEvent() { + return onEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ChargeOn getChargeOn() { + return chargeOn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.servicePeriodInDays != null) { + + formData.put("service_period_in_days", this.servicePeriodInDays); + } + + if (this.onEvent != null) { + + formData.put("on_event", this.onEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.chargeOn != null) { + + formData.put("charge_on", this.chargeOn); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private Integer servicePeriodInDays; + + private OnEvent onEvent; + + private Boolean chargeOnce; + + private ChargeOn chargeOn; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { + this.servicePeriodInDays = value; + return this; + } + + public EventBasedAddonsBuilder onEvent(OnEvent value) { + this.onEvent = value; + return this; + } + + public EventBasedAddonsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public EventBasedAddonsBuilder chargeOn(ChargeOn value) { + this.chargeOn = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + + public enum OnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** An enum member indicating that OnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (OnEvent enumValue : OnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChargeOn { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOn fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOn enumValue : ChargeOn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeForItemsParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeForItemsParams.java new file mode 100644 index 00000000..517e4295 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeForItemsParams.java @@ -0,0 +1,2885 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class HostedPageCheckoutOneTimeForItemsParams { + + private final String businessEntityId; + + private final Layout layout; + + private final String invoiceNote; + + private final String coupon; + + private final List couponIds; + + private final String currencyCode; + + private final String redirectUrl; + + private final String cancelUrl; + + private final String passThruContent; + + private final CustomerParams customer; + + private final InvoiceParams invoice; + + private final CardParams card; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final List itemPrices; + + private final List itemTiers; + + private final List charges; + + private final List discounts; + + private final List entityIdentifiers; + + private HostedPageCheckoutOneTimeForItemsParams( + HostedPageCheckoutOneTimeForItemsBuilder builder) { + + this.businessEntityId = builder.businessEntityId; + + this.layout = builder.layout; + + this.invoiceNote = builder.invoiceNote; + + this.coupon = builder.coupon; + + this.couponIds = builder.couponIds; + + this.currencyCode = builder.currencyCode; + + this.redirectUrl = builder.redirectUrl; + + this.cancelUrl = builder.cancelUrl; + + this.passThruContent = builder.passThruContent; + + this.customer = builder.customer; + + this.invoice = builder.invoice; + + this.card = builder.card; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.itemPrices = builder.itemPrices; + + this.itemTiers = builder.itemTiers; + + this.charges = builder.charges; + + this.discounts = builder.discounts; + + this.entityIdentifiers = builder.entityIdentifiers; + } + + public String getBusinessEntityId() { + return businessEntityId; + } + + public Layout getLayout() { + return layout; + } + + public String getInvoiceNote() { + return invoiceNote; + } + + public String getCoupon() { + return coupon; + } + + public List getCouponIds() { + return couponIds; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public String getCancelUrl() { + return cancelUrl; + } + + public String getPassThruContent() { + return passThruContent; + } + + public CustomerParams getCustomer() { + return customer; + } + + public InvoiceParams getInvoice() { + return invoice; + } + + public CardParams getCard() { + return card; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public List getItemPrices() { + return itemPrices; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getCharges() { + return charges; + } + + public List getDiscounts() { + return discounts; + } + + public List getEntityIdentifiers() { + return entityIdentifiers; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.businessEntityId != null) { + + formData.put("business_entity_id", this.businessEntityId); + } + + if (this.layout != null) { + + formData.put("layout", this.layout); + } + + if (this.invoiceNote != null) { + + formData.put("invoice_note", this.invoiceNote); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.cancelUrl != null) { + + formData.put("cancel_url", this.cancelUrl); + } + + if (this.passThruContent != null) { + + formData.put("pass_thru_content", this.passThruContent); + } + + 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()); + } + } + + if (this.invoice != null) { + + // Single object + Map nestedData = this.invoice.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "invoice[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemPrices != null) { + + // List of objects + for (int i = 0; i < this.itemPrices.size(); i++) { + ItemPricesParams item = this.itemPrices.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_prices[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.charges != null) { + + // List of objects + for (int i = 0; i < this.charges.size(); i++) { + ChargesParams item = this.charges.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.entityIdentifiers != null) { + + // List of objects + for (int i = 0; i < this.entityIdentifiers.size(); i++) { + EntityIdentifiersParams item = this.entityIdentifiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "entity_identifiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for HostedPageCheckoutOneTimeForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageCheckoutOneTimeForItemsBuilder builder() { + return new HostedPageCheckoutOneTimeForItemsBuilder(); + } + + public static final class HostedPageCheckoutOneTimeForItemsBuilder { + + private String businessEntityId; + + private Layout layout; + + private String invoiceNote; + + private String coupon; + + private List couponIds; + + private String currencyCode; + + private String redirectUrl; + + private String cancelUrl; + + private String passThruContent; + + private CustomerParams customer; + + private InvoiceParams invoice; + + private CardParams card; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private List itemPrices; + + private List itemTiers; + + private List charges; + + private List discounts; + + private List entityIdentifiers; + + private HostedPageCheckoutOneTimeForItemsBuilder() {} + + public HostedPageCheckoutOneTimeForItemsBuilder businessEntityId(String value) { + this.businessEntityId = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder layout(Layout value) { + this.layout = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder invoiceNote(String value) { + this.invoiceNote = value; + return this; + } + + @Deprecated + public HostedPageCheckoutOneTimeForItemsBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder cancelUrl(String value) { + this.cancelUrl = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder passThruContent(String value) { + this.passThruContent = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder invoice(InvoiceParams value) { + this.invoice = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder card(CardParams value) { + this.card = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder itemPrices(List value) { + this.itemPrices = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder charges(List value) { + this.charges = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsBuilder entityIdentifiers( + List value) { + this.entityIdentifiers = value; + return this; + } + + public HostedPageCheckoutOneTimeForItemsParams build() { + return new HostedPageCheckoutOneTimeForItemsParams(this); + } + } + + public enum Layout { + IN_APP("in_app"), + + FULL_PAGE("full_page"), + + /** An enum member indicating that Layout was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Layout(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Layout fromString(String value) { + if (value == null) return _UNKNOWN; + for (Layout enumValue : Layout.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class CustomerParams { + + private final String id; + + private final String email; + + private final String firstName; + + private final String lastName; + + private final String company; + + private final String phone; + + private final String locale; + + private final Taxability taxability; + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final EinvoicingMethod einvoicingMethod; + + private final Boolean isEinvoiceEnabled; + + private final String entityIdentifierScheme; + + private final String entityIdentifierStandard; + + private final Boolean consolidatedInvoicing; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.email = builder.email; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.company = builder.company; + + this.phone = builder.phone; + + this.locale = builder.locale; + + this.taxability = builder.taxability; + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.einvoicingMethod = builder.einvoicingMethod; + + this.isEinvoiceEnabled = builder.isEinvoiceEnabled; + + this.entityIdentifierScheme = builder.entityIdentifierScheme; + + this.entityIdentifierStandard = builder.entityIdentifierStandard; + + this.consolidatedInvoicing = builder.consolidatedInvoicing; + } + + public String getId() { + return id; + } + + public String getEmail() { + return email; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getCompany() { + return company; + } + + public String getPhone() { + return phone; + } + + public String getLocale() { + return locale; + } + + public Taxability getTaxability() { + return taxability; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public EinvoicingMethod getEinvoicingMethod() { + return einvoicingMethod; + } + + public Boolean getIsEinvoiceEnabled() { + return isEinvoiceEnabled; + } + + public String getEntityIdentifierScheme() { + return entityIdentifierScheme; + } + + public String getEntityIdentifierStandard() { + return entityIdentifierStandard; + } + + public Boolean getConsolidatedInvoicing() { + return consolidatedInvoicing; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + + if (this.company != null) { + + formData.put("company", this.company); + } + + if (this.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.locale != null) { + + formData.put("locale", this.locale); + } + + if (this.taxability != null) { + + formData.put("taxability", this.taxability); + } + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.einvoicingMethod != null) { + + formData.put("einvoicing_method", this.einvoicingMethod); + } + + if (this.isEinvoiceEnabled != null) { + + formData.put("is_einvoice_enabled", this.isEinvoiceEnabled); + } + + if (this.entityIdentifierScheme != null) { + + formData.put("entity_identifier_scheme", this.entityIdentifierScheme); + } + + if (this.entityIdentifierStandard != null) { + + formData.put("entity_identifier_standard", this.entityIdentifierStandard); + } + + if (this.consolidatedInvoicing != null) { + + formData.put("consolidated_invoicing", this.consolidatedInvoicing); + } + + 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 id; + + private String email; + + private String firstName; + + private String lastName; + + private String company; + + private String phone; + + private String locale; + + private Taxability taxability; + + private String vatNumber; + + private String vatNumberPrefix; + + private EinvoicingMethod einvoicingMethod; + + private Boolean isEinvoiceEnabled; + + private String entityIdentifierScheme; + + private String entityIdentifierStandard; + + private Boolean consolidatedInvoicing; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerBuilder email(String value) { + this.email = value; + return this; + } + + public CustomerBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CustomerBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CustomerBuilder company(String value) { + this.company = value; + return this; + } + + public CustomerBuilder phone(String value) { + this.phone = value; + return this; + } + + public CustomerBuilder locale(String value) { + this.locale = value; + return this; + } + + public CustomerBuilder taxability(Taxability value) { + this.taxability = value; + return this; + } + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder einvoicingMethod(EinvoicingMethod value) { + this.einvoicingMethod = value; + return this; + } + + public CustomerBuilder isEinvoiceEnabled(Boolean value) { + this.isEinvoiceEnabled = value; + return this; + } + + public CustomerBuilder entityIdentifierScheme(String value) { + this.entityIdentifierScheme = value; + return this; + } + + public CustomerBuilder entityIdentifierStandard(String value) { + this.entityIdentifierStandard = value; + return this; + } + + public CustomerBuilder consolidatedInvoicing(Boolean value) { + this.consolidatedInvoicing = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + + public enum Taxability { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Taxability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Taxability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Taxability fromString(String value) { + if (value == null) return _UNKNOWN; + for (Taxability enumValue : Taxability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EinvoicingMethod { + AUTOMATIC("automatic"), + + MANUAL("manual"), + + SITE_DEFAULT("site_default"), + + /** An enum member indicating that EinvoicingMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EinvoicingMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EinvoicingMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (EinvoicingMethod enumValue : EinvoicingMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class InvoiceParams { + + private final String poNumber; + + private InvoiceParams(InvoiceBuilder builder) { + + this.poNumber = builder.poNumber; + } + + public String getPoNumber() { + return poNumber; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + return formData; + } + + /** Create a new builder for InvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceBuilder builder() { + return new InvoiceBuilder(); + } + + public static final class InvoiceBuilder { + + private String poNumber; + + private InvoiceBuilder() {} + + public InvoiceBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public InvoiceParams build() { + return new InvoiceParams(this); + } + } + } + + public static final class CardParams { + + private final Gateway gateway; + + private final String gatewayAccountId; + + private CardParams(CardBuilder builder) { + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + /** 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); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + private Gateway gateway; + + private String gatewayAccountId; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public CardParams build() { + return new CardParams(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 static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class ItemPricesParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private ItemPricesParams(ItemPricesBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for ItemPricesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemPricesBuilder builder() { + return new ItemPricesBuilder(); + } + + public static final class ItemPricesBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private ItemPricesBuilder() {} + + public ItemPricesBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemPricesBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public ItemPricesBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public ItemPricesBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public ItemPricesBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public ItemPricesBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public ItemPricesBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public ItemPricesParams build() { + return new ItemPricesParams(this); + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ChargesParams { + + private final Long amount; + + private final String amountInDecimal; + + private final String description; + + private final Boolean taxable; + + private final String taxProfileId; + + private final String avalaraTaxCode; + + private final String hsnCode; + + private final String taxjarProductCode; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private ChargesParams(ChargesBuilder builder) { + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.description = builder.description; + + this.taxable = builder.taxable; + + this.taxProfileId = builder.taxProfileId; + + this.avalaraTaxCode = builder.avalaraTaxCode; + + this.hsnCode = builder.hsnCode; + + this.taxjarProductCode = builder.taxjarProductCode; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getDescription() { + return description; + } + + public Boolean getTaxable() { + return taxable; + } + + public String getTaxProfileId() { + return taxProfileId; + } + + public String getAvalaraTaxCode() { + return avalaraTaxCode; + } + + public String getHsnCode() { + return hsnCode; + } + + public String getTaxjarProductCode() { + return taxjarProductCode; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.taxable != null) { + + formData.put("taxable", this.taxable); + } + + if (this.taxProfileId != null) { + + formData.put("tax_profile_id", this.taxProfileId); + } + + if (this.avalaraTaxCode != null) { + + formData.put("avalara_tax_code", this.avalaraTaxCode); + } + + if (this.hsnCode != null) { + + formData.put("hsn_code", this.hsnCode); + } + + if (this.taxjarProductCode != null) { + + formData.put("taxjar_product_code", this.taxjarProductCode); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for ChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargesBuilder builder() { + return new ChargesBuilder(); + } + + public static final class ChargesBuilder { + + private Long amount; + + private String amountInDecimal; + + private String description; + + private Boolean taxable; + + private String taxProfileId; + + private String avalaraTaxCode; + + private String hsnCode; + + private String taxjarProductCode; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private ChargesBuilder() {} + + public ChargesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public ChargesBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public ChargesBuilder description(String value) { + this.description = value; + return this; + } + + public ChargesBuilder taxable(Boolean value) { + this.taxable = value; + return this; + } + + public ChargesBuilder taxProfileId(String value) { + this.taxProfileId = value; + return this; + } + + public ChargesBuilder avalaraTaxCode(String value) { + this.avalaraTaxCode = value; + return this; + } + + public ChargesBuilder hsnCode(String value) { + this.hsnCode = value; + return this; + } + + public ChargesBuilder taxjarProductCode(String value) { + this.taxjarProductCode = value; + return this; + } + + public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public ChargesBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public ChargesBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public ChargesBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public ChargesBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public ChargesParams build() { + return new ChargesParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DiscountsParams { + + private final Number percentage; + + private final Long amount; + + private final Integer quantity; + + private final ApplyOn applyOn; + + private final String itemPriceId; + + private DiscountsParams(DiscountsBuilder builder) { + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.quantity = builder.quantity; + + this.applyOn = builder.applyOn; + + this.itemPriceId = builder.itemPriceId; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getQuantity() { + return quantity; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public String getItemPriceId() { + return itemPriceId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private Number percentage; + + private Long amount; + + private Integer quantity; + + private ApplyOn applyOn; + + private String itemPriceId; + + private DiscountsBuilder() {} + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 static final class EntityIdentifiersParams { + + private final String id; + + private final String scheme; + + private final String value; + + private final Operation operation; + + private final String standard; + + private EntityIdentifiersParams(EntityIdentifiersBuilder builder) { + + this.id = builder.id; + + this.scheme = builder.scheme; + + this.value = builder.value; + + this.operation = builder.operation; + + this.standard = builder.standard; + } + + public String getId() { + return id; + } + + public String getScheme() { + return scheme; + } + + public String getValue() { + return value; + } + + public Operation getOperation() { + return operation; + } + + public String getStandard() { + return standard; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.scheme != null) { + + formData.put("scheme", this.scheme); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + if (this.operation != null) { + + formData.put("operation", this.operation); + } + + if (this.standard != null) { + + formData.put("standard", this.standard); + } + + return formData; + } + + /** Create a new builder for EntityIdentifiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EntityIdentifiersBuilder builder() { + return new EntityIdentifiersBuilder(); + } + + public static final class EntityIdentifiersBuilder { + + private String id; + + private String scheme; + + private String value; + + private Operation operation; + + private String standard; + + private EntityIdentifiersBuilder() {} + + public EntityIdentifiersBuilder id(String value) { + this.id = value; + return this; + } + + public EntityIdentifiersBuilder scheme(String value) { + this.scheme = value; + return this; + } + + public EntityIdentifiersBuilder value(String value) { + this.value = value; + return this; + } + + public EntityIdentifiersBuilder operation(Operation value) { + this.operation = value; + return this; + } + + public EntityIdentifiersBuilder standard(String value) { + this.standard = value; + return this; + } + + public EntityIdentifiersParams build() { + return new EntityIdentifiersParams(this); + } + } + + public enum Operation { + CREATE("create"), + + UPDATE("update"), + + DELETE("delete"), + + /** An enum member indicating that Operation was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Operation(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Operation fromString(String value) { + if (value == null) return _UNKNOWN; + for (Operation enumValue : Operation.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeParams.java new file mode 100644 index 00000000..005b5782 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeParams.java @@ -0,0 +1,2103 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class HostedPageCheckoutOneTimeParams { + + private final String currencyCode; + + private final String invoiceNote; + + private final String coupon; + + private final List couponIds; + + private final String redirectUrl; + + private final String cancelUrl; + + private final String passThruContent; + + private final Boolean embed; + + private final Boolean iframeMessaging; + + private final CustomerParams customer; + + private final InvoiceParams invoice; + + private final CardParams card; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final List addons; + + private final List charges; + + private HostedPageCheckoutOneTimeParams(HostedPageCheckoutOneTimeBuilder builder) { + + this.currencyCode = builder.currencyCode; + + this.invoiceNote = builder.invoiceNote; + + this.coupon = builder.coupon; + + this.couponIds = builder.couponIds; + + this.redirectUrl = builder.redirectUrl; + + this.cancelUrl = builder.cancelUrl; + + this.passThruContent = builder.passThruContent; + + this.embed = builder.embed; + + this.iframeMessaging = builder.iframeMessaging; + + this.customer = builder.customer; + + this.invoice = builder.invoice; + + this.card = builder.card; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.addons = builder.addons; + + this.charges = builder.charges; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getInvoiceNote() { + return invoiceNote; + } + + public String getCoupon() { + return coupon; + } + + public List getCouponIds() { + return couponIds; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public String getCancelUrl() { + return cancelUrl; + } + + public String getPassThruContent() { + return passThruContent; + } + + public Boolean getEmbed() { + return embed; + } + + public Boolean getIframeMessaging() { + return iframeMessaging; + } + + public CustomerParams getCustomer() { + return customer; + } + + public InvoiceParams getInvoice() { + return invoice; + } + + public CardParams getCard() { + return card; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public List getAddons() { + return addons; + } + + public List getCharges() { + return charges; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.invoiceNote != null) { + + formData.put("invoice_note", this.invoiceNote); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.cancelUrl != null) { + + formData.put("cancel_url", this.cancelUrl); + } + + if (this.passThruContent != null) { + + formData.put("pass_thru_content", this.passThruContent); + } + + if (this.embed != null) { + + formData.put("embed", this.embed); + } + + if (this.iframeMessaging != null) { + + formData.put("iframe_messaging", this.iframeMessaging); + } + + 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()); + } + } + + if (this.invoice != null) { + + // Single object + Map nestedData = this.invoice.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "invoice[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.charges != null) { + + // List of objects + for (int i = 0; i < this.charges.size(); i++) { + ChargesParams item = this.charges.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for HostedPageCheckoutOneTimeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageCheckoutOneTimeBuilder builder() { + return new HostedPageCheckoutOneTimeBuilder(); + } + + public static final class HostedPageCheckoutOneTimeBuilder { + + private String currencyCode; + + private String invoiceNote; + + private String coupon; + + private List couponIds; + + private String redirectUrl; + + private String cancelUrl; + + private String passThruContent; + + private Boolean embed; + + private Boolean iframeMessaging; + + private CustomerParams customer; + + private InvoiceParams invoice; + + private CardParams card; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private List addons; + + private List charges; + + private HostedPageCheckoutOneTimeBuilder() {} + + public HostedPageCheckoutOneTimeBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public HostedPageCheckoutOneTimeBuilder invoiceNote(String value) { + this.invoiceNote = value; + return this; + } + + @Deprecated + public HostedPageCheckoutOneTimeBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public HostedPageCheckoutOneTimeBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public HostedPageCheckoutOneTimeBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public HostedPageCheckoutOneTimeBuilder cancelUrl(String value) { + this.cancelUrl = value; + return this; + } + + public HostedPageCheckoutOneTimeBuilder passThruContent(String value) { + this.passThruContent = value; + return this; + } + + public HostedPageCheckoutOneTimeBuilder embed(Boolean value) { + this.embed = value; + return this; + } + + public HostedPageCheckoutOneTimeBuilder iframeMessaging(Boolean value) { + this.iframeMessaging = value; + return this; + } + + public HostedPageCheckoutOneTimeBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public HostedPageCheckoutOneTimeBuilder invoice(InvoiceParams value) { + this.invoice = value; + return this; + } + + public HostedPageCheckoutOneTimeBuilder card(CardParams value) { + this.card = value; + return this; + } + + public HostedPageCheckoutOneTimeBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public HostedPageCheckoutOneTimeBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public HostedPageCheckoutOneTimeBuilder addons(List value) { + this.addons = value; + return this; + } + + public HostedPageCheckoutOneTimeBuilder charges(List value) { + this.charges = value; + return this; + } + + public HostedPageCheckoutOneTimeParams build() { + return new HostedPageCheckoutOneTimeParams(this); + } + } + + public static final class CustomerParams { + + private final String id; + + private final String email; + + private final String firstName; + + private final String lastName; + + private final String company; + + private final String phone; + + private final String locale; + + private final Taxability taxability; + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final Boolean consolidatedInvoicing; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.email = builder.email; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.company = builder.company; + + this.phone = builder.phone; + + this.locale = builder.locale; + + this.taxability = builder.taxability; + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.consolidatedInvoicing = builder.consolidatedInvoicing; + } + + public String getId() { + return id; + } + + public String getEmail() { + return email; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getCompany() { + return company; + } + + public String getPhone() { + return phone; + } + + public String getLocale() { + return locale; + } + + public Taxability getTaxability() { + return taxability; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public Boolean getConsolidatedInvoicing() { + return consolidatedInvoicing; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + + if (this.company != null) { + + formData.put("company", this.company); + } + + if (this.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.locale != null) { + + formData.put("locale", this.locale); + } + + if (this.taxability != null) { + + formData.put("taxability", this.taxability); + } + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.consolidatedInvoicing != null) { + + formData.put("consolidated_invoicing", this.consolidatedInvoicing); + } + + 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 id; + + private String email; + + private String firstName; + + private String lastName; + + private String company; + + private String phone; + + private String locale; + + private Taxability taxability; + + private String vatNumber; + + private String vatNumberPrefix; + + private Boolean consolidatedInvoicing; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerBuilder email(String value) { + this.email = value; + return this; + } + + public CustomerBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CustomerBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CustomerBuilder company(String value) { + this.company = value; + return this; + } + + public CustomerBuilder phone(String value) { + this.phone = value; + return this; + } + + public CustomerBuilder locale(String value) { + this.locale = value; + return this; + } + + public CustomerBuilder taxability(Taxability value) { + this.taxability = value; + return this; + } + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder consolidatedInvoicing(Boolean value) { + this.consolidatedInvoicing = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + + public enum Taxability { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Taxability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Taxability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Taxability fromString(String value) { + if (value == null) return _UNKNOWN; + for (Taxability enumValue : Taxability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class InvoiceParams { + + private final String poNumber; + + private InvoiceParams(InvoiceBuilder builder) { + + this.poNumber = builder.poNumber; + } + + public String getPoNumber() { + return poNumber; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + return formData; + } + + /** Create a new builder for InvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceBuilder builder() { + return new InvoiceBuilder(); + } + + public static final class InvoiceBuilder { + + private String poNumber; + + private InvoiceBuilder() {} + + public InvoiceBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public InvoiceParams build() { + return new InvoiceParams(this); + } + } + } + + public static final class CardParams { + + private final Gateway gateway; + + private final String gatewayAccountId; + + private CardParams(CardBuilder builder) { + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + /** 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); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + private Gateway gateway; + + private String gatewayAccountId; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public CardParams build() { + return new CardParams(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 static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public AddonsBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class ChargesParams { + + private final Long amount; + + private final String amountInDecimal; + + private final String description; + + private final Boolean taxable; + + private final String taxProfileId; + + private final String avalaraTaxCode; + + private final String hsnCode; + + private final String taxjarProductCode; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private ChargesParams(ChargesBuilder builder) { + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.description = builder.description; + + this.taxable = builder.taxable; + + this.taxProfileId = builder.taxProfileId; + + this.avalaraTaxCode = builder.avalaraTaxCode; + + this.hsnCode = builder.hsnCode; + + this.taxjarProductCode = builder.taxjarProductCode; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getDescription() { + return description; + } + + public Boolean getTaxable() { + return taxable; + } + + public String getTaxProfileId() { + return taxProfileId; + } + + public String getAvalaraTaxCode() { + return avalaraTaxCode; + } + + public String getHsnCode() { + return hsnCode; + } + + public String getTaxjarProductCode() { + return taxjarProductCode; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.taxable != null) { + + formData.put("taxable", this.taxable); + } + + if (this.taxProfileId != null) { + + formData.put("tax_profile_id", this.taxProfileId); + } + + if (this.avalaraTaxCode != null) { + + formData.put("avalara_tax_code", this.avalaraTaxCode); + } + + if (this.hsnCode != null) { + + formData.put("hsn_code", this.hsnCode); + } + + if (this.taxjarProductCode != null) { + + formData.put("taxjar_product_code", this.taxjarProductCode); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for ChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargesBuilder builder() { + return new ChargesBuilder(); + } + + public static final class ChargesBuilder { + + private Long amount; + + private String amountInDecimal; + + private String description; + + private Boolean taxable; + + private String taxProfileId; + + private String avalaraTaxCode; + + private String hsnCode; + + private String taxjarProductCode; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private ChargesBuilder() {} + + public ChargesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public ChargesBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public ChargesBuilder description(String value) { + this.description = value; + return this; + } + + public ChargesBuilder taxable(Boolean value) { + this.taxable = value; + return this; + } + + public ChargesBuilder taxProfileId(String value) { + this.taxProfileId = value; + return this; + } + + public ChargesBuilder avalaraTaxCode(String value) { + this.avalaraTaxCode = value; + return this; + } + + public ChargesBuilder hsnCode(String value) { + this.hsnCode = value; + return this; + } + + public ChargesBuilder taxjarProductCode(String value) { + this.taxjarProductCode = value; + return this; + } + + public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public ChargesBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public ChargesBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public ChargesBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public ChargesBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public ChargesParams build() { + return new ChargesParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageClaimGiftParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageClaimGiftParams.java new file mode 100644 index 00000000..d3f5c275 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageClaimGiftParams.java @@ -0,0 +1,206 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class HostedPageClaimGiftParams { + + private final String redirectUrl; + + private final GiftParams gift; + + private final CustomerParams customer; + + private HostedPageClaimGiftParams(HostedPageClaimGiftBuilder builder) { + + this.redirectUrl = builder.redirectUrl; + + this.gift = builder.gift; + + this.customer = builder.customer; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public GiftParams getGift() { + return gift; + } + + public CustomerParams getCustomer() { + return customer; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.gift != null) { + + // Single object + Map nestedData = this.gift.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "gift[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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 HostedPageClaimGiftParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageClaimGiftBuilder builder() { + return new HostedPageClaimGiftBuilder(); + } + + public static final class HostedPageClaimGiftBuilder { + + private String redirectUrl; + + private GiftParams gift; + + private CustomerParams customer; + + private HostedPageClaimGiftBuilder() {} + + public HostedPageClaimGiftBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public HostedPageClaimGiftBuilder gift(GiftParams value) { + this.gift = value; + return this; + } + + public HostedPageClaimGiftBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public HostedPageClaimGiftParams build() { + return new HostedPageClaimGiftParams(this); + } + } + + public static final class GiftParams { + + private final String id; + + private GiftParams(GiftBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for GiftParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GiftBuilder builder() { + return new GiftBuilder(); + } + + public static final class GiftBuilder { + + private String id; + + private GiftBuilder() {} + + public GiftBuilder id(String value) { + this.id = value; + return this; + } + + public GiftParams build() { + return new GiftParams(this); + } + } + } + + public static final class CustomerParams { + + private final String locale; + + private CustomerParams(CustomerBuilder builder) { + + this.locale = builder.locale; + } + + public String getLocale() { + return locale; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.locale != null) { + + formData.put("locale", this.locale); + } + + 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 locale; + + private CustomerBuilder() {} + + public CustomerBuilder locale(String value) { + this.locale = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCollectNowParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCollectNowParams.java new file mode 100644 index 00000000..376e45f8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCollectNowParams.java @@ -0,0 +1,381 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class HostedPageCollectNowParams { + + private final String redirectUrl; + + private final String currencyCode; + + private final CustomerParams customer; + + private final CardParams card; + + private HostedPageCollectNowParams(HostedPageCollectNowBuilder builder) { + + this.redirectUrl = builder.redirectUrl; + + this.currencyCode = builder.currencyCode; + + this.customer = builder.customer; + + this.card = builder.card; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public CustomerParams getCustomer() { + return customer; + } + + public CardParams getCard() { + return card; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + 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()); + } + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for HostedPageCollectNowParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageCollectNowBuilder builder() { + return new HostedPageCollectNowBuilder(); + } + + public static final class HostedPageCollectNowBuilder { + + private String redirectUrl; + + private String currencyCode; + + private CustomerParams customer; + + private CardParams card; + + private HostedPageCollectNowBuilder() {} + + public HostedPageCollectNowBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public HostedPageCollectNowBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public HostedPageCollectNowBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public HostedPageCollectNowBuilder card(CardParams value) { + this.card = value; + return this; + } + + public HostedPageCollectNowParams build() { + return new HostedPageCollectNowParams(this); + } + } + + public static final class CustomerParams { + + private final String id; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + 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 id; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } + + public static final class CardParams { + + private final Gateway gateway; + + private final String gatewayAccountId; + + private CardParams(CardBuilder builder) { + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + /** 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); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + private Gateway gateway; + + private String gatewayAccountId; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public CardParams build() { + return new CardParams(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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageEventsParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageEventsParams.java new file mode 100644 index 00000000..ae1fe23f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageEventsParams.java @@ -0,0 +1,128 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class HostedPageEventsParams { + + private final EventName eventName; + + private final Timestamp occurredAt; + + private final java.util.Map eventData; + + private HostedPageEventsParams(HostedPageEventsBuilder builder) { + + this.eventName = builder.eventName; + + this.occurredAt = builder.occurredAt; + + this.eventData = builder.eventData; + } + + public EventName getEventName() { + return eventName; + } + + public Timestamp getOccurredAt() { + return occurredAt; + } + + public java.util.Map getEventData() { + return eventData; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.eventName != null) { + + formData.put("event_name", this.eventName); + } + + if (this.occurredAt != null) { + + formData.put("occurred_at", this.occurredAt); + } + + if (this.eventData != null) { + + formData.put("event_data", JsonUtil.toJson(this.eventData)); + } + + return formData; + } + + /** Create a new builder for HostedPageEventsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageEventsBuilder builder() { + return new HostedPageEventsBuilder(); + } + + public static final class HostedPageEventsBuilder { + + private EventName eventName; + + private Timestamp occurredAt; + + private java.util.Map eventData; + + private HostedPageEventsBuilder() {} + + public HostedPageEventsBuilder eventName(EventName value) { + this.eventName = value; + return this; + } + + public HostedPageEventsBuilder occurredAt(Timestamp value) { + this.occurredAt = value; + return this; + } + + public HostedPageEventsBuilder eventData(java.util.Map value) { + this.eventData = value; + return this; + } + + public HostedPageEventsParams build() { + return new HostedPageEventsParams(this); + } + } + + public enum EventName { + CANCELLATION_PAGE_LOADED("cancellation_page_loaded"), + + /** An enum member indicating that EventName was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EventName(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EventName fromString(String value) { + if (value == null) return _UNKNOWN; + for (EventName enumValue : EventName.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageExtendSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageExtendSubscriptionParams.java new file mode 100644 index 00000000..17a1f026 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageExtendSubscriptionParams.java @@ -0,0 +1,153 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class HostedPageExtendSubscriptionParams { + + private final Integer expiry; + + private final Integer billingCycle; + + private final SubscriptionParams subscription; + + private HostedPageExtendSubscriptionParams(HostedPageExtendSubscriptionBuilder builder) { + + this.expiry = builder.expiry; + + this.billingCycle = builder.billingCycle; + + this.subscription = builder.subscription; + } + + public Integer getExpiry() { + return expiry; + } + + public Integer getBillingCycle() { + return billingCycle; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.expiry != null) { + + formData.put("expiry", this.expiry); + } + + if (this.billingCycle != null) { + + formData.put("billing_cycle", this.billingCycle); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for HostedPageExtendSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageExtendSubscriptionBuilder builder() { + return new HostedPageExtendSubscriptionBuilder(); + } + + public static final class HostedPageExtendSubscriptionBuilder { + + private Integer expiry; + + private Integer billingCycle; + + private SubscriptionParams subscription; + + private HostedPageExtendSubscriptionBuilder() {} + + public HostedPageExtendSubscriptionBuilder expiry(Integer value) { + this.expiry = value; + return this; + } + + public HostedPageExtendSubscriptionBuilder billingCycle(Integer value) { + this.billingCycle = value; + return this; + } + + public HostedPageExtendSubscriptionBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public HostedPageExtendSubscriptionParams build() { + return new HostedPageExtendSubscriptionParams(this); + } + } + + public static final class SubscriptionParams { + + private final String id; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageListParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageListParams.java rename to src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageListParams.java index 3cfc2225..92c85055 100644 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageListParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.hostedPage.params; +package com.chargebee.v4.models.hostedPage.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageManagePaymentSourcesParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageManagePaymentSourcesParams.java new file mode 100644 index 00000000..e09c4c96 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageManagePaymentSourcesParams.java @@ -0,0 +1,361 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class HostedPageManagePaymentSourcesParams { + + private final String redirectUrl; + + private final CustomerParams customer; + + private final CardParams card; + + private HostedPageManagePaymentSourcesParams(HostedPageManagePaymentSourcesBuilder builder) { + + this.redirectUrl = builder.redirectUrl; + + this.customer = builder.customer; + + this.card = builder.card; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public CustomerParams getCustomer() { + return customer; + } + + public CardParams getCard() { + return card; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + 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()); + } + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for HostedPageManagePaymentSourcesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageManagePaymentSourcesBuilder builder() { + return new HostedPageManagePaymentSourcesBuilder(); + } + + public static final class HostedPageManagePaymentSourcesBuilder { + + private String redirectUrl; + + private CustomerParams customer; + + private CardParams card; + + private HostedPageManagePaymentSourcesBuilder() {} + + public HostedPageManagePaymentSourcesBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public HostedPageManagePaymentSourcesBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public HostedPageManagePaymentSourcesBuilder card(CardParams value) { + this.card = value; + return this; + } + + public HostedPageManagePaymentSourcesParams build() { + return new HostedPageManagePaymentSourcesParams(this); + } + } + + public static final class CustomerParams { + + private final String id; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + 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 id; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } + + public static final class CardParams { + + private final Gateway gateway; + + private final String gatewayAccountId; + + private CardParams(CardBuilder builder) { + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + /** 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); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + private Gateway gateway; + + private String gatewayAccountId; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public CardParams build() { + return new CardParams(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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPagePreCancelParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPagePreCancelParams.java new file mode 100644 index 00000000..0385991b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPagePreCancelParams.java @@ -0,0 +1,173 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class HostedPagePreCancelParams { + + private final String passThruContent; + + private final String cancelUrl; + + private final String redirectUrl; + + private final SubscriptionParams subscription; + + private HostedPagePreCancelParams(HostedPagePreCancelBuilder builder) { + + this.passThruContent = builder.passThruContent; + + this.cancelUrl = builder.cancelUrl; + + this.redirectUrl = builder.redirectUrl; + + this.subscription = builder.subscription; + } + + public String getPassThruContent() { + return passThruContent; + } + + public String getCancelUrl() { + return cancelUrl; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.passThruContent != null) { + + formData.put("pass_thru_content", this.passThruContent); + } + + if (this.cancelUrl != null) { + + formData.put("cancel_url", this.cancelUrl); + } + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for HostedPagePreCancelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPagePreCancelBuilder builder() { + return new HostedPagePreCancelBuilder(); + } + + public static final class HostedPagePreCancelBuilder { + + private String passThruContent; + + private String cancelUrl; + + private String redirectUrl; + + private SubscriptionParams subscription; + + private HostedPagePreCancelBuilder() {} + + public HostedPagePreCancelBuilder passThruContent(String value) { + this.passThruContent = value; + return this; + } + + public HostedPagePreCancelBuilder cancelUrl(String value) { + this.cancelUrl = value; + return this; + } + + public HostedPagePreCancelBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public HostedPagePreCancelBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public HostedPagePreCancelParams build() { + return new HostedPagePreCancelParams(this); + } + } + + public static final class SubscriptionParams { + + private final String id; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageRetrieveAgreementPdfParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageRetrieveAgreementPdfParams.java new file mode 100644 index 00000000..a1c52997 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageRetrieveAgreementPdfParams.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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class HostedPageRetrieveAgreementPdfParams { + + private final String paymentSourceId; + + private HostedPageRetrieveAgreementPdfParams(HostedPageRetrieveAgreementPdfBuilder builder) { + + this.paymentSourceId = builder.paymentSourceId; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + return formData; + } + + /** Create a new builder for HostedPageRetrieveAgreementPdfParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageRetrieveAgreementPdfBuilder builder() { + return new HostedPageRetrieveAgreementPdfBuilder(); + } + + public static final class HostedPageRetrieveAgreementPdfBuilder { + + private String paymentSourceId; + + private HostedPageRetrieveAgreementPdfBuilder() {} + + public HostedPageRetrieveAgreementPdfBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public HostedPageRetrieveAgreementPdfParams build() { + return new HostedPageRetrieveAgreementPdfParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageRetrieveParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageRetrieveParams.java index 8059ebcd..dba3ae38 100644 --- a/src/main/java/com/chargebee/v4/core/models/hostedPage/params/HostedPageRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.hostedPage.params; +package com.chargebee.v4.models.hostedPage.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdateCardParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdateCardParams.java new file mode 100644 index 00000000..9fb81ae5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdateCardParams.java @@ -0,0 +1,483 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class HostedPageUpdateCardParams { + + private final String redirectUrl; + + private final String cancelUrl; + + private final String passThruContent; + + private final Boolean iframeMessaging; + + private final CustomerParams customer; + + private final CardParams card; + + private final Boolean embed; + + private HostedPageUpdateCardParams(HostedPageUpdateCardBuilder builder) { + + this.redirectUrl = builder.redirectUrl; + + this.cancelUrl = builder.cancelUrl; + + this.passThruContent = builder.passThruContent; + + this.iframeMessaging = builder.iframeMessaging; + + this.customer = builder.customer; + + this.card = builder.card; + + this.embed = builder.embed; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public String getCancelUrl() { + return cancelUrl; + } + + public String getPassThruContent() { + return passThruContent; + } + + public Boolean getIframeMessaging() { + return iframeMessaging; + } + + public CustomerParams getCustomer() { + return customer; + } + + public CardParams getCard() { + return card; + } + + public Boolean getEmbed() { + return embed; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.cancelUrl != null) { + + formData.put("cancel_url", this.cancelUrl); + } + + if (this.passThruContent != null) { + + formData.put("pass_thru_content", this.passThruContent); + } + + if (this.iframeMessaging != null) { + + formData.put("iframe_messaging", this.iframeMessaging); + } + + 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()); + } + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.embed != null) { + + formData.put("embed", this.embed); + } + + return formData; + } + + /** Create a new builder for HostedPageUpdateCardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageUpdateCardBuilder builder() { + return new HostedPageUpdateCardBuilder(); + } + + public static final class HostedPageUpdateCardBuilder { + + private String redirectUrl; + + private String cancelUrl; + + private String passThruContent; + + private Boolean iframeMessaging; + + private CustomerParams customer; + + private CardParams card; + + private Boolean embed; + + private HostedPageUpdateCardBuilder() {} + + public HostedPageUpdateCardBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public HostedPageUpdateCardBuilder cancelUrl(String value) { + this.cancelUrl = value; + return this; + } + + public HostedPageUpdateCardBuilder passThruContent(String value) { + this.passThruContent = value; + return this; + } + + public HostedPageUpdateCardBuilder iframeMessaging(Boolean value) { + this.iframeMessaging = value; + return this; + } + + public HostedPageUpdateCardBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public HostedPageUpdateCardBuilder card(CardParams value) { + this.card = value; + return this; + } + + public HostedPageUpdateCardBuilder embed(Boolean value) { + this.embed = value; + return this; + } + + public HostedPageUpdateCardParams build() { + return new HostedPageUpdateCardParams(this); + } + } + + public static final class CustomerParams { + + private final String id; + + private final String vatNumber; + + private final String vatNumberPrefix; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + } + + public String getId() { + return id; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + 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 id; + + private String vatNumber; + + private String vatNumberPrefix; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + @Deprecated + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + @Deprecated + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } + + public static final class CardParams { + + private final Gateway gateway; + + private final String gatewayAccountId; + + private CardParams(CardBuilder builder) { + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + /** 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); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + private Gateway gateway; + + private String gatewayAccountId; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public CardParams build() { + return new CardParams(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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdatePaymentMethodParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdatePaymentMethodParams.java new file mode 100644 index 00000000..67d692e2 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdatePaymentMethodParams.java @@ -0,0 +1,483 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class HostedPageUpdatePaymentMethodParams { + + private final String redirectUrl; + + private final String cancelUrl; + + private final String passThruContent; + + private final Boolean iframeMessaging; + + private final CustomerParams customer; + + private final CardParams card; + + private final Boolean embed; + + private HostedPageUpdatePaymentMethodParams(HostedPageUpdatePaymentMethodBuilder builder) { + + this.redirectUrl = builder.redirectUrl; + + this.cancelUrl = builder.cancelUrl; + + this.passThruContent = builder.passThruContent; + + this.iframeMessaging = builder.iframeMessaging; + + this.customer = builder.customer; + + this.card = builder.card; + + this.embed = builder.embed; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public String getCancelUrl() { + return cancelUrl; + } + + public String getPassThruContent() { + return passThruContent; + } + + public Boolean getIframeMessaging() { + return iframeMessaging; + } + + public CustomerParams getCustomer() { + return customer; + } + + public CardParams getCard() { + return card; + } + + public Boolean getEmbed() { + return embed; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.cancelUrl != null) { + + formData.put("cancel_url", this.cancelUrl); + } + + if (this.passThruContent != null) { + + formData.put("pass_thru_content", this.passThruContent); + } + + if (this.iframeMessaging != null) { + + formData.put("iframe_messaging", this.iframeMessaging); + } + + 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()); + } + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.embed != null) { + + formData.put("embed", this.embed); + } + + return formData; + } + + /** Create a new builder for HostedPageUpdatePaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageUpdatePaymentMethodBuilder builder() { + return new HostedPageUpdatePaymentMethodBuilder(); + } + + public static final class HostedPageUpdatePaymentMethodBuilder { + + private String redirectUrl; + + private String cancelUrl; + + private String passThruContent; + + private Boolean iframeMessaging; + + private CustomerParams customer; + + private CardParams card; + + private Boolean embed; + + private HostedPageUpdatePaymentMethodBuilder() {} + + public HostedPageUpdatePaymentMethodBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public HostedPageUpdatePaymentMethodBuilder cancelUrl(String value) { + this.cancelUrl = value; + return this; + } + + public HostedPageUpdatePaymentMethodBuilder passThruContent(String value) { + this.passThruContent = value; + return this; + } + + public HostedPageUpdatePaymentMethodBuilder iframeMessaging(Boolean value) { + this.iframeMessaging = value; + return this; + } + + public HostedPageUpdatePaymentMethodBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public HostedPageUpdatePaymentMethodBuilder card(CardParams value) { + this.card = value; + return this; + } + + public HostedPageUpdatePaymentMethodBuilder embed(Boolean value) { + this.embed = value; + return this; + } + + public HostedPageUpdatePaymentMethodParams build() { + return new HostedPageUpdatePaymentMethodParams(this); + } + } + + public static final class CustomerParams { + + private final String id; + + private final String vatNumber; + + private final String vatNumberPrefix; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + } + + public String getId() { + return id; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + 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 id; + + private String vatNumber; + + private String vatNumberPrefix; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + @Deprecated + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + @Deprecated + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } + + public static final class CardParams { + + private final Gateway gateway; + + private final String gatewayAccountId; + + private CardParams(CardBuilder builder) { + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + /** 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); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + private Gateway gateway; + + private String gatewayAccountId; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public CardParams build() { + return new CardParams(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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageViewVoucherParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageViewVoucherParams.java new file mode 100644 index 00000000..f7371a8d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageViewVoucherParams.java @@ -0,0 +1,186 @@ +/* + * 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.hostedPage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class HostedPageViewVoucherParams { + + private final PaymentVoucherParams paymentVoucher; + + private final CustomerParams customer; + + private HostedPageViewVoucherParams(HostedPageViewVoucherBuilder builder) { + + this.paymentVoucher = builder.paymentVoucher; + + this.customer = builder.customer; + } + + public PaymentVoucherParams getPaymentVoucher() { + return paymentVoucher; + } + + public CustomerParams getCustomer() { + return customer; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.paymentVoucher != null) { + + // Single object + Map nestedData = this.paymentVoucher.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_voucher[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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 HostedPageViewVoucherParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static HostedPageViewVoucherBuilder builder() { + return new HostedPageViewVoucherBuilder(); + } + + public static final class HostedPageViewVoucherBuilder { + + private PaymentVoucherParams paymentVoucher; + + private CustomerParams customer; + + private HostedPageViewVoucherBuilder() {} + + public HostedPageViewVoucherBuilder paymentVoucher(PaymentVoucherParams value) { + this.paymentVoucher = value; + return this; + } + + public HostedPageViewVoucherBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public HostedPageViewVoucherParams build() { + return new HostedPageViewVoucherParams(this); + } + } + + public static final class PaymentVoucherParams { + + private final String id; + + private PaymentVoucherParams(PaymentVoucherBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for PaymentVoucherParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentVoucherBuilder builder() { + return new PaymentVoucherBuilder(); + } + + public static final class PaymentVoucherBuilder { + + private String id; + + private PaymentVoucherBuilder() {} + + public PaymentVoucherBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentVoucherParams build() { + return new PaymentVoucherParams(this); + } + } + } + + public static final class CustomerParams { + + private final String locale; + + private CustomerParams(CustomerBuilder builder) { + + this.locale = builder.locale; + } + + public String getLocale() { + return locale; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.locale != null) { + + formData.put("locale", this.locale); + } + + 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 locale; + + private CustomerBuilder() {} + + public CustomerBuilder locale(String value) { + this.locale = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageAcceptQuoteResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageAcceptQuoteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageAcceptQuoteResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageAcceptQuoteResponse.java index 8e73dbf5..e203da08 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageAcceptQuoteResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageAcceptQuoteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageAcknowledgeResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageAcknowledgeResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageAcknowledgeResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageAcknowledgeResponse.java index dfc2406a..9da68a40 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageAcknowledgeResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageAcknowledgeResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutExistingForItemsResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutExistingForItemsResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutExistingForItemsResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutExistingForItemsResponse.java index 259abfd3..370adfcc 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutExistingForItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutExistingForItemsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutExistingResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutExistingResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutExistingResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutExistingResponse.java index 2fd4ee76..98657a71 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutExistingResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutExistingResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutGiftForItemsResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutGiftForItemsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutGiftForItemsResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutGiftForItemsResponse.java index 4cbb05ad..2e546505 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutGiftForItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutGiftForItemsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutGiftResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutGiftResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutGiftResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutGiftResponse.java index 6ed582a8..3b99eadb 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutGiftResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutGiftResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutNewForItemsResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutNewForItemsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutNewForItemsResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutNewForItemsResponse.java index 5ddb89e2..243ca268 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutNewForItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutNewForItemsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutNewResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutNewResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutNewResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutNewResponse.java index d3c86adc..9fed5351 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutNewResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutNewResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutOneTimeForItemsResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutOneTimeForItemsResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutOneTimeForItemsResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutOneTimeForItemsResponse.java index 8037534e..ca21f811 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutOneTimeForItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutOneTimeForItemsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutOneTimeResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutOneTimeResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutOneTimeResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutOneTimeResponse.java index 117081ef..d99bfab7 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCheckoutOneTimeResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCheckoutOneTimeResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageClaimGiftResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageClaimGiftResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageClaimGiftResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageClaimGiftResponse.java index d430f412..b2acd0b5 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageClaimGiftResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageClaimGiftResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCollectNowResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCollectNowResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCollectNowResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCollectNowResponse.java index 5543f5ab..a5e4a659 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageCollectNowResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageCollectNowResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageEventsResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageEventsResponse.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageEventsResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageEventsResponse.java index 4d47de86..12865c9e 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageEventsResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageEventsResponse.java @@ -1,6 +1,6 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageExtendSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageExtendSubscriptionResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageExtendSubscriptionResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageExtendSubscriptionResponse.java index b12b570b..fcc49ecd 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageExtendSubscriptionResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageExtendSubscriptionResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageListResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageListResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageListResponse.java index 11f8f410..d2410fd3 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageListResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; import java.util.List; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.HostedPageService; -import com.chargebee.v4.core.models.hostedPage.params.HostedPageListParams; +import com.chargebee.v4.services.HostedPageService; +import com.chargebee.v4.models.hostedPage.params.HostedPageListParams; /** Immutable response object for HostedPageList operation. Contains paginated list data. */ public final class HostedPageListResponse { @@ -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 HostedPageListResponse nextPage() throws Exception { + public HostedPageListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageManagePaymentSourcesResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageManagePaymentSourcesResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageManagePaymentSourcesResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageManagePaymentSourcesResponse.java index 413307e8..7b943498 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageManagePaymentSourcesResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageManagePaymentSourcesResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPagePreCancelResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPagePreCancelResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPagePreCancelResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPagePreCancelResponse.java index 55bf0d1a..1b3a80bf 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPagePreCancelResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPagePreCancelResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageRetrieveAgreementPdfResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageRetrieveAgreementPdfResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageRetrieveAgreementPdfResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageRetrieveAgreementPdfResponse.java index 2b356948..7d0977da 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageRetrieveAgreementPdfResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageRetrieveAgreementPdfResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageRetrieveResponse.java new file mode 100644 index 00000000..92d6ca54 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.hostedPage.responses; + +import com.chargebee.v4.models.hostedPage.HostedPage; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for HostedPageRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class HostedPageRetrieveResponse extends BaseResponse { + private final HostedPage hostedPage; + + private HostedPageRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.hostedPage = builder.hostedPage; + } + + /** Parse JSON response into HostedPageRetrieveResponse object. */ + public static HostedPageRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into HostedPageRetrieveResponse object with HTTP response. */ + public static HostedPageRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __hostedPageJson = JsonUtil.getObject(json, "hosted_page"); + if (__hostedPageJson != null) { + builder.hostedPage(HostedPage.fromJson(__hostedPageJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse HostedPageRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for HostedPageRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for HostedPageRetrieveResponse. */ + public static class Builder { + + private HostedPage hostedPage; + + private Response httpResponse; + + private Builder() {} + + public Builder hostedPage(HostedPage hostedPage) { + this.hostedPage = hostedPage; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public HostedPageRetrieveResponse build() { + return new HostedPageRetrieveResponse(this); + } + } + + /** Get the hostedPage from the response. */ + public HostedPage getHostedPage() { + return hostedPage; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageUpdateCardResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageUpdateCardResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageUpdateCardResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageUpdateCardResponse.java index 2f5c4cb4..40bcc113 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageUpdateCardResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageUpdateCardResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageUpdatePaymentMethodResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageUpdatePaymentMethodResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageUpdatePaymentMethodResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageUpdatePaymentMethodResponse.java index 0c2a41a9..0c42f55c 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageUpdatePaymentMethodResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageUpdatePaymentMethodResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageViewVoucherResponse.java b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageViewVoucherResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageViewVoucherResponse.java rename to src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageViewVoucherResponse.java index bd31d54c..9edfbc32 100644 --- a/src/main/java/com/chargebee/v4/core/responses/hostedPage/HostedPageViewVoucherResponse.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/responses/HostedPageViewVoucherResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.hostedPage; +package com.chargebee.v4.models.hostedPage.responses; -import com.chargebee.v4.core.models.hostedPage.HostedPage; +import com.chargebee.v4.models.hostedPage.HostedPage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/impactedCustomer/ImpactedCustomer.java b/src/main/java/com/chargebee/v4/models/impactedCustomer/ImpactedCustomer.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/impactedCustomer/ImpactedCustomer.java rename to src/main/java/com/chargebee/v4/models/impactedCustomer/ImpactedCustomer.java index b024a85c..bf4b481c 100644 --- a/src/main/java/com/chargebee/v4/core/models/impactedCustomer/ImpactedCustomer.java +++ b/src/main/java/com/chargebee/v4/models/impactedCustomer/ImpactedCustomer.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.impactedCustomer; +package com.chargebee.v4.models.impactedCustomer; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/impactedItem/ImpactedItem.java b/src/main/java/com/chargebee/v4/models/impactedItem/ImpactedItem.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/impactedItem/ImpactedItem.java rename to src/main/java/com/chargebee/v4/models/impactedItem/ImpactedItem.java index 748af364..71f9eae1 100644 --- a/src/main/java/com/chargebee/v4/core/models/impactedItem/ImpactedItem.java +++ b/src/main/java/com/chargebee/v4/models/impactedItem/ImpactedItem.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.impactedItem; +package com.chargebee.v4.models.impactedItem; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/impactedItemPrice/ImpactedItemPrice.java b/src/main/java/com/chargebee/v4/models/impactedItemPrice/ImpactedItemPrice.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/impactedItemPrice/ImpactedItemPrice.java rename to src/main/java/com/chargebee/v4/models/impactedItemPrice/ImpactedItemPrice.java index 485cf6e7..5335b7c3 100644 --- a/src/main/java/com/chargebee/v4/core/models/impactedItemPrice/ImpactedItemPrice.java +++ b/src/main/java/com/chargebee/v4/models/impactedItemPrice/ImpactedItemPrice.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.impactedItemPrice; +package com.chargebee.v4.models.impactedItemPrice; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/impactedSubscription/ImpactedSubscription.java b/src/main/java/com/chargebee/v4/models/impactedSubscription/ImpactedSubscription.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/impactedSubscription/ImpactedSubscription.java rename to src/main/java/com/chargebee/v4/models/impactedSubscription/ImpactedSubscription.java index dd50bd84..a18dfad2 100644 --- a/src/main/java/com/chargebee/v4/core/models/impactedSubscription/ImpactedSubscription.java +++ b/src/main/java/com/chargebee/v4/models/impactedSubscription/ImpactedSubscription.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.impactedSubscription; +package com.chargebee.v4.models.impactedSubscription; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/inAppSubscription/InAppSubscription.java b/src/main/java/com/chargebee/v4/models/inAppSubscription/InAppSubscription.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/inAppSubscription/InAppSubscription.java rename to src/main/java/com/chargebee/v4/models/inAppSubscription/InAppSubscription.java index a582259f..cf2f78a1 100644 --- a/src/main/java/com/chargebee/v4/core/models/inAppSubscription/InAppSubscription.java +++ b/src/main/java/com/chargebee/v4/models/inAppSubscription/InAppSubscription.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.inAppSubscription; +package com.chargebee.v4.models.inAppSubscription; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/models/inAppSubscription/params/InAppSubscriptionImportReceiptParams.java b/src/main/java/com/chargebee/v4/models/inAppSubscription/params/InAppSubscriptionImportReceiptParams.java new file mode 100644 index 00000000..f37194ab --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/inAppSubscription/params/InAppSubscriptionImportReceiptParams.java @@ -0,0 +1,226 @@ +/* + * 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.inAppSubscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InAppSubscriptionImportReceiptParams { + + private final String receipt; + + private final ProductParams product; + + private final CustomerParams customer; + + private InAppSubscriptionImportReceiptParams(InAppSubscriptionImportReceiptBuilder builder) { + + this.receipt = builder.receipt; + + this.product = builder.product; + + this.customer = builder.customer; + } + + public String getReceipt() { + return receipt; + } + + public ProductParams getProduct() { + return product; + } + + public CustomerParams getCustomer() { + return customer; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.receipt != null) { + + formData.put("receipt", this.receipt); + } + + if (this.product != null) { + + // Single object + Map nestedData = this.product.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "product[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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 InAppSubscriptionImportReceiptParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InAppSubscriptionImportReceiptBuilder builder() { + return new InAppSubscriptionImportReceiptBuilder(); + } + + public static final class InAppSubscriptionImportReceiptBuilder { + + private String receipt; + + private ProductParams product; + + private CustomerParams customer; + + private InAppSubscriptionImportReceiptBuilder() {} + + public InAppSubscriptionImportReceiptBuilder receipt(String value) { + this.receipt = value; + return this; + } + + public InAppSubscriptionImportReceiptBuilder product(ProductParams value) { + this.product = value; + return this; + } + + public InAppSubscriptionImportReceiptBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public InAppSubscriptionImportReceiptParams build() { + return new InAppSubscriptionImportReceiptParams(this); + } + } + + public static final class ProductParams { + + private final String currencyCode; + + private ProductParams(ProductBuilder builder) { + + this.currencyCode = builder.currencyCode; + } + + public String getCurrencyCode() { + return currencyCode; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + return formData; + } + + /** Create a new builder for ProductParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ProductBuilder builder() { + return new ProductBuilder(); + } + + public static final class ProductBuilder { + + private String currencyCode; + + private ProductBuilder() {} + + public ProductBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public ProductParams build() { + return new ProductParams(this); + } + } + } + + public static final class CustomerParams { + + private final String id; + + private final String email; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.email = builder.email; + } + + public String getId() { + return id; + } + + public String getEmail() { + return email; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + 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 id; + + private String email; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerBuilder email(String value) { + this.email = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/inAppSubscription/params/InAppSubscriptionImportSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/inAppSubscription/params/InAppSubscriptionImportSubscriptionParams.java new file mode 100644 index 00000000..ea7659c9 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/inAppSubscription/params/InAppSubscriptionImportSubscriptionParams.java @@ -0,0 +1,348 @@ +/* + * 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.inAppSubscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class InAppSubscriptionImportSubscriptionParams { + + private final SubscriptionParams subscription; + + private final CustomerParams customer; + + private InAppSubscriptionImportSubscriptionParams( + InAppSubscriptionImportSubscriptionBuilder builder) { + + this.subscription = builder.subscription; + + this.customer = builder.customer; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public CustomerParams getCustomer() { + return customer; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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 InAppSubscriptionImportSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InAppSubscriptionImportSubscriptionBuilder builder() { + return new InAppSubscriptionImportSubscriptionBuilder(); + } + + public static final class InAppSubscriptionImportSubscriptionBuilder { + + private SubscriptionParams subscription; + + private CustomerParams customer; + + private InAppSubscriptionImportSubscriptionBuilder() {} + + public InAppSubscriptionImportSubscriptionBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public InAppSubscriptionImportSubscriptionBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public InAppSubscriptionImportSubscriptionParams build() { + return new InAppSubscriptionImportSubscriptionParams(this); + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final Timestamp startedAt; + + private final Timestamp termStart; + + private final Timestamp termEnd; + + private final String productId; + + private final String currencyCode; + + private final String transactionId; + + private final Boolean isTrial; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.startedAt = builder.startedAt; + + this.termStart = builder.termStart; + + this.termEnd = builder.termEnd; + + this.productId = builder.productId; + + this.currencyCode = builder.currencyCode; + + this.transactionId = builder.transactionId; + + this.isTrial = builder.isTrial; + } + + public String getId() { + return id; + } + + public Timestamp getStartedAt() { + return startedAt; + } + + public Timestamp getTermStart() { + return termStart; + } + + public Timestamp getTermEnd() { + return termEnd; + } + + public String getProductId() { + return productId; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getTransactionId() { + return transactionId; + } + + public Boolean getIsTrial() { + return isTrial; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.startedAt != null) { + + formData.put("started_at", this.startedAt); + } + + if (this.termStart != null) { + + formData.put("term_start", this.termStart); + } + + if (this.termEnd != null) { + + formData.put("term_end", this.termEnd); + } + + if (this.productId != null) { + + formData.put("product_id", this.productId); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.transactionId != null) { + + formData.put("transaction_id", this.transactionId); + } + + if (this.isTrial != null) { + + formData.put("is_trial", this.isTrial); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private Timestamp startedAt; + + private Timestamp termStart; + + private Timestamp termEnd; + + private String productId; + + private String currencyCode; + + private String transactionId; + + private Boolean isTrial; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionBuilder startedAt(Timestamp value) { + this.startedAt = value; + return this; + } + + public SubscriptionBuilder termStart(Timestamp value) { + this.termStart = value; + return this; + } + + public SubscriptionBuilder termEnd(Timestamp value) { + this.termEnd = value; + return this; + } + + public SubscriptionBuilder productId(String value) { + this.productId = value; + return this; + } + + public SubscriptionBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public SubscriptionBuilder transactionId(String value) { + this.transactionId = value; + return this; + } + + public SubscriptionBuilder isTrial(Boolean value) { + this.isTrial = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + } + + public static final class CustomerParams { + + private final String id; + + private final String email; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.email = builder.email; + } + + public String getId() { + return id; + } + + public String getEmail() { + return email; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + 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 id; + + private String email; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerBuilder email(String value) { + this.email = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/inAppSubscription/params/InAppSubscriptionProcessReceiptParams.java b/src/main/java/com/chargebee/v4/models/inAppSubscription/params/InAppSubscriptionProcessReceiptParams.java new file mode 100644 index 00000000..1456a283 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/inAppSubscription/params/InAppSubscriptionProcessReceiptParams.java @@ -0,0 +1,386 @@ +/* + * 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.inAppSubscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InAppSubscriptionProcessReceiptParams { + + private final String receipt; + + private final ProductParams product; + + private final CustomerParams customer; + + private InAppSubscriptionProcessReceiptParams(InAppSubscriptionProcessReceiptBuilder builder) { + + this.receipt = builder.receipt; + + this.product = builder.product; + + this.customer = builder.customer; + } + + public String getReceipt() { + return receipt; + } + + public ProductParams getProduct() { + return product; + } + + public CustomerParams getCustomer() { + return customer; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.receipt != null) { + + formData.put("receipt", this.receipt); + } + + if (this.product != null) { + + // Single object + Map nestedData = this.product.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "product[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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 InAppSubscriptionProcessReceiptParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InAppSubscriptionProcessReceiptBuilder builder() { + return new InAppSubscriptionProcessReceiptBuilder(); + } + + public static final class InAppSubscriptionProcessReceiptBuilder { + + private String receipt; + + private ProductParams product; + + private CustomerParams customer; + + private InAppSubscriptionProcessReceiptBuilder() {} + + public InAppSubscriptionProcessReceiptBuilder receipt(String value) { + this.receipt = value; + return this; + } + + public InAppSubscriptionProcessReceiptBuilder product(ProductParams value) { + this.product = value; + return this; + } + + public InAppSubscriptionProcessReceiptBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public InAppSubscriptionProcessReceiptParams build() { + return new InAppSubscriptionProcessReceiptParams(this); + } + } + + public static final class ProductParams { + + private final String id; + + private final String currencyCode; + + private final Integer price; + + private final String name; + + private final String priceInDecimal; + + private final String period; + + private final String periodUnit; + + private ProductParams(ProductBuilder builder) { + + this.id = builder.id; + + this.currencyCode = builder.currencyCode; + + this.price = builder.price; + + this.name = builder.name; + + this.priceInDecimal = builder.priceInDecimal; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + } + + public String getId() { + return id; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public Integer getPrice() { + return price; + } + + public String getName() { + return name; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public String getPeriod() { + return period; + } + + public String getPeriodUnit() { + return periodUnit; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + return formData; + } + + /** Create a new builder for ProductParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ProductBuilder builder() { + return new ProductBuilder(); + } + + public static final class ProductBuilder { + + private String id; + + private String currencyCode; + + private Integer price; + + private String name; + + private String priceInDecimal; + + private String period; + + private String periodUnit; + + private ProductBuilder() {} + + public ProductBuilder id(String value) { + this.id = value; + return this; + } + + public ProductBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public ProductBuilder price(Integer value) { + this.price = value; + return this; + } + + public ProductBuilder name(String value) { + this.name = value; + return this; + } + + public ProductBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ProductBuilder period(String value) { + this.period = value; + return this; + } + + public ProductBuilder periodUnit(String value) { + this.periodUnit = value; + return this; + } + + public ProductParams build() { + return new ProductParams(this); + } + } + } + + public static final class CustomerParams { + + private final String id; + + private final String email; + + private final String firstName; + + private final String lastName; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.email = builder.email; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + } + + public String getId() { + return id; + } + + public String getEmail() { + return email; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + + 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 id; + + private String email; + + private String firstName; + + private String lastName; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerBuilder email(String value) { + this.email = value; + return this; + } + + public CustomerBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CustomerBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/inAppSubscription/params/InAppSubscriptionRetrieveStoreSubscriptionsParams.java b/src/main/java/com/chargebee/v4/models/inAppSubscription/params/InAppSubscriptionRetrieveStoreSubscriptionsParams.java new file mode 100644 index 00000000..5aeb7def --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/inAppSubscription/params/InAppSubscriptionRetrieveStoreSubscriptionsParams.java @@ -0,0 +1,61 @@ +/* + * 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.inAppSubscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InAppSubscriptionRetrieveStoreSubscriptionsParams { + + private final String receipt; + + private InAppSubscriptionRetrieveStoreSubscriptionsParams( + InAppSubscriptionRetrieveStoreSubscriptionsBuilder builder) { + + this.receipt = builder.receipt; + } + + public String getReceipt() { + return receipt; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.receipt != null) { + + formData.put("receipt", this.receipt); + } + + return formData; + } + + /** Create a new builder for InAppSubscriptionRetrieveStoreSubscriptionsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InAppSubscriptionRetrieveStoreSubscriptionsBuilder builder() { + return new InAppSubscriptionRetrieveStoreSubscriptionsBuilder(); + } + + public static final class InAppSubscriptionRetrieveStoreSubscriptionsBuilder { + + private String receipt; + + private InAppSubscriptionRetrieveStoreSubscriptionsBuilder() {} + + public InAppSubscriptionRetrieveStoreSubscriptionsBuilder receipt(String value) { + this.receipt = value; + return this; + } + + public InAppSubscriptionRetrieveStoreSubscriptionsParams build() { + return new InAppSubscriptionRetrieveStoreSubscriptionsParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/inAppSubscription/InAppSubscriptionImportReceiptResponse.java b/src/main/java/com/chargebee/v4/models/inAppSubscription/responses/InAppSubscriptionImportReceiptResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/inAppSubscription/InAppSubscriptionImportReceiptResponse.java rename to src/main/java/com/chargebee/v4/models/inAppSubscription/responses/InAppSubscriptionImportReceiptResponse.java index e7c56181..29066aac 100644 --- a/src/main/java/com/chargebee/v4/core/responses/inAppSubscription/InAppSubscriptionImportReceiptResponse.java +++ b/src/main/java/com/chargebee/v4/models/inAppSubscription/responses/InAppSubscriptionImportReceiptResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.inAppSubscription; +package com.chargebee.v4.models.inAppSubscription.responses; import java.util.List; -import com.chargebee.v4.core.models.inAppSubscription.InAppSubscription; +import com.chargebee.v4.models.inAppSubscription.InAppSubscription; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/inAppSubscription/InAppSubscriptionImportSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/inAppSubscription/responses/InAppSubscriptionImportSubscriptionResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/inAppSubscription/InAppSubscriptionImportSubscriptionResponse.java rename to src/main/java/com/chargebee/v4/models/inAppSubscription/responses/InAppSubscriptionImportSubscriptionResponse.java index d8b7ae91..1e8ccbf6 100644 --- a/src/main/java/com/chargebee/v4/core/responses/inAppSubscription/InAppSubscriptionImportSubscriptionResponse.java +++ b/src/main/java/com/chargebee/v4/models/inAppSubscription/responses/InAppSubscriptionImportSubscriptionResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.inAppSubscription; +package com.chargebee.v4.models.inAppSubscription.responses; -import com.chargebee.v4.core.models.inAppSubscription.InAppSubscription; +import com.chargebee.v4.models.inAppSubscription.InAppSubscription; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/inAppSubscription/InAppSubscriptionProcessReceiptResponse.java b/src/main/java/com/chargebee/v4/models/inAppSubscription/responses/InAppSubscriptionProcessReceiptResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/inAppSubscription/InAppSubscriptionProcessReceiptResponse.java rename to src/main/java/com/chargebee/v4/models/inAppSubscription/responses/InAppSubscriptionProcessReceiptResponse.java index 61995ed6..4d8469fc 100644 --- a/src/main/java/com/chargebee/v4/core/responses/inAppSubscription/InAppSubscriptionProcessReceiptResponse.java +++ b/src/main/java/com/chargebee/v4/models/inAppSubscription/responses/InAppSubscriptionProcessReceiptResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.inAppSubscription; +package com.chargebee.v4.models.inAppSubscription.responses; -import com.chargebee.v4.core.models.inAppSubscription.InAppSubscription; +import com.chargebee.v4.models.inAppSubscription.InAppSubscription; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/inAppSubscription/responses/InAppSubscriptionRetrieveStoreSubscriptionsResponse.java b/src/main/java/com/chargebee/v4/models/inAppSubscription/responses/InAppSubscriptionRetrieveStoreSubscriptionsResponse.java new file mode 100644 index 00000000..9458295a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/inAppSubscription/responses/InAppSubscriptionRetrieveStoreSubscriptionsResponse.java @@ -0,0 +1,84 @@ +package com.chargebee.v4.models.inAppSubscription.responses; + +import java.util.List; + +import com.chargebee.v4.models.inAppSubscription.InAppSubscription; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for InAppSubscriptionRetrieveStoreSubscriptions operation. Contains the + * response data from the API. + */ +public final class InAppSubscriptionRetrieveStoreSubscriptionsResponse extends BaseResponse { + private final List inAppSubscriptions; + + private InAppSubscriptionRetrieveStoreSubscriptionsResponse(Builder builder) { + super(builder.httpResponse); + + this.inAppSubscriptions = builder.inAppSubscriptions; + } + + /** Parse JSON response into InAppSubscriptionRetrieveStoreSubscriptionsResponse object. */ + public static InAppSubscriptionRetrieveStoreSubscriptionsResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into InAppSubscriptionRetrieveStoreSubscriptionsResponse object with HTTP + * response. + */ + public static InAppSubscriptionRetrieveStoreSubscriptionsResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + builder.inAppSubscriptions( + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "in_app_subscriptions")).stream() + .map(InAppSubscription::fromJson) + .collect(java.util.stream.Collectors.toList())); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse InAppSubscriptionRetrieveStoreSubscriptionsResponse from JSON", e); + } + } + + /** Create a new builder for InAppSubscriptionRetrieveStoreSubscriptionsResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for InAppSubscriptionRetrieveStoreSubscriptionsResponse. */ + public static class Builder { + + private List inAppSubscriptions; + + private Response httpResponse; + + private Builder() {} + + public Builder inAppSubscriptions(List inAppSubscriptions) { + this.inAppSubscriptions = inAppSubscriptions; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public InAppSubscriptionRetrieveStoreSubscriptionsResponse build() { + return new InAppSubscriptionRetrieveStoreSubscriptionsResponse(this); + } + } + + /** Get the inAppSubscriptions from the response. */ + public List getInAppSubscriptions() { + return inAppSubscriptions; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/Invoice.java b/src/main/java/com/chargebee/v4/models/invoice/Invoice.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/invoice/Invoice.java rename to src/main/java/com/chargebee/v4/models/invoice/Invoice.java index 296e2e4d..620e61c4 100644 --- a/src/main/java/com/chargebee/v4/core/models/invoice/Invoice.java +++ b/src/main/java/com/chargebee/v4/models/invoice/Invoice.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.invoice; +package com.chargebee.v4.models.invoice; import com.chargebee.v4.internal.JsonUtil; import java.math.BigDecimal; @@ -46,6 +46,7 @@ public class Invoice { private Timestamp voidedAt; private Long resourceVersion; private Timestamp updatedAt; + private String lineItemsNextOffset; private Boolean firstInvoice; private Long newSalesAmount; private Boolean hasAdvanceCharges; @@ -84,7 +85,7 @@ public class Invoice { private Einvoice einvoice; private SiteDetailsAtCreation siteDetailsAtCreation; - private java.util.Map customFields = new java.util.HashMap<>(); + private java.util.Map customFields = new java.util.HashMap<>(); public String getId() { return id; @@ -214,6 +215,10 @@ public Timestamp getUpdatedAt() { return updatedAt; } + public String getLineItemsNextOffset() { + return lineItemsNextOffset; + } + public Boolean getFirstInvoice() { return firstInvoice; } @@ -368,7 +373,7 @@ public SiteDetailsAtCreation getSiteDetailsAtCreation() { * * @return map containing all custom fields */ - public java.util.Map getCustomFields() { + public java.util.Map getCustomFields() { return customFields; } @@ -378,7 +383,7 @@ public java.util.Map getCustomFields() { * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") * @return the value of the custom field, or null if not present */ - public Object getCustomField(String fieldName) { + public String getCustomField(String fieldName) { return customFields.get(fieldName); } @@ -511,7 +516,7 @@ public static Channel fromString(String value) { public static Invoice fromJson(String json) { Invoice obj = new Invoice(); - // Parse JSON to extract all keys + // Parse JSON to extract all keys for custom field extraction java.util.Set knownFields = new java.util.HashSet<>(); knownFields.add("id"); @@ -578,6 +583,8 @@ public static Invoice fromJson(String json) { knownFields.add("updated_at"); + knownFields.add("line_items_next_offset"); + knownFields.add("first_invoice"); knownFields.add("new_sales_amount"); @@ -716,6 +723,8 @@ public static Invoice fromJson(String json) { obj.updatedAt = JsonUtil.getTimestamp(json, "updated_at"); + obj.lineItemsNextOffset = JsonUtil.getString(json, "line_items_next_offset"); + obj.firstInvoice = JsonUtil.getBoolean(json, "first_invoice"); obj.newSalesAmount = JsonUtil.getLong(json, "new_sales_amount"); @@ -870,9 +879,9 @@ public static Invoice fromJson(String json) { * @param knownFields set of known field names * @return map of custom fields */ - private static java.util.Map extractCustomFields( + private static java.util.Map extractCustomFields( String json, java.util.Set knownFields) { - java.util.Map customFields = new java.util.HashMap<>(); + java.util.Map customFields = new java.util.HashMap<>(); try { // Parse the entire JSON as a map java.util.Map allFields = JsonUtil.parseJsonObjectToMap(json); @@ -881,7 +890,8 @@ private static java.util.Map extractCustomFields( String key = entry.getKey(); // Include fields that start with "cf_" and are not in knownFields if (key != null && key.startsWith("cf_") && !knownFields.contains(key)) { - customFields.put(key, entry.getValue()); + customFields.put( + key, entry.getValue() != null ? String.valueOf(entry.getValue()) : null); } } } @@ -1729,6 +1739,7 @@ public static class Discounts { private Long amount; private String description; + private String lineItemId; private EntityType entityType; private DiscountType discountType; private String entityId; @@ -1742,6 +1753,10 @@ public String getDescription() { return description; } + public String getLineItemId() { + return lineItemId; + } + public EntityType getEntityType() { return entityType; } @@ -1829,6 +1844,8 @@ public static Discounts fromJson(String json) { obj.description = JsonUtil.getString(json, "description"); + obj.lineItemId = JsonUtil.getString(json, "line_item_id"); + obj.entityType = EntityType.fromString(JsonUtil.getString(json, "entity_type")); obj.discountType = DiscountType.fromString(JsonUtil.getString(json, "discount_type")); @@ -2170,6 +2187,7 @@ public static class DunningAttempts { private Timestamp createdAt; private TxnStatus txnStatus; private Long txnAmount; + private RetryEngine retryEngine; public Integer getAttempt() { return attempt; @@ -2195,6 +2213,10 @@ public Long getTxnAmount() { return txnAmount; } + public RetryEngine getRetryEngine() { + return retryEngine; + } + public enum DunningType { AUTO_COLLECT("auto_collect"), @@ -2263,6 +2285,36 @@ public static TxnStatus fromString(String value) { } } + public enum RetryEngine { + CHARGEBEE("chargebee"), + + FLEXPAY("flexpay"), + + SUCCESSPLUS("successplus"), + + /** An enum member indicating that RetryEngine was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + RetryEngine(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static RetryEngine fromString(String value) { + if (value == null) return _UNKNOWN; + for (RetryEngine enumValue : RetryEngine.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + public static DunningAttempts fromJson(String json) { DunningAttempts obj = new DunningAttempts(); @@ -2278,6 +2330,8 @@ public static DunningAttempts fromJson(String json) { obj.txnAmount = JsonUtil.getLong(json, "txn_amount"); + obj.retryEngine = RetryEngine.fromString(JsonUtil.getString(json, "retry_engine")); + return obj; } } diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/DownloadEinvoiceParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/DownloadEinvoiceParams.java new file mode 100644 index 00000000..7a292799 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/DownloadEinvoiceParams.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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class DownloadEinvoiceParams { + + private final Map queryParams; + + private DownloadEinvoiceParams(DownloadEinvoiceBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public DownloadEinvoiceBuilder toBuilder() { + DownloadEinvoiceBuilder builder = new DownloadEinvoiceBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for DownloadEinvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DownloadEinvoiceBuilder builder() { + return new DownloadEinvoiceBuilder(); + } + + public static final class DownloadEinvoiceBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private DownloadEinvoiceBuilder() {} + + public DownloadEinvoiceParams build() { + return new DownloadEinvoiceParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/ImportInvoiceParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/ImportInvoiceParams.java new file mode 100644 index 00000000..60927894 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/ImportInvoiceParams.java @@ -0,0 +1,3847 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class ImportInvoiceParams { + + private final String id; + + private final String currencyCode; + + private final String customerId; + + private final String subscriptionId; + + private final String poNumber; + + private final PriceType priceType; + + private final TaxOverrideReason taxOverrideReason; + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final Timestamp date; + + private final Long total; + + private final Long roundOff; + + private final Status status; + + private final Timestamp voidedAt; + + private final String voidReasonCode; + + private final Boolean isWrittenOff; + + private final Long writeOffAmount; + + private final Timestamp writeOffDate; + + private final Timestamp dueDate; + + private final Integer netTermDays; + + private final Boolean hasAdvanceCharges; + + private final Boolean useForProration; + + private final CreditNoteParams creditNote; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final List lineItems; + + private final List paymentReferenceNumbers; + + private final List lineItemTiers; + + private final List discounts; + + private final List taxes; + + private final List payments; + + private final List notes; + + private final List lineItemAddresses; + + private final Map customFields; + + private ImportInvoiceParams(ImportInvoiceBuilder builder) { + + this.id = builder.id; + + this.currencyCode = builder.currencyCode; + + this.customerId = builder.customerId; + + this.subscriptionId = builder.subscriptionId; + + this.poNumber = builder.poNumber; + + this.priceType = builder.priceType; + + this.taxOverrideReason = builder.taxOverrideReason; + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.date = builder.date; + + this.total = builder.total; + + this.roundOff = builder.roundOff; + + this.status = builder.status; + + this.voidedAt = builder.voidedAt; + + this.voidReasonCode = builder.voidReasonCode; + + this.isWrittenOff = builder.isWrittenOff; + + this.writeOffAmount = builder.writeOffAmount; + + this.writeOffDate = builder.writeOffDate; + + this.dueDate = builder.dueDate; + + this.netTermDays = builder.netTermDays; + + this.hasAdvanceCharges = builder.hasAdvanceCharges; + + this.useForProration = builder.useForProration; + + this.creditNote = builder.creditNote; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.lineItems = builder.lineItems; + + this.paymentReferenceNumbers = builder.paymentReferenceNumbers; + + this.lineItemTiers = builder.lineItemTiers; + + this.discounts = builder.discounts; + + this.taxes = builder.taxes; + + this.payments = builder.payments; + + this.notes = builder.notes; + + this.lineItemAddresses = builder.lineItemAddresses; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getId() { + return id; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getCustomerId() { + return customerId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getPoNumber() { + return poNumber; + } + + public PriceType getPriceType() { + return priceType; + } + + public TaxOverrideReason getTaxOverrideReason() { + return taxOverrideReason; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public Timestamp getDate() { + return date; + } + + public Long getTotal() { + return total; + } + + public Long getRoundOff() { + return roundOff; + } + + public Status getStatus() { + return status; + } + + public Timestamp getVoidedAt() { + return voidedAt; + } + + public String getVoidReasonCode() { + return voidReasonCode; + } + + public Boolean getIsWrittenOff() { + return isWrittenOff; + } + + public Long getWriteOffAmount() { + return writeOffAmount; + } + + public Timestamp getWriteOffDate() { + return writeOffDate; + } + + public Timestamp getDueDate() { + return dueDate; + } + + public Integer getNetTermDays() { + return netTermDays; + } + + public Boolean getHasAdvanceCharges() { + return hasAdvanceCharges; + } + + public Boolean getUseForProration() { + return useForProration; + } + + public CreditNoteParams getCreditNote() { + return creditNote; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public List getLineItems() { + return lineItems; + } + + public List getPaymentReferenceNumbers() { + return paymentReferenceNumbers; + } + + public List getLineItemTiers() { + return lineItemTiers; + } + + public List getDiscounts() { + return discounts; + } + + public List getTaxes() { + return taxes; + } + + public List getPayments() { + return payments; + } + + public List getNotes() { + return notes; + } + + public List getLineItemAddresses() { + return lineItemAddresses; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.priceType != null) { + + formData.put("price_type", this.priceType); + } + + if (this.taxOverrideReason != null) { + + formData.put("tax_override_reason", this.taxOverrideReason); + } + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + if (this.total != null) { + + formData.put("total", this.total); + } + + if (this.roundOff != null) { + + formData.put("round_off", this.roundOff); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.voidedAt != null) { + + formData.put("voided_at", this.voidedAt); + } + + if (this.voidReasonCode != null) { + + formData.put("void_reason_code", this.voidReasonCode); + } + + if (this.isWrittenOff != null) { + + formData.put("is_written_off", this.isWrittenOff); + } + + if (this.writeOffAmount != null) { + + formData.put("write_off_amount", this.writeOffAmount); + } + + if (this.writeOffDate != null) { + + formData.put("write_off_date", this.writeOffDate); + } + + if (this.dueDate != null) { + + formData.put("due_date", this.dueDate); + } + + if (this.netTermDays != null) { + + formData.put("net_term_days", this.netTermDays); + } + + if (this.hasAdvanceCharges != null) { + + formData.put("has_advance_charges", this.hasAdvanceCharges); + } + + if (this.useForProration != null) { + + formData.put("use_for_proration", this.useForProration); + } + + if (this.creditNote != null) { + + // Single object + Map nestedData = this.creditNote.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "credit_note[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.lineItems != null) { + + // List of objects + for (int i = 0; i < this.lineItems.size(); i++) { + LineItemsParams item = this.lineItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "line_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.paymentReferenceNumbers != null) { + + // List of objects + for (int i = 0; i < this.paymentReferenceNumbers.size(); i++) { + PaymentReferenceNumbersParams item = this.paymentReferenceNumbers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "payment_reference_numbers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.lineItemTiers != null) { + + // List of objects + for (int i = 0; i < this.lineItemTiers.size(); i++) { + LineItemTiersParams item = this.lineItemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "line_item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxes != null) { + + // List of objects + for (int i = 0; i < this.taxes.size(); i++) { + TaxesParams item = this.taxes.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "taxes[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.payments != null) { + + // List of objects + for (int i = 0; i < this.payments.size(); i++) { + PaymentsParams item = this.payments.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "payments[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.notes != null) { + + // List of objects + for (int i = 0; i < this.notes.size(); i++) { + NotesParams item = this.notes.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "notes[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.lineItemAddresses != null) { + + // List of objects + for (int i = 0; i < this.lineItemAddresses.size(); i++) { + LineItemAddressesParams item = this.lineItemAddresses.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "line_item_addresses[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for ImportInvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ImportInvoiceBuilder builder() { + return new ImportInvoiceBuilder(); + } + + public static final class ImportInvoiceBuilder { + + private String id; + + private String currencyCode; + + private String customerId; + + private String subscriptionId; + + private String poNumber; + + private PriceType priceType; + + private TaxOverrideReason taxOverrideReason; + + private String vatNumber; + + private String vatNumberPrefix; + + private Timestamp date; + + private Long total; + + private Long roundOff; + + private Status status; + + private Timestamp voidedAt; + + private String voidReasonCode; + + private Boolean isWrittenOff; + + private Long writeOffAmount; + + private Timestamp writeOffDate; + + private Timestamp dueDate; + + private Integer netTermDays; + + private Boolean hasAdvanceCharges; + + private Boolean useForProration; + + private CreditNoteParams creditNote; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private List lineItems; + + private List paymentReferenceNumbers; + + private List lineItemTiers; + + private List discounts; + + private List taxes; + + private List payments; + + private List notes; + + private List lineItemAddresses; + + private Map customFields = new LinkedHashMap<>(); + + private ImportInvoiceBuilder() {} + + public ImportInvoiceBuilder id(String value) { + this.id = value; + return this; + } + + public ImportInvoiceBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public ImportInvoiceBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public ImportInvoiceBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public ImportInvoiceBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public ImportInvoiceBuilder priceType(PriceType value) { + this.priceType = value; + return this; + } + + public ImportInvoiceBuilder taxOverrideReason(TaxOverrideReason value) { + this.taxOverrideReason = value; + return this; + } + + public ImportInvoiceBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public ImportInvoiceBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public ImportInvoiceBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public ImportInvoiceBuilder total(Long value) { + this.total = value; + return this; + } + + public ImportInvoiceBuilder roundOff(Long value) { + this.roundOff = value; + return this; + } + + public ImportInvoiceBuilder status(Status value) { + this.status = value; + return this; + } + + public ImportInvoiceBuilder voidedAt(Timestamp value) { + this.voidedAt = value; + return this; + } + + public ImportInvoiceBuilder voidReasonCode(String value) { + this.voidReasonCode = value; + return this; + } + + public ImportInvoiceBuilder isWrittenOff(Boolean value) { + this.isWrittenOff = value; + return this; + } + + public ImportInvoiceBuilder writeOffAmount(Long value) { + this.writeOffAmount = value; + return this; + } + + public ImportInvoiceBuilder writeOffDate(Timestamp value) { + this.writeOffDate = value; + return this; + } + + public ImportInvoiceBuilder dueDate(Timestamp value) { + this.dueDate = value; + return this; + } + + public ImportInvoiceBuilder netTermDays(Integer value) { + this.netTermDays = value; + return this; + } + + public ImportInvoiceBuilder hasAdvanceCharges(Boolean value) { + this.hasAdvanceCharges = value; + return this; + } + + public ImportInvoiceBuilder useForProration(Boolean value) { + this.useForProration = value; + return this; + } + + public ImportInvoiceBuilder creditNote(CreditNoteParams value) { + this.creditNote = value; + return this; + } + + public ImportInvoiceBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public ImportInvoiceBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public ImportInvoiceBuilder lineItems(List value) { + this.lineItems = value; + return this; + } + + public ImportInvoiceBuilder paymentReferenceNumbers(List value) { + this.paymentReferenceNumbers = value; + return this; + } + + public ImportInvoiceBuilder lineItemTiers(List value) { + this.lineItemTiers = value; + return this; + } + + public ImportInvoiceBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public ImportInvoiceBuilder taxes(List value) { + this.taxes = value; + return this; + } + + public ImportInvoiceBuilder payments(List value) { + this.payments = value; + return this; + } + + public ImportInvoiceBuilder notes(List value) { + this.notes = value; + return this; + } + + public ImportInvoiceBuilder lineItemAddresses(List value) { + this.lineItemAddresses = 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 ImportInvoiceBuilder 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 ImportInvoiceBuilder 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 ImportInvoiceParams build() { + return new ImportInvoiceParams(this); + } + } + + public enum PriceType { + TAX_EXCLUSIVE("tax_exclusive"), + + TAX_INCLUSIVE("tax_inclusive"), + + /** An enum member indicating that PriceType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PriceType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PriceType enumValue : PriceType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TaxOverrideReason { + ID_EXEMPT("id_exempt"), + + CUSTOMER_EXEMPT("customer_exempt"), + + EXPORT("export"), + + /** An enum member indicating that TaxOverrideReason was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TaxOverrideReason(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TaxOverrideReason fromString(String value) { + if (value == null) return _UNKNOWN; + for (TaxOverrideReason enumValue : TaxOverrideReason.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + PAID("paid"), + + POSTED("posted"), + + PAYMENT_DUE("payment_due"), + + NOT_PAID("not_paid"), + + VOIDED("voided"), + + PENDING("pending"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class CreditNoteParams { + + private final String id; + + private CreditNoteParams(CreditNoteBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for CreditNoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNoteBuilder builder() { + return new CreditNoteBuilder(); + } + + public static final class CreditNoteBuilder { + + private String id; + + private CreditNoteBuilder() {} + + public CreditNoteBuilder id(String value) { + this.id = value; + return this; + } + + public CreditNoteParams build() { + return new CreditNoteParams(this); + } + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class LineItemsParams { + + private final String id; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private final String subscriptionId; + + private final String description; + + private final Long unitAmount; + + private final Integer quantity; + + private final Long amount; + + private final String unitAmountInDecimal; + + private final String quantityInDecimal; + + private final String amountInDecimal; + + private final EntityType entityType; + + private final String entityId; + + private final String itemLevelDiscount1EntityId; + + private final Long itemLevelDiscount1Amount; + + private final String itemLevelDiscount2EntityId; + + private final Long itemLevelDiscount2Amount; + + private final String tax1Name; + + private final Long tax1Amount; + + private final String tax2Name; + + private final Long tax2Amount; + + private final String tax3Name; + + private final Long tax3Amount; + + private final String tax4Name; + + private final Long tax4Amount; + + private final String tax5Name; + + private final Long tax5Amount; + + private final String tax6Name; + + private final Long tax6Amount; + + private final String tax7Name; + + private final Long tax7Amount; + + private final String tax8Name; + + private final Long tax8Amount; + + private final String tax9Name; + + private final Long tax9Amount; + + private final String tax10Name; + + private final Long tax10Amount; + + private final Timestamp createdAt; + + private LineItemsParams(LineItemsBuilder builder) { + + this.id = builder.id; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + + this.subscriptionId = builder.subscriptionId; + + this.description = builder.description; + + this.unitAmount = builder.unitAmount; + + this.quantity = builder.quantity; + + this.amount = builder.amount; + + this.unitAmountInDecimal = builder.unitAmountInDecimal; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.amountInDecimal = builder.amountInDecimal; + + this.entityType = builder.entityType; + + this.entityId = builder.entityId; + + this.itemLevelDiscount1EntityId = builder.itemLevelDiscount1EntityId; + + this.itemLevelDiscount1Amount = builder.itemLevelDiscount1Amount; + + this.itemLevelDiscount2EntityId = builder.itemLevelDiscount2EntityId; + + this.itemLevelDiscount2Amount = builder.itemLevelDiscount2Amount; + + this.tax1Name = builder.tax1Name; + + this.tax1Amount = builder.tax1Amount; + + this.tax2Name = builder.tax2Name; + + this.tax2Amount = builder.tax2Amount; + + this.tax3Name = builder.tax3Name; + + this.tax3Amount = builder.tax3Amount; + + this.tax4Name = builder.tax4Name; + + this.tax4Amount = builder.tax4Amount; + + this.tax5Name = builder.tax5Name; + + this.tax5Amount = builder.tax5Amount; + + this.tax6Name = builder.tax6Name; + + this.tax6Amount = builder.tax6Amount; + + this.tax7Name = builder.tax7Name; + + this.tax7Amount = builder.tax7Amount; + + this.tax8Name = builder.tax8Name; + + this.tax8Amount = builder.tax8Amount; + + this.tax9Name = builder.tax9Name; + + this.tax9Amount = builder.tax9Amount; + + this.tax10Name = builder.tax10Name; + + this.tax10Amount = builder.tax10Amount; + + this.createdAt = builder.createdAt; + } + + public String getId() { + return id; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getDescription() { + return description; + } + + public Long getUnitAmount() { + return unitAmount; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getAmount() { + return amount; + } + + public String getUnitAmountInDecimal() { + return unitAmountInDecimal; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + + public String getItemLevelDiscount1EntityId() { + return itemLevelDiscount1EntityId; + } + + public Long getItemLevelDiscount1Amount() { + return itemLevelDiscount1Amount; + } + + public String getItemLevelDiscount2EntityId() { + return itemLevelDiscount2EntityId; + } + + public Long getItemLevelDiscount2Amount() { + return itemLevelDiscount2Amount; + } + + public String getTax1Name() { + return tax1Name; + } + + public Long getTax1Amount() { + return tax1Amount; + } + + public String getTax2Name() { + return tax2Name; + } + + public Long getTax2Amount() { + return tax2Amount; + } + + public String getTax3Name() { + return tax3Name; + } + + public Long getTax3Amount() { + return tax3Amount; + } + + public String getTax4Name() { + return tax4Name; + } + + public Long getTax4Amount() { + return tax4Amount; + } + + public String getTax5Name() { + return tax5Name; + } + + public Long getTax5Amount() { + return tax5Amount; + } + + public String getTax6Name() { + return tax6Name; + } + + public Long getTax6Amount() { + return tax6Amount; + } + + public String getTax7Name() { + return tax7Name; + } + + public Long getTax7Amount() { + return tax7Amount; + } + + public String getTax8Name() { + return tax8Name; + } + + public Long getTax8Amount() { + return tax8Amount; + } + + public String getTax9Name() { + return tax9Name; + } + + public Long getTax9Amount() { + return tax9Amount; + } + + public String getTax10Name() { + return tax10Name; + } + + public Long getTax10Amount() { + return tax10Amount; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.unitAmount != null) { + + formData.put("unit_amount", this.unitAmount); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.unitAmountInDecimal != null) { + + formData.put("unit_amount_in_decimal", this.unitAmountInDecimal); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.entityType != null) { + + formData.put("entity_type", this.entityType); + } + + if (this.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + if (this.itemLevelDiscount1EntityId != null) { + + formData.put("item_level_discount1_entity_id", this.itemLevelDiscount1EntityId); + } + + if (this.itemLevelDiscount1Amount != null) { + + formData.put("item_level_discount1_amount", this.itemLevelDiscount1Amount); + } + + if (this.itemLevelDiscount2EntityId != null) { + + formData.put("item_level_discount2_entity_id", this.itemLevelDiscount2EntityId); + } + + if (this.itemLevelDiscount2Amount != null) { + + formData.put("item_level_discount2_amount", this.itemLevelDiscount2Amount); + } + + if (this.tax1Name != null) { + + formData.put("tax1_name", this.tax1Name); + } + + if (this.tax1Amount != null) { + + formData.put("tax1_amount", this.tax1Amount); + } + + if (this.tax2Name != null) { + + formData.put("tax2_name", this.tax2Name); + } + + if (this.tax2Amount != null) { + + formData.put("tax2_amount", this.tax2Amount); + } + + if (this.tax3Name != null) { + + formData.put("tax3_name", this.tax3Name); + } + + if (this.tax3Amount != null) { + + formData.put("tax3_amount", this.tax3Amount); + } + + if (this.tax4Name != null) { + + formData.put("tax4_name", this.tax4Name); + } + + if (this.tax4Amount != null) { + + formData.put("tax4_amount", this.tax4Amount); + } + + if (this.tax5Name != null) { + + formData.put("tax5_name", this.tax5Name); + } + + if (this.tax5Amount != null) { + + formData.put("tax5_amount", this.tax5Amount); + } + + if (this.tax6Name != null) { + + formData.put("tax6_name", this.tax6Name); + } + + if (this.tax6Amount != null) { + + formData.put("tax6_amount", this.tax6Amount); + } + + if (this.tax7Name != null) { + + formData.put("tax7_name", this.tax7Name); + } + + if (this.tax7Amount != null) { + + formData.put("tax7_amount", this.tax7Amount); + } + + if (this.tax8Name != null) { + + formData.put("tax8_name", this.tax8Name); + } + + if (this.tax8Amount != null) { + + formData.put("tax8_amount", this.tax8Amount); + } + + if (this.tax9Name != null) { + + formData.put("tax9_name", this.tax9Name); + } + + if (this.tax9Amount != null) { + + formData.put("tax9_amount", this.tax9Amount); + } + + if (this.tax10Name != null) { + + formData.put("tax10_name", this.tax10Name); + } + + if (this.tax10Amount != null) { + + formData.put("tax10_amount", this.tax10Amount); + } + + if (this.createdAt != null) { + + formData.put("created_at", this.createdAt); + } + + return formData; + } + + /** Create a new builder for LineItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static LineItemsBuilder builder() { + return new LineItemsBuilder(); + } + + public static final class LineItemsBuilder { + + private String id; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private String subscriptionId; + + private String description; + + private Long unitAmount; + + private Integer quantity; + + private Long amount; + + private String unitAmountInDecimal; + + private String quantityInDecimal; + + private String amountInDecimal; + + private EntityType entityType; + + private String entityId; + + private String itemLevelDiscount1EntityId; + + private Long itemLevelDiscount1Amount; + + private String itemLevelDiscount2EntityId; + + private Long itemLevelDiscount2Amount; + + private String tax1Name; + + private Long tax1Amount; + + private String tax2Name; + + private Long tax2Amount; + + private String tax3Name; + + private Long tax3Amount; + + private String tax4Name; + + private Long tax4Amount; + + private String tax5Name; + + private Long tax5Amount; + + private String tax6Name; + + private Long tax6Amount; + + private String tax7Name; + + private Long tax7Amount; + + private String tax8Name; + + private Long tax8Amount; + + private String tax9Name; + + private Long tax9Amount; + + private String tax10Name; + + private Long tax10Amount; + + private Timestamp createdAt; + + private LineItemsBuilder() {} + + public LineItemsBuilder id(String value) { + this.id = value; + return this; + } + + public LineItemsBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public LineItemsBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public LineItemsBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public LineItemsBuilder description(String value) { + this.description = value; + return this; + } + + public LineItemsBuilder unitAmount(Long value) { + this.unitAmount = value; + return this; + } + + public LineItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public LineItemsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public LineItemsBuilder unitAmountInDecimal(String value) { + this.unitAmountInDecimal = value; + return this; + } + + public LineItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public LineItemsBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public LineItemsBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public LineItemsBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public LineItemsBuilder itemLevelDiscount1EntityId(String value) { + this.itemLevelDiscount1EntityId = value; + return this; + } + + public LineItemsBuilder itemLevelDiscount1Amount(Long value) { + this.itemLevelDiscount1Amount = value; + return this; + } + + public LineItemsBuilder itemLevelDiscount2EntityId(String value) { + this.itemLevelDiscount2EntityId = value; + return this; + } + + public LineItemsBuilder itemLevelDiscount2Amount(Long value) { + this.itemLevelDiscount2Amount = value; + return this; + } + + public LineItemsBuilder tax1Name(String value) { + this.tax1Name = value; + return this; + } + + public LineItemsBuilder tax1Amount(Long value) { + this.tax1Amount = value; + return this; + } + + public LineItemsBuilder tax2Name(String value) { + this.tax2Name = value; + return this; + } + + public LineItemsBuilder tax2Amount(Long value) { + this.tax2Amount = value; + return this; + } + + public LineItemsBuilder tax3Name(String value) { + this.tax3Name = value; + return this; + } + + public LineItemsBuilder tax3Amount(Long value) { + this.tax3Amount = value; + return this; + } + + public LineItemsBuilder tax4Name(String value) { + this.tax4Name = value; + return this; + } + + public LineItemsBuilder tax4Amount(Long value) { + this.tax4Amount = value; + return this; + } + + public LineItemsBuilder tax5Name(String value) { + this.tax5Name = value; + return this; + } + + public LineItemsBuilder tax5Amount(Long value) { + this.tax5Amount = value; + return this; + } + + public LineItemsBuilder tax6Name(String value) { + this.tax6Name = value; + return this; + } + + public LineItemsBuilder tax6Amount(Long value) { + this.tax6Amount = value; + return this; + } + + public LineItemsBuilder tax7Name(String value) { + this.tax7Name = value; + return this; + } + + public LineItemsBuilder tax7Amount(Long value) { + this.tax7Amount = value; + return this; + } + + public LineItemsBuilder tax8Name(String value) { + this.tax8Name = value; + return this; + } + + public LineItemsBuilder tax8Amount(Long value) { + this.tax8Amount = value; + return this; + } + + public LineItemsBuilder tax9Name(String value) { + this.tax9Name = value; + return this; + } + + public LineItemsBuilder tax9Amount(Long value) { + this.tax9Amount = value; + return this; + } + + public LineItemsBuilder tax10Name(String value) { + this.tax10Name = value; + return this; + } + + public LineItemsBuilder tax10Amount(Long value) { + this.tax10Amount = value; + return this; + } + + public LineItemsBuilder createdAt(Timestamp value) { + this.createdAt = value; + return this; + } + + public LineItemsParams build() { + return new LineItemsParams(this); + } + } + + public enum EntityType { + ADHOC("adhoc"), + + PLAN_ITEM_PRICE("plan_item_price"), + + ADDON_ITEM_PRICE("addon_item_price"), + + CHARGE_ITEM_PRICE("charge_item_price"), + + PLAN_SETUP("plan_setup"), + + PLAN("plan"), + + ADDON("addon"), + + /** 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 static final class PaymentReferenceNumbersParams { + + private final String id; + + private final Type type; + + private final String number; + + private PaymentReferenceNumbersParams(PaymentReferenceNumbersBuilder builder) { + + this.id = builder.id; + + this.type = builder.type; + + this.number = builder.number; + } + + public String getId() { + return id; + } + + public Type getType() { + return type; + } + + public String getNumber() { + return number; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.number != null) { + + formData.put("number", this.number); + } + + return formData; + } + + /** Create a new builder for PaymentReferenceNumbersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentReferenceNumbersBuilder builder() { + return new PaymentReferenceNumbersBuilder(); + } + + public static final class PaymentReferenceNumbersBuilder { + + private String id; + + private Type type; + + private String number; + + private PaymentReferenceNumbersBuilder() {} + + public PaymentReferenceNumbersBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentReferenceNumbersBuilder type(Type value) { + this.type = value; + return this; + } + + public PaymentReferenceNumbersBuilder number(String value) { + this.number = value; + return this; + } + + public PaymentReferenceNumbersParams build() { + return new PaymentReferenceNumbersParams(this); + } + } + + public enum Type { + KID("kid"), + + OCR("ocr"), + + FRN("frn"), + + FIK("fik"), + + SWISS_REFERENCE("swiss_reference"), + + /** 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 static final class LineItemTiersParams { + + private final String lineItemId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Integer quantityUsed; + + private final Long unitAmount; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String quantityUsedInDecimal; + + private final String unitAmountInDecimal; + + private LineItemTiersParams(LineItemTiersBuilder builder) { + + this.lineItemId = builder.lineItemId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.quantityUsed = builder.quantityUsed; + + this.unitAmount = builder.unitAmount; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.quantityUsedInDecimal = builder.quantityUsedInDecimal; + + this.unitAmountInDecimal = builder.unitAmountInDecimal; + } + + public String getLineItemId() { + return lineItemId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Integer getQuantityUsed() { + return quantityUsed; + } + + public Long getUnitAmount() { + return unitAmount; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getQuantityUsedInDecimal() { + return quantityUsedInDecimal; + } + + public String getUnitAmountInDecimal() { + return unitAmountInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.lineItemId != null) { + + formData.put("line_item_id", this.lineItemId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.quantityUsed != null) { + + formData.put("quantity_used", this.quantityUsed); + } + + if (this.unitAmount != null) { + + formData.put("unit_amount", this.unitAmount); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.quantityUsedInDecimal != null) { + + formData.put("quantity_used_in_decimal", this.quantityUsedInDecimal); + } + + if (this.unitAmountInDecimal != null) { + + formData.put("unit_amount_in_decimal", this.unitAmountInDecimal); + } + + return formData; + } + + /** Create a new builder for LineItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static LineItemTiersBuilder builder() { + return new LineItemTiersBuilder(); + } + + public static final class LineItemTiersBuilder { + + private String lineItemId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Integer quantityUsed; + + private Long unitAmount; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String quantityUsedInDecimal; + + private String unitAmountInDecimal; + + private LineItemTiersBuilder() {} + + public LineItemTiersBuilder lineItemId(String value) { + this.lineItemId = value; + return this; + } + + public LineItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public LineItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public LineItemTiersBuilder quantityUsed(Integer value) { + this.quantityUsed = value; + return this; + } + + public LineItemTiersBuilder unitAmount(Long value) { + this.unitAmount = value; + return this; + } + + public LineItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public LineItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public LineItemTiersBuilder quantityUsedInDecimal(String value) { + this.quantityUsedInDecimal = value; + return this; + } + + public LineItemTiersBuilder unitAmountInDecimal(String value) { + this.unitAmountInDecimal = value; + return this; + } + + public LineItemTiersParams build() { + return new LineItemTiersParams(this); + } + } + } + + public static final class DiscountsParams { + + private final String lineItemId; + + private final EntityType entityType; + + private final String entityId; + + private final String description; + + private final Long amount; + + private DiscountsParams(DiscountsBuilder builder) { + + this.lineItemId = builder.lineItemId; + + this.entityType = builder.entityType; + + this.entityId = builder.entityId; + + this.description = builder.description; + + this.amount = builder.amount; + } + + public String getLineItemId() { + return lineItemId; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + + public String getDescription() { + return description; + } + + public Long getAmount() { + return amount; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.lineItemId != null) { + + formData.put("line_item_id", this.lineItemId); + } + + if (this.entityType != null) { + + formData.put("entity_type", this.entityType); + } + + if (this.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private String lineItemId; + + private EntityType entityType; + + private String entityId; + + private String description; + + private Long amount; + + private DiscountsBuilder() {} + + public DiscountsBuilder lineItemId(String value) { + this.lineItemId = value; + return this; + } + + public DiscountsBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public DiscountsBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public DiscountsBuilder description(String value) { + this.description = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum EntityType { + ITEM_LEVEL_COUPON("item_level_coupon"), + + DOCUMENT_LEVEL_COUPON("document_level_coupon"), + + PROMOTIONAL_CREDITS("promotional_credits"), + + ITEM_LEVEL_DISCOUNT("item_level_discount"), + + DOCUMENT_LEVEL_DISCOUNT("document_level_discount"), + + /** 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 static final class TaxesParams { + + private final String name; + + private final Number rate; + + private final Long amount; + + private final String description; + + private final JurisType jurisType; + + private final String jurisName; + + private final String jurisCode; + + private TaxesParams(TaxesBuilder builder) { + + this.name = builder.name; + + this.rate = builder.rate; + + this.amount = builder.amount; + + this.description = builder.description; + + this.jurisType = builder.jurisType; + + this.jurisName = builder.jurisName; + + this.jurisCode = builder.jurisCode; + } + + public String getName() { + return name; + } + + public Number getRate() { + return rate; + } + + public Long getAmount() { + return amount; + } + + public String getDescription() { + return description; + } + + public JurisType getJurisType() { + return jurisType; + } + + public String getJurisName() { + return jurisName; + } + + public String getJurisCode() { + return jurisCode; + } + + /** 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.rate != null) { + + formData.put("rate", this.rate); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.jurisType != null) { + + formData.put("juris_type", this.jurisType); + } + + if (this.jurisName != null) { + + formData.put("juris_name", this.jurisName); + } + + if (this.jurisCode != null) { + + formData.put("juris_code", this.jurisCode); + } + + return formData; + } + + /** Create a new builder for TaxesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxesBuilder builder() { + return new TaxesBuilder(); + } + + public static final class TaxesBuilder { + + private String name; + + private Number rate; + + private Long amount; + + private String description; + + private JurisType jurisType; + + private String jurisName; + + private String jurisCode; + + private TaxesBuilder() {} + + public TaxesBuilder name(String value) { + this.name = value; + return this; + } + + public TaxesBuilder rate(Number value) { + this.rate = value; + return this; + } + + public TaxesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public TaxesBuilder description(String value) { + this.description = value; + return this; + } + + public TaxesBuilder jurisType(JurisType value) { + this.jurisType = value; + return this; + } + + public TaxesBuilder jurisName(String value) { + this.jurisName = value; + return this; + } + + public TaxesBuilder jurisCode(String value) { + this.jurisCode = value; + return this; + } + + public TaxesParams build() { + return new TaxesParams(this); + } + } + + public enum JurisType { + COUNTRY("country"), + + FEDERAL("federal"), + + STATE("state"), + + COUNTY("county"), + + CITY("city"), + + SPECIAL("special"), + + UNINCORPORATED("unincorporated"), + + OTHER("other"), + + /** An enum member indicating that JurisType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + JurisType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static JurisType fromString(String value) { + if (value == null) return _UNKNOWN; + for (JurisType enumValue : JurisType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PaymentsParams { + + private final String id; + + private final Long amount; + + private final PaymentMethod paymentMethod; + + private final Timestamp date; + + private final String referenceNumber; + + private PaymentsParams(PaymentsBuilder builder) { + + this.id = builder.id; + + this.amount = builder.amount; + + this.paymentMethod = builder.paymentMethod; + + this.date = builder.date; + + this.referenceNumber = builder.referenceNumber; + } + + public String getId() { + return id; + } + + public Long getAmount() { + return amount; + } + + public PaymentMethod getPaymentMethod() { + return paymentMethod; + } + + public Timestamp getDate() { + return date; + } + + public String getReferenceNumber() { + return referenceNumber; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.paymentMethod != null) { + + formData.put("payment_method", this.paymentMethod); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + if (this.referenceNumber != null) { + + formData.put("reference_number", this.referenceNumber); + } + + return formData; + } + + /** Create a new builder for PaymentsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentsBuilder builder() { + return new PaymentsBuilder(); + } + + public static final class PaymentsBuilder { + + private String id; + + private Long amount; + + private PaymentMethod paymentMethod; + + private Timestamp date; + + private String referenceNumber; + + private PaymentsBuilder() {} + + public PaymentsBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public PaymentsBuilder paymentMethod(PaymentMethod value) { + this.paymentMethod = value; + return this; + } + + public PaymentsBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public PaymentsBuilder referenceNumber(String value) { + this.referenceNumber = value; + return this; + } + + public PaymentsParams build() { + return new PaymentsParams(this); + } + } + + public enum PaymentMethod { + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + OTHER("other"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + CUSTOM("custom"), + + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethod enumValue : PaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class NotesParams { + + private final EntityType entityType; + + private final String entityId; + + private final String note; + + private NotesParams(NotesBuilder builder) { + + this.entityType = builder.entityType; + + this.entityId = builder.entityId; + + this.note = builder.note; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + + public String getNote() { + return note; + } + + /** 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.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + if (this.note != null) { + + formData.put("note", this.note); + } + + return formData; + } + + /** Create a new builder for NotesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NotesBuilder builder() { + return new NotesBuilder(); + } + + public static final class NotesBuilder { + + private EntityType entityType; + + private String entityId; + + private String note; + + private NotesBuilder() {} + + public NotesBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public NotesBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public NotesBuilder note(String value) { + this.note = value; + return this; + } + + public NotesParams build() { + return new NotesParams(this); + } + } + + public enum EntityType { + COUPON("coupon"), + + PLAN_ITEM_PRICE("plan_item_price"), + + ADDON_ITEM_PRICE("addon_item_price"), + + CHARGE_ITEM_PRICE("charge_item_price"), + + PLAN("plan"), + + ADDON("addon"), + + /** 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 static final class LineItemAddressesParams { + + private final String lineItemId; + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 LineItemAddressesParams(LineItemAddressesBuilder builder) { + + this.lineItemId = builder.lineItemId; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 getLineItemId() { + return lineItemId; + } + + 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.lineItemId != null) { + + formData.put("line_item_id", this.lineItemId); + } + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 LineItemAddressesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static LineItemAddressesBuilder builder() { + return new LineItemAddressesBuilder(); + } + + public static final class LineItemAddressesBuilder { + + private String lineItemId; + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private LineItemAddressesBuilder() {} + + public LineItemAddressesBuilder lineItemId(String value) { + this.lineItemId = value; + return this; + } + + public LineItemAddressesBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public LineItemAddressesBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public LineItemAddressesBuilder email(String value) { + this.email = value; + return this; + } + + public LineItemAddressesBuilder company(String value) { + this.company = value; + return this; + } + + public LineItemAddressesBuilder phone(String value) { + this.phone = value; + return this; + } + + public LineItemAddressesBuilder line1(String value) { + this.line1 = value; + return this; + } + + public LineItemAddressesBuilder line2(String value) { + this.line2 = value; + return this; + } + + public LineItemAddressesBuilder line3(String value) { + this.line3 = value; + return this; + } + + public LineItemAddressesBuilder city(String value) { + this.city = value; + return this; + } + + public LineItemAddressesBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public LineItemAddressesBuilder state(String value) { + this.state = value; + return this; + } + + public LineItemAddressesBuilder zip(String value) { + this.zip = value; + return this; + } + + public LineItemAddressesBuilder country(String value) { + this.country = value; + return this; + } + + public LineItemAddressesBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public LineItemAddressesParams build() { + return new LineItemAddressesParams(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/invoice/params/InvoiceAddAddonChargeParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceAddAddonChargeParams.java new file mode 100644 index 00000000..ad3b512d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceAddAddonChargeParams.java @@ -0,0 +1,274 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class InvoiceAddAddonChargeParams { + + private final String addonId; + + private final Integer addonQuantity; + + private final Long addonUnitPrice; + + private final String addonQuantityInDecimal; + + private final String addonUnitPriceInDecimal; + + private final String comment; + + private final String subscriptionId; + + private final LineItemParams lineItem; + + private InvoiceAddAddonChargeParams(InvoiceAddAddonChargeBuilder builder) { + + this.addonId = builder.addonId; + + this.addonQuantity = builder.addonQuantity; + + this.addonUnitPrice = builder.addonUnitPrice; + + this.addonQuantityInDecimal = builder.addonQuantityInDecimal; + + this.addonUnitPriceInDecimal = builder.addonUnitPriceInDecimal; + + this.comment = builder.comment; + + this.subscriptionId = builder.subscriptionId; + + this.lineItem = builder.lineItem; + } + + public String getAddonId() { + return addonId; + } + + public Integer getAddonQuantity() { + return addonQuantity; + } + + public Long getAddonUnitPrice() { + return addonUnitPrice; + } + + public String getAddonQuantityInDecimal() { + return addonQuantityInDecimal; + } + + public String getAddonUnitPriceInDecimal() { + return addonUnitPriceInDecimal; + } + + public String getComment() { + return comment; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public LineItemParams getLineItem() { + return lineItem; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.addonId != null) { + + formData.put("addon_id", this.addonId); + } + + if (this.addonQuantity != null) { + + formData.put("addon_quantity", this.addonQuantity); + } + + if (this.addonUnitPrice != null) { + + formData.put("addon_unit_price", this.addonUnitPrice); + } + + if (this.addonQuantityInDecimal != null) { + + formData.put("addon_quantity_in_decimal", this.addonQuantityInDecimal); + } + + if (this.addonUnitPriceInDecimal != null) { + + formData.put("addon_unit_price_in_decimal", this.addonUnitPriceInDecimal); + } + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.lineItem != null) { + + // Single object + Map nestedData = this.lineItem.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "line_item[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for InvoiceAddAddonChargeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceAddAddonChargeBuilder builder() { + return new InvoiceAddAddonChargeBuilder(); + } + + public static final class InvoiceAddAddonChargeBuilder { + + private String addonId; + + private Integer addonQuantity; + + private Long addonUnitPrice; + + private String addonQuantityInDecimal; + + private String addonUnitPriceInDecimal; + + private String comment; + + private String subscriptionId; + + private LineItemParams lineItem; + + private InvoiceAddAddonChargeBuilder() {} + + public InvoiceAddAddonChargeBuilder addonId(String value) { + this.addonId = value; + return this; + } + + public InvoiceAddAddonChargeBuilder addonQuantity(Integer value) { + this.addonQuantity = value; + return this; + } + + public InvoiceAddAddonChargeBuilder addonUnitPrice(Long value) { + this.addonUnitPrice = value; + return this; + } + + public InvoiceAddAddonChargeBuilder addonQuantityInDecimal(String value) { + this.addonQuantityInDecimal = value; + return this; + } + + public InvoiceAddAddonChargeBuilder addonUnitPriceInDecimal(String value) { + this.addonUnitPriceInDecimal = value; + return this; + } + + public InvoiceAddAddonChargeBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoiceAddAddonChargeBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public InvoiceAddAddonChargeBuilder lineItem(LineItemParams value) { + this.lineItem = value; + return this; + } + + public InvoiceAddAddonChargeParams build() { + return new InvoiceAddAddonChargeParams(this); + } + } + + public static final class LineItemParams { + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private LineItemParams(LineItemBuilder builder) { + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for LineItemParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static LineItemBuilder builder() { + return new LineItemBuilder(); + } + + public static final class LineItemBuilder { + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private LineItemBuilder() {} + + public LineItemBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public LineItemBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public LineItemParams build() { + return new LineItemParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceAddChargeItemParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceAddChargeItemParams.java new file mode 100644 index 00000000..52e72ed7 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceAddChargeItemParams.java @@ -0,0 +1,523 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class InvoiceAddChargeItemParams { + + private final String comment; + + private final String subscriptionId; + + private final ItemPriceParams itemPrice; + + private final List itemTiers; + + private InvoiceAddChargeItemParams(InvoiceAddChargeItemBuilder builder) { + + this.comment = builder.comment; + + this.subscriptionId = builder.subscriptionId; + + this.itemPrice = builder.itemPrice; + + this.itemTiers = builder.itemTiers; + } + + public String getComment() { + return comment; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public ItemPriceParams getItemPrice() { + return itemPrice; + } + + public List getItemTiers() { + return itemTiers; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.itemPrice != null) { + + // Single object + Map nestedData = this.itemPrice.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_price[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for InvoiceAddChargeItemParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceAddChargeItemBuilder builder() { + return new InvoiceAddChargeItemBuilder(); + } + + public static final class InvoiceAddChargeItemBuilder { + + private String comment; + + private String subscriptionId; + + private ItemPriceParams itemPrice; + + private List itemTiers; + + private InvoiceAddChargeItemBuilder() {} + + public InvoiceAddChargeItemBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoiceAddChargeItemBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public InvoiceAddChargeItemBuilder itemPrice(ItemPriceParams value) { + this.itemPrice = value; + return this; + } + + public InvoiceAddChargeItemBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public InvoiceAddChargeItemParams build() { + return new InvoiceAddChargeItemParams(this); + } + } + + public static final class ItemPriceParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private ItemPriceParams(ItemPriceBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for ItemPriceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemPriceBuilder builder() { + return new ItemPriceBuilder(); + } + + public static final class ItemPriceBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private ItemPriceBuilder() {} + + public ItemPriceBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemPriceBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public ItemPriceBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public ItemPriceBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public ItemPriceBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public ItemPriceBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public ItemPriceBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public ItemPriceParams build() { + return new ItemPriceParams(this); + } + } + } + + public static final class ItemTiersParams { + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceAddChargeParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceAddChargeParams.java new file mode 100644 index 00000000..2900745d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceAddChargeParams.java @@ -0,0 +1,366 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class InvoiceAddChargeParams { + + private final Long amount; + + private final String description; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final String avalaraTaxCode; + + private final String hsnCode; + + private final String taxjarProductCode; + + private final String comment; + + private final String subscriptionId; + + private final LineItemParams lineItem; + + private InvoiceAddChargeParams(InvoiceAddChargeBuilder builder) { + + this.amount = builder.amount; + + this.description = builder.description; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.avalaraTaxCode = builder.avalaraTaxCode; + + this.hsnCode = builder.hsnCode; + + this.taxjarProductCode = builder.taxjarProductCode; + + this.comment = builder.comment; + + this.subscriptionId = builder.subscriptionId; + + this.lineItem = builder.lineItem; + } + + public Long getAmount() { + return amount; + } + + public String getDescription() { + return description; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public String getAvalaraTaxCode() { + return avalaraTaxCode; + } + + public String getHsnCode() { + return hsnCode; + } + + public String getTaxjarProductCode() { + return taxjarProductCode; + } + + public String getComment() { + return comment; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public LineItemParams getLineItem() { + return lineItem; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.avalaraTaxCode != null) { + + formData.put("avalara_tax_code", this.avalaraTaxCode); + } + + if (this.hsnCode != null) { + + formData.put("hsn_code", this.hsnCode); + } + + if (this.taxjarProductCode != null) { + + formData.put("taxjar_product_code", this.taxjarProductCode); + } + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.lineItem != null) { + + // Single object + Map nestedData = this.lineItem.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "line_item[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for InvoiceAddChargeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceAddChargeBuilder builder() { + return new InvoiceAddChargeBuilder(); + } + + public static final class InvoiceAddChargeBuilder { + + private Long amount; + + private String description; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private String avalaraTaxCode; + + private String hsnCode; + + private String taxjarProductCode; + + private String comment; + + private String subscriptionId; + + private LineItemParams lineItem; + + private InvoiceAddChargeBuilder() {} + + public InvoiceAddChargeBuilder amount(Long value) { + this.amount = value; + return this; + } + + public InvoiceAddChargeBuilder description(String value) { + this.description = value; + return this; + } + + public InvoiceAddChargeBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public InvoiceAddChargeBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public InvoiceAddChargeBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public InvoiceAddChargeBuilder avalaraTaxCode(String value) { + this.avalaraTaxCode = value; + return this; + } + + public InvoiceAddChargeBuilder hsnCode(String value) { + this.hsnCode = value; + return this; + } + + public InvoiceAddChargeBuilder taxjarProductCode(String value) { + this.taxjarProductCode = value; + return this; + } + + public InvoiceAddChargeBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoiceAddChargeBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public InvoiceAddChargeBuilder lineItem(LineItemParams value) { + this.lineItem = value; + return this; + } + + public InvoiceAddChargeParams build() { + return new InvoiceAddChargeParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class LineItemParams { + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private LineItemParams(LineItemBuilder builder) { + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for LineItemParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static LineItemBuilder builder() { + return new LineItemBuilder(); + } + + public static final class LineItemBuilder { + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private LineItemBuilder() {} + + public LineItemBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public LineItemBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public LineItemParams build() { + return new LineItemParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceApplyCreditsParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceApplyCreditsParams.java new file mode 100644 index 00000000..61143c0b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceApplyCreditsParams.java @@ -0,0 +1,139 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class InvoiceApplyCreditsParams { + + private final String comment; + + private final List creditNotes; + + private InvoiceApplyCreditsParams(InvoiceApplyCreditsBuilder builder) { + + this.comment = builder.comment; + + this.creditNotes = builder.creditNotes; + } + + public String getComment() { + return comment; + } + + public List getCreditNotes() { + return creditNotes; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.creditNotes != null) { + + // List of objects + for (int i = 0; i < this.creditNotes.size(); i++) { + CreditNotesParams item = this.creditNotes.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "credit_notes[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for InvoiceApplyCreditsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceApplyCreditsBuilder builder() { + return new InvoiceApplyCreditsBuilder(); + } + + public static final class InvoiceApplyCreditsBuilder { + + private String comment; + + private List creditNotes; + + private InvoiceApplyCreditsBuilder() {} + + public InvoiceApplyCreditsBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoiceApplyCreditsBuilder creditNotes(List value) { + this.creditNotes = value; + return this; + } + + public InvoiceApplyCreditsParams build() { + return new InvoiceApplyCreditsParams(this); + } + } + + public static final class CreditNotesParams { + + private final String id; + + private CreditNotesParams(CreditNotesBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for CreditNotesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNotesBuilder builder() { + return new CreditNotesBuilder(); + } + + public static final class CreditNotesBuilder { + + private String id; + + private CreditNotesBuilder() {} + + public CreditNotesBuilder id(String value) { + this.id = value; + return this; + } + + public CreditNotesParams build() { + return new CreditNotesParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceApplyPaymentScheduleSchemeParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceApplyPaymentScheduleSchemeParams.java new file mode 100644 index 00000000..9b4560bb --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceApplyPaymentScheduleSchemeParams.java @@ -0,0 +1,81 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InvoiceApplyPaymentScheduleSchemeParams { + + private final String schemeId; + + private final Long amount; + + private InvoiceApplyPaymentScheduleSchemeParams( + InvoiceApplyPaymentScheduleSchemeBuilder builder) { + + this.schemeId = builder.schemeId; + + this.amount = builder.amount; + } + + public String getSchemeId() { + return schemeId; + } + + public Long getAmount() { + return amount; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.schemeId != null) { + + formData.put("scheme_id", this.schemeId); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + return formData; + } + + /** Create a new builder for InvoiceApplyPaymentScheduleSchemeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceApplyPaymentScheduleSchemeBuilder builder() { + return new InvoiceApplyPaymentScheduleSchemeBuilder(); + } + + public static final class InvoiceApplyPaymentScheduleSchemeBuilder { + + private String schemeId; + + private Long amount; + + private InvoiceApplyPaymentScheduleSchemeBuilder() {} + + public InvoiceApplyPaymentScheduleSchemeBuilder schemeId(String value) { + this.schemeId = value; + return this; + } + + public InvoiceApplyPaymentScheduleSchemeBuilder amount(Long value) { + this.amount = value; + return this; + } + + public InvoiceApplyPaymentScheduleSchemeParams build() { + return new InvoiceApplyPaymentScheduleSchemeParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceApplyPaymentsParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceApplyPaymentsParams.java new file mode 100644 index 00000000..7d14fe11 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceApplyPaymentsParams.java @@ -0,0 +1,159 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class InvoiceApplyPaymentsParams { + + private final String comment; + + private final List transactions; + + private InvoiceApplyPaymentsParams(InvoiceApplyPaymentsBuilder builder) { + + this.comment = builder.comment; + + this.transactions = builder.transactions; + } + + public String getComment() { + return comment; + } + + public List getTransactions() { + return transactions; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.transactions != null) { + + // List of objects + for (int i = 0; i < this.transactions.size(); i++) { + TransactionsParams item = this.transactions.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "transactions[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for InvoiceApplyPaymentsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceApplyPaymentsBuilder builder() { + return new InvoiceApplyPaymentsBuilder(); + } + + public static final class InvoiceApplyPaymentsBuilder { + + private String comment; + + private List transactions; + + private InvoiceApplyPaymentsBuilder() {} + + public InvoiceApplyPaymentsBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoiceApplyPaymentsBuilder transactions(List value) { + this.transactions = value; + return this; + } + + public InvoiceApplyPaymentsParams build() { + return new InvoiceApplyPaymentsParams(this); + } + } + + public static final class TransactionsParams { + + private final String id; + + private final Long amount; + + private TransactionsParams(TransactionsBuilder builder) { + + this.id = builder.id; + + this.amount = builder.amount; + } + + public String getId() { + return id; + } + + public Long getAmount() { + return amount; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + return formData; + } + + /** Create a new builder for TransactionsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionsBuilder builder() { + return new TransactionsBuilder(); + } + + public static final class TransactionsBuilder { + + private String id; + + private Long amount; + + private TransactionsBuilder() {} + + public TransactionsBuilder id(String value) { + this.id = value; + return this; + } + + public TransactionsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public TransactionsParams build() { + return new TransactionsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceChargeAddonParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceChargeAddonParams.java new file mode 100644 index 00000000..1b4cb346 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceChargeAddonParams.java @@ -0,0 +1,371 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class InvoiceChargeAddonParams { + + private final String customerId; + + private final String subscriptionId; + + private final String addonId; + + private final Integer addonQuantity; + + private final Long addonUnitPrice; + + private final String addonQuantityInDecimal; + + private final String addonUnitPriceInDecimal; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private final List couponIds; + + private final String coupon; + + private final String poNumber; + + private final Timestamp invoiceDate; + + private final String paymentSourceId; + + private final PaymentInitiator paymentInitiator; + + private InvoiceChargeAddonParams(InvoiceChargeAddonBuilder builder) { + + this.customerId = builder.customerId; + + this.subscriptionId = builder.subscriptionId; + + this.addonId = builder.addonId; + + this.addonQuantity = builder.addonQuantity; + + this.addonUnitPrice = builder.addonUnitPrice; + + this.addonQuantityInDecimal = builder.addonQuantityInDecimal; + + this.addonUnitPriceInDecimal = builder.addonUnitPriceInDecimal; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + + this.couponIds = builder.couponIds; + + this.coupon = builder.coupon; + + this.poNumber = builder.poNumber; + + this.invoiceDate = builder.invoiceDate; + + this.paymentSourceId = builder.paymentSourceId; + + this.paymentInitiator = builder.paymentInitiator; + } + + public String getCustomerId() { + return customerId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getAddonId() { + return addonId; + } + + public Integer getAddonQuantity() { + return addonQuantity; + } + + public Long getAddonUnitPrice() { + return addonUnitPrice; + } + + public String getAddonQuantityInDecimal() { + return addonQuantityInDecimal; + } + + public String getAddonUnitPriceInDecimal() { + return addonUnitPriceInDecimal; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + public List getCouponIds() { + return couponIds; + } + + public String getCoupon() { + return coupon; + } + + public String getPoNumber() { + return poNumber; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public PaymentInitiator getPaymentInitiator() { + return paymentInitiator; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.addonId != null) { + + formData.put("addon_id", this.addonId); + } + + if (this.addonQuantity != null) { + + formData.put("addon_quantity", this.addonQuantity); + } + + if (this.addonUnitPrice != null) { + + formData.put("addon_unit_price", this.addonUnitPrice); + } + + if (this.addonQuantityInDecimal != null) { + + formData.put("addon_quantity_in_decimal", this.addonQuantityInDecimal); + } + + if (this.addonUnitPriceInDecimal != null) { + + formData.put("addon_unit_price_in_decimal", this.addonUnitPriceInDecimal); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.paymentInitiator != null) { + + formData.put("payment_initiator", this.paymentInitiator); + } + + return formData; + } + + /** Create a new builder for InvoiceChargeAddonParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceChargeAddonBuilder builder() { + return new InvoiceChargeAddonBuilder(); + } + + public static final class InvoiceChargeAddonBuilder { + + private String customerId; + + private String subscriptionId; + + private String addonId; + + private Integer addonQuantity; + + private Long addonUnitPrice; + + private String addonQuantityInDecimal; + + private String addonUnitPriceInDecimal; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private List couponIds; + + private String coupon; + + private String poNumber; + + private Timestamp invoiceDate; + + private String paymentSourceId; + + private PaymentInitiator paymentInitiator; + + private InvoiceChargeAddonBuilder() {} + + public InvoiceChargeAddonBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public InvoiceChargeAddonBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public InvoiceChargeAddonBuilder addonId(String value) { + this.addonId = value; + return this; + } + + public InvoiceChargeAddonBuilder addonQuantity(Integer value) { + this.addonQuantity = value; + return this; + } + + public InvoiceChargeAddonBuilder addonUnitPrice(Long value) { + this.addonUnitPrice = value; + return this; + } + + public InvoiceChargeAddonBuilder addonQuantityInDecimal(String value) { + this.addonQuantityInDecimal = value; + return this; + } + + public InvoiceChargeAddonBuilder addonUnitPriceInDecimal(String value) { + this.addonUnitPriceInDecimal = value; + return this; + } + + public InvoiceChargeAddonBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public InvoiceChargeAddonBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public InvoiceChargeAddonBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + @Deprecated + public InvoiceChargeAddonBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public InvoiceChargeAddonBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public InvoiceChargeAddonBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public InvoiceChargeAddonBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public InvoiceChargeAddonBuilder paymentInitiator(PaymentInitiator value) { + this.paymentInitiator = value; + return this; + } + + public InvoiceChargeAddonParams build() { + return new InvoiceChargeAddonParams(this); + } + } + + public enum PaymentInitiator { + CUSTOMER("customer"), + + MERCHANT("merchant"), + + /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentInitiator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentInitiator fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentInitiator enumValue : PaymentInitiator.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceChargeParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceChargeParams.java new file mode 100644 index 00000000..6bada6c7 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceChargeParams.java @@ -0,0 +1,561 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class InvoiceChargeParams { + + private final String customerId; + + private final String subscriptionId; + + private final String currencyCode; + + private final Long amount; + + private final String amountInDecimal; + + private final String description; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private final List couponIds; + + private final String coupon; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final String poNumber; + + private final Timestamp invoiceDate; + + private final String paymentSourceId; + + private final PaymentInitiator paymentInitiator; + + private final List taxProvidersFields; + + private InvoiceChargeParams(InvoiceChargeBuilder builder) { + + this.customerId = builder.customerId; + + this.subscriptionId = builder.subscriptionId; + + this.currencyCode = builder.currencyCode; + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.description = builder.description; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + + this.couponIds = builder.couponIds; + + this.coupon = builder.coupon; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.poNumber = builder.poNumber; + + this.invoiceDate = builder.invoiceDate; + + this.paymentSourceId = builder.paymentSourceId; + + this.paymentInitiator = builder.paymentInitiator; + + this.taxProvidersFields = builder.taxProvidersFields; + } + + public String getCustomerId() { + return customerId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getDescription() { + return description; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + public List getCouponIds() { + return couponIds; + } + + public String getCoupon() { + return coupon; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public String getPoNumber() { + return poNumber; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public PaymentInitiator getPaymentInitiator() { + return paymentInitiator; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.paymentInitiator != null) { + + formData.put("payment_initiator", this.paymentInitiator); + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for InvoiceChargeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceChargeBuilder builder() { + return new InvoiceChargeBuilder(); + } + + public static final class InvoiceChargeBuilder { + + private String customerId; + + private String subscriptionId; + + private String currencyCode; + + private Long amount; + + private String amountInDecimal; + + private String description; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private List couponIds; + + private String coupon; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private String poNumber; + + private Timestamp invoiceDate; + + private String paymentSourceId; + + private PaymentInitiator paymentInitiator; + + private List taxProvidersFields; + + private InvoiceChargeBuilder() {} + + public InvoiceChargeBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public InvoiceChargeBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public InvoiceChargeBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public InvoiceChargeBuilder amount(Long value) { + this.amount = value; + return this; + } + + public InvoiceChargeBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public InvoiceChargeBuilder description(String value) { + this.description = value; + return this; + } + + public InvoiceChargeBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public InvoiceChargeBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public InvoiceChargeBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + @Deprecated + public InvoiceChargeBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public InvoiceChargeBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public InvoiceChargeBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public InvoiceChargeBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public InvoiceChargeBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public InvoiceChargeBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public InvoiceChargeBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public InvoiceChargeBuilder paymentInitiator(PaymentInitiator value) { + this.paymentInitiator = value; + return this; + } + + public InvoiceChargeBuilder taxProvidersFields(List value) { + this.taxProvidersFields = value; + return this; + } + + public InvoiceChargeParams build() { + return new InvoiceChargeParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PaymentInitiator { + CUSTOMER("customer"), + + MERCHANT("merchant"), + + /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentInitiator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentInitiator fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentInitiator enumValue : PaymentInitiator.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCloseParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCloseParams.java new file mode 100644 index 00000000..b6daae6c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCloseParams.java @@ -0,0 +1,312 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class InvoiceCloseParams { + + private final String comment; + + private final String invoiceNote; + + private final Boolean removeGeneralNote; + + private final Timestamp invoiceDate; + + private final List notesToRemove; + + private final Map customFields; + + private InvoiceCloseParams(InvoiceCloseBuilder builder) { + + this.comment = builder.comment; + + this.invoiceNote = builder.invoiceNote; + + this.removeGeneralNote = builder.removeGeneralNote; + + this.invoiceDate = builder.invoiceDate; + + this.notesToRemove = builder.notesToRemove; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getComment() { + return comment; + } + + public String getInvoiceNote() { + return invoiceNote; + } + + public Boolean getRemoveGeneralNote() { + return removeGeneralNote; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public List getNotesToRemove() { + return notesToRemove; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.invoiceNote != null) { + + formData.put("invoice_note", this.invoiceNote); + } + + if (this.removeGeneralNote != null) { + + formData.put("remove_general_note", this.removeGeneralNote); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.notesToRemove != null) { + + // List of objects + for (int i = 0; i < this.notesToRemove.size(); i++) { + NotesToRemoveParams item = this.notesToRemove.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "notes_to_remove[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for InvoiceCloseParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceCloseBuilder builder() { + return new InvoiceCloseBuilder(); + } + + public static final class InvoiceCloseBuilder { + + private String comment; + + private String invoiceNote; + + private Boolean removeGeneralNote; + + private Timestamp invoiceDate; + + private List notesToRemove; + + private Map customFields = new LinkedHashMap<>(); + + private InvoiceCloseBuilder() {} + + public InvoiceCloseBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoiceCloseBuilder invoiceNote(String value) { + this.invoiceNote = value; + return this; + } + + public InvoiceCloseBuilder removeGeneralNote(Boolean value) { + this.removeGeneralNote = value; + return this; + } + + public InvoiceCloseBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public InvoiceCloseBuilder notesToRemove(List value) { + this.notesToRemove = 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 InvoiceCloseBuilder 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 InvoiceCloseBuilder 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 InvoiceCloseParams build() { + return new InvoiceCloseParams(this); + } + } + + public static final class NotesToRemoveParams { + + private final EntityType entityType; + + private final String entityId; + + private NotesToRemoveParams(NotesToRemoveBuilder builder) { + + this.entityType = builder.entityType; + + this.entityId = builder.entityId; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + + /** 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.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + return formData; + } + + /** Create a new builder for NotesToRemoveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NotesToRemoveBuilder builder() { + return new NotesToRemoveBuilder(); + } + + public static final class NotesToRemoveBuilder { + + private EntityType entityType; + + private String entityId; + + private NotesToRemoveBuilder() {} + + public NotesToRemoveBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public NotesToRemoveBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public NotesToRemoveParams build() { + return new NotesToRemoveParams(this); + } + } + + public enum EntityType { + CUSTOMER("customer"), + + SUBSCRIPTION("subscription"), + + COUPON("coupon"), + + PLAN_ITEM_PRICE("plan_item_price"), + + ADDON_ITEM_PRICE("addon_item_price"), + + CHARGE_ITEM_PRICE("charge_item_price"), + + PLAN("plan"), + + ADDON("addon"), + + /** 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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCollectPaymentParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCollectPaymentParams.java new file mode 100644 index 00000000..5857c98f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCollectPaymentParams.java @@ -0,0 +1,168 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InvoiceCollectPaymentParams { + + private final Long amount; + + private final String authorizationTransactionId; + + private final String paymentSourceId; + + private final String comment; + + private final PaymentInitiator paymentInitiator; + + private InvoiceCollectPaymentParams(InvoiceCollectPaymentBuilder builder) { + + this.amount = builder.amount; + + this.authorizationTransactionId = builder.authorizationTransactionId; + + this.paymentSourceId = builder.paymentSourceId; + + this.comment = builder.comment; + + this.paymentInitiator = builder.paymentInitiator; + } + + public Long getAmount() { + return amount; + } + + public String getAuthorizationTransactionId() { + return authorizationTransactionId; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public String getComment() { + return comment; + } + + public PaymentInitiator getPaymentInitiator() { + return paymentInitiator; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.authorizationTransactionId != null) { + + formData.put("authorization_transaction_id", this.authorizationTransactionId); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.paymentInitiator != null) { + + formData.put("payment_initiator", this.paymentInitiator); + } + + return formData; + } + + /** Create a new builder for InvoiceCollectPaymentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceCollectPaymentBuilder builder() { + return new InvoiceCollectPaymentBuilder(); + } + + public static final class InvoiceCollectPaymentBuilder { + + private Long amount; + + private String authorizationTransactionId; + + private String paymentSourceId; + + private String comment; + + private PaymentInitiator paymentInitiator; + + private InvoiceCollectPaymentBuilder() {} + + public InvoiceCollectPaymentBuilder amount(Long value) { + this.amount = value; + return this; + } + + public InvoiceCollectPaymentBuilder authorizationTransactionId(String value) { + this.authorizationTransactionId = value; + return this; + } + + public InvoiceCollectPaymentBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public InvoiceCollectPaymentBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoiceCollectPaymentBuilder paymentInitiator(PaymentInitiator value) { + this.paymentInitiator = value; + return this; + } + + public InvoiceCollectPaymentParams build() { + return new InvoiceCollectPaymentParams(this); + } + } + + public enum PaymentInitiator { + CUSTOMER("customer"), + + MERCHANT("merchant"), + + /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentInitiator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentInitiator fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentInitiator enumValue : PaymentInitiator.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemParams.java new file mode 100644 index 00000000..860d8ed8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemParams.java @@ -0,0 +1,651 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class InvoiceCreateForChargeItemParams { + + private final String customerId; + + private final String subscriptionId; + + private final String poNumber; + + private final String coupon; + + private final String paymentSourceId; + + private final PaymentInitiator paymentInitiator; + + private final Timestamp invoiceDate; + + private final ItemPriceParams itemPrice; + + private final List itemTiers; + + private InvoiceCreateForChargeItemParams(InvoiceCreateForChargeItemBuilder builder) { + + this.customerId = builder.customerId; + + this.subscriptionId = builder.subscriptionId; + + this.poNumber = builder.poNumber; + + this.coupon = builder.coupon; + + this.paymentSourceId = builder.paymentSourceId; + + this.paymentInitiator = builder.paymentInitiator; + + this.invoiceDate = builder.invoiceDate; + + this.itemPrice = builder.itemPrice; + + this.itemTiers = builder.itemTiers; + } + + public String getCustomerId() { + return customerId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getPoNumber() { + return poNumber; + } + + public String getCoupon() { + return coupon; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public PaymentInitiator getPaymentInitiator() { + return paymentInitiator; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public ItemPriceParams getItemPrice() { + return itemPrice; + } + + public List getItemTiers() { + return itemTiers; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.paymentInitiator != null) { + + formData.put("payment_initiator", this.paymentInitiator); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.itemPrice != null) { + + // Single object + Map nestedData = this.itemPrice.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "item_price[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for InvoiceCreateForChargeItemParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceCreateForChargeItemBuilder builder() { + return new InvoiceCreateForChargeItemBuilder(); + } + + public static final class InvoiceCreateForChargeItemBuilder { + + private String customerId; + + private String subscriptionId; + + private String poNumber; + + private String coupon; + + private String paymentSourceId; + + private PaymentInitiator paymentInitiator; + + private Timestamp invoiceDate; + + private ItemPriceParams itemPrice; + + private List itemTiers; + + private InvoiceCreateForChargeItemBuilder() {} + + public InvoiceCreateForChargeItemBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public InvoiceCreateForChargeItemBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public InvoiceCreateForChargeItemBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public InvoiceCreateForChargeItemBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public InvoiceCreateForChargeItemBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public InvoiceCreateForChargeItemBuilder paymentInitiator(PaymentInitiator value) { + this.paymentInitiator = value; + return this; + } + + public InvoiceCreateForChargeItemBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public InvoiceCreateForChargeItemBuilder itemPrice(ItemPriceParams value) { + this.itemPrice = value; + return this; + } + + public InvoiceCreateForChargeItemBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public InvoiceCreateForChargeItemParams build() { + return new InvoiceCreateForChargeItemParams(this); + } + } + + public enum PaymentInitiator { + CUSTOMER("customer"), + + MERCHANT("merchant"), + + /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentInitiator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentInitiator fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentInitiator enumValue : PaymentInitiator.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class ItemPriceParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private ItemPriceParams(ItemPriceBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for ItemPriceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemPriceBuilder builder() { + return new ItemPriceBuilder(); + } + + public static final class ItemPriceBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private ItemPriceBuilder() {} + + public ItemPriceBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemPriceBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public ItemPriceBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public ItemPriceBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public ItemPriceBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public ItemPriceBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public ItemPriceBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public ItemPriceParams build() { + return new ItemPriceParams(this); + } + } + } + + public static final class ItemTiersParams { + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java new file mode 100644 index 00000000..90224c27 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java @@ -0,0 +1,3940 @@ +/* + * 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.invoice.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 InvoiceCreateForChargeItemsAndChargesParams { + + private final String customerId; + + private final String subscriptionId; + + private final String currencyCode; + + private final String invoiceNote; + + private final Boolean removeGeneralNote; + + private final String poNumber; + + private final String coupon; + + private final List couponIds; + + private final String authorizationTransactionId; + + private final String paymentSourceId; + + private final AutoCollection autoCollection; + + private final Timestamp invoiceDate; + + private final String tokenId; + + private final Boolean replacePrimaryPaymentSource; + + private final Boolean retainPaymentSource; + + private final PaymentInitiator paymentInitiator; + + private final ShippingAddressParams shippingAddress; + + private final StatementDescriptorParams statementDescriptor; + + private final CardParams card; + + private final BankAccountParams bankAccount; + + private final PaymentMethodParams paymentMethod; + + private final PaymentIntentParams paymentIntent; + + private final List itemPrices; + + private final List itemTiers; + + private final List charges; + + private final List notesToRemove; + + private final List taxProvidersFields; + + private final List discounts; + + private final Map customFields; + + private InvoiceCreateForChargeItemsAndChargesParams( + InvoiceCreateForChargeItemsAndChargesBuilder builder) { + + this.customerId = builder.customerId; + + this.subscriptionId = builder.subscriptionId; + + this.currencyCode = builder.currencyCode; + + this.invoiceNote = builder.invoiceNote; + + this.removeGeneralNote = builder.removeGeneralNote; + + this.poNumber = builder.poNumber; + + this.coupon = builder.coupon; + + this.couponIds = builder.couponIds; + + this.authorizationTransactionId = builder.authorizationTransactionId; + + this.paymentSourceId = builder.paymentSourceId; + + this.autoCollection = builder.autoCollection; + + this.invoiceDate = builder.invoiceDate; + + this.tokenId = builder.tokenId; + + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; + + this.retainPaymentSource = builder.retainPaymentSource; + + this.paymentInitiator = builder.paymentInitiator; + + this.shippingAddress = builder.shippingAddress; + + this.statementDescriptor = builder.statementDescriptor; + + this.card = builder.card; + + this.bankAccount = builder.bankAccount; + + this.paymentMethod = builder.paymentMethod; + + this.paymentIntent = builder.paymentIntent; + + this.itemPrices = builder.itemPrices; + + this.itemTiers = builder.itemTiers; + + this.charges = builder.charges; + + this.notesToRemove = builder.notesToRemove; + + this.taxProvidersFields = builder.taxProvidersFields; + + this.discounts = builder.discounts; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getCustomerId() { + return customerId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getInvoiceNote() { + return invoiceNote; + } + + public Boolean getRemoveGeneralNote() { + return removeGeneralNote; + } + + public String getPoNumber() { + return poNumber; + } + + public String getCoupon() { + return coupon; + } + + public List getCouponIds() { + return couponIds; + } + + public String getAuthorizationTransactionId() { + return authorizationTransactionId; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public String getTokenId() { + return tokenId; + } + + public Boolean getReplacePrimaryPaymentSource() { + return replacePrimaryPaymentSource; + } + + public Boolean getRetainPaymentSource() { + return retainPaymentSource; + } + + public PaymentInitiator getPaymentInitiator() { + return paymentInitiator; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public StatementDescriptorParams getStatementDescriptor() { + return statementDescriptor; + } + + public CardParams getCard() { + return card; + } + + public BankAccountParams getBankAccount() { + return bankAccount; + } + + public PaymentMethodParams getPaymentMethod() { + return paymentMethod; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + public List getItemPrices() { + return itemPrices; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getCharges() { + return charges; + } + + public List getNotesToRemove() { + return notesToRemove; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + public List getDiscounts() { + return discounts; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.invoiceNote != null) { + + formData.put("invoice_note", this.invoiceNote); + } + + if (this.removeGeneralNote != null) { + + formData.put("remove_general_note", this.removeGeneralNote); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.authorizationTransactionId != null) { + + formData.put("authorization_transaction_id", this.authorizationTransactionId); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.tokenId != null) { + + formData.put("token_id", this.tokenId); + } + + if (this.replacePrimaryPaymentSource != null) { + + formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); + } + + if (this.retainPaymentSource != null) { + + formData.put("retain_payment_source", this.retainPaymentSource); + } + + if (this.paymentInitiator != null) { + + formData.put("payment_initiator", this.paymentInitiator); + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.statementDescriptor != null) { + + // Single object + Map nestedData = this.statementDescriptor.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.bankAccount != null) { + + // Single object + Map nestedData = this.bankAccount.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "bank_account[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentMethod != null) { + + // Single object + Map nestedData = this.paymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemPrices != null) { + + // List of objects + for (int i = 0; i < this.itemPrices.size(); i++) { + ItemPricesParams item = this.itemPrices.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_prices[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.charges != null) { + + // List of objects + for (int i = 0; i < this.charges.size(); i++) { + ChargesParams item = this.charges.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.notesToRemove != null) { + + // List of objects + for (int i = 0; i < this.notesToRemove.size(); i++) { + NotesToRemoveParams item = this.notesToRemove.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "notes_to_remove[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for InvoiceCreateForChargeItemsAndChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceCreateForChargeItemsAndChargesBuilder builder() { + return new InvoiceCreateForChargeItemsAndChargesBuilder(); + } + + public static final class InvoiceCreateForChargeItemsAndChargesBuilder { + + private String customerId; + + private String subscriptionId; + + private String currencyCode; + + private String invoiceNote; + + private Boolean removeGeneralNote; + + private String poNumber; + + private String coupon; + + private List couponIds; + + private String authorizationTransactionId; + + private String paymentSourceId; + + private AutoCollection autoCollection; + + private Timestamp invoiceDate; + + private String tokenId; + + private Boolean replacePrimaryPaymentSource; + + private Boolean retainPaymentSource; + + private PaymentInitiator paymentInitiator; + + private ShippingAddressParams shippingAddress; + + private StatementDescriptorParams statementDescriptor; + + private CardParams card; + + private BankAccountParams bankAccount; + + private PaymentMethodParams paymentMethod; + + private PaymentIntentParams paymentIntent; + + private List itemPrices; + + private List itemTiers; + + private List charges; + + private List notesToRemove; + + private List taxProvidersFields; + + private List discounts; + + private Map customFields = new LinkedHashMap<>(); + + private InvoiceCreateForChargeItemsAndChargesBuilder() {} + + public InvoiceCreateForChargeItemsAndChargesBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder invoiceNote(String value) { + this.invoiceNote = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder removeGeneralNote(Boolean value) { + this.removeGeneralNote = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + @Deprecated + public InvoiceCreateForChargeItemsAndChargesBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder authorizationTransactionId(String value) { + this.authorizationTransactionId = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder tokenId(String value) { + this.tokenId = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder replacePrimaryPaymentSource(Boolean value) { + this.replacePrimaryPaymentSource = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder retainPaymentSource(Boolean value) { + this.retainPaymentSource = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder paymentInitiator(PaymentInitiator value) { + this.paymentInitiator = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder shippingAddress( + ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder statementDescriptor( + StatementDescriptorParams value) { + this.statementDescriptor = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder card(CardParams value) { + this.card = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder bankAccount(BankAccountParams value) { + this.bankAccount = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder paymentMethod(PaymentMethodParams value) { + this.paymentMethod = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder itemPrices(List value) { + this.itemPrices = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder charges(List value) { + this.charges = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder notesToRemove( + List value) { + this.notesToRemove = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder taxProvidersFields( + List value) { + this.taxProvidersFields = value; + return this; + } + + public InvoiceCreateForChargeItemsAndChargesBuilder discounts(List value) { + this.discounts = 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 InvoiceCreateForChargeItemsAndChargesBuilder 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 InvoiceCreateForChargeItemsAndChargesBuilder 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 InvoiceCreateForChargeItemsAndChargesParams build() { + return new InvoiceCreateForChargeItemsAndChargesParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PaymentInitiator { + CUSTOMER("customer"), + + MERCHANT("merchant"), + + /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentInitiator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentInitiator fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentInitiator enumValue : PaymentInitiator.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class StatementDescriptorParams { + + private final String descriptor; + + private StatementDescriptorParams(StatementDescriptorBuilder builder) { + + this.descriptor = builder.descriptor; + } + + public String getDescriptor() { + return descriptor; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.descriptor != null) { + + formData.put("descriptor", this.descriptor); + } + + return formData; + } + + /** Create a new builder for StatementDescriptorParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatementDescriptorBuilder builder() { + return new StatementDescriptorBuilder(); + } + + public static final class StatementDescriptorBuilder { + + private String descriptor; + + private StatementDescriptorBuilder() {} + + public StatementDescriptorBuilder descriptor(String value) { + this.descriptor = value; + return this; + } + + public StatementDescriptorParams build() { + return new StatementDescriptorParams(this); + } + } + } + + public static final class CardParams { + + 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 java.util.Map additionalInformation; + + private CardParams(CardBuilder 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.additionalInformation = builder.additionalInformation; + } + + 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 java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** 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.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + 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 java.util.Map additionalInformation; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + @Deprecated + public CardBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public CardBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CardBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CardBuilder number(String value) { + this.number = value; + return this; + } + + public CardBuilder expiryMonth(Integer value) { + this.expiryMonth = value; + return this; + } + + public CardBuilder expiryYear(Integer value) { + this.expiryYear = value; + return this; + } + + public CardBuilder cvv(String value) { + this.cvv = value; + return this; + } + + public CardBuilder preferredScheme(PreferredScheme value) { + this.preferredScheme = value; + return this; + } + + public CardBuilder billingAddr1(String value) { + this.billingAddr1 = value; + return this; + } + + public CardBuilder billingAddr2(String value) { + this.billingAddr2 = value; + return this; + } + + public CardBuilder billingCity(String value) { + this.billingCity = value; + return this; + } + + public CardBuilder billingStateCode(String value) { + this.billingStateCode = value; + return this; + } + + public CardBuilder billingState(String value) { + this.billingState = value; + return this; + } + + public CardBuilder billingZip(String value) { + this.billingZip = value; + return this; + } + + public CardBuilder billingCountry(String value) { + this.billingCountry = value; + return this; + } + + @Deprecated + public CardBuilder ipAddress(String value) { + this.ipAddress = value; + return this; + } + + public CardBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public CardParams build() { + return new CardParams(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 BankAccountParams { + + private final String gatewayAccountId; + + private final String iban; + + private final String firstName; + + private final String lastName; + + private final String company; + + private final String email; + + private final String phone; + + private final String bankName; + + private final String accountNumber; + + private final String routingNumber; + + private final String bankCode; + + private final AccountType accountType; + + private final AccountHolderType accountHolderType; + + private final EcheckType echeckType; + + private final String issuingCountry; + + private final String swedishIdentityNumber; + + private final java.util.Map billingAddress; + + private BankAccountParams(BankAccountBuilder builder) { + + this.gatewayAccountId = builder.gatewayAccountId; + + this.iban = builder.iban; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.company = builder.company; + + this.email = builder.email; + + this.phone = builder.phone; + + this.bankName = builder.bankName; + + this.accountNumber = builder.accountNumber; + + this.routingNumber = builder.routingNumber; + + this.bankCode = builder.bankCode; + + this.accountType = builder.accountType; + + this.accountHolderType = builder.accountHolderType; + + this.echeckType = builder.echeckType; + + this.issuingCountry = builder.issuingCountry; + + this.swedishIdentityNumber = builder.swedishIdentityNumber; + + this.billingAddress = builder.billingAddress; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getIban() { + return iban; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getCompany() { + return company; + } + + public String getEmail() { + return email; + } + + public String getPhone() { + return phone; + } + + public String getBankName() { + return bankName; + } + + public String getAccountNumber() { + return accountNumber; + } + + public String getRoutingNumber() { + return routingNumber; + } + + public String getBankCode() { + return bankCode; + } + + public AccountType getAccountType() { + return accountType; + } + + public AccountHolderType getAccountHolderType() { + return accountHolderType; + } + + public EcheckType getEcheckType() { + return echeckType; + } + + public String getIssuingCountry() { + return issuingCountry; + } + + public String getSwedishIdentityNumber() { + return swedishIdentityNumber; + } + + public java.util.Map getBillingAddress() { + return billingAddress; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.iban != null) { + + formData.put("iban", this.iban); + } + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + + if (this.company != null) { + + formData.put("company", this.company); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.bankName != null) { + + formData.put("bank_name", this.bankName); + } + + if (this.accountNumber != null) { + + formData.put("account_number", this.accountNumber); + } + + if (this.routingNumber != null) { + + formData.put("routing_number", this.routingNumber); + } + + if (this.bankCode != null) { + + formData.put("bank_code", this.bankCode); + } + + if (this.accountType != null) { + + formData.put("account_type", this.accountType); + } + + if (this.accountHolderType != null) { + + formData.put("account_holder_type", this.accountHolderType); + } + + if (this.echeckType != null) { + + formData.put("echeck_type", this.echeckType); + } + + if (this.issuingCountry != null) { + + formData.put("issuing_country", this.issuingCountry); + } + + if (this.swedishIdentityNumber != null) { + + formData.put("swedish_identity_number", this.swedishIdentityNumber); + } + + if (this.billingAddress != null) { + + formData.put("billing_address", JsonUtil.toJson(this.billingAddress)); + } + + return formData; + } + + /** Create a new builder for BankAccountParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BankAccountBuilder builder() { + return new BankAccountBuilder(); + } + + public static final class BankAccountBuilder { + + private String gatewayAccountId; + + private String iban; + + private String firstName; + + private String lastName; + + private String company; + + private String email; + + private String phone; + + private String bankName; + + private String accountNumber; + + private String routingNumber; + + private String bankCode; + + private AccountType accountType; + + private AccountHolderType accountHolderType; + + private EcheckType echeckType; + + private String issuingCountry; + + private String swedishIdentityNumber; + + private java.util.Map billingAddress; + + private BankAccountBuilder() {} + + public BankAccountBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public BankAccountBuilder iban(String value) { + this.iban = value; + return this; + } + + public BankAccountBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BankAccountBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BankAccountBuilder company(String value) { + this.company = value; + return this; + } + + public BankAccountBuilder email(String value) { + this.email = value; + return this; + } + + public BankAccountBuilder phone(String value) { + this.phone = value; + return this; + } + + public BankAccountBuilder bankName(String value) { + this.bankName = value; + return this; + } + + public BankAccountBuilder accountNumber(String value) { + this.accountNumber = value; + return this; + } + + public BankAccountBuilder routingNumber(String value) { + this.routingNumber = value; + return this; + } + + public BankAccountBuilder bankCode(String value) { + this.bankCode = value; + return this; + } + + public BankAccountBuilder accountType(AccountType value) { + this.accountType = value; + return this; + } + + public BankAccountBuilder accountHolderType(AccountHolderType value) { + this.accountHolderType = value; + return this; + } + + public BankAccountBuilder echeckType(EcheckType value) { + this.echeckType = value; + return this; + } + + public BankAccountBuilder issuingCountry(String value) { + this.issuingCountry = value; + return this; + } + + public BankAccountBuilder swedishIdentityNumber(String value) { + this.swedishIdentityNumber = value; + return this; + } + + public BankAccountBuilder billingAddress(java.util.Map value) { + this.billingAddress = value; + return this; + } + + public BankAccountParams build() { + return new BankAccountParams(this); + } + } + + public enum AccountType { + CHECKING("checking"), + + SAVINGS("savings"), + + BUSINESS_CHECKING("business_checking"), + + CURRENT("current"), + + /** An enum member indicating that AccountType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AccountType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AccountType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AccountType enumValue : AccountType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AccountHolderType { + INDIVIDUAL("individual"), + + COMPANY("company"), + + /** + * An enum member indicating that AccountHolderType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + AccountHolderType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AccountHolderType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AccountHolderType enumValue : AccountHolderType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EcheckType { + WEB("web"), + + PPD("ppd"), + + CCD("ccd"), + + /** An enum member indicating that EcheckType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EcheckType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EcheckType fromString(String value) { + if (value == null) return _UNKNOWN; + for (EcheckType enumValue : EcheckType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PaymentMethodParams { + + private final Type type; + + private final Gateway gateway; + + private final String gatewayAccountId; + + private final String referenceId; + + private final String tmpToken; + + private final String issuingCountry; + + private final java.util.Map additionalInformation; + + private PaymentMethodParams(PaymentMethodBuilder builder) { + + this.type = builder.type; + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.referenceId = builder.referenceId; + + this.tmpToken = builder.tmpToken; + + this.issuingCountry = builder.issuingCountry; + + this.additionalInformation = builder.additionalInformation; + } + + public Type getType() { + return type; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getReferenceId() { + return referenceId; + } + + public String getTmpToken() { + return tmpToken; + } + + public String getIssuingCountry() { + return issuingCountry; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.gateway != null) { + + formData.put("gateway", this.gateway); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.tmpToken != null) { + + formData.put("tmp_token", this.tmpToken); + } + + if (this.issuingCountry != null) { + + formData.put("issuing_country", this.issuingCountry); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentMethodBuilder builder() { + return new PaymentMethodBuilder(); + } + + public static final class PaymentMethodBuilder { + + private Type type; + + private Gateway gateway; + + private String gatewayAccountId; + + private String referenceId; + + private String tmpToken; + + private String issuingCountry; + + private java.util.Map additionalInformation; + + private PaymentMethodBuilder() {} + + public PaymentMethodBuilder type(Type value) { + this.type = value; + return this; + } + + @Deprecated + public PaymentMethodBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public PaymentMethodBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentMethodBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public PaymentMethodBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public PaymentMethodBuilder issuingCountry(String value) { + this.issuingCountry = value; + return this; + } + + public PaymentMethodBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentMethodParams build() { + return new PaymentMethodParams(this); + } + } + + public enum Type { + CARD("card"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + AMAZON_PAYMENTS("amazon_payments"), + + DIRECT_DEBIT("direct_debit"), + + GENERIC("generic"), + + ALIPAY("alipay"), + + UNIONPAY("unionpay"), + + APPLE_PAY("apple_pay"), + + WECHAT_PAY("wechat_pay"), + + IDEAL("ideal"), + + GOOGLE_PAY("google_pay"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GIROPAY("giropay"), + + DOTPAY("dotpay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + VENMO("venmo"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** 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 Gateway { + 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"), + + GOCARDLESS("gocardless"), + + 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 static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemPricesParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private ItemPricesParams(ItemPricesBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for ItemPricesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemPricesBuilder builder() { + return new ItemPricesBuilder(); + } + + public static final class ItemPricesBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private ItemPricesBuilder() {} + + public ItemPricesBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemPricesBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public ItemPricesBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public ItemPricesBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public ItemPricesBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public ItemPricesBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public ItemPricesBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public ItemPricesParams build() { + return new ItemPricesParams(this); + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ChargesParams { + + private final Long amount; + + private final String amountInDecimal; + + private final String description; + + private final Boolean taxable; + + private final String taxProfileId; + + private final String avalaraTaxCode; + + private final String hsnCode; + + private final String taxjarProductCode; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private ChargesParams(ChargesBuilder builder) { + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.description = builder.description; + + this.taxable = builder.taxable; + + this.taxProfileId = builder.taxProfileId; + + this.avalaraTaxCode = builder.avalaraTaxCode; + + this.hsnCode = builder.hsnCode; + + this.taxjarProductCode = builder.taxjarProductCode; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getDescription() { + return description; + } + + public Boolean getTaxable() { + return taxable; + } + + public String getTaxProfileId() { + return taxProfileId; + } + + public String getAvalaraTaxCode() { + return avalaraTaxCode; + } + + public String getHsnCode() { + return hsnCode; + } + + public String getTaxjarProductCode() { + return taxjarProductCode; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.taxable != null) { + + formData.put("taxable", this.taxable); + } + + if (this.taxProfileId != null) { + + formData.put("tax_profile_id", this.taxProfileId); + } + + if (this.avalaraTaxCode != null) { + + formData.put("avalara_tax_code", this.avalaraTaxCode); + } + + if (this.hsnCode != null) { + + formData.put("hsn_code", this.hsnCode); + } + + if (this.taxjarProductCode != null) { + + formData.put("taxjar_product_code", this.taxjarProductCode); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for ChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargesBuilder builder() { + return new ChargesBuilder(); + } + + public static final class ChargesBuilder { + + private Long amount; + + private String amountInDecimal; + + private String description; + + private Boolean taxable; + + private String taxProfileId; + + private String avalaraTaxCode; + + private String hsnCode; + + private String taxjarProductCode; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private ChargesBuilder() {} + + public ChargesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public ChargesBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public ChargesBuilder description(String value) { + this.description = value; + return this; + } + + public ChargesBuilder taxable(Boolean value) { + this.taxable = value; + return this; + } + + public ChargesBuilder taxProfileId(String value) { + this.taxProfileId = value; + return this; + } + + public ChargesBuilder avalaraTaxCode(String value) { + this.avalaraTaxCode = value; + return this; + } + + public ChargesBuilder hsnCode(String value) { + this.hsnCode = value; + return this; + } + + public ChargesBuilder taxjarProductCode(String value) { + this.taxjarProductCode = value; + return this; + } + + public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public ChargesBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public ChargesBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public ChargesBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public ChargesBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public ChargesParams build() { + return new ChargesParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class NotesToRemoveParams { + + private final EntityType entityType; + + private final String entityId; + + private NotesToRemoveParams(NotesToRemoveBuilder builder) { + + this.entityType = builder.entityType; + + this.entityId = builder.entityId; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + + /** 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.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + return formData; + } + + /** Create a new builder for NotesToRemoveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NotesToRemoveBuilder builder() { + return new NotesToRemoveBuilder(); + } + + public static final class NotesToRemoveBuilder { + + private EntityType entityType; + + private String entityId; + + private NotesToRemoveBuilder() {} + + public NotesToRemoveBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public NotesToRemoveBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public NotesToRemoveParams build() { + return new NotesToRemoveParams(this); + } + } + + public enum EntityType { + CUSTOMER("customer"), + + SUBSCRIPTION("subscription"), + + COUPON("coupon"), + + PLAN_ITEM_PRICE("plan_item_price"), + + ADDON_ITEM_PRICE("addon_item_price"), + + CHARGE_ITEM_PRICE("charge_item_price"), + + /** 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 static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } + + public static final class DiscountsParams { + + private final Number percentage; + + private final Long amount; + + private final Integer quantity; + + private final ApplyOn applyOn; + + private final String itemPriceId; + + private DiscountsParams(DiscountsBuilder builder) { + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.quantity = builder.quantity; + + this.applyOn = builder.applyOn; + + this.itemPriceId = builder.itemPriceId; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getQuantity() { + return quantity; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public String getItemPriceId() { + return itemPriceId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private Number percentage; + + private Long amount; + + private Integer quantity; + + private ApplyOn applyOn; + + private String itemPriceId; + + private DiscountsBuilder() {} + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateParams.java new file mode 100644 index 00000000..13cdc543 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateParams.java @@ -0,0 +1,3425 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class InvoiceCreateParams { + + private final String customerId; + + private final String subscriptionId; + + private final String currencyCode; + + private final Timestamp invoiceDate; + + private final String invoiceNote; + + private final Boolean removeGeneralNote; + + private final String poNumber; + + private final String coupon; + + private final List couponIds; + + private final String authorizationTransactionId; + + private final String paymentSourceId; + + private final AutoCollection autoCollection; + + private final String tokenId; + + private final Boolean replacePrimaryPaymentSource; + + private final Boolean retainPaymentSource; + + private final PaymentInitiator paymentInitiator; + + private final ShippingAddressParams shippingAddress; + + private final StatementDescriptorParams statementDescriptor; + + private final CardParams card; + + private final BankAccountParams bankAccount; + + private final PaymentMethodParams paymentMethod; + + private final PaymentIntentParams paymentIntent; + + private final List addons; + + private final List charges; + + private final List taxProvidersFields; + + private final List notesToRemove; + + private InvoiceCreateParams(InvoiceCreateBuilder builder) { + + this.customerId = builder.customerId; + + this.subscriptionId = builder.subscriptionId; + + this.currencyCode = builder.currencyCode; + + this.invoiceDate = builder.invoiceDate; + + this.invoiceNote = builder.invoiceNote; + + this.removeGeneralNote = builder.removeGeneralNote; + + this.poNumber = builder.poNumber; + + this.coupon = builder.coupon; + + this.couponIds = builder.couponIds; + + this.authorizationTransactionId = builder.authorizationTransactionId; + + this.paymentSourceId = builder.paymentSourceId; + + this.autoCollection = builder.autoCollection; + + this.tokenId = builder.tokenId; + + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; + + this.retainPaymentSource = builder.retainPaymentSource; + + this.paymentInitiator = builder.paymentInitiator; + + this.shippingAddress = builder.shippingAddress; + + this.statementDescriptor = builder.statementDescriptor; + + this.card = builder.card; + + this.bankAccount = builder.bankAccount; + + this.paymentMethod = builder.paymentMethod; + + this.paymentIntent = builder.paymentIntent; + + this.addons = builder.addons; + + this.charges = builder.charges; + + this.taxProvidersFields = builder.taxProvidersFields; + + this.notesToRemove = builder.notesToRemove; + } + + public String getCustomerId() { + return customerId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public String getInvoiceNote() { + return invoiceNote; + } + + public Boolean getRemoveGeneralNote() { + return removeGeneralNote; + } + + public String getPoNumber() { + return poNumber; + } + + public String getCoupon() { + return coupon; + } + + public List getCouponIds() { + return couponIds; + } + + public String getAuthorizationTransactionId() { + return authorizationTransactionId; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public String getTokenId() { + return tokenId; + } + + public Boolean getReplacePrimaryPaymentSource() { + return replacePrimaryPaymentSource; + } + + public Boolean getRetainPaymentSource() { + return retainPaymentSource; + } + + public PaymentInitiator getPaymentInitiator() { + return paymentInitiator; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public StatementDescriptorParams getStatementDescriptor() { + return statementDescriptor; + } + + public CardParams getCard() { + return card; + } + + public BankAccountParams getBankAccount() { + return bankAccount; + } + + public PaymentMethodParams getPaymentMethod() { + return paymentMethod; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + public List getAddons() { + return addons; + } + + public List getCharges() { + return charges; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + public List getNotesToRemove() { + return notesToRemove; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.invoiceNote != null) { + + formData.put("invoice_note", this.invoiceNote); + } + + if (this.removeGeneralNote != null) { + + formData.put("remove_general_note", this.removeGeneralNote); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.authorizationTransactionId != null) { + + formData.put("authorization_transaction_id", this.authorizationTransactionId); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.tokenId != null) { + + formData.put("token_id", this.tokenId); + } + + if (this.replacePrimaryPaymentSource != null) { + + formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); + } + + if (this.retainPaymentSource != null) { + + formData.put("retain_payment_source", this.retainPaymentSource); + } + + if (this.paymentInitiator != null) { + + formData.put("payment_initiator", this.paymentInitiator); + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.statementDescriptor != null) { + + // Single object + Map nestedData = this.statementDescriptor.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.bankAccount != null) { + + // Single object + Map nestedData = this.bankAccount.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "bank_account[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentMethod != null) { + + // Single object + Map nestedData = this.paymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.charges != null) { + + // List of objects + for (int i = 0; i < this.charges.size(); i++) { + ChargesParams item = this.charges.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.notesToRemove != null) { + + // List of objects + for (int i = 0; i < this.notesToRemove.size(); i++) { + NotesToRemoveParams item = this.notesToRemove.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "notes_to_remove[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for InvoiceCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceCreateBuilder builder() { + return new InvoiceCreateBuilder(); + } + + public static final class InvoiceCreateBuilder { + + private String customerId; + + private String subscriptionId; + + private String currencyCode; + + private Timestamp invoiceDate; + + private String invoiceNote; + + private Boolean removeGeneralNote; + + private String poNumber; + + private String coupon; + + private List couponIds; + + private String authorizationTransactionId; + + private String paymentSourceId; + + private AutoCollection autoCollection; + + private String tokenId; + + private Boolean replacePrimaryPaymentSource; + + private Boolean retainPaymentSource; + + private PaymentInitiator paymentInitiator; + + private ShippingAddressParams shippingAddress; + + private StatementDescriptorParams statementDescriptor; + + private CardParams card; + + private BankAccountParams bankAccount; + + private PaymentMethodParams paymentMethod; + + private PaymentIntentParams paymentIntent; + + private List addons; + + private List charges; + + private List taxProvidersFields; + + private List notesToRemove; + + private InvoiceCreateBuilder() {} + + public InvoiceCreateBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public InvoiceCreateBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public InvoiceCreateBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public InvoiceCreateBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public InvoiceCreateBuilder invoiceNote(String value) { + this.invoiceNote = value; + return this; + } + + public InvoiceCreateBuilder removeGeneralNote(Boolean value) { + this.removeGeneralNote = value; + return this; + } + + public InvoiceCreateBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + @Deprecated + public InvoiceCreateBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public InvoiceCreateBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public InvoiceCreateBuilder authorizationTransactionId(String value) { + this.authorizationTransactionId = value; + return this; + } + + public InvoiceCreateBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public InvoiceCreateBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public InvoiceCreateBuilder tokenId(String value) { + this.tokenId = value; + return this; + } + + public InvoiceCreateBuilder replacePrimaryPaymentSource(Boolean value) { + this.replacePrimaryPaymentSource = value; + return this; + } + + public InvoiceCreateBuilder retainPaymentSource(Boolean value) { + this.retainPaymentSource = value; + return this; + } + + public InvoiceCreateBuilder paymentInitiator(PaymentInitiator value) { + this.paymentInitiator = value; + return this; + } + + public InvoiceCreateBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public InvoiceCreateBuilder statementDescriptor(StatementDescriptorParams value) { + this.statementDescriptor = value; + return this; + } + + public InvoiceCreateBuilder card(CardParams value) { + this.card = value; + return this; + } + + public InvoiceCreateBuilder bankAccount(BankAccountParams value) { + this.bankAccount = value; + return this; + } + + public InvoiceCreateBuilder paymentMethod(PaymentMethodParams value) { + this.paymentMethod = value; + return this; + } + + public InvoiceCreateBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public InvoiceCreateBuilder addons(List value) { + this.addons = value; + return this; + } + + public InvoiceCreateBuilder charges(List value) { + this.charges = value; + return this; + } + + public InvoiceCreateBuilder taxProvidersFields(List value) { + this.taxProvidersFields = value; + return this; + } + + public InvoiceCreateBuilder notesToRemove(List value) { + this.notesToRemove = value; + return this; + } + + public InvoiceCreateParams build() { + return new InvoiceCreateParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PaymentInitiator { + CUSTOMER("customer"), + + MERCHANT("merchant"), + + /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentInitiator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentInitiator fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentInitiator enumValue : PaymentInitiator.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class StatementDescriptorParams { + + private final String descriptor; + + private StatementDescriptorParams(StatementDescriptorBuilder builder) { + + this.descriptor = builder.descriptor; + } + + public String getDescriptor() { + return descriptor; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.descriptor != null) { + + formData.put("descriptor", this.descriptor); + } + + return formData; + } + + /** Create a new builder for StatementDescriptorParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatementDescriptorBuilder builder() { + return new StatementDescriptorBuilder(); + } + + public static final class StatementDescriptorBuilder { + + private String descriptor; + + private StatementDescriptorBuilder() {} + + public StatementDescriptorBuilder descriptor(String value) { + this.descriptor = value; + return this; + } + + public StatementDescriptorParams build() { + return new StatementDescriptorParams(this); + } + } + } + + public static final class CardParams { + + 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 java.util.Map additionalInformation; + + private CardParams(CardBuilder 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.additionalInformation = builder.additionalInformation; + } + + 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 java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** 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.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + 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 java.util.Map additionalInformation; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + @Deprecated + public CardBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public CardBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CardBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CardBuilder number(String value) { + this.number = value; + return this; + } + + public CardBuilder expiryMonth(Integer value) { + this.expiryMonth = value; + return this; + } + + public CardBuilder expiryYear(Integer value) { + this.expiryYear = value; + return this; + } + + public CardBuilder cvv(String value) { + this.cvv = value; + return this; + } + + public CardBuilder preferredScheme(PreferredScheme value) { + this.preferredScheme = value; + return this; + } + + public CardBuilder billingAddr1(String value) { + this.billingAddr1 = value; + return this; + } + + public CardBuilder billingAddr2(String value) { + this.billingAddr2 = value; + return this; + } + + public CardBuilder billingCity(String value) { + this.billingCity = value; + return this; + } + + public CardBuilder billingStateCode(String value) { + this.billingStateCode = value; + return this; + } + + public CardBuilder billingState(String value) { + this.billingState = value; + return this; + } + + public CardBuilder billingZip(String value) { + this.billingZip = value; + return this; + } + + public CardBuilder billingCountry(String value) { + this.billingCountry = value; + return this; + } + + @Deprecated + public CardBuilder ipAddress(String value) { + this.ipAddress = value; + return this; + } + + public CardBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public CardParams build() { + return new CardParams(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 BankAccountParams { + + private final String gatewayAccountId; + + private final String iban; + + private final String firstName; + + private final String lastName; + + private final String company; + + private final String email; + + private final String phone; + + private final String bankName; + + private final String accountNumber; + + private final String routingNumber; + + private final String bankCode; + + private final AccountType accountType; + + private final AccountHolderType accountHolderType; + + private final EcheckType echeckType; + + private final String issuingCountry; + + private final String swedishIdentityNumber; + + private final java.util.Map billingAddress; + + private BankAccountParams(BankAccountBuilder builder) { + + this.gatewayAccountId = builder.gatewayAccountId; + + this.iban = builder.iban; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.company = builder.company; + + this.email = builder.email; + + this.phone = builder.phone; + + this.bankName = builder.bankName; + + this.accountNumber = builder.accountNumber; + + this.routingNumber = builder.routingNumber; + + this.bankCode = builder.bankCode; + + this.accountType = builder.accountType; + + this.accountHolderType = builder.accountHolderType; + + this.echeckType = builder.echeckType; + + this.issuingCountry = builder.issuingCountry; + + this.swedishIdentityNumber = builder.swedishIdentityNumber; + + this.billingAddress = builder.billingAddress; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getIban() { + return iban; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getCompany() { + return company; + } + + public String getEmail() { + return email; + } + + public String getPhone() { + return phone; + } + + public String getBankName() { + return bankName; + } + + public String getAccountNumber() { + return accountNumber; + } + + public String getRoutingNumber() { + return routingNumber; + } + + public String getBankCode() { + return bankCode; + } + + public AccountType getAccountType() { + return accountType; + } + + public AccountHolderType getAccountHolderType() { + return accountHolderType; + } + + public EcheckType getEcheckType() { + return echeckType; + } + + public String getIssuingCountry() { + return issuingCountry; + } + + public String getSwedishIdentityNumber() { + return swedishIdentityNumber; + } + + public java.util.Map getBillingAddress() { + return billingAddress; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.iban != null) { + + formData.put("iban", this.iban); + } + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + + if (this.company != null) { + + formData.put("company", this.company); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.bankName != null) { + + formData.put("bank_name", this.bankName); + } + + if (this.accountNumber != null) { + + formData.put("account_number", this.accountNumber); + } + + if (this.routingNumber != null) { + + formData.put("routing_number", this.routingNumber); + } + + if (this.bankCode != null) { + + formData.put("bank_code", this.bankCode); + } + + if (this.accountType != null) { + + formData.put("account_type", this.accountType); + } + + if (this.accountHolderType != null) { + + formData.put("account_holder_type", this.accountHolderType); + } + + if (this.echeckType != null) { + + formData.put("echeck_type", this.echeckType); + } + + if (this.issuingCountry != null) { + + formData.put("issuing_country", this.issuingCountry); + } + + if (this.swedishIdentityNumber != null) { + + formData.put("swedish_identity_number", this.swedishIdentityNumber); + } + + if (this.billingAddress != null) { + + formData.put("billing_address", JsonUtil.toJson(this.billingAddress)); + } + + return formData; + } + + /** Create a new builder for BankAccountParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BankAccountBuilder builder() { + return new BankAccountBuilder(); + } + + public static final class BankAccountBuilder { + + private String gatewayAccountId; + + private String iban; + + private String firstName; + + private String lastName; + + private String company; + + private String email; + + private String phone; + + private String bankName; + + private String accountNumber; + + private String routingNumber; + + private String bankCode; + + private AccountType accountType; + + private AccountHolderType accountHolderType; + + private EcheckType echeckType; + + private String issuingCountry; + + private String swedishIdentityNumber; + + private java.util.Map billingAddress; + + private BankAccountBuilder() {} + + public BankAccountBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public BankAccountBuilder iban(String value) { + this.iban = value; + return this; + } + + public BankAccountBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BankAccountBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BankAccountBuilder company(String value) { + this.company = value; + return this; + } + + public BankAccountBuilder email(String value) { + this.email = value; + return this; + } + + public BankAccountBuilder phone(String value) { + this.phone = value; + return this; + } + + public BankAccountBuilder bankName(String value) { + this.bankName = value; + return this; + } + + public BankAccountBuilder accountNumber(String value) { + this.accountNumber = value; + return this; + } + + public BankAccountBuilder routingNumber(String value) { + this.routingNumber = value; + return this; + } + + public BankAccountBuilder bankCode(String value) { + this.bankCode = value; + return this; + } + + public BankAccountBuilder accountType(AccountType value) { + this.accountType = value; + return this; + } + + public BankAccountBuilder accountHolderType(AccountHolderType value) { + this.accountHolderType = value; + return this; + } + + public BankAccountBuilder echeckType(EcheckType value) { + this.echeckType = value; + return this; + } + + public BankAccountBuilder issuingCountry(String value) { + this.issuingCountry = value; + return this; + } + + public BankAccountBuilder swedishIdentityNumber(String value) { + this.swedishIdentityNumber = value; + return this; + } + + public BankAccountBuilder billingAddress(java.util.Map value) { + this.billingAddress = value; + return this; + } + + public BankAccountParams build() { + return new BankAccountParams(this); + } + } + + public enum AccountType { + CHECKING("checking"), + + SAVINGS("savings"), + + BUSINESS_CHECKING("business_checking"), + + CURRENT("current"), + + /** An enum member indicating that AccountType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AccountType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AccountType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AccountType enumValue : AccountType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AccountHolderType { + INDIVIDUAL("individual"), + + COMPANY("company"), + + /** + * An enum member indicating that AccountHolderType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + AccountHolderType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AccountHolderType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AccountHolderType enumValue : AccountHolderType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EcheckType { + WEB("web"), + + PPD("ppd"), + + CCD("ccd"), + + /** An enum member indicating that EcheckType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EcheckType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EcheckType fromString(String value) { + if (value == null) return _UNKNOWN; + for (EcheckType enumValue : EcheckType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PaymentMethodParams { + + private final Type type; + + private final Gateway gateway; + + private final String gatewayAccountId; + + private final String referenceId; + + private final String tmpToken; + + private final String issuingCountry; + + private final java.util.Map additionalInformation; + + private PaymentMethodParams(PaymentMethodBuilder builder) { + + this.type = builder.type; + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.referenceId = builder.referenceId; + + this.tmpToken = builder.tmpToken; + + this.issuingCountry = builder.issuingCountry; + + this.additionalInformation = builder.additionalInformation; + } + + public Type getType() { + return type; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getReferenceId() { + return referenceId; + } + + public String getTmpToken() { + return tmpToken; + } + + public String getIssuingCountry() { + return issuingCountry; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.gateway != null) { + + formData.put("gateway", this.gateway); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.tmpToken != null) { + + formData.put("tmp_token", this.tmpToken); + } + + if (this.issuingCountry != null) { + + formData.put("issuing_country", this.issuingCountry); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentMethodBuilder builder() { + return new PaymentMethodBuilder(); + } + + public static final class PaymentMethodBuilder { + + private Type type; + + private Gateway gateway; + + private String gatewayAccountId; + + private String referenceId; + + private String tmpToken; + + private String issuingCountry; + + private java.util.Map additionalInformation; + + private PaymentMethodBuilder() {} + + public PaymentMethodBuilder type(Type value) { + this.type = value; + return this; + } + + @Deprecated + public PaymentMethodBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public PaymentMethodBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentMethodBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public PaymentMethodBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public PaymentMethodBuilder issuingCountry(String value) { + this.issuingCountry = value; + return this; + } + + public PaymentMethodBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentMethodParams build() { + return new PaymentMethodParams(this); + } + } + + public enum Type { + CARD("card"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + AMAZON_PAYMENTS("amazon_payments"), + + DIRECT_DEBIT("direct_debit"), + + GENERIC("generic"), + + ALIPAY("alipay"), + + UNIONPAY("unionpay"), + + APPLE_PAY("apple_pay"), + + WECHAT_PAY("wechat_pay"), + + IDEAL("ideal"), + + GOOGLE_PAY("google_pay"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GIROPAY("giropay"), + + DOTPAY("dotpay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + VENMO("venmo"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** 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 Gateway { + 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"), + + GOCARDLESS("gocardless"), + + 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 static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public AddonsBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class ChargesParams { + + private final Long amount; + + private final String amountInDecimal; + + private final String description; + + private final Boolean taxable; + + private final String taxProfileId; + + private final String avalaraTaxCode; + + private final String hsnCode; + + private final String taxjarProductCode; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private ChargesParams(ChargesBuilder builder) { + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.description = builder.description; + + this.taxable = builder.taxable; + + this.taxProfileId = builder.taxProfileId; + + this.avalaraTaxCode = builder.avalaraTaxCode; + + this.hsnCode = builder.hsnCode; + + this.taxjarProductCode = builder.taxjarProductCode; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getDescription() { + return description; + } + + public Boolean getTaxable() { + return taxable; + } + + public String getTaxProfileId() { + return taxProfileId; + } + + public String getAvalaraTaxCode() { + return avalaraTaxCode; + } + + public String getHsnCode() { + return hsnCode; + } + + public String getTaxjarProductCode() { + return taxjarProductCode; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.taxable != null) { + + formData.put("taxable", this.taxable); + } + + if (this.taxProfileId != null) { + + formData.put("tax_profile_id", this.taxProfileId); + } + + if (this.avalaraTaxCode != null) { + + formData.put("avalara_tax_code", this.avalaraTaxCode); + } + + if (this.hsnCode != null) { + + formData.put("hsn_code", this.hsnCode); + } + + if (this.taxjarProductCode != null) { + + formData.put("taxjar_product_code", this.taxjarProductCode); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for ChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargesBuilder builder() { + return new ChargesBuilder(); + } + + public static final class ChargesBuilder { + + private Long amount; + + private String amountInDecimal; + + private String description; + + private Boolean taxable; + + private String taxProfileId; + + private String avalaraTaxCode; + + private String hsnCode; + + private String taxjarProductCode; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private ChargesBuilder() {} + + public ChargesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public ChargesBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public ChargesBuilder description(String value) { + this.description = value; + return this; + } + + public ChargesBuilder taxable(Boolean value) { + this.taxable = value; + return this; + } + + public ChargesBuilder taxProfileId(String value) { + this.taxProfileId = value; + return this; + } + + public ChargesBuilder avalaraTaxCode(String value) { + this.avalaraTaxCode = value; + return this; + } + + public ChargesBuilder hsnCode(String value) { + this.hsnCode = value; + return this; + } + + public ChargesBuilder taxjarProductCode(String value) { + this.taxjarProductCode = value; + return this; + } + + public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public ChargesBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public ChargesBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public ChargesBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public ChargesBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public ChargesParams build() { + return new ChargesParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } + + public static final class NotesToRemoveParams { + + private final EntityType entityType; + + private final String entityId; + + private NotesToRemoveParams(NotesToRemoveBuilder builder) { + + this.entityType = builder.entityType; + + this.entityId = builder.entityId; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + + /** 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.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + return formData; + } + + /** Create a new builder for NotesToRemoveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NotesToRemoveBuilder builder() { + return new NotesToRemoveBuilder(); + } + + public static final class NotesToRemoveBuilder { + + private EntityType entityType; + + private String entityId; + + private NotesToRemoveBuilder() {} + + public NotesToRemoveBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public NotesToRemoveBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public NotesToRemoveParams build() { + return new NotesToRemoveParams(this); + } + } + + public enum EntityType { + PLAN("plan"), + + ADDON("addon"), + + CUSTOMER("customer"), + + SUBSCRIPTION("subscription"), + + COUPON("coupon"), + + /** 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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceDeleteImportedParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceDeleteImportedParams.java similarity index 75% rename from src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceDeleteImportedParams.java rename to src/main/java/com/chargebee/v4/models/invoice/params/InvoiceDeleteImportedParams.java index 13a012aa..f8bef357 100644 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceDeleteImportedParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceDeleteImportedParams.java @@ -4,24 +4,35 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.invoice.params; +package com.chargebee.v4.models.invoice.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class InvoiceDeleteImportedParams { - private final Map formData; + private final String comment; private InvoiceDeleteImportedParams(InvoiceDeleteImportedBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); + + this.comment = builder.comment; + } + + public String getComment() { + return comment; } /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + return formData; } @@ -32,14 +43,13 @@ public static InvoiceDeleteImportedBuilder builder() { } public static final class InvoiceDeleteImportedBuilder { - private final Map formData = new LinkedHashMap<>(); + + private String comment; private InvoiceDeleteImportedBuilder() {} public InvoiceDeleteImportedBuilder comment(String value) { - - formData.put("comment", value); - + this.comment = value; return this; } diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceDeleteLineItemsParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceDeleteLineItemsParams.java new file mode 100644 index 00000000..1f0b0a44 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceDeleteLineItemsParams.java @@ -0,0 +1,119 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class InvoiceDeleteLineItemsParams { + + private final List lineItems; + + private InvoiceDeleteLineItemsParams(InvoiceDeleteLineItemsBuilder builder) { + + this.lineItems = builder.lineItems; + } + + public List getLineItems() { + return lineItems; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.lineItems != null) { + + // List of objects + for (int i = 0; i < this.lineItems.size(); i++) { + LineItemsParams item = this.lineItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "line_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for InvoiceDeleteLineItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceDeleteLineItemsBuilder builder() { + return new InvoiceDeleteLineItemsBuilder(); + } + + public static final class InvoiceDeleteLineItemsBuilder { + + private List lineItems; + + private InvoiceDeleteLineItemsBuilder() {} + + public InvoiceDeleteLineItemsBuilder lineItems(List value) { + this.lineItems = value; + return this; + } + + public InvoiceDeleteLineItemsParams build() { + return new InvoiceDeleteLineItemsParams(this); + } + } + + public static final class LineItemsParams { + + private final String id; + + private LineItemsParams(LineItemsBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for LineItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static LineItemsBuilder builder() { + return new LineItemsBuilder(); + } + + public static final class LineItemsBuilder { + + private String id; + + private LineItemsBuilder() {} + + public LineItemsBuilder id(String value) { + this.id = value; + return this; + } + + public LineItemsParams build() { + return new LineItemsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceDeleteParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceDeleteParams.java new file mode 100644 index 00000000..a63a4abc --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceDeleteParams.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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InvoiceDeleteParams { + + private final String comment; + + private InvoiceDeleteParams(InvoiceDeleteBuilder builder) { + + this.comment = builder.comment; + } + + public String getComment() { + return comment; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + return formData; + } + + /** Create a new builder for InvoiceDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceDeleteBuilder builder() { + return new InvoiceDeleteBuilder(); + } + + public static final class InvoiceDeleteBuilder { + + private String comment; + + private InvoiceDeleteBuilder() {} + + public InvoiceDeleteBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoiceDeleteParams build() { + return new InvoiceDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceListParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceListParams.java rename to src/main/java/com/chargebee/v4/models/invoice/params/InvoiceListParams.java index 2928ae1d..902c0ad6 100644 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceListParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.invoice.params; +package com.chargebee.v4.models.invoice.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceListPaymentReferenceNumbersParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceListPaymentReferenceNumbersParams.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceListPaymentReferenceNumbersParams.java rename to src/main/java/com/chargebee/v4/models/invoice/params/InvoiceListPaymentReferenceNumbersParams.java index 13ca3aa4..74b98c2a 100644 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceListPaymentReferenceNumbersParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceListPaymentReferenceNumbersParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.invoice.params; +package com.chargebee.v4.models.invoice.params; import com.chargebee.v4.internal.Recommended; @@ -78,13 +78,13 @@ public static final class IdFilter { this.builder = builder; } - public InvoiceListPaymentReferenceNumbersBuilder in(String... values) { - builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + public InvoiceListPaymentReferenceNumbersBuilder is(String value) { + builder.queryParams.put(fieldName + "[is]", value); return builder; } - public InvoiceListPaymentReferenceNumbersBuilder is(String value) { - builder.queryParams.put(fieldName + "[is]", value); + public InvoiceListPaymentReferenceNumbersBuilder in(String... values) { + builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); return builder; } } @@ -137,13 +137,13 @@ public static final class NumberFilter { this.builder = builder; } - public PaymentReferenceNumberBuilder in(String... values) { - builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + public PaymentReferenceNumberBuilder is(String value) { + builder.queryParams.put(fieldName + "[is]", value); return builder; } - public PaymentReferenceNumberBuilder is(String value) { - builder.queryParams.put(fieldName + "[is]", value); + public PaymentReferenceNumberBuilder in(String... values) { + builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); return builder; } } diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoicePauseDunningParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoicePauseDunningParams.java new file mode 100644 index 00000000..969f6f05 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoicePauseDunningParams.java @@ -0,0 +1,81 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class InvoicePauseDunningParams { + + private final Timestamp expectedPaymentDate; + + private final String comment; + + private InvoicePauseDunningParams(InvoicePauseDunningBuilder builder) { + + this.expectedPaymentDate = builder.expectedPaymentDate; + + this.comment = builder.comment; + } + + public Timestamp getExpectedPaymentDate() { + return expectedPaymentDate; + } + + public String getComment() { + return comment; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.expectedPaymentDate != null) { + + formData.put("expected_payment_date", this.expectedPaymentDate); + } + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + return formData; + } + + /** Create a new builder for InvoicePauseDunningParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoicePauseDunningBuilder builder() { + return new InvoicePauseDunningBuilder(); + } + + public static final class InvoicePauseDunningBuilder { + + private Timestamp expectedPaymentDate; + + private String comment; + + private InvoicePauseDunningBuilder() {} + + public InvoicePauseDunningBuilder expectedPaymentDate(Timestamp value) { + this.expectedPaymentDate = value; + return this; + } + + public InvoicePauseDunningBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoicePauseDunningParams build() { + return new InvoicePauseDunningParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoicePaymentSchedulesParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoicePaymentSchedulesParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/invoice/params/InvoicePaymentSchedulesParams.java rename to src/main/java/com/chargebee/v4/models/invoice/params/InvoicePaymentSchedulesParams.java index 899925b0..d669f9a4 100644 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoicePaymentSchedulesParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoicePaymentSchedulesParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.invoice.params; +package com.chargebee.v4.models.invoice.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoicePdfParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoicePdfParams.java similarity index 78% rename from src/main/java/com/chargebee/v4/core/models/invoice/params/InvoicePdfParams.java rename to src/main/java/com/chargebee/v4/models/invoice/params/InvoicePdfParams.java index 4f094c11..0e871dee 100644 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoicePdfParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoicePdfParams.java @@ -4,24 +4,35 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.invoice.params; +package com.chargebee.v4.models.invoice.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class InvoicePdfParams { - private final Map formData; + private final DispositionType dispositionType; private InvoicePdfParams(InvoicePdfBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); + + this.dispositionType = builder.dispositionType; + } + + public DispositionType getDispositionType() { + return dispositionType; } /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.dispositionType != null) { + + formData.put("disposition_type", this.dispositionType); + } + return formData; } @@ -32,14 +43,13 @@ public static InvoicePdfBuilder builder() { } public static final class InvoicePdfBuilder { - private final Map formData = new LinkedHashMap<>(); + + private DispositionType dispositionType; private InvoicePdfBuilder() {} public InvoicePdfBuilder dispositionType(DispositionType value) { - - formData.put("disposition_type", value); - + this.dispositionType = value; return this; } diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordPaymentParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordPaymentParams.java new file mode 100644 index 00000000..abbcba9d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordPaymentParams.java @@ -0,0 +1,362 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class InvoiceRecordPaymentParams { + + private final String comment; + + private final TransactionParams transaction; + + private InvoiceRecordPaymentParams(InvoiceRecordPaymentBuilder builder) { + + this.comment = builder.comment; + + this.transaction = builder.transaction; + } + + public String getComment() { + return comment; + } + + public TransactionParams getTransaction() { + return transaction; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.transaction != null) { + + // Single object + Map nestedData = this.transaction.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "transaction[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for InvoiceRecordPaymentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceRecordPaymentBuilder builder() { + return new InvoiceRecordPaymentBuilder(); + } + + public static final class InvoiceRecordPaymentBuilder { + + private String comment; + + private TransactionParams transaction; + + private InvoiceRecordPaymentBuilder() {} + + public InvoiceRecordPaymentBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoiceRecordPaymentBuilder transaction(TransactionParams value) { + this.transaction = value; + return this; + } + + public InvoiceRecordPaymentParams build() { + return new InvoiceRecordPaymentParams(this); + } + } + + public static final class TransactionParams { + + private final Long amount; + + private final PaymentMethod paymentMethod; + + private final String referenceNumber; + + private final String customPaymentMethodId; + + private final String idAtGateway; + + private final Status status; + + private final Timestamp date; + + private final String errorCode; + + private final String errorText; + + private TransactionParams(TransactionBuilder builder) { + + this.amount = builder.amount; + + this.paymentMethod = builder.paymentMethod; + + this.referenceNumber = builder.referenceNumber; + + this.customPaymentMethodId = builder.customPaymentMethodId; + + this.idAtGateway = builder.idAtGateway; + + this.status = builder.status; + + this.date = builder.date; + + this.errorCode = builder.errorCode; + + this.errorText = builder.errorText; + } + + public Long getAmount() { + return amount; + } + + public PaymentMethod getPaymentMethod() { + return paymentMethod; + } + + public String getReferenceNumber() { + return referenceNumber; + } + + public String getCustomPaymentMethodId() { + return customPaymentMethodId; + } + + public String getIdAtGateway() { + return idAtGateway; + } + + public Status getStatus() { + return status; + } + + public Timestamp getDate() { + return date; + } + + public String getErrorCode() { + return errorCode; + } + + public String getErrorText() { + return errorText; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.paymentMethod != null) { + + formData.put("payment_method", this.paymentMethod); + } + + if (this.referenceNumber != null) { + + formData.put("reference_number", this.referenceNumber); + } + + if (this.customPaymentMethodId != null) { + + formData.put("custom_payment_method_id", this.customPaymentMethodId); + } + + if (this.idAtGateway != null) { + + formData.put("id_at_gateway", this.idAtGateway); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + if (this.errorCode != null) { + + formData.put("error_code", this.errorCode); + } + + if (this.errorText != null) { + + formData.put("error_text", this.errorText); + } + + return formData; + } + + /** Create a new builder for TransactionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionBuilder builder() { + return new TransactionBuilder(); + } + + public static final class TransactionBuilder { + + private Long amount; + + private PaymentMethod paymentMethod; + + private String referenceNumber; + + private String customPaymentMethodId; + + private String idAtGateway; + + private Status status; + + private Timestamp date; + + private String errorCode; + + private String errorText; + + private TransactionBuilder() {} + + public TransactionBuilder amount(Long value) { + this.amount = value; + return this; + } + + public TransactionBuilder paymentMethod(PaymentMethod value) { + this.paymentMethod = value; + return this; + } + + public TransactionBuilder referenceNumber(String value) { + this.referenceNumber = value; + return this; + } + + public TransactionBuilder customPaymentMethodId(String value) { + this.customPaymentMethodId = value; + return this; + } + + public TransactionBuilder idAtGateway(String value) { + this.idAtGateway = value; + return this; + } + + public TransactionBuilder status(Status value) { + this.status = value; + return this; + } + + public TransactionBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public TransactionBuilder errorCode(String value) { + this.errorCode = value; + return this; + } + + public TransactionBuilder errorText(String value) { + this.errorText = value; + return this; + } + + public TransactionParams build() { + return new TransactionParams(this); + } + } + + public enum PaymentMethod { + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + OTHER("other"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + CUSTOM("custom"), + + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethod enumValue : PaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + SUCCESS("success"), + + FAILURE("failure"), + + LATE_FAILURE("late_failure"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordRefundParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordRefundParams.java new file mode 100644 index 00000000..bcfab083 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordRefundParams.java @@ -0,0 +1,405 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class InvoiceRecordRefundParams { + + private final String comment; + + private final String customerNotes; + + private final TransactionParams transaction; + + private final CreditNoteParams creditNote; + + private InvoiceRecordRefundParams(InvoiceRecordRefundBuilder builder) { + + this.comment = builder.comment; + + this.customerNotes = builder.customerNotes; + + this.transaction = builder.transaction; + + this.creditNote = builder.creditNote; + } + + public String getComment() { + return comment; + } + + public String getCustomerNotes() { + return customerNotes; + } + + public TransactionParams getTransaction() { + return transaction; + } + + public CreditNoteParams getCreditNote() { + return creditNote; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.customerNotes != null) { + + formData.put("customer_notes", this.customerNotes); + } + + if (this.transaction != null) { + + // Single object + Map nestedData = this.transaction.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "transaction[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.creditNote != null) { + + // Single object + Map nestedData = this.creditNote.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "credit_note[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for InvoiceRecordRefundParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceRecordRefundBuilder builder() { + return new InvoiceRecordRefundBuilder(); + } + + public static final class InvoiceRecordRefundBuilder { + + private String comment; + + private String customerNotes; + + private TransactionParams transaction; + + private CreditNoteParams creditNote; + + private InvoiceRecordRefundBuilder() {} + + public InvoiceRecordRefundBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoiceRecordRefundBuilder customerNotes(String value) { + this.customerNotes = value; + return this; + } + + public InvoiceRecordRefundBuilder transaction(TransactionParams value) { + this.transaction = value; + return this; + } + + public InvoiceRecordRefundBuilder creditNote(CreditNoteParams value) { + this.creditNote = value; + return this; + } + + public InvoiceRecordRefundParams build() { + return new InvoiceRecordRefundParams(this); + } + } + + public static final class TransactionParams { + + private final Long amount; + + private final PaymentMethod paymentMethod; + + private final String referenceNumber; + + private final String customPaymentMethodId; + + private final Timestamp date; + + private TransactionParams(TransactionBuilder builder) { + + this.amount = builder.amount; + + this.paymentMethod = builder.paymentMethod; + + this.referenceNumber = builder.referenceNumber; + + this.customPaymentMethodId = builder.customPaymentMethodId; + + this.date = builder.date; + } + + public Long getAmount() { + return amount; + } + + public PaymentMethod getPaymentMethod() { + return paymentMethod; + } + + public String getReferenceNumber() { + return referenceNumber; + } + + public String getCustomPaymentMethodId() { + return customPaymentMethodId; + } + + public Timestamp getDate() { + return date; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.paymentMethod != null) { + + formData.put("payment_method", this.paymentMethod); + } + + if (this.referenceNumber != null) { + + formData.put("reference_number", this.referenceNumber); + } + + if (this.customPaymentMethodId != null) { + + formData.put("custom_payment_method_id", this.customPaymentMethodId); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + return formData; + } + + /** Create a new builder for TransactionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionBuilder builder() { + return new TransactionBuilder(); + } + + public static final class TransactionBuilder { + + private Long amount; + + private PaymentMethod paymentMethod; + + private String referenceNumber; + + private String customPaymentMethodId; + + private Timestamp date; + + private TransactionBuilder() {} + + public TransactionBuilder amount(Long value) { + this.amount = value; + return this; + } + + public TransactionBuilder paymentMethod(PaymentMethod value) { + this.paymentMethod = value; + return this; + } + + public TransactionBuilder referenceNumber(String value) { + this.referenceNumber = value; + return this; + } + + public TransactionBuilder customPaymentMethodId(String value) { + this.customPaymentMethodId = value; + return this; + } + + public TransactionBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public TransactionParams build() { + return new TransactionParams(this); + } + } + + public enum PaymentMethod { + CASH("cash"), + + CHECK("check"), + + CHARGEBACK("chargeback"), + + BANK_TRANSFER("bank_transfer"), + + OTHER("other"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + CUSTOM("custom"), + + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethod enumValue : PaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CreditNoteParams { + + private final ReasonCode reasonCode; + + private final String createReasonCode; + + private CreditNoteParams(CreditNoteBuilder builder) { + + this.reasonCode = builder.reasonCode; + + this.createReasonCode = builder.createReasonCode; + } + + public ReasonCode getReasonCode() { + return reasonCode; + } + + public String getCreateReasonCode() { + return createReasonCode; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.reasonCode != null) { + + formData.put("reason_code", this.reasonCode); + } + + if (this.createReasonCode != null) { + + formData.put("create_reason_code", this.createReasonCode); + } + + return formData; + } + + /** Create a new builder for CreditNoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNoteBuilder builder() { + return new CreditNoteBuilder(); + } + + public static final class CreditNoteBuilder { + + private ReasonCode reasonCode; + + private String createReasonCode; + + private CreditNoteBuilder() {} + + public CreditNoteBuilder reasonCode(ReasonCode value) { + this.reasonCode = value; + return this; + } + + public CreditNoteBuilder createReasonCode(String value) { + this.createReasonCode = value; + return this; + } + + public CreditNoteParams build() { + return new CreditNoteParams(this); + } + } + + public enum ReasonCode { + CHARGEBACK("chargeback"), + + PRODUCT_UNSATISFACTORY("product_unsatisfactory"), + + SERVICE_UNSATISFACTORY("service_unsatisfactory"), + + ORDER_CHANGE("order_change"), + + ORDER_CANCELLATION("order_cancellation"), + + WAIVER("waiver"), + + OTHER("other"), + + /** An enum member indicating that ReasonCode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ReasonCode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ReasonCode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ReasonCode enumValue : ReasonCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordTaxWithheldParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordTaxWithheldParams.java new file mode 100644 index 00000000..8442d77b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordTaxWithheldParams.java @@ -0,0 +1,174 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class InvoiceRecordTaxWithheldParams { + + private final TaxWithheldParams taxWithheld; + + private InvoiceRecordTaxWithheldParams(InvoiceRecordTaxWithheldBuilder builder) { + + this.taxWithheld = builder.taxWithheld; + } + + public TaxWithheldParams getTaxWithheld() { + return taxWithheld; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.taxWithheld != null) { + + // Single object + Map nestedData = this.taxWithheld.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "tax_withheld[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for InvoiceRecordTaxWithheldParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceRecordTaxWithheldBuilder builder() { + return new InvoiceRecordTaxWithheldBuilder(); + } + + public static final class InvoiceRecordTaxWithheldBuilder { + + private TaxWithheldParams taxWithheld; + + private InvoiceRecordTaxWithheldBuilder() {} + + public InvoiceRecordTaxWithheldBuilder taxWithheld(TaxWithheldParams value) { + this.taxWithheld = value; + return this; + } + + public InvoiceRecordTaxWithheldParams build() { + return new InvoiceRecordTaxWithheldParams(this); + } + } + + public static final class TaxWithheldParams { + + private final Long amount; + + private final String referenceNumber; + + private final Timestamp date; + + private final String description; + + private TaxWithheldParams(TaxWithheldBuilder builder) { + + this.amount = builder.amount; + + this.referenceNumber = builder.referenceNumber; + + this.date = builder.date; + + this.description = builder.description; + } + + public Long getAmount() { + return amount; + } + + public String getReferenceNumber() { + return referenceNumber; + } + + public Timestamp getDate() { + return date; + } + + public String getDescription() { + return description; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.referenceNumber != null) { + + formData.put("reference_number", this.referenceNumber); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + return formData; + } + + /** Create a new builder for TaxWithheldParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxWithheldBuilder builder() { + return new TaxWithheldBuilder(); + } + + public static final class TaxWithheldBuilder { + + private Long amount; + + private String referenceNumber; + + private Timestamp date; + + private String description; + + private TaxWithheldBuilder() {} + + public TaxWithheldBuilder amount(Long value) { + this.amount = value; + return this; + } + + public TaxWithheldBuilder referenceNumber(String value) { + this.referenceNumber = value; + return this; + } + + public TaxWithheldBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public TaxWithheldBuilder description(String value) { + this.description = value; + return this; + } + + public TaxWithheldParams build() { + return new TaxWithheldParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRefundParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRefundParams.java new file mode 100644 index 00000000..1b0e90a3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRefundParams.java @@ -0,0 +1,229 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InvoiceRefundParams { + + private final Long refundAmount; + + private final String comment; + + private final String customerNotes; + + private final CreditNoteParams creditNote; + + private InvoiceRefundParams(InvoiceRefundBuilder builder) { + + this.refundAmount = builder.refundAmount; + + this.comment = builder.comment; + + this.customerNotes = builder.customerNotes; + + this.creditNote = builder.creditNote; + } + + public Long getRefundAmount() { + return refundAmount; + } + + public String getComment() { + return comment; + } + + public String getCustomerNotes() { + return customerNotes; + } + + public CreditNoteParams getCreditNote() { + return creditNote; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.refundAmount != null) { + + formData.put("refund_amount", this.refundAmount); + } + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.customerNotes != null) { + + formData.put("customer_notes", this.customerNotes); + } + + if (this.creditNote != null) { + + // Single object + Map nestedData = this.creditNote.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "credit_note[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for InvoiceRefundParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceRefundBuilder builder() { + return new InvoiceRefundBuilder(); + } + + public static final class InvoiceRefundBuilder { + + private Long refundAmount; + + private String comment; + + private String customerNotes; + + private CreditNoteParams creditNote; + + private InvoiceRefundBuilder() {} + + public InvoiceRefundBuilder refundAmount(Long value) { + this.refundAmount = value; + return this; + } + + public InvoiceRefundBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoiceRefundBuilder customerNotes(String value) { + this.customerNotes = value; + return this; + } + + public InvoiceRefundBuilder creditNote(CreditNoteParams value) { + this.creditNote = value; + return this; + } + + public InvoiceRefundParams build() { + return new InvoiceRefundParams(this); + } + } + + public static final class CreditNoteParams { + + private final ReasonCode reasonCode; + + private final String createReasonCode; + + private CreditNoteParams(CreditNoteBuilder builder) { + + this.reasonCode = builder.reasonCode; + + this.createReasonCode = builder.createReasonCode; + } + + public ReasonCode getReasonCode() { + return reasonCode; + } + + public String getCreateReasonCode() { + return createReasonCode; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.reasonCode != null) { + + formData.put("reason_code", this.reasonCode); + } + + if (this.createReasonCode != null) { + + formData.put("create_reason_code", this.createReasonCode); + } + + return formData; + } + + /** Create a new builder for CreditNoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNoteBuilder builder() { + return new CreditNoteBuilder(); + } + + public static final class CreditNoteBuilder { + + private ReasonCode reasonCode; + + private String createReasonCode; + + private CreditNoteBuilder() {} + + public CreditNoteBuilder reasonCode(ReasonCode value) { + this.reasonCode = value; + return this; + } + + public CreditNoteBuilder createReasonCode(String value) { + this.createReasonCode = value; + return this; + } + + public CreditNoteParams build() { + return new CreditNoteParams(this); + } + } + + public enum ReasonCode { + PRODUCT_UNSATISFACTORY("product_unsatisfactory"), + + SERVICE_UNSATISFACTORY("service_unsatisfactory"), + + ORDER_CHANGE("order_change"), + + ORDER_CANCELLATION("order_cancellation"), + + WAIVER("waiver"), + + OTHER("other"), + + /** An enum member indicating that ReasonCode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ReasonCode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ReasonCode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ReasonCode enumValue : ReasonCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRemoveCreditNoteParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRemoveCreditNoteParams.java new file mode 100644 index 00000000..38bb283c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRemoveCreditNoteParams.java @@ -0,0 +1,113 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InvoiceRemoveCreditNoteParams { + + private final CreditNoteParams creditNote; + + private InvoiceRemoveCreditNoteParams(InvoiceRemoveCreditNoteBuilder builder) { + + this.creditNote = builder.creditNote; + } + + public CreditNoteParams getCreditNote() { + return creditNote; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.creditNote != null) { + + // Single object + Map nestedData = this.creditNote.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "credit_note[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for InvoiceRemoveCreditNoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceRemoveCreditNoteBuilder builder() { + return new InvoiceRemoveCreditNoteBuilder(); + } + + public static final class InvoiceRemoveCreditNoteBuilder { + + private CreditNoteParams creditNote; + + private InvoiceRemoveCreditNoteBuilder() {} + + public InvoiceRemoveCreditNoteBuilder creditNote(CreditNoteParams value) { + this.creditNote = value; + return this; + } + + public InvoiceRemoveCreditNoteParams build() { + return new InvoiceRemoveCreditNoteParams(this); + } + } + + public static final class CreditNoteParams { + + private final String id; + + private CreditNoteParams(CreditNoteBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for CreditNoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNoteBuilder builder() { + return new CreditNoteBuilder(); + } + + public static final class CreditNoteBuilder { + + private String id; + + private CreditNoteBuilder() {} + + public CreditNoteBuilder id(String value) { + this.id = value; + return this; + } + + public CreditNoteParams build() { + return new CreditNoteParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRemovePaymentParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRemovePaymentParams.java new file mode 100644 index 00000000..cd2c257f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRemovePaymentParams.java @@ -0,0 +1,113 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InvoiceRemovePaymentParams { + + private final TransactionParams transaction; + + private InvoiceRemovePaymentParams(InvoiceRemovePaymentBuilder builder) { + + this.transaction = builder.transaction; + } + + public TransactionParams getTransaction() { + return transaction; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.transaction != null) { + + // Single object + Map nestedData = this.transaction.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "transaction[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for InvoiceRemovePaymentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceRemovePaymentBuilder builder() { + return new InvoiceRemovePaymentBuilder(); + } + + public static final class InvoiceRemovePaymentBuilder { + + private TransactionParams transaction; + + private InvoiceRemovePaymentBuilder() {} + + public InvoiceRemovePaymentBuilder transaction(TransactionParams value) { + this.transaction = value; + return this; + } + + public InvoiceRemovePaymentParams build() { + return new InvoiceRemovePaymentParams(this); + } + } + + public static final class TransactionParams { + + private final String id; + + private TransactionParams(TransactionBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for TransactionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionBuilder builder() { + return new TransactionBuilder(); + } + + public static final class TransactionBuilder { + + private String id; + + private TransactionBuilder() {} + + public TransactionBuilder id(String value) { + this.id = value; + return this; + } + + public TransactionParams build() { + return new TransactionParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRemoveTaxWithheldParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRemoveTaxWithheldParams.java new file mode 100644 index 00000000..e02606a0 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRemoveTaxWithheldParams.java @@ -0,0 +1,113 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InvoiceRemoveTaxWithheldParams { + + private final TaxWithheldParams taxWithheld; + + private InvoiceRemoveTaxWithheldParams(InvoiceRemoveTaxWithheldBuilder builder) { + + this.taxWithheld = builder.taxWithheld; + } + + public TaxWithheldParams getTaxWithheld() { + return taxWithheld; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.taxWithheld != null) { + + // Single object + Map nestedData = this.taxWithheld.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "tax_withheld[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for InvoiceRemoveTaxWithheldParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceRemoveTaxWithheldBuilder builder() { + return new InvoiceRemoveTaxWithheldBuilder(); + } + + public static final class InvoiceRemoveTaxWithheldBuilder { + + private TaxWithheldParams taxWithheld; + + private InvoiceRemoveTaxWithheldBuilder() {} + + public InvoiceRemoveTaxWithheldBuilder taxWithheld(TaxWithheldParams value) { + this.taxWithheld = value; + return this; + } + + public InvoiceRemoveTaxWithheldParams build() { + return new InvoiceRemoveTaxWithheldParams(this); + } + } + + public static final class TaxWithheldParams { + + private final String id; + + private TaxWithheldParams(TaxWithheldBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for TaxWithheldParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxWithheldBuilder builder() { + return new TaxWithheldBuilder(); + } + + public static final class TaxWithheldBuilder { + + private String id; + + private TaxWithheldBuilder() {} + + public TaxWithheldBuilder id(String value) { + this.id = value; + return this; + } + + public TaxWithheldParams build() { + return new TaxWithheldParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceResumeDunningParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceResumeDunningParams.java similarity index 75% rename from src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceResumeDunningParams.java rename to src/main/java/com/chargebee/v4/models/invoice/params/InvoiceResumeDunningParams.java index 2aa1a19d..70f24cb9 100644 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceResumeDunningParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceResumeDunningParams.java @@ -4,24 +4,35 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.invoice.params; +package com.chargebee.v4.models.invoice.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class InvoiceResumeDunningParams { - private final Map formData; + private final String comment; private InvoiceResumeDunningParams(InvoiceResumeDunningBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); + + this.comment = builder.comment; + } + + public String getComment() { + return comment; } /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + return formData; } @@ -32,14 +43,13 @@ public static InvoiceResumeDunningBuilder builder() { } public static final class InvoiceResumeDunningBuilder { - private final Map formData = new LinkedHashMap<>(); + + private String comment; private InvoiceResumeDunningBuilder() {} public InvoiceResumeDunningBuilder comment(String value) { - - formData.put("comment", value); - + this.comment = value; return this; } diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRetrieveParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRetrieveParams.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRetrieveParams.java index e34bd481..698be53a 100644 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.invoice.params; +package com.chargebee.v4.models.invoice.params; import com.chargebee.v4.internal.Recommended; @@ -43,6 +43,16 @@ public static final class InvoiceRetrieveBuilder { private InvoiceRetrieveBuilder() {} + public InvoiceRetrieveBuilder lineItemsLimit(Integer value) { + queryParams.put("line_items_limit", value); + return this; + } + + public InvoiceRetrieveBuilder lineItemsOffset(String value) { + queryParams.put("line_items_offset", value); + return this; + } + @Deprecated public InvoiceRetrieveBuilder lineItem(LineItemParams value) { queryParams.put("line_item", value); diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceStopDunningParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceStopDunningParams.java new file mode 100644 index 00000000..4476eed6 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceStopDunningParams.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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InvoiceStopDunningParams { + + private final String comment; + + private InvoiceStopDunningParams(InvoiceStopDunningBuilder builder) { + + this.comment = builder.comment; + } + + public String getComment() { + return comment; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + return formData; + } + + /** Create a new builder for InvoiceStopDunningParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceStopDunningBuilder builder() { + return new InvoiceStopDunningBuilder(); + } + + public static final class InvoiceStopDunningBuilder { + + private String comment; + + private InvoiceStopDunningBuilder() {} + + public InvoiceStopDunningBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoiceStopDunningParams build() { + return new InvoiceStopDunningParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceSyncUsagesParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceSyncUsagesParams.java similarity index 77% rename from src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceSyncUsagesParams.java rename to src/main/java/com/chargebee/v4/models/invoice/params/InvoiceSyncUsagesParams.java index f8f0d3f2..021fca06 100644 --- a/src/main/java/com/chargebee/v4/core/models/invoice/params/InvoiceSyncUsagesParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceSyncUsagesParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.invoice.params; +package com.chargebee.v4.models.invoice.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class InvoiceSyncUsagesParams { - private final Map formData; - - private InvoiceSyncUsagesParams(InvoiceSyncUsagesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private InvoiceSyncUsagesParams(InvoiceSyncUsagesBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static InvoiceSyncUsagesBuilder builder() { } public static final class InvoiceSyncUsagesBuilder { - private final Map formData = new LinkedHashMap<>(); private InvoiceSyncUsagesBuilder() {} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceUpdateDetailsParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceUpdateDetailsParams.java new file mode 100644 index 00000000..e5ee0b0e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceUpdateDetailsParams.java @@ -0,0 +1,975 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InvoiceUpdateDetailsParams { + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final String poNumber; + + private final String comment; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final StatementDescriptorParams statementDescriptor; + + private final Map customFields; + + private InvoiceUpdateDetailsParams(InvoiceUpdateDetailsBuilder builder) { + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.poNumber = builder.poNumber; + + this.comment = builder.comment; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.statementDescriptor = builder.statementDescriptor; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public String getPoNumber() { + return poNumber; + } + + public String getComment() { + return comment; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public StatementDescriptorParams getStatementDescriptor() { + return statementDescriptor; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.statementDescriptor != null) { + + // Single object + Map nestedData = this.statementDescriptor.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for InvoiceUpdateDetailsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceUpdateDetailsBuilder builder() { + return new InvoiceUpdateDetailsBuilder(); + } + + public static final class InvoiceUpdateDetailsBuilder { + + private String vatNumber; + + private String vatNumberPrefix; + + private String poNumber; + + private String comment; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private StatementDescriptorParams statementDescriptor; + + private Map customFields = new LinkedHashMap<>(); + + private InvoiceUpdateDetailsBuilder() {} + + public InvoiceUpdateDetailsBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public InvoiceUpdateDetailsBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public InvoiceUpdateDetailsBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public InvoiceUpdateDetailsBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoiceUpdateDetailsBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public InvoiceUpdateDetailsBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public InvoiceUpdateDetailsBuilder statementDescriptor(StatementDescriptorParams value) { + this.statementDescriptor = 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 InvoiceUpdateDetailsBuilder 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 InvoiceUpdateDetailsBuilder 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 InvoiceUpdateDetailsParams build() { + return new InvoiceUpdateDetailsParams(this); + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class StatementDescriptorParams { + + private final String descriptor; + + private StatementDescriptorParams(StatementDescriptorBuilder builder) { + + this.descriptor = builder.descriptor; + } + + public String getDescriptor() { + return descriptor; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.descriptor != null) { + + formData.put("descriptor", this.descriptor); + } + + return formData; + } + + /** Create a new builder for StatementDescriptorParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatementDescriptorBuilder builder() { + return new StatementDescriptorBuilder(); + } + + public static final class StatementDescriptorBuilder { + + private String descriptor; + + private StatementDescriptorBuilder() {} + + public StatementDescriptorBuilder descriptor(String value) { + this.descriptor = value; + return this; + } + + public StatementDescriptorParams build() { + return new StatementDescriptorParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceWriteOffParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceWriteOffParams.java new file mode 100644 index 00000000..caaba092 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceWriteOffParams.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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InvoiceWriteOffParams { + + private final String comment; + + private InvoiceWriteOffParams(InvoiceWriteOffBuilder builder) { + + this.comment = builder.comment; + } + + public String getComment() { + return comment; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + return formData; + } + + /** Create a new builder for InvoiceWriteOffParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceWriteOffBuilder builder() { + return new InvoiceWriteOffBuilder(); + } + + public static final class InvoiceWriteOffBuilder { + + private String comment; + + private InvoiceWriteOffBuilder() {} + + public InvoiceWriteOffBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoiceWriteOffParams build() { + return new InvoiceWriteOffParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoicesForCustomerParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoicesForCustomerParams.java new file mode 100644 index 00000000..12d1908a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoicesForCustomerParams.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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InvoicesForCustomerParams { + + private final Map queryParams; + + private InvoicesForCustomerParams(InvoicesForCustomerBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public InvoicesForCustomerBuilder toBuilder() { + InvoicesForCustomerBuilder builder = new InvoicesForCustomerBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for InvoicesForCustomerParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoicesForCustomerBuilder builder() { + return new InvoicesForCustomerBuilder(); + } + + public static final class InvoicesForCustomerBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private InvoicesForCustomerBuilder() {} + + public InvoicesForCustomerBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public InvoicesForCustomerBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public InvoicesForCustomerParams build() { + return new InvoicesForCustomerParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoicesForSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoicesForSubscriptionParams.java new file mode 100644 index 00000000..30e0f744 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoicesForSubscriptionParams.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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InvoicesForSubscriptionParams { + + private final Map queryParams; + + private InvoicesForSubscriptionParams(InvoicesForSubscriptionBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public InvoicesForSubscriptionBuilder toBuilder() { + InvoicesForSubscriptionBuilder builder = new InvoicesForSubscriptionBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for InvoicesForSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoicesForSubscriptionBuilder builder() { + return new InvoicesForSubscriptionBuilder(); + } + + public static final class InvoicesForSubscriptionBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private InvoicesForSubscriptionBuilder() {} + + public InvoicesForSubscriptionBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public InvoicesForSubscriptionBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public InvoicesForSubscriptionParams build() { + return new InvoicesForSubscriptionParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/ResendEinvoiceParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/ResendEinvoiceParams.java new file mode 100644 index 00000000..06a68200 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/ResendEinvoiceParams.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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ResendEinvoiceParams { + + private ResendEinvoiceParams(ResendEinvoiceBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for ResendEinvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ResendEinvoiceBuilder builder() { + return new ResendEinvoiceBuilder(); + } + + public static final class ResendEinvoiceBuilder { + + private ResendEinvoiceBuilder() {} + + public ResendEinvoiceParams build() { + return new ResendEinvoiceParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/SendEinvoiceParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/SendEinvoiceParams.java new file mode 100644 index 00000000..91b74384 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/SendEinvoiceParams.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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class SendEinvoiceParams { + + private SendEinvoiceParams(SendEinvoiceBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for SendEinvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SendEinvoiceBuilder builder() { + return new SendEinvoiceBuilder(); + } + + public static final class SendEinvoiceBuilder { + + private SendEinvoiceBuilder() {} + + public SendEinvoiceParams build() { + return new SendEinvoiceParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/VoidInvoiceParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/VoidInvoiceParams.java new file mode 100644 index 00000000..d6d56462 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/VoidInvoiceParams.java @@ -0,0 +1,80 @@ +/* + * 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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class VoidInvoiceParams { + + private final String comment; + + private final String voidReasonCode; + + private VoidInvoiceParams(VoidInvoiceBuilder builder) { + + this.comment = builder.comment; + + this.voidReasonCode = builder.voidReasonCode; + } + + public String getComment() { + return comment; + } + + public String getVoidReasonCode() { + return voidReasonCode; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.voidReasonCode != null) { + + formData.put("void_reason_code", this.voidReasonCode); + } + + return formData; + } + + /** Create a new builder for VoidInvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static VoidInvoiceBuilder builder() { + return new VoidInvoiceBuilder(); + } + + public static final class VoidInvoiceBuilder { + + private String comment; + + private String voidReasonCode; + + private VoidInvoiceBuilder() {} + + public VoidInvoiceBuilder comment(String value) { + this.comment = value; + return this; + } + + public VoidInvoiceBuilder voidReasonCode(String value) { + this.voidReasonCode = value; + return this; + } + + public VoidInvoiceParams build() { + return new VoidInvoiceParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/responses/DownloadEinvoiceResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/DownloadEinvoiceResponse.java new file mode 100644 index 00000000..acc145c8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/DownloadEinvoiceResponse.java @@ -0,0 +1,81 @@ +package com.chargebee.v4.models.invoice.responses; + +import com.chargebee.v4.models.download.Download; + +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 DownloadEinvoice operation. Contains the response data from a + * single resource get operation. + */ +public final class DownloadEinvoiceResponse extends BaseResponse { + private final List downloads; + + private DownloadEinvoiceResponse(Builder builder) { + super(builder.httpResponse); + + this.downloads = builder.downloads; + } + + /** Parse JSON response into DownloadEinvoiceResponse object. */ + public static DownloadEinvoiceResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into DownloadEinvoiceResponse object with HTTP response. */ + public static DownloadEinvoiceResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __downloadsJson = JsonUtil.getArray(json, "downloads"); + if (__downloadsJson != null) { + builder.downloads( + JsonUtil.parseObjectArray(__downloadsJson).stream() + .map(Download::fromJson) + .collect(java.util.stream.Collectors.toList())); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse DownloadEinvoiceResponse from JSON", e); + } + } + + /** Create a new builder for DownloadEinvoiceResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for DownloadEinvoiceResponse. */ + public static class Builder { + + private List downloads; + + private Response httpResponse; + + private Builder() {} + + public Builder downloads(List downloads) { + this.downloads = downloads; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public DownloadEinvoiceResponse build() { + return new DownloadEinvoiceResponse(this); + } + } + + /** Get the downloads from the response. */ + public List getDownloads() { + return downloads; + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/responses/ImportInvoiceResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/ImportInvoiceResponse.java new file mode 100644 index 00000000..a3d85984 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/ImportInvoiceResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.invoice.responses; + +import com.chargebee.v4.models.invoice.Invoice; + +import com.chargebee.v4.models.creditNote.CreditNote; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ImportInvoice operation. Contains the response data from the API. + */ +public final class ImportInvoiceResponse extends BaseResponse { + private final Invoice invoice; + + private final CreditNote creditNote; + + private ImportInvoiceResponse(Builder builder) { + super(builder.httpResponse); + + this.invoice = builder.invoice; + + this.creditNote = builder.creditNote; + } + + /** Parse JSON response into ImportInvoiceResponse object. */ + public static ImportInvoiceResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ImportInvoiceResponse object with HTTP response. */ + public static ImportInvoiceResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __invoiceJson = JsonUtil.getObject(json, "invoice"); + if (__invoiceJson != null) { + builder.invoice(Invoice.fromJson(__invoiceJson)); + } + + String __creditNoteJson = JsonUtil.getObject(json, "credit_note"); + if (__creditNoteJson != null) { + builder.creditNote(CreditNote.fromJson(__creditNoteJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ImportInvoiceResponse from JSON", e); + } + } + + /** Create a new builder for ImportInvoiceResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ImportInvoiceResponse. */ + public static class Builder { + + private Invoice invoice; + + private CreditNote creditNote; + + private Response httpResponse; + + private Builder() {} + + public Builder invoice(Invoice invoice) { + this.invoice = invoice; + return this; + } + + public Builder creditNote(CreditNote creditNote) { + this.creditNote = creditNote; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ImportInvoiceResponse build() { + return new ImportInvoiceResponse(this); + } + } + + /** Get the invoice from the response. */ + public Invoice getInvoice() { + return invoice; + } + + /** Get the creditNote from the response. */ + public CreditNote getCreditNote() { + return creditNote; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceAddAddonChargeResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceAddAddonChargeResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceAddAddonChargeResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceAddAddonChargeResponse.java index 52f05229..e512c968 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceAddAddonChargeResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceAddAddonChargeResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceAddChargeItemResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceAddChargeItemResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceAddChargeItemResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceAddChargeItemResponse.java index d41591af..cdee9f9b 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceAddChargeItemResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceAddChargeItemResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceAddChargeResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceAddChargeResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceAddChargeResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceAddChargeResponse.java index cc4b9bd5..ef11a95a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceAddChargeResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceAddChargeResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceApplyCreditsResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceApplyCreditsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceApplyCreditsResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceApplyCreditsResponse.java index a550e2ce..5eab90c5 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceApplyCreditsResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceApplyCreditsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceApplyPaymentScheduleSchemeResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceApplyPaymentScheduleSchemeResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceApplyPaymentScheduleSchemeResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceApplyPaymentScheduleSchemeResponse.java index a7b944ee..b1dcfcd3 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceApplyPaymentScheduleSchemeResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceApplyPaymentScheduleSchemeResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceApplyPaymentsResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceApplyPaymentsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceApplyPaymentsResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceApplyPaymentsResponse.java index 02262968..010d8125 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceApplyPaymentsResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceApplyPaymentsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceChargeAddonResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceChargeAddonResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceChargeAddonResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceChargeAddonResponse.java index c02a032f..7cae179a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceChargeAddonResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceChargeAddonResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceChargeResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceChargeResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceChargeResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceChargeResponse.java index bd472072..3e6d55d1 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceChargeResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceChargeResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceCloseResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceCloseResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceCloseResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceCloseResponse.java index bebed6c7..f6ccbbda 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceCloseResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceCloseResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceCollectPaymentResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceCollectPaymentResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceCollectPaymentResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceCollectPaymentResponse.java index acdfe45c..114d6c9a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceCollectPaymentResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceCollectPaymentResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceCreateForChargeItemResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceCreateForChargeItemResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceCreateForChargeItemResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceCreateForChargeItemResponse.java index d0f5eccf..ea5a2628 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceCreateForChargeItemResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceCreateForChargeItemResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceCreateForChargeItemsAndChargesResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceCreateForChargeItemsAndChargesResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceCreateForChargeItemsAndChargesResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceCreateForChargeItemsAndChargesResponse.java index 5e61034a..7aab9f08 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceCreateForChargeItemsAndChargesResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceCreateForChargeItemsAndChargesResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceCreateResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceCreateResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceCreateResponse.java index ffb5b366..b50bd67f 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceDeleteImportedResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceDeleteImportedResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceDeleteImportedResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceDeleteImportedResponse.java index 978e8e1a..aafd8ad2 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceDeleteImportedResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceDeleteImportedResponse.java @@ -1,12 +1,12 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; import java.util.List; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceDeleteLineItemsResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceDeleteLineItemsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceDeleteLineItemsResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceDeleteLineItemsResponse.java index 6780659e..2e5baeb0 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceDeleteLineItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceDeleteLineItemsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceDeleteResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceDeleteResponse.java index 10c18a6e..2c519836 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceListPaymentReferenceNumbersResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceListPaymentReferenceNumbersResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceListPaymentReferenceNumbersResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceListPaymentReferenceNumbersResponse.java index f88ec67d..13ca552e 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceListPaymentReferenceNumbersResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceListPaymentReferenceNumbersResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; import java.util.List; -import com.chargebee.v4.core.models.paymentReferenceNumber.PaymentReferenceNumber; +import com.chargebee.v4.models.paymentReferenceNumber.PaymentReferenceNumber; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.InvoiceService; -import com.chargebee.v4.core.models.invoice.params.InvoiceListPaymentReferenceNumbersParams; +import com.chargebee.v4.services.InvoiceService; +import com.chargebee.v4.models.invoice.params.InvoiceListPaymentReferenceNumbersParams; /** * Immutable response object for InvoiceListPaymentReferenceNumbers operation. Contains paginated @@ -104,9 +105,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 InvoiceListPaymentReferenceNumbersResponse nextPage() throws Exception { + public InvoiceListPaymentReferenceNumbersResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceListResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceListResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceListResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceListResponse.java index 937c1324..c120ae37 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceListResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; import java.util.List; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.InvoiceService; -import com.chargebee.v4.core.models.invoice.params.InvoiceListParams; +import com.chargebee.v4.services.InvoiceService; +import com.chargebee.v4.models.invoice.params.InvoiceListParams; /** Immutable response object for InvoiceList operation. Contains paginated list data. */ public final class InvoiceListResponse { @@ -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 InvoiceListResponse nextPage() throws Exception { + public InvoiceListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoicePauseDunningResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoicePauseDunningResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoicePauseDunningResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoicePauseDunningResponse.java index fa06b335..5b25d7cc 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoicePauseDunningResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoicePauseDunningResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/invoice/responses/InvoicePaymentSchedulesResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoicePaymentSchedulesResponse.java new file mode 100644 index 00000000..c71a76da --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoicePaymentSchedulesResponse.java @@ -0,0 +1,81 @@ +package com.chargebee.v4.models.invoice.responses; + +import com.chargebee.v4.models.paymentSchedule.PaymentSchedule; + +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 InvoicePaymentSchedules operation. Contains the response data from + * a single resource get operation. + */ +public final class InvoicePaymentSchedulesResponse extends BaseResponse { + private final List paymentSchedules; + + private InvoicePaymentSchedulesResponse(Builder builder) { + super(builder.httpResponse); + + this.paymentSchedules = builder.paymentSchedules; + } + + /** Parse JSON response into InvoicePaymentSchedulesResponse object. */ + public static InvoicePaymentSchedulesResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into InvoicePaymentSchedulesResponse object with HTTP response. */ + public static InvoicePaymentSchedulesResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __paymentSchedulesJson = JsonUtil.getArray(json, "payment_schedules"); + if (__paymentSchedulesJson != null) { + builder.paymentSchedules( + JsonUtil.parseObjectArray(__paymentSchedulesJson).stream() + .map(PaymentSchedule::fromJson) + .collect(java.util.stream.Collectors.toList())); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse InvoicePaymentSchedulesResponse from JSON", e); + } + } + + /** Create a new builder for InvoicePaymentSchedulesResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for InvoicePaymentSchedulesResponse. */ + public static class Builder { + + private List paymentSchedules; + + private Response httpResponse; + + private Builder() {} + + public Builder paymentSchedules(List paymentSchedules) { + this.paymentSchedules = paymentSchedules; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public InvoicePaymentSchedulesResponse build() { + return new InvoicePaymentSchedulesResponse(this); + } + } + + /** Get the paymentSchedules from the response. */ + public List getPaymentSchedules() { + return paymentSchedules; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoicePdfResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoicePdfResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoicePdfResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoicePdfResponse.java index db22961c..5deded68 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoicePdfResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoicePdfResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.download.Download; +import com.chargebee.v4.models.download.Download; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRecordPaymentResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRecordPaymentResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRecordPaymentResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRecordPaymentResponse.java index 30d36268..a6560612 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRecordPaymentResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRecordPaymentResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRecordRefundResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRecordRefundResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRecordRefundResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRecordRefundResponse.java index 02c13bac..6d399e10 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRecordRefundResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRecordRefundResponse.java @@ -1,12 +1,12 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRecordTaxWithheldResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRecordTaxWithheldResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRecordTaxWithheldResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRecordTaxWithheldResponse.java index 2b12ba8c..361434d0 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRecordTaxWithheldResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRecordTaxWithheldResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRefundResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRefundResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRefundResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRefundResponse.java index 7c6b089f..900c4327 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRefundResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRefundResponse.java @@ -1,12 +1,12 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRemoveCreditNoteResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRemoveCreditNoteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRemoveCreditNoteResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRemoveCreditNoteResponse.java index 3ff37c3d..fd5e6072 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRemoveCreditNoteResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRemoveCreditNoteResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRemovePaymentResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRemovePaymentResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRemovePaymentResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRemovePaymentResponse.java index 37c3b53d..8a6c796f 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRemovePaymentResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRemovePaymentResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRemoveTaxWithheldResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRemoveTaxWithheldResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRemoveTaxWithheldResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRemoveTaxWithheldResponse.java index 82a695f4..f8a79a9c 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceRemoveTaxWithheldResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRemoveTaxWithheldResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceResumeDunningResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceResumeDunningResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceResumeDunningResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceResumeDunningResponse.java index f77ca850..47038645 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceResumeDunningResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceResumeDunningResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRetrieveResponse.java new file mode 100644 index 00000000..fe17fd4b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.invoice.responses; + +import com.chargebee.v4.models.invoice.Invoice; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for InvoiceRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class InvoiceRetrieveResponse extends BaseResponse { + private final Invoice invoice; + + private InvoiceRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.invoice = builder.invoice; + } + + /** Parse JSON response into InvoiceRetrieveResponse object. */ + public static InvoiceRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into InvoiceRetrieveResponse object with HTTP response. */ + public static InvoiceRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __invoiceJson = JsonUtil.getObject(json, "invoice"); + if (__invoiceJson != null) { + builder.invoice(Invoice.fromJson(__invoiceJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse InvoiceRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for InvoiceRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for InvoiceRetrieveResponse. */ + public static class Builder { + + private Invoice invoice; + + private Response httpResponse; + + private Builder() {} + + public Builder invoice(Invoice invoice) { + this.invoice = invoice; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public InvoiceRetrieveResponse build() { + return new InvoiceRetrieveResponse(this); + } + } + + /** Get the invoice from the response. */ + public Invoice getInvoice() { + return invoice; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceStopDunningResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceStopDunningResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceStopDunningResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceStopDunningResponse.java index ac7ad963..6d601424 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceStopDunningResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceStopDunningResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceSyncUsagesResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceSyncUsagesResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceSyncUsagesResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceSyncUsagesResponse.java index 86f07f14..8b6e02f3 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceSyncUsagesResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceSyncUsagesResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceUpdateDetailsResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceUpdateDetailsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceUpdateDetailsResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceUpdateDetailsResponse.java index ae72d0bd..2ff71b0a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceUpdateDetailsResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceUpdateDetailsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceWriteOffResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceWriteOffResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceWriteOffResponse.java rename to src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceWriteOffResponse.java index 674ce84d..e5fa9cd6 100644 --- a/src/main/java/com/chargebee/v4/core/responses/invoice/InvoiceWriteOffResponse.java +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceWriteOffResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.invoice; +package com.chargebee.v4.models.invoice.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/invoice/responses/InvoicesForCustomerResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoicesForCustomerResponse.java new file mode 100644 index 00000000..27e7aaef --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoicesForCustomerResponse.java @@ -0,0 +1,172 @@ +package com.chargebee.v4.models.invoice.responses; + +import java.util.List; + +import com.chargebee.v4.models.invoice.Invoice; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.InvoiceService; +import com.chargebee.v4.models.invoice.params.InvoicesForCustomerParams; + +/** Immutable response object for InvoicesForCustomer operation. Contains paginated list data. */ +public final class InvoicesForCustomerResponse { + + private final List list; + + private final String nextOffset; + + private final String customerId; + + private final InvoiceService service; + private final InvoicesForCustomerParams originalParams; + private final Response httpResponse; + + private InvoicesForCustomerResponse( + List list, + String nextOffset, + String customerId, + InvoiceService service, + InvoicesForCustomerParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.customerId = customerId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into InvoicesForCustomerResponse object (no service context). Use this when + * you only need to read a single page (no nextPage()). + */ + public static InvoicesForCustomerResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(InvoiceInvoicesForCustomerItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new InvoicesForCustomerResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse InvoicesForCustomerResponse from JSON", e); + } + } + + /** + * Parse JSON response into InvoicesForCustomerResponse object with service context for pagination + * (enables nextPage()). + */ + public static InvoicesForCustomerResponse fromJson( + String json, + InvoiceService service, + InvoicesForCustomerParams originalParams, + String customerId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(InvoiceInvoicesForCustomerItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new InvoicesForCustomerResponse( + list, nextOffset, customerId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse InvoicesForCustomerResponse 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 InvoicesForCustomerResponse 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)."); + } + + InvoicesForCustomerParams nextParams = + (originalParams != null ? originalParams.toBuilder() : InvoicesForCustomerParams.builder()) + .offset(nextOffset) + .build(); + + return service.invoicesForCustomer(customerId, 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 InvoiceInvoicesForCustomerItem { + + private Invoice invoice; + + public Invoice getInvoice() { + return invoice; + } + + public static InvoiceInvoicesForCustomerItem fromJson(String json) { + InvoiceInvoicesForCustomerItem item = new InvoiceInvoicesForCustomerItem(); + + String __invoiceJson = JsonUtil.getObject(json, "invoice"); + if (__invoiceJson != null) { + item.invoice = Invoice.fromJson(__invoiceJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/responses/InvoicesForSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoicesForSubscriptionResponse.java new file mode 100644 index 00000000..65a04cd3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoicesForSubscriptionResponse.java @@ -0,0 +1,176 @@ +package com.chargebee.v4.models.invoice.responses; + +import java.util.List; + +import com.chargebee.v4.models.invoice.Invoice; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.InvoiceService; +import com.chargebee.v4.models.invoice.params.InvoicesForSubscriptionParams; + +/** + * Immutable response object for InvoicesForSubscription operation. Contains paginated list data. + */ +public final class InvoicesForSubscriptionResponse { + + private final List list; + + private final String nextOffset; + + private final String subscriptionId; + + private final InvoiceService service; + private final InvoicesForSubscriptionParams originalParams; + private final Response httpResponse; + + private InvoicesForSubscriptionResponse( + List list, + String nextOffset, + String subscriptionId, + InvoiceService service, + InvoicesForSubscriptionParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.subscriptionId = subscriptionId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into InvoicesForSubscriptionResponse object (no service context). Use this + * when you only need to read a single page (no nextPage()). + */ + public static InvoicesForSubscriptionResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(InvoiceInvoicesForSubscriptionItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new InvoicesForSubscriptionResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse InvoicesForSubscriptionResponse from JSON", e); + } + } + + /** + * Parse JSON response into InvoicesForSubscriptionResponse object with service context for + * pagination (enables nextPage()). + */ + public static InvoicesForSubscriptionResponse fromJson( + String json, + InvoiceService service, + InvoicesForSubscriptionParams originalParams, + String subscriptionId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(InvoiceInvoicesForSubscriptionItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new InvoicesForSubscriptionResponse( + list, nextOffset, subscriptionId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse InvoicesForSubscriptionResponse 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 InvoicesForSubscriptionResponse 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)."); + } + + InvoicesForSubscriptionParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : InvoicesForSubscriptionParams.builder()) + .offset(nextOffset) + .build(); + + return service.invoicesForSubscription(subscriptionId, 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 InvoiceInvoicesForSubscriptionItem { + + private Invoice invoice; + + public Invoice getInvoice() { + return invoice; + } + + public static InvoiceInvoicesForSubscriptionItem fromJson(String json) { + InvoiceInvoicesForSubscriptionItem item = new InvoiceInvoicesForSubscriptionItem(); + + String __invoiceJson = JsonUtil.getObject(json, "invoice"); + if (__invoiceJson != null) { + item.invoice = Invoice.fromJson(__invoiceJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/responses/ResendEinvoiceResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/ResendEinvoiceResponse.java new file mode 100644 index 00000000..289919e0 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/ResendEinvoiceResponse.java @@ -0,0 +1,76 @@ +package com.chargebee.v4.models.invoice.responses; + +import com.chargebee.v4.models.invoice.Invoice; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ResendEinvoice operation. Contains the response data from the API. + */ +public final class ResendEinvoiceResponse extends BaseResponse { + private final Invoice invoice; + + private ResendEinvoiceResponse(Builder builder) { + super(builder.httpResponse); + + this.invoice = builder.invoice; + } + + /** Parse JSON response into ResendEinvoiceResponse object. */ + public static ResendEinvoiceResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ResendEinvoiceResponse object with HTTP response. */ + public static ResendEinvoiceResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __invoiceJson = JsonUtil.getObject(json, "invoice"); + if (__invoiceJson != null) { + builder.invoice(Invoice.fromJson(__invoiceJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ResendEinvoiceResponse from JSON", e); + } + } + + /** Create a new builder for ResendEinvoiceResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ResendEinvoiceResponse. */ + public static class Builder { + + private Invoice invoice; + + private Response httpResponse; + + private Builder() {} + + public Builder invoice(Invoice invoice) { + this.invoice = invoice; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ResendEinvoiceResponse build() { + return new ResendEinvoiceResponse(this); + } + } + + /** Get the invoice from the response. */ + public Invoice getInvoice() { + return invoice; + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/responses/SendEinvoiceResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/SendEinvoiceResponse.java new file mode 100644 index 00000000..edc1af50 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/SendEinvoiceResponse.java @@ -0,0 +1,76 @@ +package com.chargebee.v4.models.invoice.responses; + +import com.chargebee.v4.models.invoice.Invoice; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for SendEinvoice operation. Contains the response data from the API. + */ +public final class SendEinvoiceResponse extends BaseResponse { + private final Invoice invoice; + + private SendEinvoiceResponse(Builder builder) { + super(builder.httpResponse); + + this.invoice = builder.invoice; + } + + /** Parse JSON response into SendEinvoiceResponse object. */ + public static SendEinvoiceResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into SendEinvoiceResponse object with HTTP response. */ + public static SendEinvoiceResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __invoiceJson = JsonUtil.getObject(json, "invoice"); + if (__invoiceJson != null) { + builder.invoice(Invoice.fromJson(__invoiceJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse SendEinvoiceResponse from JSON", e); + } + } + + /** Create a new builder for SendEinvoiceResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SendEinvoiceResponse. */ + public static class Builder { + + private Invoice invoice; + + private Response httpResponse; + + private Builder() {} + + public Builder invoice(Invoice invoice) { + this.invoice = invoice; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public SendEinvoiceResponse build() { + return new SendEinvoiceResponse(this); + } + } + + /** Get the invoice from the response. */ + public Invoice getInvoice() { + return invoice; + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/responses/VoidInvoiceResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/VoidInvoiceResponse.java new file mode 100644 index 00000000..7c4175bd --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/VoidInvoiceResponse.java @@ -0,0 +1,97 @@ +package com.chargebee.v4.models.invoice.responses; + +import com.chargebee.v4.models.invoice.Invoice; + +import com.chargebee.v4.models.creditNote.CreditNote; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** Immutable response object for VoidInvoice operation. Contains the response data from the API. */ +public final class VoidInvoiceResponse extends BaseResponse { + private final Invoice invoice; + + private final CreditNote creditNote; + + private VoidInvoiceResponse(Builder builder) { + super(builder.httpResponse); + + this.invoice = builder.invoice; + + this.creditNote = builder.creditNote; + } + + /** Parse JSON response into VoidInvoiceResponse object. */ + public static VoidInvoiceResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into VoidInvoiceResponse object with HTTP response. */ + public static VoidInvoiceResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __invoiceJson = JsonUtil.getObject(json, "invoice"); + if (__invoiceJson != null) { + builder.invoice(Invoice.fromJson(__invoiceJson)); + } + + String __creditNoteJson = JsonUtil.getObject(json, "credit_note"); + if (__creditNoteJson != null) { + builder.creditNote(CreditNote.fromJson(__creditNoteJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse VoidInvoiceResponse from JSON", e); + } + } + + /** Create a new builder for VoidInvoiceResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for VoidInvoiceResponse. */ + public static class Builder { + + private Invoice invoice; + + private CreditNote creditNote; + + private Response httpResponse; + + private Builder() {} + + public Builder invoice(Invoice invoice) { + this.invoice = invoice; + return this; + } + + public Builder creditNote(CreditNote creditNote) { + this.creditNote = creditNote; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public VoidInvoiceResponse build() { + return new VoidInvoiceResponse(this); + } + } + + /** Get the invoice from the response. */ + public Invoice getInvoice() { + return invoice; + } + + /** Get the creditNote from the response. */ + public CreditNote getCreditNote() { + return creditNote; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/invoiceEstimate/InvoiceEstimate.java b/src/main/java/com/chargebee/v4/models/invoiceEstimate/InvoiceEstimate.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/invoiceEstimate/InvoiceEstimate.java rename to src/main/java/com/chargebee/v4/models/invoiceEstimate/InvoiceEstimate.java index 106cadc7..d5c22c12 100644 --- a/src/main/java/com/chargebee/v4/core/models/invoiceEstimate/InvoiceEstimate.java +++ b/src/main/java/com/chargebee/v4/models/invoiceEstimate/InvoiceEstimate.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.invoiceEstimate; +package com.chargebee.v4.models.invoiceEstimate; import com.chargebee.v4.internal.JsonUtil; import java.math.BigDecimal; @@ -1037,6 +1037,7 @@ public static class Discounts { private Long amount; private String description; + private String lineItemId; private EntityType entityType; private DiscountType discountType; private String entityId; @@ -1050,6 +1051,10 @@ public String getDescription() { return description; } + public String getLineItemId() { + return lineItemId; + } + public EntityType getEntityType() { return entityType; } @@ -1137,6 +1142,8 @@ public static Discounts fromJson(String json) { obj.description = JsonUtil.getString(json, "description"); + obj.lineItemId = JsonUtil.getString(json, "line_item_id"); + obj.entityType = EntityType.fromString(JsonUtil.getString(json, "entity_type")); obj.discountType = DiscountType.fromString(JsonUtil.getString(json, "discount_type")); diff --git a/src/main/java/com/chargebee/v4/core/models/item/Item.java b/src/main/java/com/chargebee/v4/models/item/Item.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/item/Item.java rename to src/main/java/com/chargebee/v4/models/item/Item.java index 3ceb036a..754c11d4 100644 --- a/src/main/java/com/chargebee/v4/core/models/item/Item.java +++ b/src/main/java/com/chargebee/v4/models/item/Item.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.item; +package com.chargebee.v4.models.item; import com.chargebee.v4.internal.JsonUtil; import java.math.BigDecimal; @@ -44,7 +44,7 @@ public class Item { private List bundleItems; private BundleConfiguration bundleConfiguration; - private java.util.Map customFields = new java.util.HashMap<>(); + private java.util.Map customFields = new java.util.HashMap<>(); public String getId() { return id; @@ -168,7 +168,7 @@ public BundleConfiguration getBundleConfiguration() { * * @return map containing all custom fields */ - public java.util.Map getCustomFields() { + public java.util.Map getCustomFields() { return customFields; } @@ -178,7 +178,7 @@ public java.util.Map getCustomFields() { * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") * @return the value of the custom field, or null if not present */ - public Object getCustomField(String fieldName) { + public String getCustomField(String fieldName) { return customFields.get(fieldName); } @@ -333,7 +333,7 @@ public static Channel fromString(String value) { public static Item fromJson(String json) { Item obj = new Item(); - // Parse JSON to extract all keys + // Parse JSON to extract all keys for custom field extraction java.util.Set knownFields = new java.util.HashSet<>(); knownFields.add("id"); @@ -481,9 +481,9 @@ public static Item fromJson(String json) { * @param knownFields set of known field names * @return map of custom fields */ - private static java.util.Map extractCustomFields( + private static java.util.Map extractCustomFields( String json, java.util.Set knownFields) { - java.util.Map customFields = new java.util.HashMap<>(); + java.util.Map customFields = new java.util.HashMap<>(); try { // Parse the entire JSON as a map java.util.Map allFields = JsonUtil.parseJsonObjectToMap(json); @@ -492,7 +492,8 @@ private static java.util.Map extractCustomFields( String key = entry.getKey(); // Include fields that start with "cf_" and are not in knownFields if (key != null && key.startsWith("cf_") && !knownFields.contains(key)) { - customFields.put(key, entry.getValue()); + customFields.put( + key, entry.getValue() != null ? String.valueOf(entry.getValue()) : null); } } } diff --git a/src/main/java/com/chargebee/v4/models/item/params/ItemCreateParams.java b/src/main/java/com/chargebee/v4/models/item/params/ItemCreateParams.java new file mode 100644 index 00000000..3a5f0eb4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/item/params/ItemCreateParams.java @@ -0,0 +1,870 @@ +/* + * 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.item.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.math.BigDecimal; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class ItemCreateParams { + + private final String id; + + private final String name; + + private final Type type; + + private final String description; + + private final String itemFamilyId; + + private final Boolean isGiftable; + + private final Boolean isShippable; + + private final String externalName; + + private final Boolean enabledInPortal; + + private final String redirectUrl; + + private final Boolean enabledForCheckout; + + private final ItemApplicability itemApplicability; + + private final List applicableItems; + + private final String unit; + + private final String giftClaimRedirectUrl; + + private final Boolean includedInMrr; + + private final Boolean metered; + + private final UsageCalculation usageCalculation; + + private final Boolean isPercentagePricing; + + private final java.util.Map metadata; + + private final String businessEntityId; + + private final BundleConfigurationParams bundleConfiguration; + + private final List bundleItemsToAdd; + + private final Map customFields; + + private ItemCreateParams(ItemCreateBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.type = builder.type; + + this.description = builder.description; + + this.itemFamilyId = builder.itemFamilyId; + + this.isGiftable = builder.isGiftable; + + this.isShippable = builder.isShippable; + + this.externalName = builder.externalName; + + this.enabledInPortal = builder.enabledInPortal; + + this.redirectUrl = builder.redirectUrl; + + this.enabledForCheckout = builder.enabledForCheckout; + + this.itemApplicability = builder.itemApplicability; + + this.applicableItems = builder.applicableItems; + + this.unit = builder.unit; + + this.giftClaimRedirectUrl = builder.giftClaimRedirectUrl; + + this.includedInMrr = builder.includedInMrr; + + this.metered = builder.metered; + + this.usageCalculation = builder.usageCalculation; + + this.isPercentagePricing = builder.isPercentagePricing; + + this.metadata = builder.metadata; + + this.businessEntityId = builder.businessEntityId; + + this.bundleConfiguration = builder.bundleConfiguration; + + this.bundleItemsToAdd = builder.bundleItemsToAdd; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public Type getType() { + return type; + } + + public String getDescription() { + return description; + } + + public String getItemFamilyId() { + return itemFamilyId; + } + + public Boolean getIsGiftable() { + return isGiftable; + } + + public Boolean getIsShippable() { + return isShippable; + } + + public String getExternalName() { + return externalName; + } + + public Boolean getEnabledInPortal() { + return enabledInPortal; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public Boolean getEnabledForCheckout() { + return enabledForCheckout; + } + + public ItemApplicability getItemApplicability() { + return itemApplicability; + } + + public List getApplicableItems() { + return applicableItems; + } + + public String getUnit() { + return unit; + } + + public String getGiftClaimRedirectUrl() { + return giftClaimRedirectUrl; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public Boolean getMetered() { + return metered; + } + + public UsageCalculation getUsageCalculation() { + return usageCalculation; + } + + public Boolean getIsPercentagePricing() { + return isPercentagePricing; + } + + public java.util.Map getMetadata() { + return metadata; + } + + public String getBusinessEntityId() { + return businessEntityId; + } + + public BundleConfigurationParams getBundleConfiguration() { + return bundleConfiguration; + } + + public List getBundleItemsToAdd() { + return bundleItemsToAdd; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.itemFamilyId != null) { + + formData.put("item_family_id", this.itemFamilyId); + } + + if (this.isGiftable != null) { + + formData.put("is_giftable", this.isGiftable); + } + + if (this.isShippable != null) { + + formData.put("is_shippable", this.isShippable); + } + + if (this.externalName != null) { + + formData.put("external_name", this.externalName); + } + + if (this.enabledInPortal != null) { + + formData.put("enabled_in_portal", this.enabledInPortal); + } + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.enabledForCheckout != null) { + + formData.put("enabled_for_checkout", this.enabledForCheckout); + } + + if (this.itemApplicability != null) { + + formData.put("item_applicability", this.itemApplicability); + } + + if (this.applicableItems != null) { + + formData.put("applicable_items", this.applicableItems); + } + + if (this.unit != null) { + + formData.put("unit", this.unit); + } + + if (this.giftClaimRedirectUrl != null) { + + formData.put("gift_claim_redirect_url", this.giftClaimRedirectUrl); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.metered != null) { + + formData.put("metered", this.metered); + } + + if (this.usageCalculation != null) { + + formData.put("usage_calculation", this.usageCalculation); + } + + if (this.isPercentagePricing != null) { + + formData.put("is_percentage_pricing", this.isPercentagePricing); + } + + if (this.metadata != null) { + + formData.put("metadata", JsonUtil.toJson(this.metadata)); + } + + if (this.businessEntityId != null) { + + formData.put("business_entity_id", this.businessEntityId); + } + + if (this.bundleConfiguration != null) { + + // Single object + Map nestedData = this.bundleConfiguration.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "bundle_configuration[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.bundleItemsToAdd != null) { + + // List of objects + for (int i = 0; i < this.bundleItemsToAdd.size(); i++) { + BundleItemsToAddParams item = this.bundleItemsToAdd.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "bundle_items_to_add[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for ItemCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemCreateBuilder builder() { + return new ItemCreateBuilder(); + } + + public static final class ItemCreateBuilder { + + private String id; + + private String name; + + private Type type; + + private String description; + + private String itemFamilyId; + + private Boolean isGiftable; + + private Boolean isShippable; + + private String externalName; + + private Boolean enabledInPortal; + + private String redirectUrl; + + private Boolean enabledForCheckout; + + private ItemApplicability itemApplicability; + + private List applicableItems; + + private String unit; + + private String giftClaimRedirectUrl; + + private Boolean includedInMrr; + + private Boolean metered; + + private UsageCalculation usageCalculation; + + private Boolean isPercentagePricing; + + private java.util.Map metadata; + + private String businessEntityId; + + private BundleConfigurationParams bundleConfiguration; + + private List bundleItemsToAdd; + + private Map customFields = new LinkedHashMap<>(); + + private ItemCreateBuilder() {} + + public ItemCreateBuilder id(String value) { + this.id = value; + return this; + } + + public ItemCreateBuilder name(String value) { + this.name = value; + return this; + } + + public ItemCreateBuilder type(Type value) { + this.type = value; + return this; + } + + public ItemCreateBuilder description(String value) { + this.description = value; + return this; + } + + public ItemCreateBuilder itemFamilyId(String value) { + this.itemFamilyId = value; + return this; + } + + public ItemCreateBuilder isGiftable(Boolean value) { + this.isGiftable = value; + return this; + } + + public ItemCreateBuilder isShippable(Boolean value) { + this.isShippable = value; + return this; + } + + public ItemCreateBuilder externalName(String value) { + this.externalName = value; + return this; + } + + public ItemCreateBuilder enabledInPortal(Boolean value) { + this.enabledInPortal = value; + return this; + } + + public ItemCreateBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public ItemCreateBuilder enabledForCheckout(Boolean value) { + this.enabledForCheckout = value; + return this; + } + + public ItemCreateBuilder itemApplicability(ItemApplicability value) { + this.itemApplicability = value; + return this; + } + + public ItemCreateBuilder applicableItems(List value) { + this.applicableItems = value; + return this; + } + + public ItemCreateBuilder unit(String value) { + this.unit = value; + return this; + } + + public ItemCreateBuilder giftClaimRedirectUrl(String value) { + this.giftClaimRedirectUrl = value; + return this; + } + + public ItemCreateBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public ItemCreateBuilder metered(Boolean value) { + this.metered = value; + return this; + } + + public ItemCreateBuilder usageCalculation(UsageCalculation value) { + this.usageCalculation = value; + return this; + } + + public ItemCreateBuilder isPercentagePricing(Boolean value) { + this.isPercentagePricing = value; + return this; + } + + public ItemCreateBuilder metadata(java.util.Map value) { + this.metadata = value; + return this; + } + + public ItemCreateBuilder businessEntityId(String value) { + this.businessEntityId = value; + return this; + } + + public ItemCreateBuilder bundleConfiguration(BundleConfigurationParams value) { + this.bundleConfiguration = value; + return this; + } + + public ItemCreateBuilder bundleItemsToAdd(List value) { + this.bundleItemsToAdd = 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 ItemCreateBuilder 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 ItemCreateBuilder 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 ItemCreateParams build() { + return new ItemCreateParams(this); + } + } + + public enum Type { + PLAN("plan"), + + ADDON("addon"), + + CHARGE("charge"), + + /** 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 ItemApplicability { + ALL("all"), + + RESTRICTED("restricted"), + + /** An enum member indicating that ItemApplicability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ItemApplicability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ItemApplicability fromString(String value) { + if (value == null) return _UNKNOWN; + for (ItemApplicability enumValue : ItemApplicability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum UsageCalculation { + SUM_OF_USAGES("sum_of_usages"), + + LAST_USAGE("last_usage"), + + MAX_USAGE("max_usage"), + + /** An enum member indicating that UsageCalculation was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + UsageCalculation(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static UsageCalculation fromString(String value) { + if (value == null) return _UNKNOWN; + for (UsageCalculation enumValue : UsageCalculation.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class BundleConfigurationParams { + + private final Type type; + + private BundleConfigurationParams(BundleConfigurationBuilder builder) { + + this.type = builder.type; + } + + public Type getType() { + return type; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.type != null) { + + formData.put("type", this.type); + } + + return formData; + } + + /** Create a new builder for BundleConfigurationParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BundleConfigurationBuilder builder() { + return new BundleConfigurationBuilder(); + } + + public static final class BundleConfigurationBuilder { + + private Type type; + + private BundleConfigurationBuilder() {} + + public BundleConfigurationBuilder type(Type value) { + this.type = value; + return this; + } + + public BundleConfigurationParams build() { + return new BundleConfigurationParams(this); + } + } + + public enum Type { + FIXED("fixed"), + + /** 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 static final class BundleItemsToAddParams { + + private final String itemId; + + private final ItemType itemType; + + private final Integer quantity; + + private final BigDecimal priceAllocation; + + private BundleItemsToAddParams(BundleItemsToAddBuilder builder) { + + this.itemId = builder.itemId; + + this.itemType = builder.itemType; + + this.quantity = builder.quantity; + + this.priceAllocation = builder.priceAllocation; + } + + public String getItemId() { + return itemId; + } + + public ItemType getItemType() { + return itemType; + } + + public Integer getQuantity() { + return quantity; + } + + public BigDecimal getPriceAllocation() { + return priceAllocation; + } + + /** 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.itemType != null) { + + formData.put("item_type", this.itemType); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.priceAllocation != null) { + + formData.put("price_allocation", this.priceAllocation); + } + + return formData; + } + + /** Create a new builder for BundleItemsToAddParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BundleItemsToAddBuilder builder() { + return new BundleItemsToAddBuilder(); + } + + public static final class BundleItemsToAddBuilder { + + private String itemId; + + private ItemType itemType; + + private Integer quantity; + + private BigDecimal priceAllocation; + + private BundleItemsToAddBuilder() {} + + public BundleItemsToAddBuilder itemId(String value) { + this.itemId = value; + return this; + } + + public BundleItemsToAddBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public BundleItemsToAddBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public BundleItemsToAddBuilder priceAllocation(BigDecimal value) { + this.priceAllocation = value; + return this; + } + + public BundleItemsToAddParams build() { + return new BundleItemsToAddParams(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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/item/params/ItemDeleteParams.java b/src/main/java/com/chargebee/v4/models/item/params/ItemDeleteParams.java new file mode 100644 index 00000000..42b38f3c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/item/params/ItemDeleteParams.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.item.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ItemDeleteParams { + + private ItemDeleteParams(ItemDeleteBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for ItemDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemDeleteBuilder builder() { + return new ItemDeleteBuilder(); + } + + public static final class ItemDeleteBuilder { + + private ItemDeleteBuilder() {} + + public ItemDeleteParams build() { + return new ItemDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/item/params/ItemListParams.java b/src/main/java/com/chargebee/v4/models/item/params/ItemListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/item/params/ItemListParams.java rename to src/main/java/com/chargebee/v4/models/item/params/ItemListParams.java index 726a5799..daa2ac97 100644 --- a/src/main/java/com/chargebee/v4/core/models/item/params/ItemListParams.java +++ b/src/main/java/com/chargebee/v4/models/item/params/ItemListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.item.params; +package com.chargebee.v4.models.item.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/item/params/ItemRetrieveParams.java b/src/main/java/com/chargebee/v4/models/item/params/ItemRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/item/params/ItemRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/item/params/ItemRetrieveParams.java index 78bbcfa3..7bb7973d 100644 --- a/src/main/java/com/chargebee/v4/core/models/item/params/ItemRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/item/params/ItemRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.item.params; +package com.chargebee.v4.models.item.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/item/params/ItemUpdateParams.java b/src/main/java/com/chargebee/v4/models/item/params/ItemUpdateParams.java new file mode 100644 index 00000000..2425e023 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/item/params/ItemUpdateParams.java @@ -0,0 +1,1055 @@ +/* + * 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.item.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.math.BigDecimal; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class ItemUpdateParams { + + private final String name; + + private final String description; + + private final Boolean isShippable; + + private final String externalName; + + private final String itemFamilyId; + + private final Boolean enabledInPortal; + + private final String redirectUrl; + + private final Boolean enabledForCheckout; + + private final ItemApplicability itemApplicability; + + private final Boolean clearApplicableItems; + + private final List applicableItems; + + private final String unit; + + private final String giftClaimRedirectUrl; + + private final java.util.Map metadata; + + private final Boolean includedInMrr; + + private final Status status; + + private final Boolean isPercentagePricing; + + private final BundleConfigurationParams bundleConfiguration; + + private final List bundleItemsToAdd; + + private final List bundleItemsToUpdate; + + private final List bundleItemsToRemove; + + private final Map customFields; + + private ItemUpdateParams(ItemUpdateBuilder builder) { + + this.name = builder.name; + + this.description = builder.description; + + this.isShippable = builder.isShippable; + + this.externalName = builder.externalName; + + this.itemFamilyId = builder.itemFamilyId; + + this.enabledInPortal = builder.enabledInPortal; + + this.redirectUrl = builder.redirectUrl; + + this.enabledForCheckout = builder.enabledForCheckout; + + this.itemApplicability = builder.itemApplicability; + + this.clearApplicableItems = builder.clearApplicableItems; + + this.applicableItems = builder.applicableItems; + + this.unit = builder.unit; + + this.giftClaimRedirectUrl = builder.giftClaimRedirectUrl; + + this.metadata = builder.metadata; + + this.includedInMrr = builder.includedInMrr; + + this.status = builder.status; + + this.isPercentagePricing = builder.isPercentagePricing; + + this.bundleConfiguration = builder.bundleConfiguration; + + this.bundleItemsToAdd = builder.bundleItemsToAdd; + + this.bundleItemsToUpdate = builder.bundleItemsToUpdate; + + this.bundleItemsToRemove = builder.bundleItemsToRemove; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public Boolean getIsShippable() { + return isShippable; + } + + public String getExternalName() { + return externalName; + } + + public String getItemFamilyId() { + return itemFamilyId; + } + + public Boolean getEnabledInPortal() { + return enabledInPortal; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public Boolean getEnabledForCheckout() { + return enabledForCheckout; + } + + public ItemApplicability getItemApplicability() { + return itemApplicability; + } + + public Boolean getClearApplicableItems() { + return clearApplicableItems; + } + + public List getApplicableItems() { + return applicableItems; + } + + public String getUnit() { + return unit; + } + + public String getGiftClaimRedirectUrl() { + return giftClaimRedirectUrl; + } + + public java.util.Map getMetadata() { + return metadata; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public Status getStatus() { + return status; + } + + public Boolean getIsPercentagePricing() { + return isPercentagePricing; + } + + public BundleConfigurationParams getBundleConfiguration() { + return bundleConfiguration; + } + + public List getBundleItemsToAdd() { + return bundleItemsToAdd; + } + + public List getBundleItemsToUpdate() { + return bundleItemsToUpdate; + } + + public List getBundleItemsToRemove() { + return bundleItemsToRemove; + } + + 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.description != null) { + + formData.put("description", this.description); + } + + if (this.isShippable != null) { + + formData.put("is_shippable", this.isShippable); + } + + if (this.externalName != null) { + + formData.put("external_name", this.externalName); + } + + if (this.itemFamilyId != null) { + + formData.put("item_family_id", this.itemFamilyId); + } + + if (this.enabledInPortal != null) { + + formData.put("enabled_in_portal", this.enabledInPortal); + } + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.enabledForCheckout != null) { + + formData.put("enabled_for_checkout", this.enabledForCheckout); + } + + if (this.itemApplicability != null) { + + formData.put("item_applicability", this.itemApplicability); + } + + if (this.clearApplicableItems != null) { + + formData.put("clear_applicable_items", this.clearApplicableItems); + } + + if (this.applicableItems != null) { + + formData.put("applicable_items", this.applicableItems); + } + + if (this.unit != null) { + + formData.put("unit", this.unit); + } + + if (this.giftClaimRedirectUrl != null) { + + formData.put("gift_claim_redirect_url", this.giftClaimRedirectUrl); + } + + if (this.metadata != null) { + + formData.put("metadata", JsonUtil.toJson(this.metadata)); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.isPercentagePricing != null) { + + formData.put("is_percentage_pricing", this.isPercentagePricing); + } + + if (this.bundleConfiguration != null) { + + // Single object + Map nestedData = this.bundleConfiguration.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "bundle_configuration[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.bundleItemsToAdd != null) { + + // List of objects + for (int i = 0; i < this.bundleItemsToAdd.size(); i++) { + BundleItemsToAddParams item = this.bundleItemsToAdd.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "bundle_items_to_add[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.bundleItemsToUpdate != null) { + + // List of objects + for (int i = 0; i < this.bundleItemsToUpdate.size(); i++) { + BundleItemsToUpdateParams item = this.bundleItemsToUpdate.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "bundle_items_to_update[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.bundleItemsToRemove != null) { + + // List of objects + for (int i = 0; i < this.bundleItemsToRemove.size(); i++) { + BundleItemsToRemoveParams item = this.bundleItemsToRemove.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "bundle_items_to_remove[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for ItemUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemUpdateBuilder builder() { + return new ItemUpdateBuilder(); + } + + public static final class ItemUpdateBuilder { + + private String name; + + private String description; + + private Boolean isShippable; + + private String externalName; + + private String itemFamilyId; + + private Boolean enabledInPortal; + + private String redirectUrl; + + private Boolean enabledForCheckout; + + private ItemApplicability itemApplicability; + + private Boolean clearApplicableItems; + + private List applicableItems; + + private String unit; + + private String giftClaimRedirectUrl; + + private java.util.Map metadata; + + private Boolean includedInMrr; + + private Status status; + + private Boolean isPercentagePricing; + + private BundleConfigurationParams bundleConfiguration; + + private List bundleItemsToAdd; + + private List bundleItemsToUpdate; + + private List bundleItemsToRemove; + + private Map customFields = new LinkedHashMap<>(); + + private ItemUpdateBuilder() {} + + public ItemUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public ItemUpdateBuilder description(String value) { + this.description = value; + return this; + } + + public ItemUpdateBuilder isShippable(Boolean value) { + this.isShippable = value; + return this; + } + + public ItemUpdateBuilder externalName(String value) { + this.externalName = value; + return this; + } + + public ItemUpdateBuilder itemFamilyId(String value) { + this.itemFamilyId = value; + return this; + } + + public ItemUpdateBuilder enabledInPortal(Boolean value) { + this.enabledInPortal = value; + return this; + } + + public ItemUpdateBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public ItemUpdateBuilder enabledForCheckout(Boolean value) { + this.enabledForCheckout = value; + return this; + } + + public ItemUpdateBuilder itemApplicability(ItemApplicability value) { + this.itemApplicability = value; + return this; + } + + @Deprecated + public ItemUpdateBuilder clearApplicableItems(Boolean value) { + this.clearApplicableItems = value; + return this; + } + + public ItemUpdateBuilder applicableItems(List value) { + this.applicableItems = value; + return this; + } + + public ItemUpdateBuilder unit(String value) { + this.unit = value; + return this; + } + + public ItemUpdateBuilder giftClaimRedirectUrl(String value) { + this.giftClaimRedirectUrl = value; + return this; + } + + public ItemUpdateBuilder metadata(java.util.Map value) { + this.metadata = value; + return this; + } + + public ItemUpdateBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public ItemUpdateBuilder status(Status value) { + this.status = value; + return this; + } + + public ItemUpdateBuilder isPercentagePricing(Boolean value) { + this.isPercentagePricing = value; + return this; + } + + public ItemUpdateBuilder bundleConfiguration(BundleConfigurationParams value) { + this.bundleConfiguration = value; + return this; + } + + public ItemUpdateBuilder bundleItemsToAdd(List value) { + this.bundleItemsToAdd = value; + return this; + } + + public ItemUpdateBuilder bundleItemsToUpdate(List value) { + this.bundleItemsToUpdate = value; + return this; + } + + public ItemUpdateBuilder bundleItemsToRemove(List value) { + this.bundleItemsToRemove = 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 ItemUpdateBuilder 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 ItemUpdateBuilder 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 ItemUpdateParams build() { + return new ItemUpdateParams(this); + } + } + + public enum ItemApplicability { + ALL("all"), + + RESTRICTED("restricted"), + + /** An enum member indicating that ItemApplicability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ItemApplicability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ItemApplicability fromString(String value) { + if (value == null) return _UNKNOWN; + for (ItemApplicability enumValue : ItemApplicability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + ACTIVE("active"), + + ARCHIVED("archived"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class BundleConfigurationParams { + + private final Type type; + + private BundleConfigurationParams(BundleConfigurationBuilder builder) { + + this.type = builder.type; + } + + public Type getType() { + return type; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.type != null) { + + formData.put("type", this.type); + } + + return formData; + } + + /** Create a new builder for BundleConfigurationParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BundleConfigurationBuilder builder() { + return new BundleConfigurationBuilder(); + } + + public static final class BundleConfigurationBuilder { + + private Type type; + + private BundleConfigurationBuilder() {} + + public BundleConfigurationBuilder type(Type value) { + this.type = value; + return this; + } + + public BundleConfigurationParams build() { + return new BundleConfigurationParams(this); + } + } + + public enum Type { + FIXED("fixed"), + + /** 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 static final class BundleItemsToAddParams { + + private final String itemId; + + private final ItemType itemType; + + private final Integer quantity; + + private final BigDecimal priceAllocation; + + private BundleItemsToAddParams(BundleItemsToAddBuilder builder) { + + this.itemId = builder.itemId; + + this.itemType = builder.itemType; + + this.quantity = builder.quantity; + + this.priceAllocation = builder.priceAllocation; + } + + public String getItemId() { + return itemId; + } + + public ItemType getItemType() { + return itemType; + } + + public Integer getQuantity() { + return quantity; + } + + public BigDecimal getPriceAllocation() { + return priceAllocation; + } + + /** 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.itemType != null) { + + formData.put("item_type", this.itemType); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.priceAllocation != null) { + + formData.put("price_allocation", this.priceAllocation); + } + + return formData; + } + + /** Create a new builder for BundleItemsToAddParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BundleItemsToAddBuilder builder() { + return new BundleItemsToAddBuilder(); + } + + public static final class BundleItemsToAddBuilder { + + private String itemId; + + private ItemType itemType; + + private Integer quantity; + + private BigDecimal priceAllocation; + + private BundleItemsToAddBuilder() {} + + public BundleItemsToAddBuilder itemId(String value) { + this.itemId = value; + return this; + } + + public BundleItemsToAddBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public BundleItemsToAddBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public BundleItemsToAddBuilder priceAllocation(BigDecimal value) { + this.priceAllocation = value; + return this; + } + + public BundleItemsToAddParams build() { + return new BundleItemsToAddParams(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 BundleItemsToUpdateParams { + + private final String itemId; + + private final ItemType itemType; + + private final Integer quantity; + + private final BigDecimal priceAllocation; + + private BundleItemsToUpdateParams(BundleItemsToUpdateBuilder builder) { + + this.itemId = builder.itemId; + + this.itemType = builder.itemType; + + this.quantity = builder.quantity; + + this.priceAllocation = builder.priceAllocation; + } + + public String getItemId() { + return itemId; + } + + public ItemType getItemType() { + return itemType; + } + + public Integer getQuantity() { + return quantity; + } + + public BigDecimal getPriceAllocation() { + return priceAllocation; + } + + /** 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.itemType != null) { + + formData.put("item_type", this.itemType); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.priceAllocation != null) { + + formData.put("price_allocation", this.priceAllocation); + } + + return formData; + } + + /** Create a new builder for BundleItemsToUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BundleItemsToUpdateBuilder builder() { + return new BundleItemsToUpdateBuilder(); + } + + public static final class BundleItemsToUpdateBuilder { + + private String itemId; + + private ItemType itemType; + + private Integer quantity; + + private BigDecimal priceAllocation; + + private BundleItemsToUpdateBuilder() {} + + public BundleItemsToUpdateBuilder itemId(String value) { + this.itemId = value; + return this; + } + + public BundleItemsToUpdateBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public BundleItemsToUpdateBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public BundleItemsToUpdateBuilder priceAllocation(BigDecimal value) { + this.priceAllocation = value; + return this; + } + + public BundleItemsToUpdateParams build() { + return new BundleItemsToUpdateParams(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 BundleItemsToRemoveParams { + + private final String itemId; + + private final ItemType itemType; + + private BundleItemsToRemoveParams(BundleItemsToRemoveBuilder builder) { + + this.itemId = builder.itemId; + + this.itemType = builder.itemType; + } + + public String getItemId() { + return itemId; + } + + public ItemType getItemType() { + return itemType; + } + + /** 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.itemType != null) { + + formData.put("item_type", this.itemType); + } + + return formData; + } + + /** Create a new builder for BundleItemsToRemoveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BundleItemsToRemoveBuilder builder() { + return new BundleItemsToRemoveBuilder(); + } + + public static final class BundleItemsToRemoveBuilder { + + private String itemId; + + private ItemType itemType; + + private BundleItemsToRemoveBuilder() {} + + public BundleItemsToRemoveBuilder itemId(String value) { + this.itemId = value; + return this; + } + + public BundleItemsToRemoveBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public BundleItemsToRemoveParams build() { + return new BundleItemsToRemoveParams(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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/item/ItemCreateResponse.java b/src/main/java/com/chargebee/v4/models/item/responses/ItemCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/item/ItemCreateResponse.java rename to src/main/java/com/chargebee/v4/models/item/responses/ItemCreateResponse.java index f1bf6116..45c55949 100644 --- a/src/main/java/com/chargebee/v4/core/responses/item/ItemCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/item/responses/ItemCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.item; +package com.chargebee.v4.models.item.responses; -import com.chargebee.v4.core.models.item.Item; +import com.chargebee.v4.models.item.Item; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/item/ItemDeleteResponse.java b/src/main/java/com/chargebee/v4/models/item/responses/ItemDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/item/ItemDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/item/responses/ItemDeleteResponse.java index c6901a21..6d447355 100644 --- a/src/main/java/com/chargebee/v4/core/responses/item/ItemDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/item/responses/ItemDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.item; +package com.chargebee.v4.models.item.responses; -import com.chargebee.v4.core.models.item.Item; +import com.chargebee.v4.models.item.Item; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/item/ItemListResponse.java b/src/main/java/com/chargebee/v4/models/item/responses/ItemListResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/item/ItemListResponse.java rename to src/main/java/com/chargebee/v4/models/item/responses/ItemListResponse.java index bb2fe3a4..f1d87a53 100644 --- a/src/main/java/com/chargebee/v4/core/responses/item/ItemListResponse.java +++ b/src/main/java/com/chargebee/v4/models/item/responses/ItemListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.item; +package com.chargebee.v4.models.item.responses; import java.util.List; -import com.chargebee.v4.core.models.item.Item; +import com.chargebee.v4.models.item.Item; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.ItemService; -import com.chargebee.v4.core.models.item.params.ItemListParams; +import com.chargebee.v4.services.ItemService; +import com.chargebee.v4.models.item.params.ItemListParams; /** Immutable response object for ItemList operation. Contains paginated list data. */ public final class ItemListResponse { @@ -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 ItemListResponse nextPage() throws Exception { + public ItemListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/item/responses/ItemRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/item/responses/ItemRetrieveResponse.java new file mode 100644 index 00000000..c5eaa0e8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/item/responses/ItemRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.item.responses; + +import com.chargebee.v4.models.item.Item; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ItemRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class ItemRetrieveResponse extends BaseResponse { + private final Item item; + + private ItemRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.item = builder.item; + } + + /** Parse JSON response into ItemRetrieveResponse object. */ + public static ItemRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ItemRetrieveResponse object with HTTP response. */ + public static ItemRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __itemJson = JsonUtil.getObject(json, "item"); + if (__itemJson != null) { + builder.item(Item.fromJson(__itemJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ItemRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for ItemRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ItemRetrieveResponse. */ + public static class Builder { + + private Item item; + + private Response httpResponse; + + private Builder() {} + + public Builder item(Item item) { + this.item = item; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ItemRetrieveResponse build() { + return new ItemRetrieveResponse(this); + } + } + + /** Get the item from the response. */ + public Item getItem() { + return item; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/item/ItemUpdateResponse.java b/src/main/java/com/chargebee/v4/models/item/responses/ItemUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/item/ItemUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/item/responses/ItemUpdateResponse.java index 7b834988..b8aee7d8 100644 --- a/src/main/java/com/chargebee/v4/core/responses/item/ItemUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/item/responses/ItemUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.item; +package com.chargebee.v4.models.item.responses; -import com.chargebee.v4.core.models.item.Item; +import com.chargebee.v4.models.item.Item; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/itemEntitlement/ItemEntitlement.java b/src/main/java/com/chargebee/v4/models/itemEntitlement/ItemEntitlement.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/itemEntitlement/ItemEntitlement.java rename to src/main/java/com/chargebee/v4/models/itemEntitlement/ItemEntitlement.java index 19b8c179..b10f43cd 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemEntitlement/ItemEntitlement.java +++ b/src/main/java/com/chargebee/v4/models/itemEntitlement/ItemEntitlement.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemEntitlement; +package com.chargebee.v4.models.itemEntitlement; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/models/itemEntitlement/params/AddItemEntitlementsParams.java b/src/main/java/com/chargebee/v4/models/itemEntitlement/params/AddItemEntitlementsParams.java new file mode 100644 index 00000000..ff57f158 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemEntitlement/params/AddItemEntitlementsParams.java @@ -0,0 +1,241 @@ +/* + * 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.itemEntitlement.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class AddItemEntitlementsParams { + + private final Action action; + + private final List itemEntitlements; + + private AddItemEntitlementsParams(AddItemEntitlementsBuilder builder) { + + this.action = builder.action; + + this.itemEntitlements = builder.itemEntitlements; + } + + public Action getAction() { + return action; + } + + public List getItemEntitlements() { + return itemEntitlements; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.action != null) { + + formData.put("action", this.action); + } + + if (this.itemEntitlements != null) { + + // List of objects + for (int i = 0; i < this.itemEntitlements.size(); i++) { + ItemEntitlementsParams item = this.itemEntitlements.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_entitlements[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for AddItemEntitlementsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddItemEntitlementsBuilder builder() { + return new AddItemEntitlementsBuilder(); + } + + public static final class AddItemEntitlementsBuilder { + + private Action action; + + private List itemEntitlements; + + private AddItemEntitlementsBuilder() {} + + public AddItemEntitlementsBuilder action(Action value) { + this.action = value; + return this; + } + + public AddItemEntitlementsBuilder itemEntitlements(List value) { + this.itemEntitlements = value; + return this; + } + + public AddItemEntitlementsParams build() { + return new AddItemEntitlementsParams(this); + } + } + + public enum Action { + UPSERT("upsert"), + + REMOVE("remove"), + + /** An enum member indicating that Action was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Action(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Action fromString(String value) { + if (value == null) return _UNKNOWN; + for (Action enumValue : Action.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class ItemEntitlementsParams { + + private final String itemId; + + private final ItemType itemType; + + private final String value; + + private ItemEntitlementsParams(ItemEntitlementsBuilder builder) { + + this.itemId = builder.itemId; + + this.itemType = builder.itemType; + + this.value = builder.value; + } + + public String getItemId() { + return itemId; + } + + public ItemType getItemType() { + return itemType; + } + + public String getValue() { + return value; + } + + /** 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.itemType != null) { + + formData.put("item_type", this.itemType); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + return formData; + } + + /** Create a new builder for ItemEntitlementsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemEntitlementsBuilder builder() { + return new ItemEntitlementsBuilder(); + } + + public static final class ItemEntitlementsBuilder { + + private String itemId; + + private ItemType itemType; + + private String value; + + private ItemEntitlementsBuilder() {} + + public ItemEntitlementsBuilder itemId(String value) { + this.itemId = value; + return this; + } + + public ItemEntitlementsBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public ItemEntitlementsBuilder value(String value) { + this.value = value; + return this; + } + + public ItemEntitlementsParams build() { + return new ItemEntitlementsParams(this); + } + } + + public enum ItemType { + PLAN("plan"), + + ADDON("addon"), + + CHARGE("charge"), + + SUBSCRIPTION("subscription"), + + ITEM("item"), + + /** 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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/itemEntitlement/params/ItemEntitlementsForFeatureParams.java b/src/main/java/com/chargebee/v4/models/itemEntitlement/params/ItemEntitlementsForFeatureParams.java new file mode 100644 index 00000000..14d7a2e8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemEntitlement/params/ItemEntitlementsForFeatureParams.java @@ -0,0 +1,66 @@ +/* + * 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.itemEntitlement.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ItemEntitlementsForFeatureParams { + + private final Map queryParams; + + private ItemEntitlementsForFeatureParams(ItemEntitlementsForFeatureBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public ItemEntitlementsForFeatureBuilder toBuilder() { + ItemEntitlementsForFeatureBuilder builder = new ItemEntitlementsForFeatureBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for ItemEntitlementsForFeatureParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemEntitlementsForFeatureBuilder builder() { + return new ItemEntitlementsForFeatureBuilder(); + } + + public static final class ItemEntitlementsForFeatureBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private ItemEntitlementsForFeatureBuilder() {} + + public ItemEntitlementsForFeatureBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public ItemEntitlementsForFeatureBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + @Deprecated + public ItemEntitlementsForFeatureBuilder includeDrafts(Boolean value) { + queryParams.put("include_drafts", value); + return this; + } + + public ItemEntitlementsForFeatureParams build() { + return new ItemEntitlementsForFeatureParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/itemEntitlement/params/ItemEntitlementsForItemParams.java b/src/main/java/com/chargebee/v4/models/itemEntitlement/params/ItemEntitlementsForItemParams.java new file mode 100644 index 00000000..9364e052 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemEntitlement/params/ItemEntitlementsForItemParams.java @@ -0,0 +1,72 @@ +/* + * 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.itemEntitlement.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ItemEntitlementsForItemParams { + + private final Map queryParams; + + private ItemEntitlementsForItemParams(ItemEntitlementsForItemBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public ItemEntitlementsForItemBuilder toBuilder() { + ItemEntitlementsForItemBuilder builder = new ItemEntitlementsForItemBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for ItemEntitlementsForItemParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemEntitlementsForItemBuilder builder() { + return new ItemEntitlementsForItemBuilder(); + } + + public static final class ItemEntitlementsForItemBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private ItemEntitlementsForItemBuilder() {} + + public ItemEntitlementsForItemBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public ItemEntitlementsForItemBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + @Deprecated + public ItemEntitlementsForItemBuilder includeDrafts(Boolean value) { + queryParams.put("include_drafts", value); + return this; + } + + @Deprecated + public ItemEntitlementsForItemBuilder embed(String value) { + queryParams.put("embed", value); + return this; + } + + public ItemEntitlementsForItemParams build() { + return new ItemEntitlementsForItemParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/itemEntitlement/params/UpsertOrRemoveItemEntitlementsForItemParams.java b/src/main/java/com/chargebee/v4/models/itemEntitlement/params/UpsertOrRemoveItemEntitlementsForItemParams.java new file mode 100644 index 00000000..d3f24ed9 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemEntitlement/params/UpsertOrRemoveItemEntitlementsForItemParams.java @@ -0,0 +1,189 @@ +/* + * 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.itemEntitlement.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class UpsertOrRemoveItemEntitlementsForItemParams { + + private final Action action; + + private final List itemEntitlements; + + private UpsertOrRemoveItemEntitlementsForItemParams( + UpsertOrRemoveItemEntitlementsForItemBuilder builder) { + + this.action = builder.action; + + this.itemEntitlements = builder.itemEntitlements; + } + + public Action getAction() { + return action; + } + + public List getItemEntitlements() { + return itemEntitlements; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.action != null) { + + formData.put("action", this.action); + } + + if (this.itemEntitlements != null) { + + // List of objects + for (int i = 0; i < this.itemEntitlements.size(); i++) { + ItemEntitlementsParams item = this.itemEntitlements.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_entitlements[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for UpsertOrRemoveItemEntitlementsForItemParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpsertOrRemoveItemEntitlementsForItemBuilder builder() { + return new UpsertOrRemoveItemEntitlementsForItemBuilder(); + } + + public static final class UpsertOrRemoveItemEntitlementsForItemBuilder { + + private Action action; + + private List itemEntitlements; + + private UpsertOrRemoveItemEntitlementsForItemBuilder() {} + + public UpsertOrRemoveItemEntitlementsForItemBuilder action(Action value) { + this.action = value; + return this; + } + + public UpsertOrRemoveItemEntitlementsForItemBuilder itemEntitlements( + List value) { + this.itemEntitlements = value; + return this; + } + + public UpsertOrRemoveItemEntitlementsForItemParams build() { + return new UpsertOrRemoveItemEntitlementsForItemParams(this); + } + } + + public enum Action { + UPSERT("upsert"), + + REMOVE("remove"), + + /** An enum member indicating that Action was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Action(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Action fromString(String value) { + if (value == null) return _UNKNOWN; + for (Action enumValue : Action.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class ItemEntitlementsParams { + + private final String featureId; + + private final String value; + + private ItemEntitlementsParams(ItemEntitlementsBuilder builder) { + + this.featureId = builder.featureId; + + this.value = builder.value; + } + + public String getFeatureId() { + return featureId; + } + + public String getValue() { + return value; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.featureId != null) { + + formData.put("feature_id", this.featureId); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + return formData; + } + + /** Create a new builder for ItemEntitlementsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemEntitlementsBuilder builder() { + return new ItemEntitlementsBuilder(); + } + + public static final class ItemEntitlementsBuilder { + + private String featureId; + + private String value; + + private ItemEntitlementsBuilder() {} + + public ItemEntitlementsBuilder featureId(String value) { + this.featureId = value; + return this; + } + + public ItemEntitlementsBuilder value(String value) { + this.value = value; + return this; + } + + public ItemEntitlementsParams build() { + return new ItemEntitlementsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/itemEntitlement/responses/AddItemEntitlementsResponse.java b/src/main/java/com/chargebee/v4/models/itemEntitlement/responses/AddItemEntitlementsResponse.java new file mode 100644 index 00000000..a5a73f1a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemEntitlement/responses/AddItemEntitlementsResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.itemEntitlement.responses; + +import com.chargebee.v4.models.itemEntitlement.ItemEntitlement; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for AddItemEntitlements operation. Contains the response data from the + * API. + */ +public final class AddItemEntitlementsResponse extends BaseResponse { + private final ItemEntitlement itemEntitlement; + + private AddItemEntitlementsResponse(Builder builder) { + super(builder.httpResponse); + + this.itemEntitlement = builder.itemEntitlement; + } + + /** Parse JSON response into AddItemEntitlementsResponse object. */ + public static AddItemEntitlementsResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into AddItemEntitlementsResponse object with HTTP response. */ + public static AddItemEntitlementsResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __itemEntitlementJson = JsonUtil.getObject(json, "item_entitlement"); + if (__itemEntitlementJson != null) { + builder.itemEntitlement(ItemEntitlement.fromJson(__itemEntitlementJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse AddItemEntitlementsResponse from JSON", e); + } + } + + /** Create a new builder for AddItemEntitlementsResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for AddItemEntitlementsResponse. */ + public static class Builder { + + private ItemEntitlement itemEntitlement; + + private Response httpResponse; + + private Builder() {} + + public Builder itemEntitlement(ItemEntitlement itemEntitlement) { + this.itemEntitlement = itemEntitlement; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public AddItemEntitlementsResponse build() { + return new AddItemEntitlementsResponse(this); + } + } + + /** Get the itemEntitlement from the response. */ + public ItemEntitlement getItemEntitlement() { + return itemEntitlement; + } +} diff --git a/src/main/java/com/chargebee/v4/models/itemEntitlement/responses/ItemEntitlementsForFeatureResponse.java b/src/main/java/com/chargebee/v4/models/itemEntitlement/responses/ItemEntitlementsForFeatureResponse.java new file mode 100644 index 00000000..441e2921 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemEntitlement/responses/ItemEntitlementsForFeatureResponse.java @@ -0,0 +1,177 @@ +package com.chargebee.v4.models.itemEntitlement.responses; + +import java.util.List; + +import com.chargebee.v4.models.itemEntitlement.ItemEntitlement; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.ItemEntitlementService; +import com.chargebee.v4.models.itemEntitlement.params.ItemEntitlementsForFeatureParams; + +/** + * Immutable response object for ItemEntitlementsForFeature operation. Contains paginated list data. + */ +public final class ItemEntitlementsForFeatureResponse { + + private final List list; + + private final String nextOffset; + + private final String featureId; + + private final ItemEntitlementService service; + private final ItemEntitlementsForFeatureParams originalParams; + private final Response httpResponse; + + private ItemEntitlementsForFeatureResponse( + List list, + String nextOffset, + String featureId, + ItemEntitlementService service, + ItemEntitlementsForFeatureParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.featureId = featureId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into ItemEntitlementsForFeatureResponse object (no service context). Use + * this when you only need to read a single page (no nextPage()). + */ + public static ItemEntitlementsForFeatureResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(ItemEntitlementItemEntitlementsForFeatureItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new ItemEntitlementsForFeatureResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ItemEntitlementsForFeatureResponse from JSON", e); + } + } + + /** + * Parse JSON response into ItemEntitlementsForFeatureResponse object with service context for + * pagination (enables nextPage()). + */ + public static ItemEntitlementsForFeatureResponse fromJson( + String json, + ItemEntitlementService service, + ItemEntitlementsForFeatureParams originalParams, + String featureId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(ItemEntitlementItemEntitlementsForFeatureItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new ItemEntitlementsForFeatureResponse( + list, nextOffset, featureId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ItemEntitlementsForFeatureResponse 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 ItemEntitlementsForFeatureResponse 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)."); + } + + ItemEntitlementsForFeatureParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : ItemEntitlementsForFeatureParams.builder()) + .offset(nextOffset) + .build(); + + return service.itemEntitlementsForFeature(featureId, 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 ItemEntitlementItemEntitlementsForFeatureItem { + + private ItemEntitlement itemEntitlement; + + public ItemEntitlement getItemEntitlement() { + return itemEntitlement; + } + + public static ItemEntitlementItemEntitlementsForFeatureItem fromJson(String json) { + ItemEntitlementItemEntitlementsForFeatureItem item = + new ItemEntitlementItemEntitlementsForFeatureItem(); + + String __itemEntitlementJson = JsonUtil.getObject(json, "item_entitlement"); + if (__itemEntitlementJson != null) { + item.itemEntitlement = ItemEntitlement.fromJson(__itemEntitlementJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/itemEntitlement/responses/ItemEntitlementsForItemResponse.java b/src/main/java/com/chargebee/v4/models/itemEntitlement/responses/ItemEntitlementsForItemResponse.java new file mode 100644 index 00000000..5809878d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemEntitlement/responses/ItemEntitlementsForItemResponse.java @@ -0,0 +1,177 @@ +package com.chargebee.v4.models.itemEntitlement.responses; + +import java.util.List; + +import com.chargebee.v4.models.itemEntitlement.ItemEntitlement; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.ItemEntitlementService; +import com.chargebee.v4.models.itemEntitlement.params.ItemEntitlementsForItemParams; + +/** + * Immutable response object for ItemEntitlementsForItem operation. Contains paginated list data. + */ +public final class ItemEntitlementsForItemResponse { + + private final List list; + + private final String nextOffset; + + private final String itemId; + + private final ItemEntitlementService service; + private final ItemEntitlementsForItemParams originalParams; + private final Response httpResponse; + + private ItemEntitlementsForItemResponse( + List list, + String nextOffset, + String itemId, + ItemEntitlementService service, + ItemEntitlementsForItemParams 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 ItemEntitlementsForItemResponse object (no service context). Use this + * when you only need to read a single page (no nextPage()). + */ + public static ItemEntitlementsForItemResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(ItemEntitlementItemEntitlementsForItemItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new ItemEntitlementsForItemResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ItemEntitlementsForItemResponse from JSON", e); + } + } + + /** + * Parse JSON response into ItemEntitlementsForItemResponse object with service context for + * pagination (enables nextPage()). + */ + public static ItemEntitlementsForItemResponse fromJson( + String json, + ItemEntitlementService service, + ItemEntitlementsForItemParams originalParams, + String itemId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(ItemEntitlementItemEntitlementsForItemItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new ItemEntitlementsForItemResponse( + list, nextOffset, itemId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ItemEntitlementsForItemResponse 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 ItemEntitlementsForItemResponse 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)."); + } + + ItemEntitlementsForItemParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : ItemEntitlementsForItemParams.builder()) + .offset(nextOffset) + .build(); + + return service.itemEntitlementsForItem(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 ItemEntitlementItemEntitlementsForItemItem { + + private ItemEntitlement itemEntitlement; + + public ItemEntitlement getItemEntitlement() { + return itemEntitlement; + } + + public static ItemEntitlementItemEntitlementsForItemItem fromJson(String json) { + ItemEntitlementItemEntitlementsForItemItem item = + new ItemEntitlementItemEntitlementsForItemItem(); + + String __itemEntitlementJson = JsonUtil.getObject(json, "item_entitlement"); + if (__itemEntitlementJson != null) { + item.itemEntitlement = ItemEntitlement.fromJson(__itemEntitlementJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/itemEntitlement/responses/UpsertOrRemoveItemEntitlementsForItemResponse.java b/src/main/java/com/chargebee/v4/models/itemEntitlement/responses/UpsertOrRemoveItemEntitlementsForItemResponse.java new file mode 100644 index 00000000..c5e1db68 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemEntitlement/responses/UpsertOrRemoveItemEntitlementsForItemResponse.java @@ -0,0 +1,82 @@ +package com.chargebee.v4.models.itemEntitlement.responses; + +import com.chargebee.v4.models.itemEntitlement.ItemEntitlement; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for UpsertOrRemoveItemEntitlementsForItem operation. Contains the + * response data from the API. + */ +public final class UpsertOrRemoveItemEntitlementsForItemResponse extends BaseResponse { + private final ItemEntitlement itemEntitlement; + + private UpsertOrRemoveItemEntitlementsForItemResponse(Builder builder) { + super(builder.httpResponse); + + this.itemEntitlement = builder.itemEntitlement; + } + + /** Parse JSON response into UpsertOrRemoveItemEntitlementsForItemResponse object. */ + public static UpsertOrRemoveItemEntitlementsForItemResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into UpsertOrRemoveItemEntitlementsForItemResponse object with HTTP + * response. + */ + public static UpsertOrRemoveItemEntitlementsForItemResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __itemEntitlementJson = JsonUtil.getObject(json, "item_entitlement"); + if (__itemEntitlementJson != null) { + builder.itemEntitlement(ItemEntitlement.fromJson(__itemEntitlementJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse UpsertOrRemoveItemEntitlementsForItemResponse from JSON", e); + } + } + + /** Create a new builder for UpsertOrRemoveItemEntitlementsForItemResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UpsertOrRemoveItemEntitlementsForItemResponse. */ + public static class Builder { + + private ItemEntitlement itemEntitlement; + + private Response httpResponse; + + private Builder() {} + + public Builder itemEntitlement(ItemEntitlement itemEntitlement) { + this.itemEntitlement = itemEntitlement; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public UpsertOrRemoveItemEntitlementsForItemResponse build() { + return new UpsertOrRemoveItemEntitlementsForItemResponse(this); + } + } + + /** Get the itemEntitlement from the response. */ + public ItemEntitlement getItemEntitlement() { + return itemEntitlement; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/itemFamily/ItemFamily.java b/src/main/java/com/chargebee/v4/models/itemFamily/ItemFamily.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/models/itemFamily/ItemFamily.java rename to src/main/java/com/chargebee/v4/models/itemFamily/ItemFamily.java index 7520f419..94d847bf 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemFamily/ItemFamily.java +++ b/src/main/java/com/chargebee/v4/models/itemFamily/ItemFamily.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemFamily; +package com.chargebee.v4.models.itemFamily; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; @@ -22,7 +22,7 @@ public class ItemFamily { private String businessEntityId; private Boolean deleted; - private java.util.Map customFields = new java.util.HashMap<>(); + private java.util.Map customFields = new java.util.HashMap<>(); public String getId() { return id; @@ -66,7 +66,7 @@ public Boolean getDeleted() { * * @return map containing all custom fields */ - public java.util.Map getCustomFields() { + public java.util.Map getCustomFields() { return customFields; } @@ -76,7 +76,7 @@ public java.util.Map getCustomFields() { * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") * @return the value of the custom field, or null if not present */ - public Object getCustomField(String fieldName) { + public String getCustomField(String fieldName) { return customFields.get(fieldName); } @@ -141,7 +141,7 @@ public static Channel fromString(String value) { public static ItemFamily fromJson(String json) { ItemFamily obj = new ItemFamily(); - // Parse JSON to extract all keys + // Parse JSON to extract all keys for custom field extraction java.util.Set knownFields = new java.util.HashSet<>(); knownFields.add("id"); @@ -194,9 +194,9 @@ public static ItemFamily fromJson(String json) { * @param knownFields set of known field names * @return map of custom fields */ - private static java.util.Map extractCustomFields( + private static java.util.Map extractCustomFields( String json, java.util.Set knownFields) { - java.util.Map customFields = new java.util.HashMap<>(); + java.util.Map customFields = new java.util.HashMap<>(); try { // Parse the entire JSON as a map java.util.Map allFields = JsonUtil.parseJsonObjectToMap(json); @@ -205,7 +205,8 @@ private static java.util.Map extractCustomFields( String key = entry.getKey(); // Include fields that start with "cf_" and are not in knownFields if (key != null && key.startsWith("cf_") && !knownFields.contains(key)) { - customFields.put(key, entry.getValue()); + customFields.put( + key, entry.getValue() != null ? String.valueOf(entry.getValue()) : null); } } } diff --git a/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyCreateParams.java b/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyCreateParams.java new file mode 100644 index 00000000..1052c29a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyCreateParams.java @@ -0,0 +1,172 @@ +/* + * 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.itemFamily.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ItemFamilyCreateParams { + + private final String id; + + private final String name; + + private final String description; + + private final String businessEntityId; + + private final Map customFields; + + private ItemFamilyCreateParams(ItemFamilyCreateBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.description = builder.description; + + this.businessEntityId = builder.businessEntityId; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public String getBusinessEntityId() { + return businessEntityId; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.businessEntityId != null) { + + formData.put("business_entity_id", this.businessEntityId); + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for ItemFamilyCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemFamilyCreateBuilder builder() { + return new ItemFamilyCreateBuilder(); + } + + public static final class ItemFamilyCreateBuilder { + + private String id; + + private String name; + + private String description; + + private String businessEntityId; + + private Map customFields = new LinkedHashMap<>(); + + private ItemFamilyCreateBuilder() {} + + public ItemFamilyCreateBuilder id(String value) { + this.id = value; + return this; + } + + public ItemFamilyCreateBuilder name(String value) { + this.name = value; + return this; + } + + public ItemFamilyCreateBuilder description(String value) { + this.description = value; + return this; + } + + public ItemFamilyCreateBuilder businessEntityId(String value) { + this.businessEntityId = 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 ItemFamilyCreateBuilder 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 ItemFamilyCreateBuilder 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 ItemFamilyCreateParams build() { + return new ItemFamilyCreateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/itemFamily/params/ItemFamilyDeleteParams.java b/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyDeleteParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/itemFamily/params/ItemFamilyDeleteParams.java rename to src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyDeleteParams.java index 0525f3bb..a2a6e2ca 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemFamily/params/ItemFamilyDeleteParams.java +++ b/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyDeleteParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemFamily.params; +package com.chargebee.v4.models.itemFamily.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class ItemFamilyDeleteParams { - private final Map formData; - - private ItemFamilyDeleteParams(ItemFamilyDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private ItemFamilyDeleteParams(ItemFamilyDeleteBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static ItemFamilyDeleteBuilder builder() { } public static final class ItemFamilyDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); private ItemFamilyDeleteBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/itemFamily/params/ItemFamilyListParams.java b/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/itemFamily/params/ItemFamilyListParams.java rename to src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyListParams.java index 72f3f95b..f6f2b418 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemFamily/params/ItemFamilyListParams.java +++ b/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemFamily.params; +package com.chargebee.v4.models.itemFamily.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/itemFamily/params/ItemFamilyRetrieveParams.java b/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/itemFamily/params/ItemFamilyRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyRetrieveParams.java index 668e6c49..140b276a 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemFamily/params/ItemFamilyRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemFamily.params; +package com.chargebee.v4.models.itemFamily.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyUpdateParams.java b/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyUpdateParams.java new file mode 100644 index 00000000..fa11292a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyUpdateParams.java @@ -0,0 +1,132 @@ +/* + * 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.itemFamily.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ItemFamilyUpdateParams { + + private final String name; + + private final String description; + + private final Map customFields; + + private ItemFamilyUpdateParams(ItemFamilyUpdateBuilder builder) { + + this.name = builder.name; + + this.description = builder.description; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + 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.description != null) { + + formData.put("description", this.description); + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for ItemFamilyUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemFamilyUpdateBuilder builder() { + return new ItemFamilyUpdateBuilder(); + } + + public static final class ItemFamilyUpdateBuilder { + + private String name; + + private String description; + + private Map customFields = new LinkedHashMap<>(); + + private ItemFamilyUpdateBuilder() {} + + public ItemFamilyUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public ItemFamilyUpdateBuilder description(String value) { + this.description = 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 ItemFamilyUpdateBuilder 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 ItemFamilyUpdateBuilder 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 ItemFamilyUpdateParams build() { + return new ItemFamilyUpdateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/itemFamily/ItemFamilyCreateResponse.java b/src/main/java/com/chargebee/v4/models/itemFamily/responses/ItemFamilyCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/itemFamily/ItemFamilyCreateResponse.java rename to src/main/java/com/chargebee/v4/models/itemFamily/responses/ItemFamilyCreateResponse.java index 782b0859..65e7f110 100644 --- a/src/main/java/com/chargebee/v4/core/responses/itemFamily/ItemFamilyCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/itemFamily/responses/ItemFamilyCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.itemFamily; +package com.chargebee.v4.models.itemFamily.responses; -import com.chargebee.v4.core.models.itemFamily.ItemFamily; +import com.chargebee.v4.models.itemFamily.ItemFamily; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/itemFamily/ItemFamilyDeleteResponse.java b/src/main/java/com/chargebee/v4/models/itemFamily/responses/ItemFamilyDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/itemFamily/ItemFamilyDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/itemFamily/responses/ItemFamilyDeleteResponse.java index 634cbb0f..11244794 100644 --- a/src/main/java/com/chargebee/v4/core/responses/itemFamily/ItemFamilyDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/itemFamily/responses/ItemFamilyDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.itemFamily; +package com.chargebee.v4.models.itemFamily.responses; -import com.chargebee.v4.core.models.itemFamily.ItemFamily; +import com.chargebee.v4.models.itemFamily.ItemFamily; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/itemFamily/ItemFamilyListResponse.java b/src/main/java/com/chargebee/v4/models/itemFamily/responses/ItemFamilyListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/itemFamily/ItemFamilyListResponse.java rename to src/main/java/com/chargebee/v4/models/itemFamily/responses/ItemFamilyListResponse.java index 3135fbbf..4eb184e4 100644 --- a/src/main/java/com/chargebee/v4/core/responses/itemFamily/ItemFamilyListResponse.java +++ b/src/main/java/com/chargebee/v4/models/itemFamily/responses/ItemFamilyListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.itemFamily; +package com.chargebee.v4.models.itemFamily.responses; import java.util.List; -import com.chargebee.v4.core.models.itemFamily.ItemFamily; +import com.chargebee.v4.models.itemFamily.ItemFamily; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.ItemFamilyService; -import com.chargebee.v4.core.models.itemFamily.params.ItemFamilyListParams; +import com.chargebee.v4.services.ItemFamilyService; +import com.chargebee.v4.models.itemFamily.params.ItemFamilyListParams; /** Immutable response object for ItemFamilyList operation. Contains paginated list data. */ public final class ItemFamilyListResponse { @@ -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 ItemFamilyListResponse nextPage() throws Exception { + public ItemFamilyListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/itemFamily/responses/ItemFamilyRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/itemFamily/responses/ItemFamilyRetrieveResponse.java new file mode 100644 index 00000000..cbbd16ee --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemFamily/responses/ItemFamilyRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.itemFamily.responses; + +import com.chargebee.v4.models.itemFamily.ItemFamily; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ItemFamilyRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class ItemFamilyRetrieveResponse extends BaseResponse { + private final ItemFamily itemFamily; + + private ItemFamilyRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.itemFamily = builder.itemFamily; + } + + /** Parse JSON response into ItemFamilyRetrieveResponse object. */ + public static ItemFamilyRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ItemFamilyRetrieveResponse object with HTTP response. */ + public static ItemFamilyRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __itemFamilyJson = JsonUtil.getObject(json, "item_family"); + if (__itemFamilyJson != null) { + builder.itemFamily(ItemFamily.fromJson(__itemFamilyJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ItemFamilyRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for ItemFamilyRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ItemFamilyRetrieveResponse. */ + public static class Builder { + + private ItemFamily itemFamily; + + private Response httpResponse; + + private Builder() {} + + public Builder itemFamily(ItemFamily itemFamily) { + this.itemFamily = itemFamily; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ItemFamilyRetrieveResponse build() { + return new ItemFamilyRetrieveResponse(this); + } + } + + /** Get the itemFamily from the response. */ + public ItemFamily getItemFamily() { + return itemFamily; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/itemFamily/ItemFamilyUpdateResponse.java b/src/main/java/com/chargebee/v4/models/itemFamily/responses/ItemFamilyUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/itemFamily/ItemFamilyUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/itemFamily/responses/ItemFamilyUpdateResponse.java index 9b61abfb..0cc0e902 100644 --- a/src/main/java/com/chargebee/v4/core/responses/itemFamily/ItemFamilyUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/itemFamily/responses/ItemFamilyUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.itemFamily; +package com.chargebee.v4.models.itemFamily.responses; -import com.chargebee.v4.core.models.itemFamily.ItemFamily; +import com.chargebee.v4.models.itemFamily.ItemFamily; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/itemPrice/ItemPrice.java b/src/main/java/com/chargebee/v4/models/itemPrice/ItemPrice.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/itemPrice/ItemPrice.java rename to src/main/java/com/chargebee/v4/models/itemPrice/ItemPrice.java index 24227cdc..6195156d 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemPrice/ItemPrice.java +++ b/src/main/java/com/chargebee/v4/models/itemPrice/ItemPrice.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemPrice; +package com.chargebee.v4.models.itemPrice; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; @@ -57,7 +57,7 @@ public class ItemPrice { private List taxProvidersFields; private AccountingDetail accountingDetail; - private java.util.Map customFields = new java.util.HashMap<>(); + private java.util.Map customFields = new java.util.HashMap<>(); public String getId() { return id; @@ -239,7 +239,7 @@ public AccountingDetail getAccountingDetail() { * * @return map containing all custom fields */ - public java.util.Map getCustomFields() { + public java.util.Map getCustomFields() { return customFields; } @@ -249,7 +249,7 @@ public java.util.Map getCustomFields() { * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") * @return the value of the custom field, or null if not present */ - public Object getCustomField(String fieldName) { + public String getCustomField(String fieldName) { return customFields.get(fieldName); } @@ -563,7 +563,7 @@ public static ItemType fromString(String value) { public static ItemPrice fromJson(String json) { ItemPrice obj = new ItemPrice(); - // Parse JSON to extract all keys + // Parse JSON to extract all keys for custom field extraction java.util.Set knownFields = new java.util.HashSet<>(); knownFields.add("id"); @@ -771,9 +771,9 @@ public static ItemPrice fromJson(String json) { * @param knownFields set of known field names * @return map of custom fields */ - private static java.util.Map extractCustomFields( + private static java.util.Map extractCustomFields( String json, java.util.Set knownFields) { - java.util.Map customFields = new java.util.HashMap<>(); + java.util.Map customFields = new java.util.HashMap<>(); try { // Parse the entire JSON as a map java.util.Map allFields = JsonUtil.parseJsonObjectToMap(json); @@ -782,7 +782,8 @@ private static java.util.Map extractCustomFields( String key = entry.getKey(); // Include fields that start with "cf_" and are not in knownFields if (key != null && key.startsWith("cf_") && !knownFields.contains(key)) { - customFields.put(key, entry.getValue()); + customFields.put( + key, entry.getValue() != null ? String.valueOf(entry.getValue()) : null); } } } diff --git a/src/main/java/com/chargebee/v4/models/itemPrice/params/FindApplicableItemPricesParams.java b/src/main/java/com/chargebee/v4/models/itemPrice/params/FindApplicableItemPricesParams.java new file mode 100644 index 00000000..16e72bd8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemPrice/params/FindApplicableItemPricesParams.java @@ -0,0 +1,174 @@ +/* + * 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.itemPrice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class FindApplicableItemPricesParams { + + private final Map queryParams; + + private FindApplicableItemPricesParams(FindApplicableItemPricesBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public FindApplicableItemPricesBuilder toBuilder() { + FindApplicableItemPricesBuilder builder = new FindApplicableItemPricesBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for FindApplicableItemPricesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static FindApplicableItemPricesBuilder builder() { + return new FindApplicableItemPricesBuilder(); + } + + public static final class FindApplicableItemPricesBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private FindApplicableItemPricesBuilder() {} + + public FindApplicableItemPricesBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public FindApplicableItemPricesBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public FindApplicableItemPricesBuilder itemId(String value) { + queryParams.put("item_id", value); + return this; + } + + public SortBySortBuilder sortBy() { + return new SortBySortBuilder("sort_by", this); + } + + public FindApplicableItemPricesParams build() { + return new FindApplicableItemPricesParams(this); + } + + public static final class SortBySortBuilder { + private final String fieldName; + private final FindApplicableItemPricesBuilder builder; + + SortBySortBuilder(String fieldName, FindApplicableItemPricesBuilder builder) { + this.fieldName = fieldName; + this.builder = builder; + } + + public SortDirection name() { + return new SortDirection(fieldName, "name", builder); + } + + public SortDirection id() { + return new SortDirection(fieldName, "id", builder); + } + + public SortDirection updated_at() { + return new SortDirection(fieldName, "updated_at", builder); + } + } + + public static final class SortDirection { + private final String fieldName; + private final String selectedField; + private final FindApplicableItemPricesBuilder builder; + + SortDirection( + String fieldName, String selectedField, FindApplicableItemPricesBuilder builder) { + this.fieldName = fieldName; + this.selectedField = selectedField; + this.builder = builder; + } + + public FindApplicableItemPricesBuilder asc() { + builder.queryParams.put(fieldName + "[asc]", selectedField); + return builder; + } + + public FindApplicableItemPricesBuilder desc() { + builder.queryParams.put(fieldName + "[desc]", selectedField); + return builder; + } + } + } + + public enum SortByAsc { + NAME("name"), + + ID("id"), + + UPDATED_AT("updated_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 { + NAME("name"), + + ID("id"), + + UPDATED_AT("updated_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/itemPrice/params/ItemPriceCreateParams.java b/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceCreateParams.java new file mode 100644 index 00000000..15981b85 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceCreateParams.java @@ -0,0 +1,1636 @@ +/* + * 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.itemPrice.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; + +public final class ItemPriceCreateParams { + + private final String id; + + private final String name; + + private final String description; + + private final String itemId; + + private final String invoiceNotes; + + private final ProrationType prorationType; + + private final String externalName; + + private final String currencyCode; + + private final String priceVariantId; + + private final Boolean isTaxable; + + private final Integer freeQuantity; + + private final String freeQuantityInDecimal; + + private final java.util.Map metadata; + + private final Boolean showDescriptionInInvoices; + + private final Boolean showDescriptionInQuotes; + + private final UsageAccumulationResetFrequency usageAccumulationResetFrequency; + + private final String businessEntityId; + + private final PricingModel pricingModel; + + private final Long price; + + private final String priceInDecimal; + + private final PeriodUnit periodUnit; + + private final Integer period; + + private final TrialPeriodUnit trialPeriodUnit; + + private final Integer trialPeriod; + + private final Integer shippingPeriod; + + private final ShippingPeriodUnit shippingPeriodUnit; + + private final Integer billingCycles; + + private final TrialEndAction trialEndAction; + + private final TaxDetailParams taxDetail; + + private final AccountingDetailParams accountingDetail; + + private final List tiers; + + private final List taxProvidersFields; + + private final Map customFields; + + private ItemPriceCreateParams(ItemPriceCreateBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.description = builder.description; + + this.itemId = builder.itemId; + + this.invoiceNotes = builder.invoiceNotes; + + this.prorationType = builder.prorationType; + + this.externalName = builder.externalName; + + this.currencyCode = builder.currencyCode; + + this.priceVariantId = builder.priceVariantId; + + this.isTaxable = builder.isTaxable; + + this.freeQuantity = builder.freeQuantity; + + this.freeQuantityInDecimal = builder.freeQuantityInDecimal; + + this.metadata = builder.metadata; + + this.showDescriptionInInvoices = builder.showDescriptionInInvoices; + + this.showDescriptionInQuotes = builder.showDescriptionInQuotes; + + this.usageAccumulationResetFrequency = builder.usageAccumulationResetFrequency; + + this.businessEntityId = builder.businessEntityId; + + this.pricingModel = builder.pricingModel; + + this.price = builder.price; + + this.priceInDecimal = builder.priceInDecimal; + + this.periodUnit = builder.periodUnit; + + this.period = builder.period; + + this.trialPeriodUnit = builder.trialPeriodUnit; + + this.trialPeriod = builder.trialPeriod; + + this.shippingPeriod = builder.shippingPeriod; + + this.shippingPeriodUnit = builder.shippingPeriodUnit; + + this.billingCycles = builder.billingCycles; + + this.trialEndAction = builder.trialEndAction; + + this.taxDetail = builder.taxDetail; + + this.accountingDetail = builder.accountingDetail; + + this.tiers = builder.tiers; + + this.taxProvidersFields = builder.taxProvidersFields; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public String getItemId() { + return itemId; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public ProrationType getProrationType() { + return prorationType; + } + + public String getExternalName() { + return externalName; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getPriceVariantId() { + return priceVariantId; + } + + public Boolean getIsTaxable() { + return isTaxable; + } + + public Integer getFreeQuantity() { + return freeQuantity; + } + + public String getFreeQuantityInDecimal() { + return freeQuantityInDecimal; + } + + public java.util.Map getMetadata() { + return metadata; + } + + public Boolean getShowDescriptionInInvoices() { + return showDescriptionInInvoices; + } + + public Boolean getShowDescriptionInQuotes() { + return showDescriptionInQuotes; + } + + public UsageAccumulationResetFrequency getUsageAccumulationResetFrequency() { + return usageAccumulationResetFrequency; + } + + public String getBusinessEntityId() { + return businessEntityId; + } + + public PricingModel getPricingModel() { + return pricingModel; + } + + public Long getPrice() { + return price; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Integer getPeriod() { + return period; + } + + public TrialPeriodUnit getTrialPeriodUnit() { + return trialPeriodUnit; + } + + public Integer getTrialPeriod() { + return trialPeriod; + } + + public Integer getShippingPeriod() { + return shippingPeriod; + } + + public ShippingPeriodUnit getShippingPeriodUnit() { + return shippingPeriodUnit; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public TrialEndAction getTrialEndAction() { + return trialEndAction; + } + + public TaxDetailParams getTaxDetail() { + return taxDetail; + } + + public AccountingDetailParams getAccountingDetail() { + return accountingDetail; + } + + public List getTiers() { + return tiers; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.itemId != null) { + + formData.put("item_id", this.itemId); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.prorationType != null) { + + formData.put("proration_type", this.prorationType); + } + + if (this.externalName != null) { + + formData.put("external_name", this.externalName); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.priceVariantId != null) { + + formData.put("price_variant_id", this.priceVariantId); + } + + if (this.isTaxable != null) { + + formData.put("is_taxable", this.isTaxable); + } + + if (this.freeQuantity != null) { + + formData.put("free_quantity", this.freeQuantity); + } + + if (this.freeQuantityInDecimal != null) { + + formData.put("free_quantity_in_decimal", this.freeQuantityInDecimal); + } + + if (this.metadata != null) { + + formData.put("metadata", JsonUtil.toJson(this.metadata)); + } + + if (this.showDescriptionInInvoices != null) { + + formData.put("show_description_in_invoices", this.showDescriptionInInvoices); + } + + if (this.showDescriptionInQuotes != null) { + + formData.put("show_description_in_quotes", this.showDescriptionInQuotes); + } + + if (this.usageAccumulationResetFrequency != null) { + + formData.put("usage_accumulation_reset_frequency", this.usageAccumulationResetFrequency); + } + + if (this.businessEntityId != null) { + + formData.put("business_entity_id", this.businessEntityId); + } + + if (this.pricingModel != null) { + + formData.put("pricing_model", this.pricingModel); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.trialPeriodUnit != null) { + + formData.put("trial_period_unit", this.trialPeriodUnit); + } + + if (this.trialPeriod != null) { + + formData.put("trial_period", this.trialPeriod); + } + + if (this.shippingPeriod != null) { + + formData.put("shipping_period", this.shippingPeriod); + } + + if (this.shippingPeriodUnit != null) { + + formData.put("shipping_period_unit", this.shippingPeriodUnit); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEndAction != null) { + + formData.put("trial_end_action", this.trialEndAction); + } + + if (this.taxDetail != null) { + + // Single object + Map nestedData = this.taxDetail.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "tax_detail[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.accountingDetail != null) { + + // Single object + Map nestedData = this.accountingDetail.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "accounting_detail[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.tiers != null) { + + // List of objects + for (int i = 0; i < this.tiers.size(); i++) { + TiersParams item = this.tiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for ItemPriceCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemPriceCreateBuilder builder() { + return new ItemPriceCreateBuilder(); + } + + public static final class ItemPriceCreateBuilder { + + private String id; + + private String name; + + private String description; + + private String itemId; + + private String invoiceNotes; + + private ProrationType prorationType; + + private String externalName; + + private String currencyCode; + + private String priceVariantId; + + private Boolean isTaxable; + + private Integer freeQuantity; + + private String freeQuantityInDecimal; + + private java.util.Map metadata; + + private Boolean showDescriptionInInvoices; + + private Boolean showDescriptionInQuotes; + + private UsageAccumulationResetFrequency usageAccumulationResetFrequency; + + private String businessEntityId; + + private PricingModel pricingModel; + + private Long price; + + private String priceInDecimal; + + private PeriodUnit periodUnit; + + private Integer period; + + private TrialPeriodUnit trialPeriodUnit; + + private Integer trialPeriod; + + private Integer shippingPeriod; + + private ShippingPeriodUnit shippingPeriodUnit; + + private Integer billingCycles; + + private TrialEndAction trialEndAction; + + private TaxDetailParams taxDetail; + + private AccountingDetailParams accountingDetail; + + private List tiers; + + private List taxProvidersFields; + + private Map customFields = new LinkedHashMap<>(); + + private ItemPriceCreateBuilder() {} + + public ItemPriceCreateBuilder id(String value) { + this.id = value; + return this; + } + + public ItemPriceCreateBuilder name(String value) { + this.name = value; + return this; + } + + public ItemPriceCreateBuilder description(String value) { + this.description = value; + return this; + } + + public ItemPriceCreateBuilder itemId(String value) { + this.itemId = value; + return this; + } + + public ItemPriceCreateBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public ItemPriceCreateBuilder prorationType(ProrationType value) { + this.prorationType = value; + return this; + } + + public ItemPriceCreateBuilder externalName(String value) { + this.externalName = value; + return this; + } + + public ItemPriceCreateBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public ItemPriceCreateBuilder priceVariantId(String value) { + this.priceVariantId = value; + return this; + } + + public ItemPriceCreateBuilder isTaxable(Boolean value) { + this.isTaxable = value; + return this; + } + + public ItemPriceCreateBuilder freeQuantity(Integer value) { + this.freeQuantity = value; + return this; + } + + public ItemPriceCreateBuilder freeQuantityInDecimal(String value) { + this.freeQuantityInDecimal = value; + return this; + } + + public ItemPriceCreateBuilder metadata(java.util.Map value) { + this.metadata = value; + return this; + } + + public ItemPriceCreateBuilder showDescriptionInInvoices(Boolean value) { + this.showDescriptionInInvoices = value; + return this; + } + + public ItemPriceCreateBuilder showDescriptionInQuotes(Boolean value) { + this.showDescriptionInQuotes = value; + return this; + } + + public ItemPriceCreateBuilder usageAccumulationResetFrequency( + UsageAccumulationResetFrequency value) { + this.usageAccumulationResetFrequency = value; + return this; + } + + public ItemPriceCreateBuilder businessEntityId(String value) { + this.businessEntityId = value; + return this; + } + + public ItemPriceCreateBuilder pricingModel(PricingModel value) { + this.pricingModel = value; + return this; + } + + public ItemPriceCreateBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemPriceCreateBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemPriceCreateBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public ItemPriceCreateBuilder period(Integer value) { + this.period = value; + return this; + } + + public ItemPriceCreateBuilder trialPeriodUnit(TrialPeriodUnit value) { + this.trialPeriodUnit = value; + return this; + } + + public ItemPriceCreateBuilder trialPeriod(Integer value) { + this.trialPeriod = value; + return this; + } + + public ItemPriceCreateBuilder shippingPeriod(Integer value) { + this.shippingPeriod = value; + return this; + } + + public ItemPriceCreateBuilder shippingPeriodUnit(ShippingPeriodUnit value) { + this.shippingPeriodUnit = value; + return this; + } + + public ItemPriceCreateBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public ItemPriceCreateBuilder trialEndAction(TrialEndAction value) { + this.trialEndAction = value; + return this; + } + + public ItemPriceCreateBuilder taxDetail(TaxDetailParams value) { + this.taxDetail = value; + return this; + } + + public ItemPriceCreateBuilder accountingDetail(AccountingDetailParams value) { + this.accountingDetail = value; + return this; + } + + public ItemPriceCreateBuilder tiers(List value) { + this.tiers = value; + return this; + } + + public ItemPriceCreateBuilder taxProvidersFields(List value) { + this.taxProvidersFields = 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 ItemPriceCreateBuilder 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 ItemPriceCreateBuilder 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 ItemPriceCreateParams build() { + return new ItemPriceCreateParams(this); + } + } + + public enum ProrationType { + SITE_DEFAULT("site_default"), + + PARTIAL_TERM("partial_term"), + + FULL_TERM("full_term"), + + /** An enum member indicating that ProrationType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationType enumValue : ProrationType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum UsageAccumulationResetFrequency { + NEVER("never"), + + SUBSCRIPTION_BILLING_FREQUENCY("subscription_billing_frequency"), + + /** + * An enum member indicating that UsageAccumulationResetFrequency was instantiated with an + * unknown value. + */ + _UNKNOWN(null); + private final String value; + + UsageAccumulationResetFrequency(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static UsageAccumulationResetFrequency fromString(String value) { + if (value == null) return _UNKNOWN; + for (UsageAccumulationResetFrequency enumValue : UsageAccumulationResetFrequency.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PricingModel { + FLAT_FEE("flat_fee"), + + PER_UNIT("per_unit"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** An enum member indicating that PricingModel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingModel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingModel fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingModel enumValue : PricingModel.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 enum TrialPeriodUnit { + DAY("day"), + + MONTH("month"), + + /** An enum member indicating that TrialPeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialPeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialPeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialPeriodUnit enumValue : TrialPeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ShippingPeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that ShippingPeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ShippingPeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ShippingPeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (ShippingPeriodUnit enumValue : ShippingPeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialEndAction { + SITE_DEFAULT("site_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialEndAction enumValue : TrialEndAction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class TaxDetailParams { + + private final String taxProfileId; + + private final String avalaraTaxCode; + + private final String hsnCode; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final String taxjarProductCode; + + private TaxDetailParams(TaxDetailBuilder builder) { + + this.taxProfileId = builder.taxProfileId; + + this.avalaraTaxCode = builder.avalaraTaxCode; + + this.hsnCode = builder.hsnCode; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.taxjarProductCode = builder.taxjarProductCode; + } + + public String getTaxProfileId() { + return taxProfileId; + } + + public String getAvalaraTaxCode() { + return avalaraTaxCode; + } + + public String getHsnCode() { + return hsnCode; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public String getTaxjarProductCode() { + return taxjarProductCode; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.taxProfileId != null) { + + formData.put("tax_profile_id", this.taxProfileId); + } + + if (this.avalaraTaxCode != null) { + + formData.put("avalara_tax_code", this.avalaraTaxCode); + } + + if (this.hsnCode != null) { + + formData.put("hsn_code", this.hsnCode); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.taxjarProductCode != null) { + + formData.put("taxjar_product_code", this.taxjarProductCode); + } + + return formData; + } + + /** Create a new builder for TaxDetailParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxDetailBuilder builder() { + return new TaxDetailBuilder(); + } + + public static final class TaxDetailBuilder { + + private String taxProfileId; + + private String avalaraTaxCode; + + private String hsnCode; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private String taxjarProductCode; + + private TaxDetailBuilder() {} + + public TaxDetailBuilder taxProfileId(String value) { + this.taxProfileId = value; + return this; + } + + public TaxDetailBuilder avalaraTaxCode(String value) { + this.avalaraTaxCode = value; + return this; + } + + public TaxDetailBuilder hsnCode(String value) { + this.hsnCode = value; + return this; + } + + public TaxDetailBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public TaxDetailBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public TaxDetailBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public TaxDetailBuilder taxjarProductCode(String value) { + this.taxjarProductCode = value; + return this; + } + + public TaxDetailParams build() { + return new TaxDetailParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AccountingDetailParams { + + private final String sku; + + private final String accountingCode; + + private final String accountingCategory1; + + private final String accountingCategory2; + + private final String accountingCategory3; + + private final String accountingCategory4; + + private AccountingDetailParams(AccountingDetailBuilder builder) { + + this.sku = builder.sku; + + this.accountingCode = builder.accountingCode; + + this.accountingCategory1 = builder.accountingCategory1; + + this.accountingCategory2 = builder.accountingCategory2; + + this.accountingCategory3 = builder.accountingCategory3; + + this.accountingCategory4 = builder.accountingCategory4; + } + + public String getSku() { + return sku; + } + + public String getAccountingCode() { + return accountingCode; + } + + public String getAccountingCategory1() { + return accountingCategory1; + } + + public String getAccountingCategory2() { + return accountingCategory2; + } + + public String getAccountingCategory3() { + return accountingCategory3; + } + + public String getAccountingCategory4() { + return accountingCategory4; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.sku != null) { + + formData.put("sku", this.sku); + } + + if (this.accountingCode != null) { + + formData.put("accounting_code", this.accountingCode); + } + + if (this.accountingCategory1 != null) { + + formData.put("accounting_category1", this.accountingCategory1); + } + + if (this.accountingCategory2 != null) { + + formData.put("accounting_category2", this.accountingCategory2); + } + + if (this.accountingCategory3 != null) { + + formData.put("accounting_category3", this.accountingCategory3); + } + + if (this.accountingCategory4 != null) { + + formData.put("accounting_category4", this.accountingCategory4); + } + + return formData; + } + + /** Create a new builder for AccountingDetailParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AccountingDetailBuilder builder() { + return new AccountingDetailBuilder(); + } + + public static final class AccountingDetailBuilder { + + private String sku; + + private String accountingCode; + + private String accountingCategory1; + + private String accountingCategory2; + + private String accountingCategory3; + + private String accountingCategory4; + + private AccountingDetailBuilder() {} + + public AccountingDetailBuilder sku(String value) { + this.sku = value; + return this; + } + + public AccountingDetailBuilder accountingCode(String value) { + this.accountingCode = value; + return this; + } + + public AccountingDetailBuilder accountingCategory1(String value) { + this.accountingCategory1 = value; + return this; + } + + public AccountingDetailBuilder accountingCategory2(String value) { + this.accountingCategory2 = value; + return this; + } + + public AccountingDetailBuilder accountingCategory3(String value) { + this.accountingCategory3 = value; + return this; + } + + public AccountingDetailBuilder accountingCategory4(String value) { + this.accountingCategory4 = value; + return this; + } + + public AccountingDetailParams build() { + return new AccountingDetailParams(this); + } + } + } + + public static final class TiersParams { + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private TiersParams(TiersBuilder builder) { + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for TiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TiersBuilder builder() { + return new TiersBuilder(); + } + + public static final class TiersBuilder { + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private TiersBuilder() {} + + public TiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public TiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public TiersBuilder price(Long value) { + this.price = value; + return this; + } + + public TiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public TiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public TiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public TiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public TiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public TiersParams build() { + return new TiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceDeleteParams.java b/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceDeleteParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceDeleteParams.java rename to src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceDeleteParams.java index 54866475..80523762 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceDeleteParams.java +++ b/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceDeleteParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemPrice.params; +package com.chargebee.v4.models.itemPrice.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class ItemPriceDeleteParams { - private final Map formData; - - private ItemPriceDeleteParams(ItemPriceDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private ItemPriceDeleteParams(ItemPriceDeleteBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static ItemPriceDeleteBuilder builder() { } public static final class ItemPriceDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); private ItemPriceDeleteBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceFindApplicableItemsParams.java b/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceFindApplicableItemsParams.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceFindApplicableItemsParams.java rename to src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceFindApplicableItemsParams.java index 3917a020..a62f1ce0 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceFindApplicableItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceFindApplicableItemsParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemPrice.params; +package com.chargebee.v4.models.itemPrice.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceListParams.java b/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceListParams.java rename to src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceListParams.java index c0d6f5c9..00dc5a7c 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceListParams.java +++ b/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemPrice.params; +package com.chargebee.v4.models.itemPrice.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceRetrieveParams.java b/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceRetrieveParams.java index 1005947b..424fe08c 100644 --- a/src/main/java/com/chargebee/v4/core/models/itemPrice/params/ItemPriceRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.itemPrice.params; +package com.chargebee.v4.models.itemPrice.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceUpdateParams.java b/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceUpdateParams.java new file mode 100644 index 00000000..2adddb04 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceUpdateParams.java @@ -0,0 +1,1624 @@ +/* + * 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.itemPrice.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; + +public final class ItemPriceUpdateParams { + + private final String name; + + private final String description; + + private final ProrationType prorationType; + + private final String priceVariantId; + + private final Status status; + + private final String externalName; + + private final UsageAccumulationResetFrequency usageAccumulationResetFrequency; + + private final String currencyCode; + + private final String invoiceNotes; + + private final Boolean isTaxable; + + private final Integer freeQuantity; + + private final String freeQuantityInDecimal; + + private final java.util.Map metadata; + + private final PricingModel pricingModel; + + private final Long price; + + private final String priceInDecimal; + + private final PeriodUnit periodUnit; + + private final Integer period; + + private final TrialPeriodUnit trialPeriodUnit; + + private final Integer trialPeriod; + + private final Integer shippingPeriod; + + private final ShippingPeriodUnit shippingPeriodUnit; + + private final Integer billingCycles; + + private final TrialEndAction trialEndAction; + + private final Boolean showDescriptionInInvoices; + + private final Boolean showDescriptionInQuotes; + + private final TaxDetailParams taxDetail; + + private final AccountingDetailParams accountingDetail; + + private final List tiers; + + private final List taxProvidersFields; + + private final Map customFields; + + private ItemPriceUpdateParams(ItemPriceUpdateBuilder builder) { + + this.name = builder.name; + + this.description = builder.description; + + this.prorationType = builder.prorationType; + + this.priceVariantId = builder.priceVariantId; + + this.status = builder.status; + + this.externalName = builder.externalName; + + this.usageAccumulationResetFrequency = builder.usageAccumulationResetFrequency; + + this.currencyCode = builder.currencyCode; + + this.invoiceNotes = builder.invoiceNotes; + + this.isTaxable = builder.isTaxable; + + this.freeQuantity = builder.freeQuantity; + + this.freeQuantityInDecimal = builder.freeQuantityInDecimal; + + this.metadata = builder.metadata; + + this.pricingModel = builder.pricingModel; + + this.price = builder.price; + + this.priceInDecimal = builder.priceInDecimal; + + this.periodUnit = builder.periodUnit; + + this.period = builder.period; + + this.trialPeriodUnit = builder.trialPeriodUnit; + + this.trialPeriod = builder.trialPeriod; + + this.shippingPeriod = builder.shippingPeriod; + + this.shippingPeriodUnit = builder.shippingPeriodUnit; + + this.billingCycles = builder.billingCycles; + + this.trialEndAction = builder.trialEndAction; + + this.showDescriptionInInvoices = builder.showDescriptionInInvoices; + + this.showDescriptionInQuotes = builder.showDescriptionInQuotes; + + this.taxDetail = builder.taxDetail; + + this.accountingDetail = builder.accountingDetail; + + this.tiers = builder.tiers; + + this.taxProvidersFields = builder.taxProvidersFields; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public ProrationType getProrationType() { + return prorationType; + } + + public String getPriceVariantId() { + return priceVariantId; + } + + public Status getStatus() { + return status; + } + + public String getExternalName() { + return externalName; + } + + public UsageAccumulationResetFrequency getUsageAccumulationResetFrequency() { + return usageAccumulationResetFrequency; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public Boolean getIsTaxable() { + return isTaxable; + } + + public Integer getFreeQuantity() { + return freeQuantity; + } + + public String getFreeQuantityInDecimal() { + return freeQuantityInDecimal; + } + + public java.util.Map getMetadata() { + return metadata; + } + + public PricingModel getPricingModel() { + return pricingModel; + } + + public Long getPrice() { + return price; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Integer getPeriod() { + return period; + } + + public TrialPeriodUnit getTrialPeriodUnit() { + return trialPeriodUnit; + } + + public Integer getTrialPeriod() { + return trialPeriod; + } + + public Integer getShippingPeriod() { + return shippingPeriod; + } + + public ShippingPeriodUnit getShippingPeriodUnit() { + return shippingPeriodUnit; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public TrialEndAction getTrialEndAction() { + return trialEndAction; + } + + public Boolean getShowDescriptionInInvoices() { + return showDescriptionInInvoices; + } + + public Boolean getShowDescriptionInQuotes() { + return showDescriptionInQuotes; + } + + public TaxDetailParams getTaxDetail() { + return taxDetail; + } + + public AccountingDetailParams getAccountingDetail() { + return accountingDetail; + } + + public List getTiers() { + return tiers; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + 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.description != null) { + + formData.put("description", this.description); + } + + if (this.prorationType != null) { + + formData.put("proration_type", this.prorationType); + } + + if (this.priceVariantId != null) { + + formData.put("price_variant_id", this.priceVariantId); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.externalName != null) { + + formData.put("external_name", this.externalName); + } + + if (this.usageAccumulationResetFrequency != null) { + + formData.put("usage_accumulation_reset_frequency", this.usageAccumulationResetFrequency); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.isTaxable != null) { + + formData.put("is_taxable", this.isTaxable); + } + + if (this.freeQuantity != null) { + + formData.put("free_quantity", this.freeQuantity); + } + + if (this.freeQuantityInDecimal != null) { + + formData.put("free_quantity_in_decimal", this.freeQuantityInDecimal); + } + + if (this.metadata != null) { + + formData.put("metadata", JsonUtil.toJson(this.metadata)); + } + + if (this.pricingModel != null) { + + formData.put("pricing_model", this.pricingModel); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.trialPeriodUnit != null) { + + formData.put("trial_period_unit", this.trialPeriodUnit); + } + + if (this.trialPeriod != null) { + + formData.put("trial_period", this.trialPeriod); + } + + if (this.shippingPeriod != null) { + + formData.put("shipping_period", this.shippingPeriod); + } + + if (this.shippingPeriodUnit != null) { + + formData.put("shipping_period_unit", this.shippingPeriodUnit); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEndAction != null) { + + formData.put("trial_end_action", this.trialEndAction); + } + + if (this.showDescriptionInInvoices != null) { + + formData.put("show_description_in_invoices", this.showDescriptionInInvoices); + } + + if (this.showDescriptionInQuotes != null) { + + formData.put("show_description_in_quotes", this.showDescriptionInQuotes); + } + + if (this.taxDetail != null) { + + // Single object + Map nestedData = this.taxDetail.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "tax_detail[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.accountingDetail != null) { + + // Single object + Map nestedData = this.accountingDetail.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "accounting_detail[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.tiers != null) { + + // List of objects + for (int i = 0; i < this.tiers.size(); i++) { + TiersParams item = this.tiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for ItemPriceUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemPriceUpdateBuilder builder() { + return new ItemPriceUpdateBuilder(); + } + + public static final class ItemPriceUpdateBuilder { + + private String name; + + private String description; + + private ProrationType prorationType; + + private String priceVariantId; + + private Status status; + + private String externalName; + + private UsageAccumulationResetFrequency usageAccumulationResetFrequency; + + private String currencyCode; + + private String invoiceNotes; + + private Boolean isTaxable; + + private Integer freeQuantity; + + private String freeQuantityInDecimal; + + private java.util.Map metadata; + + private PricingModel pricingModel; + + private Long price; + + private String priceInDecimal; + + private PeriodUnit periodUnit; + + private Integer period; + + private TrialPeriodUnit trialPeriodUnit; + + private Integer trialPeriod; + + private Integer shippingPeriod; + + private ShippingPeriodUnit shippingPeriodUnit; + + private Integer billingCycles; + + private TrialEndAction trialEndAction; + + private Boolean showDescriptionInInvoices; + + private Boolean showDescriptionInQuotes; + + private TaxDetailParams taxDetail; + + private AccountingDetailParams accountingDetail; + + private List tiers; + + private List taxProvidersFields; + + private Map customFields = new LinkedHashMap<>(); + + private ItemPriceUpdateBuilder() {} + + public ItemPriceUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public ItemPriceUpdateBuilder description(String value) { + this.description = value; + return this; + } + + public ItemPriceUpdateBuilder prorationType(ProrationType value) { + this.prorationType = value; + return this; + } + + public ItemPriceUpdateBuilder priceVariantId(String value) { + this.priceVariantId = value; + return this; + } + + public ItemPriceUpdateBuilder status(Status value) { + this.status = value; + return this; + } + + public ItemPriceUpdateBuilder externalName(String value) { + this.externalName = value; + return this; + } + + public ItemPriceUpdateBuilder usageAccumulationResetFrequency( + UsageAccumulationResetFrequency value) { + this.usageAccumulationResetFrequency = value; + return this; + } + + public ItemPriceUpdateBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public ItemPriceUpdateBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public ItemPriceUpdateBuilder isTaxable(Boolean value) { + this.isTaxable = value; + return this; + } + + public ItemPriceUpdateBuilder freeQuantity(Integer value) { + this.freeQuantity = value; + return this; + } + + public ItemPriceUpdateBuilder freeQuantityInDecimal(String value) { + this.freeQuantityInDecimal = value; + return this; + } + + public ItemPriceUpdateBuilder metadata(java.util.Map value) { + this.metadata = value; + return this; + } + + public ItemPriceUpdateBuilder pricingModel(PricingModel value) { + this.pricingModel = value; + return this; + } + + public ItemPriceUpdateBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemPriceUpdateBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemPriceUpdateBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public ItemPriceUpdateBuilder period(Integer value) { + this.period = value; + return this; + } + + public ItemPriceUpdateBuilder trialPeriodUnit(TrialPeriodUnit value) { + this.trialPeriodUnit = value; + return this; + } + + public ItemPriceUpdateBuilder trialPeriod(Integer value) { + this.trialPeriod = value; + return this; + } + + public ItemPriceUpdateBuilder shippingPeriod(Integer value) { + this.shippingPeriod = value; + return this; + } + + public ItemPriceUpdateBuilder shippingPeriodUnit(ShippingPeriodUnit value) { + this.shippingPeriodUnit = value; + return this; + } + + public ItemPriceUpdateBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public ItemPriceUpdateBuilder trialEndAction(TrialEndAction value) { + this.trialEndAction = value; + return this; + } + + public ItemPriceUpdateBuilder showDescriptionInInvoices(Boolean value) { + this.showDescriptionInInvoices = value; + return this; + } + + public ItemPriceUpdateBuilder showDescriptionInQuotes(Boolean value) { + this.showDescriptionInQuotes = value; + return this; + } + + public ItemPriceUpdateBuilder taxDetail(TaxDetailParams value) { + this.taxDetail = value; + return this; + } + + public ItemPriceUpdateBuilder accountingDetail(AccountingDetailParams value) { + this.accountingDetail = value; + return this; + } + + public ItemPriceUpdateBuilder tiers(List value) { + this.tiers = value; + return this; + } + + public ItemPriceUpdateBuilder taxProvidersFields(List value) { + this.taxProvidersFields = 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 ItemPriceUpdateBuilder 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 ItemPriceUpdateBuilder 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 ItemPriceUpdateParams build() { + return new ItemPriceUpdateParams(this); + } + } + + public enum ProrationType { + SITE_DEFAULT("site_default"), + + PARTIAL_TERM("partial_term"), + + FULL_TERM("full_term"), + + /** An enum member indicating that ProrationType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationType enumValue : ProrationType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + ACTIVE("active"), + + ARCHIVED("archived"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum UsageAccumulationResetFrequency { + NEVER("never"), + + SUBSCRIPTION_BILLING_FREQUENCY("subscription_billing_frequency"), + + /** + * An enum member indicating that UsageAccumulationResetFrequency was instantiated with an + * unknown value. + */ + _UNKNOWN(null); + private final String value; + + UsageAccumulationResetFrequency(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static UsageAccumulationResetFrequency fromString(String value) { + if (value == null) return _UNKNOWN; + for (UsageAccumulationResetFrequency enumValue : UsageAccumulationResetFrequency.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PricingModel { + FLAT_FEE("flat_fee"), + + PER_UNIT("per_unit"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** An enum member indicating that PricingModel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingModel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingModel fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingModel enumValue : PricingModel.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 enum TrialPeriodUnit { + DAY("day"), + + MONTH("month"), + + /** An enum member indicating that TrialPeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialPeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialPeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialPeriodUnit enumValue : TrialPeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ShippingPeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that ShippingPeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ShippingPeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ShippingPeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (ShippingPeriodUnit enumValue : ShippingPeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialEndAction { + SITE_DEFAULT("site_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialEndAction enumValue : TrialEndAction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class TaxDetailParams { + + private final String taxProfileId; + + private final String avalaraTaxCode; + + private final String hsnCode; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final String taxjarProductCode; + + private TaxDetailParams(TaxDetailBuilder builder) { + + this.taxProfileId = builder.taxProfileId; + + this.avalaraTaxCode = builder.avalaraTaxCode; + + this.hsnCode = builder.hsnCode; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.taxjarProductCode = builder.taxjarProductCode; + } + + public String getTaxProfileId() { + return taxProfileId; + } + + public String getAvalaraTaxCode() { + return avalaraTaxCode; + } + + public String getHsnCode() { + return hsnCode; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public String getTaxjarProductCode() { + return taxjarProductCode; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.taxProfileId != null) { + + formData.put("tax_profile_id", this.taxProfileId); + } + + if (this.avalaraTaxCode != null) { + + formData.put("avalara_tax_code", this.avalaraTaxCode); + } + + if (this.hsnCode != null) { + + formData.put("hsn_code", this.hsnCode); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.taxjarProductCode != null) { + + formData.put("taxjar_product_code", this.taxjarProductCode); + } + + return formData; + } + + /** Create a new builder for TaxDetailParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxDetailBuilder builder() { + return new TaxDetailBuilder(); + } + + public static final class TaxDetailBuilder { + + private String taxProfileId; + + private String avalaraTaxCode; + + private String hsnCode; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private String taxjarProductCode; + + private TaxDetailBuilder() {} + + public TaxDetailBuilder taxProfileId(String value) { + this.taxProfileId = value; + return this; + } + + public TaxDetailBuilder avalaraTaxCode(String value) { + this.avalaraTaxCode = value; + return this; + } + + public TaxDetailBuilder hsnCode(String value) { + this.hsnCode = value; + return this; + } + + public TaxDetailBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public TaxDetailBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public TaxDetailBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public TaxDetailBuilder taxjarProductCode(String value) { + this.taxjarProductCode = value; + return this; + } + + public TaxDetailParams build() { + return new TaxDetailParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AccountingDetailParams { + + private final String sku; + + private final String accountingCode; + + private final String accountingCategory1; + + private final String accountingCategory2; + + private final String accountingCategory3; + + private final String accountingCategory4; + + private AccountingDetailParams(AccountingDetailBuilder builder) { + + this.sku = builder.sku; + + this.accountingCode = builder.accountingCode; + + this.accountingCategory1 = builder.accountingCategory1; + + this.accountingCategory2 = builder.accountingCategory2; + + this.accountingCategory3 = builder.accountingCategory3; + + this.accountingCategory4 = builder.accountingCategory4; + } + + public String getSku() { + return sku; + } + + public String getAccountingCode() { + return accountingCode; + } + + public String getAccountingCategory1() { + return accountingCategory1; + } + + public String getAccountingCategory2() { + return accountingCategory2; + } + + public String getAccountingCategory3() { + return accountingCategory3; + } + + public String getAccountingCategory4() { + return accountingCategory4; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.sku != null) { + + formData.put("sku", this.sku); + } + + if (this.accountingCode != null) { + + formData.put("accounting_code", this.accountingCode); + } + + if (this.accountingCategory1 != null) { + + formData.put("accounting_category1", this.accountingCategory1); + } + + if (this.accountingCategory2 != null) { + + formData.put("accounting_category2", this.accountingCategory2); + } + + if (this.accountingCategory3 != null) { + + formData.put("accounting_category3", this.accountingCategory3); + } + + if (this.accountingCategory4 != null) { + + formData.put("accounting_category4", this.accountingCategory4); + } + + return formData; + } + + /** Create a new builder for AccountingDetailParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AccountingDetailBuilder builder() { + return new AccountingDetailBuilder(); + } + + public static final class AccountingDetailBuilder { + + private String sku; + + private String accountingCode; + + private String accountingCategory1; + + private String accountingCategory2; + + private String accountingCategory3; + + private String accountingCategory4; + + private AccountingDetailBuilder() {} + + public AccountingDetailBuilder sku(String value) { + this.sku = value; + return this; + } + + public AccountingDetailBuilder accountingCode(String value) { + this.accountingCode = value; + return this; + } + + public AccountingDetailBuilder accountingCategory1(String value) { + this.accountingCategory1 = value; + return this; + } + + public AccountingDetailBuilder accountingCategory2(String value) { + this.accountingCategory2 = value; + return this; + } + + public AccountingDetailBuilder accountingCategory3(String value) { + this.accountingCategory3 = value; + return this; + } + + public AccountingDetailBuilder accountingCategory4(String value) { + this.accountingCategory4 = value; + return this; + } + + public AccountingDetailParams build() { + return new AccountingDetailParams(this); + } + } + } + + public static final class TiersParams { + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private TiersParams(TiersBuilder builder) { + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for TiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TiersBuilder builder() { + return new TiersBuilder(); + } + + public static final class TiersBuilder { + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private TiersBuilder() {} + + public TiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public TiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public TiersBuilder price(Long value) { + this.price = value; + return this; + } + + public TiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public TiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public TiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public TiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public TiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public TiersParams build() { + return new TiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/itemPrice/params/MoveItemPriceParams.java b/src/main/java/com/chargebee/v4/models/itemPrice/params/MoveItemPriceParams.java new file mode 100644 index 00000000..d9db9dfe --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemPrice/params/MoveItemPriceParams.java @@ -0,0 +1,80 @@ +/* + * 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.itemPrice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class MoveItemPriceParams { + + private final String destinationItemId; + + private final String variantId; + + private MoveItemPriceParams(MoveItemPriceBuilder builder) { + + this.destinationItemId = builder.destinationItemId; + + this.variantId = builder.variantId; + } + + public String getDestinationItemId() { + return destinationItemId; + } + + public String getVariantId() { + return variantId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.destinationItemId != null) { + + formData.put("destination_item_id", this.destinationItemId); + } + + if (this.variantId != null) { + + formData.put("variant_id", this.variantId); + } + + return formData; + } + + /** Create a new builder for MoveItemPriceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static MoveItemPriceBuilder builder() { + return new MoveItemPriceBuilder(); + } + + public static final class MoveItemPriceBuilder { + + private String destinationItemId; + + private String variantId; + + private MoveItemPriceBuilder() {} + + public MoveItemPriceBuilder destinationItemId(String value) { + this.destinationItemId = value; + return this; + } + + public MoveItemPriceBuilder variantId(String value) { + this.variantId = value; + return this; + } + + public MoveItemPriceParams build() { + return new MoveItemPriceParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/itemPrice/responses/FindApplicableItemPricesResponse.java b/src/main/java/com/chargebee/v4/models/itemPrice/responses/FindApplicableItemPricesResponse.java new file mode 100644 index 00000000..c9278069 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemPrice/responses/FindApplicableItemPricesResponse.java @@ -0,0 +1,176 @@ +package com.chargebee.v4.models.itemPrice.responses; + +import java.util.List; + +import com.chargebee.v4.models.itemPrice.ItemPrice; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.ItemPriceService; +import com.chargebee.v4.models.itemPrice.params.FindApplicableItemPricesParams; + +/** + * Immutable response object for FindApplicableItemPrices operation. Contains paginated list data. + */ +public final class FindApplicableItemPricesResponse { + + private final List list; + + private final String nextOffset; + + private final String itemPriceId; + + private final ItemPriceService service; + private final FindApplicableItemPricesParams originalParams; + private final Response httpResponse; + + private FindApplicableItemPricesResponse( + List list, + String nextOffset, + String itemPriceId, + ItemPriceService service, + FindApplicableItemPricesParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.itemPriceId = itemPriceId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into FindApplicableItemPricesResponse object (no service context). Use this + * when you only need to read a single page (no nextPage()). + */ + public static FindApplicableItemPricesResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(ItemPriceFindApplicableItemPricesItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new FindApplicableItemPricesResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse FindApplicableItemPricesResponse from JSON", e); + } + } + + /** + * Parse JSON response into FindApplicableItemPricesResponse object with service context for + * pagination (enables nextPage()). + */ + public static FindApplicableItemPricesResponse fromJson( + String json, + ItemPriceService service, + FindApplicableItemPricesParams originalParams, + String itemPriceId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(ItemPriceFindApplicableItemPricesItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new FindApplicableItemPricesResponse( + list, nextOffset, itemPriceId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse FindApplicableItemPricesResponse 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 FindApplicableItemPricesResponse 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)."); + } + + FindApplicableItemPricesParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : FindApplicableItemPricesParams.builder()) + .offset(nextOffset) + .build(); + + return service.findApplicableItemPrices(itemPriceId, 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 ItemPriceFindApplicableItemPricesItem { + + private ItemPrice itemPrice; + + public ItemPrice getItemPrice() { + return itemPrice; + } + + public static ItemPriceFindApplicableItemPricesItem fromJson(String json) { + ItemPriceFindApplicableItemPricesItem item = new ItemPriceFindApplicableItemPricesItem(); + + String __itemPriceJson = JsonUtil.getObject(json, "item_price"); + if (__itemPriceJson != null) { + item.itemPrice = ItemPrice.fromJson(__itemPriceJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceCreateResponse.java b/src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceCreateResponse.java rename to src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceCreateResponse.java index 3efdd774..13be2551 100644 --- a/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.itemPrice; +package com.chargebee.v4.models.itemPrice.responses; -import com.chargebee.v4.core.models.itemPrice.ItemPrice; +import com.chargebee.v4.models.itemPrice.ItemPrice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceDeleteResponse.java b/src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceDeleteResponse.java index ec171eac..d024e354 100644 --- a/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.itemPrice; +package com.chargebee.v4.models.itemPrice.responses; -import com.chargebee.v4.core.models.itemPrice.ItemPrice; +import com.chargebee.v4.models.itemPrice.ItemPrice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceFindApplicableItemsResponse.java b/src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceFindApplicableItemsResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceFindApplicableItemsResponse.java rename to src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceFindApplicableItemsResponse.java index 56d9db6f..ebc6fbd3 100644 --- a/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceFindApplicableItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceFindApplicableItemsResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.itemPrice; +package com.chargebee.v4.models.itemPrice.responses; import java.util.List; -import com.chargebee.v4.core.models.item.Item; +import com.chargebee.v4.models.item.Item; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.ItemPriceService; -import com.chargebee.v4.core.models.itemPrice.params.ItemPriceFindApplicableItemsParams; +import com.chargebee.v4.services.ItemPriceService; +import com.chargebee.v4.models.itemPrice.params.ItemPriceFindApplicableItemsParams; /** * Immutable response object for ItemPriceFindApplicableItems operation. Contains paginated list @@ -110,9 +111,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 ItemPriceFindApplicableItemsResponse nextPage() throws Exception { + public ItemPriceFindApplicableItemsResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceListResponse.java b/src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceListResponse.java rename to src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceListResponse.java index a2a22621..4bc936ac 100644 --- a/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceListResponse.java +++ b/src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.itemPrice; +package com.chargebee.v4.models.itemPrice.responses; import java.util.List; -import com.chargebee.v4.core.models.itemPrice.ItemPrice; +import com.chargebee.v4.models.itemPrice.ItemPrice; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.ItemPriceService; -import com.chargebee.v4.core.models.itemPrice.params.ItemPriceListParams; +import com.chargebee.v4.services.ItemPriceService; +import com.chargebee.v4.models.itemPrice.params.ItemPriceListParams; /** Immutable response object for ItemPriceList operation. Contains paginated list data. */ public final class ItemPriceListResponse { @@ -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 ItemPriceListResponse nextPage() throws Exception { + public ItemPriceListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceRetrieveResponse.java new file mode 100644 index 00000000..a259aaee --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.itemPrice.responses; + +import com.chargebee.v4.models.itemPrice.ItemPrice; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ItemPriceRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class ItemPriceRetrieveResponse extends BaseResponse { + private final ItemPrice itemPrice; + + private ItemPriceRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.itemPrice = builder.itemPrice; + } + + /** Parse JSON response into ItemPriceRetrieveResponse object. */ + public static ItemPriceRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ItemPriceRetrieveResponse object with HTTP response. */ + public static ItemPriceRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __itemPriceJson = JsonUtil.getObject(json, "item_price"); + if (__itemPriceJson != null) { + builder.itemPrice(ItemPrice.fromJson(__itemPriceJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ItemPriceRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for ItemPriceRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ItemPriceRetrieveResponse. */ + public static class Builder { + + private ItemPrice itemPrice; + + private Response httpResponse; + + private Builder() {} + + public Builder itemPrice(ItemPrice itemPrice) { + this.itemPrice = itemPrice; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ItemPriceRetrieveResponse build() { + return new ItemPriceRetrieveResponse(this); + } + } + + /** Get the itemPrice from the response. */ + public ItemPrice getItemPrice() { + return itemPrice; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceUpdateResponse.java b/src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceUpdateResponse.java index 86c4a0a2..a42e2427 100644 --- a/src/main/java/com/chargebee/v4/core/responses/itemPrice/ItemPriceUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/itemPrice/responses/ItemPriceUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.itemPrice; +package com.chargebee.v4.models.itemPrice.responses; -import com.chargebee.v4.core.models.itemPrice.ItemPrice; +import com.chargebee.v4.models.itemPrice.ItemPrice; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/itemPrice/responses/MoveItemPriceResponse.java b/src/main/java/com/chargebee/v4/models/itemPrice/responses/MoveItemPriceResponse.java new file mode 100644 index 00000000..0aa1b7cb --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/itemPrice/responses/MoveItemPriceResponse.java @@ -0,0 +1,76 @@ +package com.chargebee.v4.models.itemPrice.responses; + +import com.chargebee.v4.models.itemPrice.ItemPrice; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for MoveItemPrice operation. Contains the response data from the API. + */ +public final class MoveItemPriceResponse extends BaseResponse { + private final ItemPrice itemPrice; + + private MoveItemPriceResponse(Builder builder) { + super(builder.httpResponse); + + this.itemPrice = builder.itemPrice; + } + + /** Parse JSON response into MoveItemPriceResponse object. */ + public static MoveItemPriceResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into MoveItemPriceResponse object with HTTP response. */ + public static MoveItemPriceResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __itemPriceJson = JsonUtil.getObject(json, "item_price"); + if (__itemPriceJson != null) { + builder.itemPrice(ItemPrice.fromJson(__itemPriceJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse MoveItemPriceResponse from JSON", e); + } + } + + /** Create a new builder for MoveItemPriceResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for MoveItemPriceResponse. */ + public static class Builder { + + private ItemPrice itemPrice; + + private Response httpResponse; + + private Builder() {} + + public Builder itemPrice(ItemPrice itemPrice) { + this.itemPrice = itemPrice; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public MoveItemPriceResponse build() { + return new MoveItemPriceResponse(this); + } + } + + /** Get the itemPrice from the response. */ + public ItemPrice getItemPrice() { + return itemPrice; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/media/Media.java b/src/main/java/com/chargebee/v4/models/media/Media.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/media/Media.java rename to src/main/java/com/chargebee/v4/models/media/Media.java index 2761a0a8..11d3096c 100644 --- a/src/main/java/com/chargebee/v4/core/models/media/Media.java +++ b/src/main/java/com/chargebee/v4/models/media/Media.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.media; +package com.chargebee.v4.models.media; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/models/media/params/CreateMediaAndAttachToItemParams.java b/src/main/java/com/chargebee/v4/models/media/params/CreateMediaAndAttachToItemParams.java new file mode 100644 index 00000000..92dba1a0 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/media/params/CreateMediaAndAttachToItemParams.java @@ -0,0 +1,100 @@ +/* + * 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.media.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CreateMediaAndAttachToItemParams { + + private final String url; + + private final String id; + + private final String altText; + + private CreateMediaAndAttachToItemParams(CreateMediaAndAttachToItemBuilder builder) { + + this.url = builder.url; + + this.id = builder.id; + + this.altText = builder.altText; + } + + public String getUrl() { + return url; + } + + public String getId() { + return id; + } + + public String getAltText() { + return altText; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.url != null) { + + formData.put("url", this.url); + } + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.altText != null) { + + formData.put("alt_text", this.altText); + } + + return formData; + } + + /** Create a new builder for CreateMediaAndAttachToItemParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreateMediaAndAttachToItemBuilder builder() { + return new CreateMediaAndAttachToItemBuilder(); + } + + public static final class CreateMediaAndAttachToItemBuilder { + + private String url; + + private String id; + + private String altText; + + private CreateMediaAndAttachToItemBuilder() {} + + public CreateMediaAndAttachToItemBuilder url(String value) { + this.url = value; + return this; + } + + public CreateMediaAndAttachToItemBuilder id(String value) { + this.id = value; + return this; + } + + public CreateMediaAndAttachToItemBuilder altText(String value) { + this.altText = value; + return this; + } + + public CreateMediaAndAttachToItemParams build() { + return new CreateMediaAndAttachToItemParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/media/responses/CreateMediaAndAttachToItemResponse.java b/src/main/java/com/chargebee/v4/models/media/responses/CreateMediaAndAttachToItemResponse.java new file mode 100644 index 00000000..61eaf760 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/media/responses/CreateMediaAndAttachToItemResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.media.responses; + +import com.chargebee.v4.models.media.Media; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CreateMediaAndAttachToItem operation. Contains the response data + * from the API. + */ +public final class CreateMediaAndAttachToItemResponse extends BaseResponse { + private final Media media; + + private CreateMediaAndAttachToItemResponse(Builder builder) { + super(builder.httpResponse); + + this.media = builder.media; + } + + /** Parse JSON response into CreateMediaAndAttachToItemResponse object. */ + public static CreateMediaAndAttachToItemResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CreateMediaAndAttachToItemResponse object with HTTP response. */ + public static CreateMediaAndAttachToItemResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __mediaJson = JsonUtil.getObject(json, "media"); + if (__mediaJson != null) { + builder.media(Media.fromJson(__mediaJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CreateMediaAndAttachToItemResponse from JSON", e); + } + } + + /** Create a new builder for CreateMediaAndAttachToItemResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CreateMediaAndAttachToItemResponse. */ + public static class Builder { + + private Media media; + + private Response httpResponse; + + private Builder() {} + + public Builder media(Media media) { + this.media = media; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CreateMediaAndAttachToItemResponse build() { + return new CreateMediaAndAttachToItemResponse(this); + } + } + + /** Get the media from the response. */ + public Media getMedia() { + return media; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/metadata/Metadata.java b/src/main/java/com/chargebee/v4/models/metadata/Metadata.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/metadata/Metadata.java rename to src/main/java/com/chargebee/v4/models/metadata/Metadata.java index 49bff199..9f6dfd5f 100644 --- a/src/main/java/com/chargebee/v4/core/models/metadata/Metadata.java +++ b/src/main/java/com/chargebee/v4/models/metadata/Metadata.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.metadata; +package com.chargebee.v4.models.metadata; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/core/models/nonSubscription/NonSubscription.java b/src/main/java/com/chargebee/v4/models/nonSubscription/NonSubscription.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/nonSubscription/NonSubscription.java rename to src/main/java/com/chargebee/v4/models/nonSubscription/NonSubscription.java index 14fbffe6..beebf06d 100644 --- a/src/main/java/com/chargebee/v4/core/models/nonSubscription/NonSubscription.java +++ b/src/main/java/com/chargebee/v4/models/nonSubscription/NonSubscription.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.nonSubscription; +package com.chargebee.v4.models.nonSubscription; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/models/nonSubscription/params/NonSubscriptionProcessReceiptParams.java b/src/main/java/com/chargebee/v4/models/nonSubscription/params/NonSubscriptionProcessReceiptParams.java new file mode 100644 index 00000000..aae053b3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/nonSubscription/params/NonSubscriptionProcessReceiptParams.java @@ -0,0 +1,396 @@ +/* + * 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.nonSubscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class NonSubscriptionProcessReceiptParams { + + private final String receipt; + + private final ProductParams product; + + private final CustomerParams customer; + + private NonSubscriptionProcessReceiptParams(NonSubscriptionProcessReceiptBuilder builder) { + + this.receipt = builder.receipt; + + this.product = builder.product; + + this.customer = builder.customer; + } + + public String getReceipt() { + return receipt; + } + + public ProductParams getProduct() { + return product; + } + + public CustomerParams getCustomer() { + return customer; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.receipt != null) { + + formData.put("receipt", this.receipt); + } + + if (this.product != null) { + + // Single object + Map nestedData = this.product.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "product[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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 NonSubscriptionProcessReceiptParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NonSubscriptionProcessReceiptBuilder builder() { + return new NonSubscriptionProcessReceiptBuilder(); + } + + public static final class NonSubscriptionProcessReceiptBuilder { + + private String receipt; + + private ProductParams product; + + private CustomerParams customer; + + private NonSubscriptionProcessReceiptBuilder() {} + + public NonSubscriptionProcessReceiptBuilder receipt(String value) { + this.receipt = value; + return this; + } + + public NonSubscriptionProcessReceiptBuilder product(ProductParams value) { + this.product = value; + return this; + } + + public NonSubscriptionProcessReceiptBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public NonSubscriptionProcessReceiptParams build() { + return new NonSubscriptionProcessReceiptParams(this); + } + } + + public static final class ProductParams { + + private final String id; + + private final String currencyCode; + + private final Integer price; + + private final Type type; + + private final String name; + + private final String priceInDecimal; + + private ProductParams(ProductBuilder builder) { + + this.id = builder.id; + + this.currencyCode = builder.currencyCode; + + this.price = builder.price; + + this.type = builder.type; + + this.name = builder.name; + + this.priceInDecimal = builder.priceInDecimal; + } + + public String getId() { + return id; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public Integer getPrice() { + return price; + } + + public Type getType() { + return type; + } + + public String getName() { + return name; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + return formData; + } + + /** Create a new builder for ProductParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ProductBuilder builder() { + return new ProductBuilder(); + } + + public static final class ProductBuilder { + + private String id; + + private String currencyCode; + + private Integer price; + + private Type type; + + private String name; + + private String priceInDecimal; + + private ProductBuilder() {} + + public ProductBuilder id(String value) { + this.id = value; + return this; + } + + public ProductBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public ProductBuilder price(Integer value) { + this.price = value; + return this; + } + + public ProductBuilder type(Type value) { + this.type = value; + return this; + } + + public ProductBuilder name(String value) { + this.name = value; + return this; + } + + public ProductBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ProductParams build() { + return new ProductParams(this); + } + } + + public enum Type { + CONSUMABLE("consumable"), + + NON_CONSUMABLE("non_consumable"), + + NON_RENEWING_SUBSCRIPTION("non_renewing_subscription"), + + /** 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 static final class CustomerParams { + + private final String id; + + private final String email; + + private final String firstName; + + private final String lastName; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.email = builder.email; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + } + + public String getId() { + return id; + } + + public String getEmail() { + return email; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + + 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 id; + + private String email; + + private String firstName; + + private String lastName; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerBuilder email(String value) { + this.email = value; + return this; + } + + public CustomerBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CustomerBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/nonSubscription/NonSubscriptionProcessReceiptResponse.java b/src/main/java/com/chargebee/v4/models/nonSubscription/responses/NonSubscriptionProcessReceiptResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/nonSubscription/NonSubscriptionProcessReceiptResponse.java rename to src/main/java/com/chargebee/v4/models/nonSubscription/responses/NonSubscriptionProcessReceiptResponse.java index 4c832a68..19e6b131 100644 --- a/src/main/java/com/chargebee/v4/core/responses/nonSubscription/NonSubscriptionProcessReceiptResponse.java +++ b/src/main/java/com/chargebee/v4/models/nonSubscription/responses/NonSubscriptionProcessReceiptResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.nonSubscription; +package com.chargebee.v4.models.nonSubscription.responses; -import com.chargebee.v4.core.models.nonSubscription.NonSubscription; +import com.chargebee.v4.models.nonSubscription.NonSubscription; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/offerEvent/params/OfferEventsParams.java b/src/main/java/com/chargebee/v4/models/offerEvent/params/OfferEventsParams.java new file mode 100644 index 00000000..c50bfb05 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/offerEvent/params/OfferEventsParams.java @@ -0,0 +1,108 @@ +/* + * 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.offerEvent.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class OfferEventsParams { + + private final String personalizedOfferId; + + private final Type type; + + private OfferEventsParams(OfferEventsBuilder builder) { + + this.personalizedOfferId = builder.personalizedOfferId; + + this.type = builder.type; + } + + public String getPersonalizedOfferId() { + return personalizedOfferId; + } + + public Type getType() { + return type; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.personalizedOfferId != null) { + + formData.put("personalized_offer_id", this.personalizedOfferId); + } + + if (this.type != null) { + + formData.put("type", this.type); + } + + return formData; + } + + /** Create a new builder for OfferEventsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OfferEventsBuilder builder() { + return new OfferEventsBuilder(); + } + + public static final class OfferEventsBuilder { + + private String personalizedOfferId; + + private Type type; + + private OfferEventsBuilder() {} + + public OfferEventsBuilder personalizedOfferId(String value) { + this.personalizedOfferId = value; + return this; + } + + public OfferEventsBuilder type(Type value) { + this.type = value; + return this; + } + + public OfferEventsParams build() { + return new OfferEventsParams(this); + } + } + + public enum Type { + VIEWED("viewed"), + + DISMISSED("dismissed"), + + /** 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/offerEvent/responses/OfferEventsResponse.java b/src/main/java/com/chargebee/v4/models/offerEvent/responses/OfferEventsResponse.java new file mode 100644 index 00000000..d4af3944 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/offerEvent/responses/OfferEventsResponse.java @@ -0,0 +1,51 @@ +package com.chargebee.v4.models.offerEvent.responses; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.transport.Response; + +/** Immutable response object for OfferEvents operation. Contains the response data from the API. */ +public final class OfferEventsResponse extends BaseResponse { + + private OfferEventsResponse(Builder builder) { + super(builder.httpResponse); + } + + /** Parse JSON response into OfferEventsResponse object. */ + public static OfferEventsResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into OfferEventsResponse object with HTTP response. */ + public static OfferEventsResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse OfferEventsResponse from JSON", e); + } + } + + /** Create a new builder for OfferEventsResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for OfferEventsResponse. */ + public static class Builder { + + private Response httpResponse; + + private Builder() {} + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public OfferEventsResponse build() { + return new OfferEventsResponse(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/offerFulfillment/OfferFulfillment.java b/src/main/java/com/chargebee/v4/models/offerFulfillment/OfferFulfillment.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/offerFulfillment/OfferFulfillment.java rename to src/main/java/com/chargebee/v4/models/offerFulfillment/OfferFulfillment.java index 47e5931b..34377686 100644 --- a/src/main/java/com/chargebee/v4/core/models/offerFulfillment/OfferFulfillment.java +++ b/src/main/java/com/chargebee/v4/models/offerFulfillment/OfferFulfillment.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.offerFulfillment; +package com.chargebee.v4.models.offerFulfillment; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/offerFulfillment/params/OfferFulfillmentsGetParams.java b/src/main/java/com/chargebee/v4/models/offerFulfillment/params/OfferFulfillmentsGetParams.java new file mode 100644 index 00000000..5f307842 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/offerFulfillment/params/OfferFulfillmentsGetParams.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.offerFulfillment.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class OfferFulfillmentsGetParams { + + private final Map queryParams; + + private OfferFulfillmentsGetParams(OfferFulfillmentsGetBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public OfferFulfillmentsGetBuilder toBuilder() { + OfferFulfillmentsGetBuilder builder = new OfferFulfillmentsGetBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for OfferFulfillmentsGetParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OfferFulfillmentsGetBuilder builder() { + return new OfferFulfillmentsGetBuilder(); + } + + public static final class OfferFulfillmentsGetBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private OfferFulfillmentsGetBuilder() {} + + public OfferFulfillmentsGetParams build() { + return new OfferFulfillmentsGetParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/offerFulfillment/params/OfferFulfillmentsParams.java b/src/main/java/com/chargebee/v4/models/offerFulfillment/params/OfferFulfillmentsParams.java new file mode 100644 index 00000000..aac85227 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/offerFulfillment/params/OfferFulfillmentsParams.java @@ -0,0 +1,80 @@ +/* + * 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.offerFulfillment.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class OfferFulfillmentsParams { + + private final String personalizedOfferId; + + private final String optionId; + + private OfferFulfillmentsParams(OfferFulfillmentsBuilder builder) { + + this.personalizedOfferId = builder.personalizedOfferId; + + this.optionId = builder.optionId; + } + + public String getPersonalizedOfferId() { + return personalizedOfferId; + } + + public String getOptionId() { + return optionId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.personalizedOfferId != null) { + + formData.put("personalized_offer_id", this.personalizedOfferId); + } + + if (this.optionId != null) { + + formData.put("option_id", this.optionId); + } + + return formData; + } + + /** Create a new builder for OfferFulfillmentsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OfferFulfillmentsBuilder builder() { + return new OfferFulfillmentsBuilder(); + } + + public static final class OfferFulfillmentsBuilder { + + private String personalizedOfferId; + + private String optionId; + + private OfferFulfillmentsBuilder() {} + + public OfferFulfillmentsBuilder personalizedOfferId(String value) { + this.personalizedOfferId = value; + return this; + } + + public OfferFulfillmentsBuilder optionId(String value) { + this.optionId = value; + return this; + } + + public OfferFulfillmentsParams build() { + return new OfferFulfillmentsParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/offerFulfillment/params/OfferFulfillmentsUpdateParams.java b/src/main/java/com/chargebee/v4/models/offerFulfillment/params/OfferFulfillmentsUpdateParams.java new file mode 100644 index 00000000..18ee2825 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/offerFulfillment/params/OfferFulfillmentsUpdateParams.java @@ -0,0 +1,128 @@ +/* + * 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.offerFulfillment.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class OfferFulfillmentsUpdateParams { + + private final String id; + + private final Status status; + + private final String failureReason; + + private OfferFulfillmentsUpdateParams(OfferFulfillmentsUpdateBuilder builder) { + + this.id = builder.id; + + this.status = builder.status; + + this.failureReason = builder.failureReason; + } + + public String getId() { + return id; + } + + public Status getStatus() { + return status; + } + + public String getFailureReason() { + return failureReason; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.failureReason != null) { + + formData.put("failure_reason", this.failureReason); + } + + return formData; + } + + /** Create a new builder for OfferFulfillmentsUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OfferFulfillmentsUpdateBuilder builder() { + return new OfferFulfillmentsUpdateBuilder(); + } + + public static final class OfferFulfillmentsUpdateBuilder { + + private String id; + + private Status status; + + private String failureReason; + + private OfferFulfillmentsUpdateBuilder() {} + + public OfferFulfillmentsUpdateBuilder id(String value) { + this.id = value; + return this; + } + + public OfferFulfillmentsUpdateBuilder status(Status value) { + this.status = value; + return this; + } + + public OfferFulfillmentsUpdateBuilder failureReason(String value) { + this.failureReason = value; + return this; + } + + public OfferFulfillmentsUpdateParams build() { + return new OfferFulfillmentsUpdateParams(this); + } + } + + public enum Status { + COMPLETED("completed"), + + FAILED("failed"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/offerFulfillment/responses/OfferFulfillmentsGetResponse.java b/src/main/java/com/chargebee/v4/models/offerFulfillment/responses/OfferFulfillmentsGetResponse.java new file mode 100644 index 00000000..e29a71a4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/offerFulfillment/responses/OfferFulfillmentsGetResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.offerFulfillment.responses; + +import com.chargebee.v4.models.offerFulfillment.OfferFulfillment; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for OfferFulfillmentsGet operation. Contains the response data from a + * single resource get operation. + */ +public final class OfferFulfillmentsGetResponse extends BaseResponse { + private final OfferFulfillment offerFulfillment; + + private OfferFulfillmentsGetResponse(Builder builder) { + super(builder.httpResponse); + + this.offerFulfillment = builder.offerFulfillment; + } + + /** Parse JSON response into OfferFulfillmentsGetResponse object. */ + public static OfferFulfillmentsGetResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into OfferFulfillmentsGetResponse object with HTTP response. */ + public static OfferFulfillmentsGetResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __offerFulfillmentJson = JsonUtil.getObject(json, "offer_fulfillment"); + if (__offerFulfillmentJson != null) { + builder.offerFulfillment(OfferFulfillment.fromJson(__offerFulfillmentJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse OfferFulfillmentsGetResponse from JSON", e); + } + } + + /** Create a new builder for OfferFulfillmentsGetResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for OfferFulfillmentsGetResponse. */ + public static class Builder { + + private OfferFulfillment offerFulfillment; + + private Response httpResponse; + + private Builder() {} + + public Builder offerFulfillment(OfferFulfillment offerFulfillment) { + this.offerFulfillment = offerFulfillment; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public OfferFulfillmentsGetResponse build() { + return new OfferFulfillmentsGetResponse(this); + } + } + + /** Get the offerFulfillment from the response. */ + public OfferFulfillment getOfferFulfillment() { + return offerFulfillment; + } +} diff --git a/src/main/java/com/chargebee/v4/models/offerFulfillment/responses/OfferFulfillmentsResponse.java b/src/main/java/com/chargebee/v4/models/offerFulfillment/responses/OfferFulfillmentsResponse.java new file mode 100644 index 00000000..b5f7d111 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/offerFulfillment/responses/OfferFulfillmentsResponse.java @@ -0,0 +1,100 @@ +package com.chargebee.v4.models.offerFulfillment.responses; + +import com.chargebee.v4.models.offerFulfillment.OfferFulfillment; + +import com.chargebee.v4.models.hostedPage.HostedPage; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for OfferFulfillments operation. Contains the response data from the + * API. + */ +public final class OfferFulfillmentsResponse extends BaseResponse { + private final OfferFulfillment offerFulfillment; + + private final HostedPage hostedPage; + + private OfferFulfillmentsResponse(Builder builder) { + super(builder.httpResponse); + + this.offerFulfillment = builder.offerFulfillment; + + this.hostedPage = builder.hostedPage; + } + + /** Parse JSON response into OfferFulfillmentsResponse object. */ + public static OfferFulfillmentsResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into OfferFulfillmentsResponse object with HTTP response. */ + public static OfferFulfillmentsResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __offerFulfillmentJson = JsonUtil.getObject(json, "offer_fulfillment"); + if (__offerFulfillmentJson != null) { + builder.offerFulfillment(OfferFulfillment.fromJson(__offerFulfillmentJson)); + } + + String __hostedPageJson = JsonUtil.getObject(json, "hosted_page"); + if (__hostedPageJson != null) { + builder.hostedPage(HostedPage.fromJson(__hostedPageJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse OfferFulfillmentsResponse from JSON", e); + } + } + + /** Create a new builder for OfferFulfillmentsResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for OfferFulfillmentsResponse. */ + public static class Builder { + + private OfferFulfillment offerFulfillment; + + private HostedPage hostedPage; + + private Response httpResponse; + + private Builder() {} + + public Builder offerFulfillment(OfferFulfillment offerFulfillment) { + this.offerFulfillment = offerFulfillment; + return this; + } + + public Builder hostedPage(HostedPage hostedPage) { + this.hostedPage = hostedPage; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public OfferFulfillmentsResponse build() { + return new OfferFulfillmentsResponse(this); + } + } + + /** Get the offerFulfillment from the response. */ + public OfferFulfillment getOfferFulfillment() { + return offerFulfillment; + } + + /** Get the hostedPage from the response. */ + public HostedPage getHostedPage() { + return hostedPage; + } +} diff --git a/src/main/java/com/chargebee/v4/models/offerFulfillment/responses/OfferFulfillmentsUpdateResponse.java b/src/main/java/com/chargebee/v4/models/offerFulfillment/responses/OfferFulfillmentsUpdateResponse.java new file mode 100644 index 00000000..bea12526 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/offerFulfillment/responses/OfferFulfillmentsUpdateResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.offerFulfillment.responses; + +import com.chargebee.v4.models.offerFulfillment.OfferFulfillment; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for OfferFulfillmentsUpdate operation. Contains the response data from + * the API. + */ +public final class OfferFulfillmentsUpdateResponse extends BaseResponse { + private final OfferFulfillment offerFulfillment; + + private OfferFulfillmentsUpdateResponse(Builder builder) { + super(builder.httpResponse); + + this.offerFulfillment = builder.offerFulfillment; + } + + /** Parse JSON response into OfferFulfillmentsUpdateResponse object. */ + public static OfferFulfillmentsUpdateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into OfferFulfillmentsUpdateResponse object with HTTP response. */ + public static OfferFulfillmentsUpdateResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __offerFulfillmentJson = JsonUtil.getObject(json, "offer_fulfillment"); + if (__offerFulfillmentJson != null) { + builder.offerFulfillment(OfferFulfillment.fromJson(__offerFulfillmentJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse OfferFulfillmentsUpdateResponse from JSON", e); + } + } + + /** Create a new builder for OfferFulfillmentsUpdateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for OfferFulfillmentsUpdateResponse. */ + public static class Builder { + + private OfferFulfillment offerFulfillment; + + private Response httpResponse; + + private Builder() {} + + public Builder offerFulfillment(OfferFulfillment offerFulfillment) { + this.offerFulfillment = offerFulfillment; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public OfferFulfillmentsUpdateResponse build() { + return new OfferFulfillmentsUpdateResponse(this); + } + } + + /** Get the offerFulfillment from the response. */ + public OfferFulfillment getOfferFulfillment() { + return offerFulfillment; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrder/OmnichannelOneTimeOrder.java b/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/OmnichannelOneTimeOrder.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrder/OmnichannelOneTimeOrder.java rename to src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/OmnichannelOneTimeOrder.java index 05ea5394..b591c787 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrder/OmnichannelOneTimeOrder.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/OmnichannelOneTimeOrder.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelOneTimeOrder; +package com.chargebee.v4.models.omnichannelOneTimeOrder; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderListParams.java b/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderListParams.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderListParams.java rename to src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderListParams.java index d6a225fd..bf53f876 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderListParams.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelOneTimeOrder.params; +package com.chargebee.v4.models.omnichannelOneTimeOrder.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderRetrieveParams.java b/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderRetrieveParams.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderRetrieveParams.java index 6ec9032e..fbeae142 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelOneTimeOrder.params; +package com.chargebee.v4.models.omnichannelOneTimeOrder.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/responses/omnichannelOneTimeOrder/OmnichannelOneTimeOrderListResponse.java b/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/responses/OmnichannelOneTimeOrderListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/omnichannelOneTimeOrder/OmnichannelOneTimeOrderListResponse.java rename to src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/responses/OmnichannelOneTimeOrderListResponse.java index 140b5689..a2c065b1 100644 --- a/src/main/java/com/chargebee/v4/core/responses/omnichannelOneTimeOrder/OmnichannelOneTimeOrderListResponse.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/responses/OmnichannelOneTimeOrderListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.omnichannelOneTimeOrder; +package com.chargebee.v4.models.omnichannelOneTimeOrder.responses; import java.util.List; -import com.chargebee.v4.core.models.omnichannelOneTimeOrder.OmnichannelOneTimeOrder; +import com.chargebee.v4.models.omnichannelOneTimeOrder.OmnichannelOneTimeOrder; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.OmnichannelOneTimeOrderService; -import com.chargebee.v4.core.models.omnichannelOneTimeOrder.params.OmnichannelOneTimeOrderListParams; +import com.chargebee.v4.services.OmnichannelOneTimeOrderService; +import com.chargebee.v4.models.omnichannelOneTimeOrder.params.OmnichannelOneTimeOrderListParams; /** * Immutable response object for OmnichannelOneTimeOrderList operation. Contains paginated list @@ -104,9 +105,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 OmnichannelOneTimeOrderListResponse nextPage() throws Exception { + public OmnichannelOneTimeOrderListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/responses/OmnichannelOneTimeOrderRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/responses/OmnichannelOneTimeOrderRetrieveResponse.java new file mode 100644 index 00000000..52dfb65d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/responses/OmnichannelOneTimeOrderRetrieveResponse.java @@ -0,0 +1,80 @@ +package com.chargebee.v4.models.omnichannelOneTimeOrder.responses; + +import com.chargebee.v4.models.omnichannelOneTimeOrder.OmnichannelOneTimeOrder; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for OmnichannelOneTimeOrderRetrieve operation. Contains the response + * data from a single resource get operation. + */ +public final class OmnichannelOneTimeOrderRetrieveResponse extends BaseResponse { + private final OmnichannelOneTimeOrder omnichannelOneTimeOrder; + + private OmnichannelOneTimeOrderRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.omnichannelOneTimeOrder = builder.omnichannelOneTimeOrder; + } + + /** Parse JSON response into OmnichannelOneTimeOrderRetrieveResponse object. */ + public static OmnichannelOneTimeOrderRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into OmnichannelOneTimeOrderRetrieveResponse object with HTTP response. */ + public static OmnichannelOneTimeOrderRetrieveResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __omnichannelOneTimeOrderJson = JsonUtil.getObject(json, "omnichannel_one_time_order"); + if (__omnichannelOneTimeOrderJson != null) { + builder.omnichannelOneTimeOrder( + OmnichannelOneTimeOrder.fromJson(__omnichannelOneTimeOrderJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse OmnichannelOneTimeOrderRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for OmnichannelOneTimeOrderRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for OmnichannelOneTimeOrderRetrieveResponse. */ + public static class Builder { + + private OmnichannelOneTimeOrder omnichannelOneTimeOrder; + + private Response httpResponse; + + private Builder() {} + + public Builder omnichannelOneTimeOrder(OmnichannelOneTimeOrder omnichannelOneTimeOrder) { + this.omnichannelOneTimeOrder = omnichannelOneTimeOrder; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public OmnichannelOneTimeOrderRetrieveResponse build() { + return new OmnichannelOneTimeOrderRetrieveResponse(this); + } + } + + /** Get the omnichannelOneTimeOrder from the response. */ + public OmnichannelOneTimeOrder getOmnichannelOneTimeOrder() { + return omnichannelOneTimeOrder; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrderItem/OmnichannelOneTimeOrderItem.java b/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrderItem/OmnichannelOneTimeOrderItem.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrderItem/OmnichannelOneTimeOrderItem.java rename to src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrderItem/OmnichannelOneTimeOrderItem.java index f7b0c1f7..2b580d0e 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelOneTimeOrderItem/OmnichannelOneTimeOrderItem.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrderItem/OmnichannelOneTimeOrderItem.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelOneTimeOrderItem; +package com.chargebee.v4.models.omnichannelOneTimeOrderItem; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscription/OmnichannelSubscription.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/OmnichannelSubscription.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscription/OmnichannelSubscription.java rename to src/main/java/com/chargebee/v4/models/omnichannelSubscription/OmnichannelSubscription.java index 13dcd6b9..31cc72d5 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscription/OmnichannelSubscription.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/OmnichannelSubscription.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscription; +package com.chargebee.v4.models.omnichannelSubscription; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscription/params/OmnichannelSubscriptionListParams.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelSubscriptionListParams.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscription/params/OmnichannelSubscriptionListParams.java rename to src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelSubscriptionListParams.java index 28783063..f2f367d8 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscription/params/OmnichannelSubscriptionListParams.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelSubscriptionListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscription.params; +package com.chargebee.v4.models.omnichannelSubscription.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelSubscriptionMoveParams.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelSubscriptionMoveParams.java new file mode 100644 index 00000000..eaf0bdbc --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelSubscriptionMoveParams.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.omnichannelSubscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class OmnichannelSubscriptionMoveParams { + + private final String toCustomerId; + + private OmnichannelSubscriptionMoveParams(OmnichannelSubscriptionMoveBuilder builder) { + + this.toCustomerId = builder.toCustomerId; + } + + public String getToCustomerId() { + return toCustomerId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.toCustomerId != null) { + + formData.put("to_customer_id", this.toCustomerId); + } + + return formData; + } + + /** Create a new builder for OmnichannelSubscriptionMoveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OmnichannelSubscriptionMoveBuilder builder() { + return new OmnichannelSubscriptionMoveBuilder(); + } + + public static final class OmnichannelSubscriptionMoveBuilder { + + private String toCustomerId; + + private OmnichannelSubscriptionMoveBuilder() {} + + public OmnichannelSubscriptionMoveBuilder toCustomerId(String value) { + this.toCustomerId = value; + return this; + } + + public OmnichannelSubscriptionMoveParams build() { + return new OmnichannelSubscriptionMoveParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscription/params/OmnichannelSubscriptionRetrieveParams.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelSubscriptionRetrieveParams.java similarity index 95% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscription/params/OmnichannelSubscriptionRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelSubscriptionRetrieveParams.java index 8a48fc4f..51bd038c 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscription/params/OmnichannelSubscriptionRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelSubscriptionRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscription.params; +package com.chargebee.v4.models.omnichannelSubscription.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelTransactionsForOmnichannelSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelTransactionsForOmnichannelSubscriptionParams.java new file mode 100644 index 00000000..e342a33d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelTransactionsForOmnichannelSubscriptionParams.java @@ -0,0 +1,62 @@ +/* + * 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.omnichannelSubscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class OmnichannelTransactionsForOmnichannelSubscriptionParams { + + private final Map queryParams; + + private OmnichannelTransactionsForOmnichannelSubscriptionParams( + OmnichannelTransactionsForOmnichannelSubscriptionBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public OmnichannelTransactionsForOmnichannelSubscriptionBuilder toBuilder() { + OmnichannelTransactionsForOmnichannelSubscriptionBuilder builder = + new OmnichannelTransactionsForOmnichannelSubscriptionBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for OmnichannelTransactionsForOmnichannelSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OmnichannelTransactionsForOmnichannelSubscriptionBuilder builder() { + return new OmnichannelTransactionsForOmnichannelSubscriptionBuilder(); + } + + public static final class OmnichannelTransactionsForOmnichannelSubscriptionBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private OmnichannelTransactionsForOmnichannelSubscriptionBuilder() {} + + public OmnichannelTransactionsForOmnichannelSubscriptionBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public OmnichannelTransactionsForOmnichannelSubscriptionBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public OmnichannelTransactionsForOmnichannelSubscriptionParams build() { + return new OmnichannelTransactionsForOmnichannelSubscriptionParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/omnichannelSubscription/OmnichannelSubscriptionListResponse.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/responses/OmnichannelSubscriptionListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/omnichannelSubscription/OmnichannelSubscriptionListResponse.java rename to src/main/java/com/chargebee/v4/models/omnichannelSubscription/responses/OmnichannelSubscriptionListResponse.java index 06666a86..2197a4ce 100644 --- a/src/main/java/com/chargebee/v4/core/responses/omnichannelSubscription/OmnichannelSubscriptionListResponse.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/responses/OmnichannelSubscriptionListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.omnichannelSubscription; +package com.chargebee.v4.models.omnichannelSubscription.responses; import java.util.List; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.OmnichannelSubscriptionService; -import com.chargebee.v4.core.models.omnichannelSubscription.params.OmnichannelSubscriptionListParams; +import com.chargebee.v4.services.OmnichannelSubscriptionService; +import com.chargebee.v4.models.omnichannelSubscription.params.OmnichannelSubscriptionListParams; /** * Immutable response object for OmnichannelSubscriptionList operation. Contains paginated list @@ -104,9 +105,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 OmnichannelSubscriptionListResponse nextPage() throws Exception { + public OmnichannelSubscriptionListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/omnichannelSubscription/OmnichannelSubscriptionMoveResponse.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/responses/OmnichannelSubscriptionMoveResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/omnichannelSubscription/OmnichannelSubscriptionMoveResponse.java rename to src/main/java/com/chargebee/v4/models/omnichannelSubscription/responses/OmnichannelSubscriptionMoveResponse.java index 5023a556..0a67506a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/omnichannelSubscription/OmnichannelSubscriptionMoveResponse.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/responses/OmnichannelSubscriptionMoveResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.omnichannelSubscription; +package com.chargebee.v4.models.omnichannelSubscription.responses; -import com.chargebee.v4.core.models.omnichannelSubscription.OmnichannelSubscription; +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/omnichannelSubscription/responses/OmnichannelSubscriptionRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/responses/OmnichannelSubscriptionRetrieveResponse.java new file mode 100644 index 00000000..5981cf7c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/responses/OmnichannelSubscriptionRetrieveResponse.java @@ -0,0 +1,80 @@ +package com.chargebee.v4.models.omnichannelSubscription.responses; + +import com.chargebee.v4.models.omnichannelSubscription.OmnichannelSubscription; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for OmnichannelSubscriptionRetrieve operation. Contains the response + * data from a single resource get operation. + */ +public final class OmnichannelSubscriptionRetrieveResponse extends BaseResponse { + private final OmnichannelSubscription omnichannelSubscription; + + private OmnichannelSubscriptionRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.omnichannelSubscription = builder.omnichannelSubscription; + } + + /** Parse JSON response into OmnichannelSubscriptionRetrieveResponse object. */ + public static OmnichannelSubscriptionRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into OmnichannelSubscriptionRetrieveResponse object with HTTP response. */ + public static OmnichannelSubscriptionRetrieveResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __omnichannelSubscriptionJson = JsonUtil.getObject(json, "omnichannel_subscription"); + if (__omnichannelSubscriptionJson != null) { + builder.omnichannelSubscription( + OmnichannelSubscription.fromJson(__omnichannelSubscriptionJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse OmnichannelSubscriptionRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for OmnichannelSubscriptionRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for OmnichannelSubscriptionRetrieveResponse. */ + public static class Builder { + + private OmnichannelSubscription omnichannelSubscription; + + private Response httpResponse; + + private Builder() {} + + public Builder omnichannelSubscription(OmnichannelSubscription omnichannelSubscription) { + this.omnichannelSubscription = omnichannelSubscription; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public OmnichannelSubscriptionRetrieveResponse build() { + return new OmnichannelSubscriptionRetrieveResponse(this); + } + } + + /** Get the omnichannelSubscription from the response. */ + public OmnichannelSubscription getOmnichannelSubscription() { + return omnichannelSubscription; + } +} diff --git a/src/main/java/com/chargebee/v4/models/omnichannelSubscription/responses/OmnichannelTransactionsForOmnichannelSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/responses/OmnichannelTransactionsForOmnichannelSubscriptionResponse.java new file mode 100644 index 00000000..de5bd3bd --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/responses/OmnichannelTransactionsForOmnichannelSubscriptionResponse.java @@ -0,0 +1,190 @@ +package com.chargebee.v4.models.omnichannelSubscription.responses; + +import java.util.List; + +import com.chargebee.v4.models.omnichannelTransaction.OmnichannelTransaction; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.OmnichannelSubscriptionService; +import com.chargebee.v4.models.omnichannelSubscription.params.OmnichannelTransactionsForOmnichannelSubscriptionParams; + +/** + * Immutable response object for OmnichannelTransactionsForOmnichannelSubscription operation. + * Contains paginated list data. + */ +public final class OmnichannelTransactionsForOmnichannelSubscriptionResponse { + + private final List + list; + + private final String nextOffset; + + private final String omnichannelSubscriptionId; + + private final OmnichannelSubscriptionService service; + private final OmnichannelTransactionsForOmnichannelSubscriptionParams originalParams; + private final Response httpResponse; + + private OmnichannelTransactionsForOmnichannelSubscriptionResponse( + List list, + String nextOffset, + String omnichannelSubscriptionId, + OmnichannelSubscriptionService service, + OmnichannelTransactionsForOmnichannelSubscriptionParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.omnichannelSubscriptionId = omnichannelSubscriptionId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into OmnichannelTransactionsForOmnichannelSubscriptionResponse object (no + * service context). Use this when you only need to read a single page (no nextPage()). + */ + public static OmnichannelTransactionsForOmnichannelSubscriptionResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map( + OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionItem + ::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new OmnichannelTransactionsForOmnichannelSubscriptionResponse( + list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse OmnichannelTransactionsForOmnichannelSubscriptionResponse from JSON", e); + } + } + + /** + * Parse JSON response into OmnichannelTransactionsForOmnichannelSubscriptionResponse object with + * service context for pagination (enables nextPage()). + */ + public static OmnichannelTransactionsForOmnichannelSubscriptionResponse fromJson( + String json, + OmnichannelSubscriptionService service, + OmnichannelTransactionsForOmnichannelSubscriptionParams originalParams, + String omnichannelSubscriptionId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map( + OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionItem + ::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new OmnichannelTransactionsForOmnichannelSubscriptionResponse( + list, nextOffset, omnichannelSubscriptionId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse OmnichannelTransactionsForOmnichannelSubscriptionResponse 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 OmnichannelTransactionsForOmnichannelSubscriptionResponse 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)."); + } + + OmnichannelTransactionsForOmnichannelSubscriptionParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : OmnichannelTransactionsForOmnichannelSubscriptionParams.builder()) + .offset(nextOffset) + .build(); + + return service.omnichannelTransactionsForOmnichannelSubscription( + omnichannelSubscriptionId, 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 OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionItem { + + private OmnichannelTransaction omnichannelTransaction; + + public OmnichannelTransaction getOmnichannelTransaction() { + return omnichannelTransaction; + } + + public static OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionItem + fromJson(String json) { + OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionItem item = + new OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionItem(); + + String __omnichannelTransactionJson = JsonUtil.getObject(json, "omnichannel_transaction"); + if (__omnichannelTransactionJson != null) { + item.omnichannelTransaction = OmnichannelTransaction.fromJson(__omnichannelTransactionJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItem/OmnichannelSubscriptionItem.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItem/OmnichannelSubscriptionItem.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItem/OmnichannelSubscriptionItem.java rename to src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItem/OmnichannelSubscriptionItem.java index da7178be..63747c9c 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItem/OmnichannelSubscriptionItem.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItem/OmnichannelSubscriptionItem.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItem; +package com.chargebee.v4.models.omnichannelSubscriptionItem; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItem/params/OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItem/params/OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams.java new file mode 100644 index 00000000..609d1cfd --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItem/params/OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams.java @@ -0,0 +1,69 @@ +/* + * 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.omnichannelSubscriptionItem.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams { + + private final Map queryParams; + + private OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams( + OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesBuilder toBuilder() { + OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesBuilder builder = + new OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** + * Create a new builder for + * OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams. + */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesBuilder + builder() { + return new OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesBuilder(); + } + + public static final + class OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesBuilder() {} + + public OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesBuilder limit( + Integer value) { + queryParams.put("limit", value); + return this; + } + + public OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesBuilder offset( + String value) { + queryParams.put("offset", value); + return this; + } + + public OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams build() { + return new OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItem/responses/OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItem/responses/OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse.java new file mode 100644 index 00000000..be0c8d21 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItem/responses/OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse.java @@ -0,0 +1,195 @@ +package com.chargebee.v4.models.omnichannelSubscriptionItem.responses; + +import java.util.List; + +import com.chargebee.v4.models.omnichannelSubscriptionItemScheduledChange.OmnichannelSubscriptionItemScheduledChange; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.OmnichannelSubscriptionItemService; +import com.chargebee.v4.models.omnichannelSubscriptionItem.params.OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams; + +/** + * Immutable response object for OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChanges + * operation. Contains paginated list data. + */ +public final class OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse { + + private final List list; + + private final String nextOffset; + + private final String omnichannelSubscriptionItemId; + + private final OmnichannelSubscriptionItemService service; + private final OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams + originalParams; + private final Response httpResponse; + + private OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse( + List list, + String nextOffset, + String omnichannelSubscriptionItemId, + OmnichannelSubscriptionItemService service, + OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.omnichannelSubscriptionItemId = omnichannelSubscriptionItemId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into + * OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse object (no service + * context). Use this when you only need to read a single page (no nextPage()). + */ + public static OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse fromJson( + String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse( + list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse from JSON", + e); + } + } + + /** + * Parse JSON response into + * OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse object with service + * context for pagination (enables nextPage()). + */ + public static OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse fromJson( + String json, + OmnichannelSubscriptionItemService service, + OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams originalParams, + String omnichannelSubscriptionItemId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse( + list, nextOffset, omnichannelSubscriptionItemId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse 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 OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse 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)."); + } + + OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams + .builder()) + .offset(nextOffset) + .build(); + + return service.listOmniSubscriptionItemScheduleChanges( + omnichannelSubscriptionItemId, 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 OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesItem { + + private OmnichannelSubscriptionItemScheduledChange omnichannelSubscriptionItemScheduledChange; + + public OmnichannelSubscriptionItemScheduledChange + getOmnichannelSubscriptionItemScheduledChange() { + return omnichannelSubscriptionItemScheduledChange; + } + + public static OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesItem fromJson( + String json) { + OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesItem item = + new OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesItem(); + + String __omnichannelSubscriptionItemScheduledChangeJson = + JsonUtil.getObject(json, "omnichannel_subscription_item_scheduled_change"); + if (__omnichannelSubscriptionItemScheduledChangeJson != null) { + item.omnichannelSubscriptionItemScheduledChange = + OmnichannelSubscriptionItemScheduledChange.fromJson( + __omnichannelSubscriptionItemScheduledChangeJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemOffer/OmnichannelSubscriptionItemOffer.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItemOffer/OmnichannelSubscriptionItemOffer.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemOffer/OmnichannelSubscriptionItemOffer.java rename to src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItemOffer/OmnichannelSubscriptionItemOffer.java index e086822b..fa45f202 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemOffer/OmnichannelSubscriptionItemOffer.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItemOffer/OmnichannelSubscriptionItemOffer.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemOffer; +package com.chargebee.v4.models.omnichannelSubscriptionItemOffer; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemScheduledChange/OmnichannelSubscriptionItemScheduledChange.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItemScheduledChange/OmnichannelSubscriptionItemScheduledChange.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemScheduledChange/OmnichannelSubscriptionItemScheduledChange.java rename to src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItemScheduledChange/OmnichannelSubscriptionItemScheduledChange.java index 12cfa051..77a735fd 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelSubscriptionItemScheduledChange/OmnichannelSubscriptionItemScheduledChange.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItemScheduledChange/OmnichannelSubscriptionItemScheduledChange.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelSubscriptionItemScheduledChange; +package com.chargebee.v4.models.omnichannelSubscriptionItemScheduledChange; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/omnichannelTransaction/OmnichannelTransaction.java b/src/main/java/com/chargebee/v4/models/omnichannelTransaction/OmnichannelTransaction.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/omnichannelTransaction/OmnichannelTransaction.java rename to src/main/java/com/chargebee/v4/models/omnichannelTransaction/OmnichannelTransaction.java index 9d2c8cee..f7eaf0a4 100644 --- a/src/main/java/com/chargebee/v4/core/models/omnichannelTransaction/OmnichannelTransaction.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelTransaction/OmnichannelTransaction.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.omnichannelTransaction; +package com.chargebee.v4.models.omnichannelTransaction; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/order/Order.java b/src/main/java/com/chargebee/v4/models/order/Order.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/order/Order.java rename to src/main/java/com/chargebee/v4/models/order/Order.java index 45b6e598..a4366684 100644 --- a/src/main/java/com/chargebee/v4/core/models/order/Order.java +++ b/src/main/java/com/chargebee/v4/models/order/Order.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.order; +package com.chargebee.v4.models.order; import com.chargebee.v4.internal.JsonUtil; import java.math.BigDecimal; diff --git a/src/main/java/com/chargebee/v4/models/order/params/AssignOrderNumberParams.java b/src/main/java/com/chargebee/v4/models/order/params/AssignOrderNumberParams.java new file mode 100644 index 00000000..597e2f35 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/order/params/AssignOrderNumberParams.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.order.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class AssignOrderNumberParams { + + private AssignOrderNumberParams(AssignOrderNumberBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for AssignOrderNumberParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AssignOrderNumberBuilder builder() { + return new AssignOrderNumberBuilder(); + } + + public static final class AssignOrderNumberBuilder { + + private AssignOrderNumberBuilder() {} + + public AssignOrderNumberParams build() { + return new AssignOrderNumberParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/order/params/ImportOrderParams.java b/src/main/java/com/chargebee/v4/models/order/params/ImportOrderParams.java new file mode 100644 index 00000000..c4264b47 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/order/params/ImportOrderParams.java @@ -0,0 +1,1303 @@ +/* + * 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.order.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class ImportOrderParams { + + private final String id; + + private final String documentNumber; + + private final String invoiceId; + + private final Status status; + + private final String subscriptionId; + + private final String customerId; + + private final Timestamp createdAt; + + private final Timestamp orderDate; + + private final Timestamp shippingDate; + + private final String referenceId; + + private final String fulfillmentStatus; + + private final String note; + + private final String trackingId; + + private final String trackingUrl; + + private final String batchId; + + private final String shipmentCarrier; + + private final Timestamp shippingCutOffDate; + + private final Timestamp deliveredAt; + + private final Timestamp shippedAt; + + private final Timestamp cancelledAt; + + private final CancellationReason cancellationReason; + + private final Long refundableCreditsIssued; + + private final ShippingAddressParams shippingAddress; + + private final BillingAddressParams billingAddress; + + private ImportOrderParams(ImportOrderBuilder builder) { + + this.id = builder.id; + + this.documentNumber = builder.documentNumber; + + this.invoiceId = builder.invoiceId; + + this.status = builder.status; + + this.subscriptionId = builder.subscriptionId; + + this.customerId = builder.customerId; + + this.createdAt = builder.createdAt; + + this.orderDate = builder.orderDate; + + this.shippingDate = builder.shippingDate; + + this.referenceId = builder.referenceId; + + this.fulfillmentStatus = builder.fulfillmentStatus; + + this.note = builder.note; + + this.trackingId = builder.trackingId; + + this.trackingUrl = builder.trackingUrl; + + this.batchId = builder.batchId; + + this.shipmentCarrier = builder.shipmentCarrier; + + this.shippingCutOffDate = builder.shippingCutOffDate; + + this.deliveredAt = builder.deliveredAt; + + this.shippedAt = builder.shippedAt; + + this.cancelledAt = builder.cancelledAt; + + this.cancellationReason = builder.cancellationReason; + + this.refundableCreditsIssued = builder.refundableCreditsIssued; + + this.shippingAddress = builder.shippingAddress; + + this.billingAddress = builder.billingAddress; + } + + public String getId() { + return id; + } + + public String getDocumentNumber() { + return documentNumber; + } + + public String getInvoiceId() { + return invoiceId; + } + + public Status getStatus() { + return status; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getCustomerId() { + return customerId; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Timestamp getOrderDate() { + return orderDate; + } + + public Timestamp getShippingDate() { + return shippingDate; + } + + public String getReferenceId() { + return referenceId; + } + + public String getFulfillmentStatus() { + return fulfillmentStatus; + } + + public String getNote() { + return note; + } + + public String getTrackingId() { + return trackingId; + } + + public String getTrackingUrl() { + return trackingUrl; + } + + public String getBatchId() { + return batchId; + } + + public String getShipmentCarrier() { + return shipmentCarrier; + } + + public Timestamp getShippingCutOffDate() { + return shippingCutOffDate; + } + + public Timestamp getDeliveredAt() { + return deliveredAt; + } + + public Timestamp getShippedAt() { + return shippedAt; + } + + public Timestamp getCancelledAt() { + return cancelledAt; + } + + public CancellationReason getCancellationReason() { + return cancellationReason; + } + + public Long getRefundableCreditsIssued() { + return refundableCreditsIssued; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.documentNumber != null) { + + formData.put("document_number", this.documentNumber); + } + + if (this.invoiceId != null) { + + formData.put("invoice_id", this.invoiceId); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.createdAt != null) { + + formData.put("created_at", this.createdAt); + } + + if (this.orderDate != null) { + + formData.put("order_date", this.orderDate); + } + + if (this.shippingDate != null) { + + formData.put("shipping_date", this.shippingDate); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.fulfillmentStatus != null) { + + formData.put("fulfillment_status", this.fulfillmentStatus); + } + + if (this.note != null) { + + formData.put("note", this.note); + } + + if (this.trackingId != null) { + + formData.put("tracking_id", this.trackingId); + } + + if (this.trackingUrl != null) { + + formData.put("tracking_url", this.trackingUrl); + } + + if (this.batchId != null) { + + formData.put("batch_id", this.batchId); + } + + if (this.shipmentCarrier != null) { + + formData.put("shipment_carrier", this.shipmentCarrier); + } + + if (this.shippingCutOffDate != null) { + + formData.put("shipping_cut_off_date", this.shippingCutOffDate); + } + + if (this.deliveredAt != null) { + + formData.put("delivered_at", this.deliveredAt); + } + + if (this.shippedAt != null) { + + formData.put("shipped_at", this.shippedAt); + } + + if (this.cancelledAt != null) { + + formData.put("cancelled_at", this.cancelledAt); + } + + if (this.cancellationReason != null) { + + formData.put("cancellation_reason", this.cancellationReason); + } + + if (this.refundableCreditsIssued != null) { + + formData.put("refundable_credits_issued", this.refundableCreditsIssued); + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ImportOrderParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ImportOrderBuilder builder() { + return new ImportOrderBuilder(); + } + + public static final class ImportOrderBuilder { + + private String id; + + private String documentNumber; + + private String invoiceId; + + private Status status; + + private String subscriptionId; + + private String customerId; + + private Timestamp createdAt; + + private Timestamp orderDate; + + private Timestamp shippingDate; + + private String referenceId; + + private String fulfillmentStatus; + + private String note; + + private String trackingId; + + private String trackingUrl; + + private String batchId; + + private String shipmentCarrier; + + private Timestamp shippingCutOffDate; + + private Timestamp deliveredAt; + + private Timestamp shippedAt; + + private Timestamp cancelledAt; + + private CancellationReason cancellationReason; + + private Long refundableCreditsIssued; + + private ShippingAddressParams shippingAddress; + + private BillingAddressParams billingAddress; + + private ImportOrderBuilder() {} + + public ImportOrderBuilder id(String value) { + this.id = value; + return this; + } + + public ImportOrderBuilder documentNumber(String value) { + this.documentNumber = value; + return this; + } + + public ImportOrderBuilder invoiceId(String value) { + this.invoiceId = value; + return this; + } + + public ImportOrderBuilder status(Status value) { + this.status = value; + return this; + } + + public ImportOrderBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public ImportOrderBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public ImportOrderBuilder createdAt(Timestamp value) { + this.createdAt = value; + return this; + } + + public ImportOrderBuilder orderDate(Timestamp value) { + this.orderDate = value; + return this; + } + + public ImportOrderBuilder shippingDate(Timestamp value) { + this.shippingDate = value; + return this; + } + + public ImportOrderBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public ImportOrderBuilder fulfillmentStatus(String value) { + this.fulfillmentStatus = value; + return this; + } + + public ImportOrderBuilder note(String value) { + this.note = value; + return this; + } + + public ImportOrderBuilder trackingId(String value) { + this.trackingId = value; + return this; + } + + public ImportOrderBuilder trackingUrl(String value) { + this.trackingUrl = value; + return this; + } + + public ImportOrderBuilder batchId(String value) { + this.batchId = value; + return this; + } + + public ImportOrderBuilder shipmentCarrier(String value) { + this.shipmentCarrier = value; + return this; + } + + public ImportOrderBuilder shippingCutOffDate(Timestamp value) { + this.shippingCutOffDate = value; + return this; + } + + public ImportOrderBuilder deliveredAt(Timestamp value) { + this.deliveredAt = value; + return this; + } + + public ImportOrderBuilder shippedAt(Timestamp value) { + this.shippedAt = value; + return this; + } + + public ImportOrderBuilder cancelledAt(Timestamp value) { + this.cancelledAt = value; + return this; + } + + public ImportOrderBuilder cancellationReason(CancellationReason value) { + this.cancellationReason = value; + return this; + } + + public ImportOrderBuilder refundableCreditsIssued(Long value) { + this.refundableCreditsIssued = value; + return this; + } + + public ImportOrderBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public ImportOrderBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public ImportOrderParams build() { + return new ImportOrderParams(this); + } + } + + public enum Status { + CANCELLED("cancelled"), + + QUEUED("queued"), + + AWAITING_SHIPMENT("awaiting_shipment"), + + ON_HOLD("on_hold"), + + DELIVERED("delivered"), + + SHIPPED("shipped"), + + PARTIALLY_DELIVERED("partially_delivered"), + + RETURNED("returned"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum CancellationReason { + SHIPPING_CUT_OFF_PASSED("shipping_cut_off_passed"), + + PRODUCT_UNSATISFACTORY("product_unsatisfactory"), + + THIRD_PARTY_CANCELLATION("third_party_cancellation"), + + PRODUCT_NOT_REQUIRED("product_not_required"), + + DELIVERY_DATE_MISSED("delivery_date_missed"), + + ALTERNATIVE_FOUND("alternative_found"), + + INVOICE_WRITTEN_OFF("invoice_written_off"), + + INVOICE_VOIDED("invoice_voided"), + + FRAUDULENT_TRANSACTION("fraudulent_transaction"), + + PAYMENT_DECLINED("payment_declined"), + + SUBSCRIPTION_CANCELLED("subscription_cancelled"), + + PRODUCT_NOT_AVAILABLE("product_not_available"), + + OTHERS("others"), + + ORDER_RESENT("order_resent"), + + /** An enum member indicating that CancellationReason was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CancellationReason(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CancellationReason fromString(String value) { + if (value == null) return _UNKNOWN; + for (CancellationReason enumValue : CancellationReason.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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/order/params/OrderCancelParams.java b/src/main/java/com/chargebee/v4/models/order/params/OrderCancelParams.java new file mode 100644 index 00000000..e614104e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/order/params/OrderCancelParams.java @@ -0,0 +1,246 @@ +/* + * 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.order.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class OrderCancelParams { + + private final CancellationReason cancellationReason; + + private final String customerNotes; + + private final String comment; + + private final Timestamp cancelledAt; + + private final CreditNoteParams creditNote; + + private OrderCancelParams(OrderCancelBuilder builder) { + + this.cancellationReason = builder.cancellationReason; + + this.customerNotes = builder.customerNotes; + + this.comment = builder.comment; + + this.cancelledAt = builder.cancelledAt; + + this.creditNote = builder.creditNote; + } + + public CancellationReason getCancellationReason() { + return cancellationReason; + } + + public String getCustomerNotes() { + return customerNotes; + } + + public String getComment() { + return comment; + } + + public Timestamp getCancelledAt() { + return cancelledAt; + } + + public CreditNoteParams getCreditNote() { + return creditNote; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.cancellationReason != null) { + + formData.put("cancellation_reason", this.cancellationReason); + } + + if (this.customerNotes != null) { + + formData.put("customer_notes", this.customerNotes); + } + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.cancelledAt != null) { + + formData.put("cancelled_at", this.cancelledAt); + } + + if (this.creditNote != null) { + + // Single object + Map nestedData = this.creditNote.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "credit_note[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for OrderCancelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OrderCancelBuilder builder() { + return new OrderCancelBuilder(); + } + + public static final class OrderCancelBuilder { + + private CancellationReason cancellationReason; + + private String customerNotes; + + private String comment; + + private Timestamp cancelledAt; + + private CreditNoteParams creditNote; + + private OrderCancelBuilder() {} + + public OrderCancelBuilder cancellationReason(CancellationReason value) { + this.cancellationReason = value; + return this; + } + + public OrderCancelBuilder customerNotes(String value) { + this.customerNotes = value; + return this; + } + + public OrderCancelBuilder comment(String value) { + this.comment = value; + return this; + } + + public OrderCancelBuilder cancelledAt(Timestamp value) { + this.cancelledAt = value; + return this; + } + + public OrderCancelBuilder creditNote(CreditNoteParams value) { + this.creditNote = value; + return this; + } + + public OrderCancelParams build() { + return new OrderCancelParams(this); + } + } + + public enum CancellationReason { + SHIPPING_CUT_OFF_PASSED("shipping_cut_off_passed"), + + PRODUCT_UNSATISFACTORY("product_unsatisfactory"), + + THIRD_PARTY_CANCELLATION("third_party_cancellation"), + + PRODUCT_NOT_REQUIRED("product_not_required"), + + DELIVERY_DATE_MISSED("delivery_date_missed"), + + ALTERNATIVE_FOUND("alternative_found"), + + INVOICE_WRITTEN_OFF("invoice_written_off"), + + INVOICE_VOIDED("invoice_voided"), + + FRAUDULENT_TRANSACTION("fraudulent_transaction"), + + PAYMENT_DECLINED("payment_declined"), + + SUBSCRIPTION_CANCELLED("subscription_cancelled"), + + PRODUCT_NOT_AVAILABLE("product_not_available"), + + OTHERS("others"), + + ORDER_RESENT("order_resent"), + + /** An enum member indicating that CancellationReason was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CancellationReason(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CancellationReason fromString(String value) { + if (value == null) return _UNKNOWN; + for (CancellationReason enumValue : CancellationReason.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class CreditNoteParams { + + private final Long total; + + private CreditNoteParams(CreditNoteBuilder builder) { + + this.total = builder.total; + } + + public Long getTotal() { + return total; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.total != null) { + + formData.put("total", this.total); + } + + return formData; + } + + /** Create a new builder for CreditNoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNoteBuilder builder() { + return new CreditNoteBuilder(); + } + + public static final class CreditNoteBuilder { + + private Long total; + + private CreditNoteBuilder() {} + + public CreditNoteBuilder total(Long value) { + this.total = value; + return this; + } + + public CreditNoteParams build() { + return new CreditNoteParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/order/params/OrderCreateParams.java b/src/main/java/com/chargebee/v4/models/order/params/OrderCreateParams.java new file mode 100644 index 00000000..fd174f63 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/order/params/OrderCreateParams.java @@ -0,0 +1,254 @@ +/* + * 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.order.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class OrderCreateParams { + + private final String id; + + private final String invoiceId; + + private final Status status; + + private final String referenceId; + + private final String fulfillmentStatus; + + private final String note; + + private final String trackingId; + + private final String trackingUrl; + + private final String batchId; + + private OrderCreateParams(OrderCreateBuilder builder) { + + this.id = builder.id; + + this.invoiceId = builder.invoiceId; + + this.status = builder.status; + + this.referenceId = builder.referenceId; + + this.fulfillmentStatus = builder.fulfillmentStatus; + + this.note = builder.note; + + this.trackingId = builder.trackingId; + + this.trackingUrl = builder.trackingUrl; + + this.batchId = builder.batchId; + } + + public String getId() { + return id; + } + + public String getInvoiceId() { + return invoiceId; + } + + public Status getStatus() { + return status; + } + + public String getReferenceId() { + return referenceId; + } + + public String getFulfillmentStatus() { + return fulfillmentStatus; + } + + public String getNote() { + return note; + } + + public String getTrackingId() { + return trackingId; + } + + public String getTrackingUrl() { + return trackingUrl; + } + + public String getBatchId() { + return batchId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.invoiceId != null) { + + formData.put("invoice_id", this.invoiceId); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.fulfillmentStatus != null) { + + formData.put("fulfillment_status", this.fulfillmentStatus); + } + + if (this.note != null) { + + formData.put("note", this.note); + } + + if (this.trackingId != null) { + + formData.put("tracking_id", this.trackingId); + } + + if (this.trackingUrl != null) { + + formData.put("tracking_url", this.trackingUrl); + } + + if (this.batchId != null) { + + formData.put("batch_id", this.batchId); + } + + return formData; + } + + /** Create a new builder for OrderCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OrderCreateBuilder builder() { + return new OrderCreateBuilder(); + } + + public static final class OrderCreateBuilder { + + private String id; + + private String invoiceId; + + private Status status; + + private String referenceId; + + private String fulfillmentStatus; + + private String note; + + private String trackingId; + + private String trackingUrl; + + private String batchId; + + private OrderCreateBuilder() {} + + public OrderCreateBuilder id(String value) { + this.id = value; + return this; + } + + public OrderCreateBuilder invoiceId(String value) { + this.invoiceId = value; + return this; + } + + public OrderCreateBuilder status(Status value) { + this.status = value; + return this; + } + + public OrderCreateBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public OrderCreateBuilder fulfillmentStatus(String value) { + this.fulfillmentStatus = value; + return this; + } + + public OrderCreateBuilder note(String value) { + this.note = value; + return this; + } + + public OrderCreateBuilder trackingId(String value) { + this.trackingId = value; + return this; + } + + public OrderCreateBuilder trackingUrl(String value) { + this.trackingUrl = value; + return this; + } + + public OrderCreateBuilder batchId(String value) { + this.batchId = value; + return this; + } + + public OrderCreateParams build() { + return new OrderCreateParams(this); + } + } + + public enum Status { + NEW("new"), + + PROCESSING("processing"), + + COMPLETE("complete"), + + CANCELLED("cancelled"), + + VOIDED("voided"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/order/params/OrderCreateRefundableCreditNoteParams.java b/src/main/java/com/chargebee/v4/models/order/params/OrderCreateRefundableCreditNoteParams.java new file mode 100644 index 00000000..e4f2d7a6 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/order/params/OrderCreateRefundableCreditNoteParams.java @@ -0,0 +1,221 @@ +/* + * 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.order.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class OrderCreateRefundableCreditNoteParams { + + private final String customerNotes; + + private final String comment; + + private final CreditNoteParams creditNote; + + private OrderCreateRefundableCreditNoteParams(OrderCreateRefundableCreditNoteBuilder builder) { + + this.customerNotes = builder.customerNotes; + + this.comment = builder.comment; + + this.creditNote = builder.creditNote; + } + + public String getCustomerNotes() { + return customerNotes; + } + + public String getComment() { + return comment; + } + + public CreditNoteParams getCreditNote() { + return creditNote; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerNotes != null) { + + formData.put("customer_notes", this.customerNotes); + } + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.creditNote != null) { + + // Single object + Map nestedData = this.creditNote.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "credit_note[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for OrderCreateRefundableCreditNoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OrderCreateRefundableCreditNoteBuilder builder() { + return new OrderCreateRefundableCreditNoteBuilder(); + } + + public static final class OrderCreateRefundableCreditNoteBuilder { + + private String customerNotes; + + private String comment; + + private CreditNoteParams creditNote; + + private OrderCreateRefundableCreditNoteBuilder() {} + + public OrderCreateRefundableCreditNoteBuilder customerNotes(String value) { + this.customerNotes = value; + return this; + } + + public OrderCreateRefundableCreditNoteBuilder comment(String value) { + this.comment = value; + return this; + } + + public OrderCreateRefundableCreditNoteBuilder creditNote(CreditNoteParams value) { + this.creditNote = value; + return this; + } + + public OrderCreateRefundableCreditNoteParams build() { + return new OrderCreateRefundableCreditNoteParams(this); + } + } + + public static final class CreditNoteParams { + + private final ReasonCode reasonCode; + + private final Long total; + + private CreditNoteParams(CreditNoteBuilder builder) { + + this.reasonCode = builder.reasonCode; + + this.total = builder.total; + } + + public ReasonCode getReasonCode() { + return reasonCode; + } + + public Long getTotal() { + return total; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.reasonCode != null) { + + formData.put("reason_code", this.reasonCode); + } + + if (this.total != null) { + + formData.put("total", this.total); + } + + return formData; + } + + /** Create a new builder for CreditNoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNoteBuilder builder() { + return new CreditNoteBuilder(); + } + + public static final class CreditNoteBuilder { + + private ReasonCode reasonCode; + + private Long total; + + private CreditNoteBuilder() {} + + public CreditNoteBuilder reasonCode(ReasonCode value) { + this.reasonCode = value; + return this; + } + + public CreditNoteBuilder total(Long value) { + this.total = value; + return this; + } + + public CreditNoteParams build() { + return new CreditNoteParams(this); + } + } + + public enum ReasonCode { + WRITE_OFF("write_off"), + + SUBSCRIPTION_CHANGE("subscription_change"), + + SUBSCRIPTION_CANCELLATION("subscription_cancellation"), + + SUBSCRIPTION_PAUSE("subscription_pause"), + + CHARGEBACK("chargeback"), + + PRODUCT_UNSATISFACTORY("product_unsatisfactory"), + + SERVICE_UNSATISFACTORY("service_unsatisfactory"), + + ORDER_CHANGE("order_change"), + + ORDER_CANCELLATION("order_cancellation"), + + WAIVER("waiver"), + + OTHER("other"), + + FRAUDULENT("fraudulent"), + + /** An enum member indicating that ReasonCode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ReasonCode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ReasonCode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ReasonCode enumValue : ReasonCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/order/params/OrderDeleteParams.java b/src/main/java/com/chargebee/v4/models/order/params/OrderDeleteParams.java new file mode 100644 index 00000000..62d6b39d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/order/params/OrderDeleteParams.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.order.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class OrderDeleteParams { + + private OrderDeleteParams(OrderDeleteBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for OrderDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OrderDeleteBuilder builder() { + return new OrderDeleteBuilder(); + } + + public static final class OrderDeleteBuilder { + + private OrderDeleteBuilder() {} + + public OrderDeleteParams build() { + return new OrderDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/order/params/OrderListParams.java b/src/main/java/com/chargebee/v4/models/order/params/OrderListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/order/params/OrderListParams.java rename to src/main/java/com/chargebee/v4/models/order/params/OrderListParams.java index e64d72d6..62371fd0 100644 --- a/src/main/java/com/chargebee/v4/core/models/order/params/OrderListParams.java +++ b/src/main/java/com/chargebee/v4/models/order/params/OrderListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.order.params; +package com.chargebee.v4.models.order.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/order/params/OrderReopenParams.java b/src/main/java/com/chargebee/v4/models/order/params/OrderReopenParams.java new file mode 100644 index 00000000..a1e67225 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/order/params/OrderReopenParams.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.order.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class OrderReopenParams { + + private final Boolean voidCancellationCreditNotes; + + private OrderReopenParams(OrderReopenBuilder builder) { + + this.voidCancellationCreditNotes = builder.voidCancellationCreditNotes; + } + + public Boolean getVoidCancellationCreditNotes() { + return voidCancellationCreditNotes; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.voidCancellationCreditNotes != null) { + + formData.put("void_cancellation_credit_notes", this.voidCancellationCreditNotes); + } + + return formData; + } + + /** Create a new builder for OrderReopenParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OrderReopenBuilder builder() { + return new OrderReopenBuilder(); + } + + public static final class OrderReopenBuilder { + + private Boolean voidCancellationCreditNotes; + + private OrderReopenBuilder() {} + + public OrderReopenBuilder voidCancellationCreditNotes(Boolean value) { + this.voidCancellationCreditNotes = value; + return this; + } + + public OrderReopenParams build() { + return new OrderReopenParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/order/params/OrderResendParams.java b/src/main/java/com/chargebee/v4/models/order/params/OrderResendParams.java new file mode 100644 index 00000000..e06a9bb8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/order/params/OrderResendParams.java @@ -0,0 +1,180 @@ +/* + * 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.order.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class OrderResendParams { + + private final Timestamp shippingDate; + + private final String resendReason; + + private final List orderLineItems; + + private OrderResendParams(OrderResendBuilder builder) { + + this.shippingDate = builder.shippingDate; + + this.resendReason = builder.resendReason; + + this.orderLineItems = builder.orderLineItems; + } + + public Timestamp getShippingDate() { + return shippingDate; + } + + public String getResendReason() { + return resendReason; + } + + public List getOrderLineItems() { + return orderLineItems; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.shippingDate != null) { + + formData.put("shipping_date", this.shippingDate); + } + + if (this.resendReason != null) { + + formData.put("resend_reason", this.resendReason); + } + + if (this.orderLineItems != null) { + + // List of objects + for (int i = 0; i < this.orderLineItems.size(); i++) { + OrderLineItemsParams item = this.orderLineItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "order_line_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for OrderResendParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OrderResendBuilder builder() { + return new OrderResendBuilder(); + } + + public static final class OrderResendBuilder { + + private Timestamp shippingDate; + + private String resendReason; + + private List orderLineItems; + + private OrderResendBuilder() {} + + public OrderResendBuilder shippingDate(Timestamp value) { + this.shippingDate = value; + return this; + } + + public OrderResendBuilder resendReason(String value) { + this.resendReason = value; + return this; + } + + public OrderResendBuilder orderLineItems(List value) { + this.orderLineItems = value; + return this; + } + + public OrderResendParams build() { + return new OrderResendParams(this); + } + } + + public static final class OrderLineItemsParams { + + private final String id; + + private final Integer fulfillmentQuantity; + + private OrderLineItemsParams(OrderLineItemsBuilder builder) { + + this.id = builder.id; + + this.fulfillmentQuantity = builder.fulfillmentQuantity; + } + + public String getId() { + return id; + } + + public Integer getFulfillmentQuantity() { + return fulfillmentQuantity; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.fulfillmentQuantity != null) { + + formData.put("fulfillment_quantity", this.fulfillmentQuantity); + } + + return formData; + } + + /** Create a new builder for OrderLineItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OrderLineItemsBuilder builder() { + return new OrderLineItemsBuilder(); + } + + public static final class OrderLineItemsBuilder { + + private String id; + + private Integer fulfillmentQuantity; + + private OrderLineItemsBuilder() {} + + public OrderLineItemsBuilder id(String value) { + this.id = value; + return this; + } + + public OrderLineItemsBuilder fulfillmentQuantity(Integer value) { + this.fulfillmentQuantity = value; + return this; + } + + public OrderLineItemsParams build() { + return new OrderLineItemsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/order/params/OrderRetrieveParams.java b/src/main/java/com/chargebee/v4/models/order/params/OrderRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/order/params/OrderRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/order/params/OrderRetrieveParams.java index 81b8603d..560187d0 100644 --- a/src/main/java/com/chargebee/v4/core/models/order/params/OrderRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/order/params/OrderRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.order.params; +package com.chargebee.v4.models.order.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/order/params/OrderUpdateParams.java b/src/main/java/com/chargebee/v4/models/order/params/OrderUpdateParams.java new file mode 100644 index 00000000..37693467 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/order/params/OrderUpdateParams.java @@ -0,0 +1,945 @@ +/* + * 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.order.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class OrderUpdateParams { + + private final String referenceId; + + private final String batchId; + + private final String note; + + private final Timestamp shippingDate; + + private final Timestamp orderDate; + + private final Timestamp cancelledAt; + + private final CancellationReason cancellationReason; + + private final Timestamp shippedAt; + + private final Timestamp deliveredAt; + + private final String trackingUrl; + + private final String trackingId; + + private final String shipmentCarrier; + + private final String fulfillmentStatus; + + private final Status status; + + private final ShippingAddressParams shippingAddress; + + private final List orderLineItems; + + private OrderUpdateParams(OrderUpdateBuilder builder) { + + this.referenceId = builder.referenceId; + + this.batchId = builder.batchId; + + this.note = builder.note; + + this.shippingDate = builder.shippingDate; + + this.orderDate = builder.orderDate; + + this.cancelledAt = builder.cancelledAt; + + this.cancellationReason = builder.cancellationReason; + + this.shippedAt = builder.shippedAt; + + this.deliveredAt = builder.deliveredAt; + + this.trackingUrl = builder.trackingUrl; + + this.trackingId = builder.trackingId; + + this.shipmentCarrier = builder.shipmentCarrier; + + this.fulfillmentStatus = builder.fulfillmentStatus; + + this.status = builder.status; + + this.shippingAddress = builder.shippingAddress; + + this.orderLineItems = builder.orderLineItems; + } + + public String getReferenceId() { + return referenceId; + } + + public String getBatchId() { + return batchId; + } + + public String getNote() { + return note; + } + + public Timestamp getShippingDate() { + return shippingDate; + } + + public Timestamp getOrderDate() { + return orderDate; + } + + public Timestamp getCancelledAt() { + return cancelledAt; + } + + public CancellationReason getCancellationReason() { + return cancellationReason; + } + + public Timestamp getShippedAt() { + return shippedAt; + } + + public Timestamp getDeliveredAt() { + return deliveredAt; + } + + public String getTrackingUrl() { + return trackingUrl; + } + + public String getTrackingId() { + return trackingId; + } + + public String getShipmentCarrier() { + return shipmentCarrier; + } + + public String getFulfillmentStatus() { + return fulfillmentStatus; + } + + public Status getStatus() { + return status; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public List getOrderLineItems() { + return orderLineItems; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.batchId != null) { + + formData.put("batch_id", this.batchId); + } + + if (this.note != null) { + + formData.put("note", this.note); + } + + if (this.shippingDate != null) { + + formData.put("shipping_date", this.shippingDate); + } + + if (this.orderDate != null) { + + formData.put("order_date", this.orderDate); + } + + if (this.cancelledAt != null) { + + formData.put("cancelled_at", this.cancelledAt); + } + + if (this.cancellationReason != null) { + + formData.put("cancellation_reason", this.cancellationReason); + } + + if (this.shippedAt != null) { + + formData.put("shipped_at", this.shippedAt); + } + + if (this.deliveredAt != null) { + + formData.put("delivered_at", this.deliveredAt); + } + + if (this.trackingUrl != null) { + + formData.put("tracking_url", this.trackingUrl); + } + + if (this.trackingId != null) { + + formData.put("tracking_id", this.trackingId); + } + + if (this.shipmentCarrier != null) { + + formData.put("shipment_carrier", this.shipmentCarrier); + } + + if (this.fulfillmentStatus != null) { + + formData.put("fulfillment_status", this.fulfillmentStatus); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.orderLineItems != null) { + + // List of objects + for (int i = 0; i < this.orderLineItems.size(); i++) { + OrderLineItemsParams item = this.orderLineItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "order_line_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for OrderUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OrderUpdateBuilder builder() { + return new OrderUpdateBuilder(); + } + + public static final class OrderUpdateBuilder { + + private String referenceId; + + private String batchId; + + private String note; + + private Timestamp shippingDate; + + private Timestamp orderDate; + + private Timestamp cancelledAt; + + private CancellationReason cancellationReason; + + private Timestamp shippedAt; + + private Timestamp deliveredAt; + + private String trackingUrl; + + private String trackingId; + + private String shipmentCarrier; + + private String fulfillmentStatus; + + private Status status; + + private ShippingAddressParams shippingAddress; + + private List orderLineItems; + + private OrderUpdateBuilder() {} + + public OrderUpdateBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public OrderUpdateBuilder batchId(String value) { + this.batchId = value; + return this; + } + + public OrderUpdateBuilder note(String value) { + this.note = value; + return this; + } + + public OrderUpdateBuilder shippingDate(Timestamp value) { + this.shippingDate = value; + return this; + } + + public OrderUpdateBuilder orderDate(Timestamp value) { + this.orderDate = value; + return this; + } + + public OrderUpdateBuilder cancelledAt(Timestamp value) { + this.cancelledAt = value; + return this; + } + + public OrderUpdateBuilder cancellationReason(CancellationReason value) { + this.cancellationReason = value; + return this; + } + + public OrderUpdateBuilder shippedAt(Timestamp value) { + this.shippedAt = value; + return this; + } + + public OrderUpdateBuilder deliveredAt(Timestamp value) { + this.deliveredAt = value; + return this; + } + + public OrderUpdateBuilder trackingUrl(String value) { + this.trackingUrl = value; + return this; + } + + public OrderUpdateBuilder trackingId(String value) { + this.trackingId = value; + return this; + } + + public OrderUpdateBuilder shipmentCarrier(String value) { + this.shipmentCarrier = value; + return this; + } + + public OrderUpdateBuilder fulfillmentStatus(String value) { + this.fulfillmentStatus = value; + return this; + } + + public OrderUpdateBuilder status(Status value) { + this.status = value; + return this; + } + + public OrderUpdateBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public OrderUpdateBuilder orderLineItems(List value) { + this.orderLineItems = value; + return this; + } + + public OrderUpdateParams build() { + return new OrderUpdateParams(this); + } + } + + public enum CancellationReason { + SHIPPING_CUT_OFF_PASSED("shipping_cut_off_passed"), + + PRODUCT_UNSATISFACTORY("product_unsatisfactory"), + + THIRD_PARTY_CANCELLATION("third_party_cancellation"), + + PRODUCT_NOT_REQUIRED("product_not_required"), + + DELIVERY_DATE_MISSED("delivery_date_missed"), + + ALTERNATIVE_FOUND("alternative_found"), + + INVOICE_WRITTEN_OFF("invoice_written_off"), + + INVOICE_VOIDED("invoice_voided"), + + FRAUDULENT_TRANSACTION("fraudulent_transaction"), + + PAYMENT_DECLINED("payment_declined"), + + SUBSCRIPTION_CANCELLED("subscription_cancelled"), + + PRODUCT_NOT_AVAILABLE("product_not_available"), + + OTHERS("others"), + + ORDER_RESENT("order_resent"), + + /** An enum member indicating that CancellationReason was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CancellationReason(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CancellationReason fromString(String value) { + if (value == null) return _UNKNOWN; + for (CancellationReason enumValue : CancellationReason.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + NEW("new"), + + PROCESSING("processing"), + + COMPLETE("complete"), + + CANCELLED("cancelled"), + + VOIDED("voided"), + + QUEUED("queued"), + + AWAITING_SHIPMENT("awaiting_shipment"), + + ON_HOLD("on_hold"), + + DELIVERED("delivered"), + + SHIPPED("shipped"), + + PARTIALLY_DELIVERED("partially_delivered"), + + RETURNED("returned"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class OrderLineItemsParams { + + private final String id; + + private final Status status; + + private final String sku; + + private OrderLineItemsParams(OrderLineItemsBuilder builder) { + + this.id = builder.id; + + this.status = builder.status; + + this.sku = builder.sku; + } + + public String getId() { + return id; + } + + public Status getStatus() { + return status; + } + + public String getSku() { + return sku; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.sku != null) { + + formData.put("sku", this.sku); + } + + return formData; + } + + /** Create a new builder for OrderLineItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OrderLineItemsBuilder builder() { + return new OrderLineItemsBuilder(); + } + + public static final class OrderLineItemsBuilder { + + private String id; + + private Status status; + + private String sku; + + private OrderLineItemsBuilder() {} + + public OrderLineItemsBuilder id(String value) { + this.id = value; + return this; + } + + public OrderLineItemsBuilder status(Status value) { + this.status = value; + return this; + } + + public OrderLineItemsBuilder sku(String value) { + this.sku = value; + return this; + } + + public OrderLineItemsParams build() { + return new OrderLineItemsParams(this); + } + } + + public enum Status { + QUEUED("queued"), + + AWAITING_SHIPMENT("awaiting_shipment"), + + ON_HOLD("on_hold"), + + DELIVERED("delivered"), + + SHIPPED("shipped"), + + PARTIALLY_DELIVERED("partially_delivered"), + + RETURNED("returned"), + + CANCELLED("cancelled"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/order/params/OrdersForInvoiceParams.java b/src/main/java/com/chargebee/v4/models/order/params/OrdersForInvoiceParams.java new file mode 100644 index 00000000..26a48072 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/order/params/OrdersForInvoiceParams.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.order.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class OrdersForInvoiceParams { + + private final Map queryParams; + + private OrdersForInvoiceParams(OrdersForInvoiceBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public OrdersForInvoiceBuilder toBuilder() { + OrdersForInvoiceBuilder builder = new OrdersForInvoiceBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for OrdersForInvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OrdersForInvoiceBuilder builder() { + return new OrdersForInvoiceBuilder(); + } + + public static final class OrdersForInvoiceBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private OrdersForInvoiceBuilder() {} + + public OrdersForInvoiceBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public OrdersForInvoiceBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public OrdersForInvoiceParams build() { + return new OrdersForInvoiceParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/order/responses/AssignOrderNumberResponse.java b/src/main/java/com/chargebee/v4/models/order/responses/AssignOrderNumberResponse.java new file mode 100644 index 00000000..40036fcf --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/order/responses/AssignOrderNumberResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.order.responses; + +import com.chargebee.v4.models.order.Order; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for AssignOrderNumber operation. Contains the response data from the + * API. + */ +public final class AssignOrderNumberResponse extends BaseResponse { + private final Order order; + + private AssignOrderNumberResponse(Builder builder) { + super(builder.httpResponse); + + this.order = builder.order; + } + + /** Parse JSON response into AssignOrderNumberResponse object. */ + public static AssignOrderNumberResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into AssignOrderNumberResponse object with HTTP response. */ + public static AssignOrderNumberResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __orderJson = JsonUtil.getObject(json, "order"); + if (__orderJson != null) { + builder.order(Order.fromJson(__orderJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse AssignOrderNumberResponse from JSON", e); + } + } + + /** Create a new builder for AssignOrderNumberResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for AssignOrderNumberResponse. */ + public static class Builder { + + private Order order; + + private Response httpResponse; + + private Builder() {} + + public Builder order(Order order) { + this.order = order; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public AssignOrderNumberResponse build() { + return new AssignOrderNumberResponse(this); + } + } + + /** Get the order from the response. */ + public Order getOrder() { + return order; + } +} diff --git a/src/main/java/com/chargebee/v4/models/order/responses/ImportOrderResponse.java b/src/main/java/com/chargebee/v4/models/order/responses/ImportOrderResponse.java new file mode 100644 index 00000000..89baf553 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/order/responses/ImportOrderResponse.java @@ -0,0 +1,74 @@ +package com.chargebee.v4.models.order.responses; + +import com.chargebee.v4.models.order.Order; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** Immutable response object for ImportOrder operation. Contains the response data from the API. */ +public final class ImportOrderResponse extends BaseResponse { + private final Order order; + + private ImportOrderResponse(Builder builder) { + super(builder.httpResponse); + + this.order = builder.order; + } + + /** Parse JSON response into ImportOrderResponse object. */ + public static ImportOrderResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ImportOrderResponse object with HTTP response. */ + public static ImportOrderResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __orderJson = JsonUtil.getObject(json, "order"); + if (__orderJson != null) { + builder.order(Order.fromJson(__orderJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ImportOrderResponse from JSON", e); + } + } + + /** Create a new builder for ImportOrderResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ImportOrderResponse. */ + public static class Builder { + + private Order order; + + private Response httpResponse; + + private Builder() {} + + public Builder order(Order order) { + this.order = order; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ImportOrderResponse build() { + return new ImportOrderResponse(this); + } + } + + /** Get the order from the response. */ + public Order getOrder() { + return order; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/order/OrderCancelResponse.java b/src/main/java/com/chargebee/v4/models/order/responses/OrderCancelResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/order/OrderCancelResponse.java rename to src/main/java/com/chargebee/v4/models/order/responses/OrderCancelResponse.java index f37c41c5..62c63865 100644 --- a/src/main/java/com/chargebee/v4/core/responses/order/OrderCancelResponse.java +++ b/src/main/java/com/chargebee/v4/models/order/responses/OrderCancelResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.order; +package com.chargebee.v4.models.order.responses; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/order/OrderCreateRefundableCreditNoteResponse.java b/src/main/java/com/chargebee/v4/models/order/responses/OrderCreateRefundableCreditNoteResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/order/OrderCreateRefundableCreditNoteResponse.java rename to src/main/java/com/chargebee/v4/models/order/responses/OrderCreateRefundableCreditNoteResponse.java index 5250d7b7..56989cbe 100644 --- a/src/main/java/com/chargebee/v4/core/responses/order/OrderCreateRefundableCreditNoteResponse.java +++ b/src/main/java/com/chargebee/v4/models/order/responses/OrderCreateRefundableCreditNoteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.order; +package com.chargebee.v4.models.order.responses; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/order/OrderCreateResponse.java b/src/main/java/com/chargebee/v4/models/order/responses/OrderCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/order/OrderCreateResponse.java rename to src/main/java/com/chargebee/v4/models/order/responses/OrderCreateResponse.java index fcb7ead0..85ef3747 100644 --- a/src/main/java/com/chargebee/v4/core/responses/order/OrderCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/order/responses/OrderCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.order; +package com.chargebee.v4.models.order.responses; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/order/OrderDeleteResponse.java b/src/main/java/com/chargebee/v4/models/order/responses/OrderDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/order/OrderDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/order/responses/OrderDeleteResponse.java index 08686916..5c5c6a64 100644 --- a/src/main/java/com/chargebee/v4/core/responses/order/OrderDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/order/responses/OrderDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.order; +package com.chargebee.v4.models.order.responses; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/order/OrderListResponse.java b/src/main/java/com/chargebee/v4/models/order/responses/OrderListResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/order/OrderListResponse.java rename to src/main/java/com/chargebee/v4/models/order/responses/OrderListResponse.java index 7127d902..54b8e805 100644 --- a/src/main/java/com/chargebee/v4/core/responses/order/OrderListResponse.java +++ b/src/main/java/com/chargebee/v4/models/order/responses/OrderListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.order; +package com.chargebee.v4.models.order.responses; import java.util.List; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.OrderService; -import com.chargebee.v4.core.models.order.params.OrderListParams; +import com.chargebee.v4.services.OrderService; +import com.chargebee.v4.models.order.params.OrderListParams; /** Immutable response object for OrderList operation. Contains paginated list data. */ public final class OrderListResponse { @@ -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 OrderListResponse nextPage() throws Exception { + public OrderListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/order/OrderReopenResponse.java b/src/main/java/com/chargebee/v4/models/order/responses/OrderReopenResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/order/OrderReopenResponse.java rename to src/main/java/com/chargebee/v4/models/order/responses/OrderReopenResponse.java index 10c2a68e..f341863f 100644 --- a/src/main/java/com/chargebee/v4/core/responses/order/OrderReopenResponse.java +++ b/src/main/java/com/chargebee/v4/models/order/responses/OrderReopenResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.order; +package com.chargebee.v4.models.order.responses; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/order/OrderResendResponse.java b/src/main/java/com/chargebee/v4/models/order/responses/OrderResendResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/order/OrderResendResponse.java rename to src/main/java/com/chargebee/v4/models/order/responses/OrderResendResponse.java index e1f0a91c..95e2afe4 100644 --- a/src/main/java/com/chargebee/v4/core/responses/order/OrderResendResponse.java +++ b/src/main/java/com/chargebee/v4/models/order/responses/OrderResendResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.order; +package com.chargebee.v4.models.order.responses; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/order/responses/OrderRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/order/responses/OrderRetrieveResponse.java new file mode 100644 index 00000000..d1cb449b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/order/responses/OrderRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.order.responses; + +import com.chargebee.v4.models.order.Order; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for OrderRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class OrderRetrieveResponse extends BaseResponse { + private final Order order; + + private OrderRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.order = builder.order; + } + + /** Parse JSON response into OrderRetrieveResponse object. */ + public static OrderRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into OrderRetrieveResponse object with HTTP response. */ + public static OrderRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __orderJson = JsonUtil.getObject(json, "order"); + if (__orderJson != null) { + builder.order(Order.fromJson(__orderJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse OrderRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for OrderRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for OrderRetrieveResponse. */ + public static class Builder { + + private Order order; + + private Response httpResponse; + + private Builder() {} + + public Builder order(Order order) { + this.order = order; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public OrderRetrieveResponse build() { + return new OrderRetrieveResponse(this); + } + } + + /** Get the order from the response. */ + public Order getOrder() { + return order; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/order/OrderUpdateResponse.java b/src/main/java/com/chargebee/v4/models/order/responses/OrderUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/order/OrderUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/order/responses/OrderUpdateResponse.java index a2265789..29cc841e 100644 --- a/src/main/java/com/chargebee/v4/core/responses/order/OrderUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/order/responses/OrderUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.order; +package com.chargebee.v4.models.order.responses; -import com.chargebee.v4.core.models.order.Order; +import com.chargebee.v4.models.order.Order; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/order/responses/OrdersForInvoiceResponse.java b/src/main/java/com/chargebee/v4/models/order/responses/OrdersForInvoiceResponse.java new file mode 100644 index 00000000..389bea5b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/order/responses/OrdersForInvoiceResponse.java @@ -0,0 +1,172 @@ +package com.chargebee.v4.models.order.responses; + +import java.util.List; + +import com.chargebee.v4.models.order.Order; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.OrderService; +import com.chargebee.v4.models.order.params.OrdersForInvoiceParams; + +/** Immutable response object for OrdersForInvoice operation. Contains paginated list data. */ +public final class OrdersForInvoiceResponse { + + private final List list; + + private final String nextOffset; + + private final String invoiceId; + + private final OrderService service; + private final OrdersForInvoiceParams originalParams; + private final Response httpResponse; + + private OrdersForInvoiceResponse( + List list, + String nextOffset, + String invoiceId, + OrderService service, + OrdersForInvoiceParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.invoiceId = invoiceId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into OrdersForInvoiceResponse object (no service context). Use this when + * you only need to read a single page (no nextPage()). + */ + public static OrdersForInvoiceResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(OrderOrdersForInvoiceItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new OrdersForInvoiceResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse OrdersForInvoiceResponse from JSON", e); + } + } + + /** + * Parse JSON response into OrdersForInvoiceResponse object with service context for pagination + * (enables nextPage()). + */ + public static OrdersForInvoiceResponse fromJson( + String json, + OrderService service, + OrdersForInvoiceParams originalParams, + String invoiceId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(OrderOrdersForInvoiceItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new OrdersForInvoiceResponse( + list, nextOffset, invoiceId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse OrdersForInvoiceResponse 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 OrdersForInvoiceResponse 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)."); + } + + OrdersForInvoiceParams nextParams = + (originalParams != null ? originalParams.toBuilder() : OrdersForInvoiceParams.builder()) + .offset(nextOffset) + .build(); + + return service.ordersForInvoice(invoiceId, 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 OrderOrdersForInvoiceItem { + + private Order order; + + public Order getOrder() { + return order; + } + + public static OrderOrdersForInvoiceItem fromJson(String json) { + OrderOrdersForInvoiceItem item = new OrderOrdersForInvoiceItem(); + + String __orderJson = JsonUtil.getObject(json, "order"); + if (__orderJson != null) { + item.order = Order.fromJson(__orderJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentIntent/PaymentIntent.java b/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/paymentIntent/PaymentIntent.java rename to src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java index 2d53fdd0..8f44a891 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentIntent/PaymentIntent.java +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentIntent; +package com.chargebee.v4.models.paymentIntent; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; @@ -186,6 +186,16 @@ public enum PaymentMethodType { PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + /** An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -394,6 +404,16 @@ public enum PaymentMethodType { PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ @@ -699,6 +719,16 @@ public enum PaymentMethodType { PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentCreateParams.java b/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentCreateParams.java new file mode 100644 index 00000000..342b435f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentCreateParams.java @@ -0,0 +1,296 @@ +/* + * 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.paymentIntent.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentIntentCreateParams { + + private final String businessEntityId; + + private final String customerId; + + private final Long amount; + + private final String currencyCode; + + private final String gatewayAccountId; + + private final String referenceId; + + private final PaymentMethodType paymentMethodType; + + private final String successUrl; + + private final String failureUrl; + + private PaymentIntentCreateParams(PaymentIntentCreateBuilder builder) { + + this.businessEntityId = builder.businessEntityId; + + this.customerId = builder.customerId; + + this.amount = builder.amount; + + this.currencyCode = builder.currencyCode; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.referenceId = builder.referenceId; + + this.paymentMethodType = builder.paymentMethodType; + + this.successUrl = builder.successUrl; + + this.failureUrl = builder.failureUrl; + } + + public String getBusinessEntityId() { + return businessEntityId; + } + + public String getCustomerId() { + return customerId; + } + + public Long getAmount() { + return amount; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getReferenceId() { + return referenceId; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getSuccessUrl() { + return successUrl; + } + + public String getFailureUrl() { + return failureUrl; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.businessEntityId != null) { + + formData.put("business_entity_id", this.businessEntityId); + } + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.successUrl != null) { + + formData.put("success_url", this.successUrl); + } + + if (this.failureUrl != null) { + + formData.put("failure_url", this.failureUrl); + } + + return formData; + } + + /** Create a new builder for PaymentIntentCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentCreateBuilder builder() { + return new PaymentIntentCreateBuilder(); + } + + public static final class PaymentIntentCreateBuilder { + + private String businessEntityId; + + private String customerId; + + private Long amount; + + private String currencyCode; + + private String gatewayAccountId; + + private String referenceId; + + private PaymentMethodType paymentMethodType; + + private String successUrl; + + private String failureUrl; + + private PaymentIntentCreateBuilder() {} + + public PaymentIntentCreateBuilder businessEntityId(String value) { + this.businessEntityId = value; + return this; + } + + public PaymentIntentCreateBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public PaymentIntentCreateBuilder amount(Long value) { + this.amount = value; + return this; + } + + public PaymentIntentCreateBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public PaymentIntentCreateBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentCreateBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public PaymentIntentCreateBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentCreateBuilder successUrl(String value) { + this.successUrl = value; + return this; + } + + public PaymentIntentCreateBuilder failureUrl(String value) { + this.failureUrl = value; + return this; + } + + public PaymentIntentCreateParams build() { + return new PaymentIntentCreateParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentIntent/params/PaymentIntentRetrieveParams.java b/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/paymentIntent/params/PaymentIntentRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentRetrieveParams.java index 76225e72..354ebe7b 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentIntent/params/PaymentIntentRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentIntent.params; +package com.chargebee.v4.models.paymentIntent.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentUpdateParams.java b/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentUpdateParams.java new file mode 100644 index 00000000..5a985841 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentUpdateParams.java @@ -0,0 +1,236 @@ +/* + * 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.paymentIntent.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentIntentUpdateParams { + + private final Long amount; + + private final String currencyCode; + + private final String gatewayAccountId; + + private final PaymentMethodType paymentMethodType; + + private final String successUrl; + + private final String failureUrl; + + private PaymentIntentUpdateParams(PaymentIntentUpdateBuilder builder) { + + this.amount = builder.amount; + + this.currencyCode = builder.currencyCode; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.paymentMethodType = builder.paymentMethodType; + + this.successUrl = builder.successUrl; + + this.failureUrl = builder.failureUrl; + } + + public Long getAmount() { + return amount; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getSuccessUrl() { + return successUrl; + } + + public String getFailureUrl() { + return failureUrl; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.successUrl != null) { + + formData.put("success_url", this.successUrl); + } + + if (this.failureUrl != null) { + + formData.put("failure_url", this.failureUrl); + } + + return formData; + } + + /** Create a new builder for PaymentIntentUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentUpdateBuilder builder() { + return new PaymentIntentUpdateBuilder(); + } + + public static final class PaymentIntentUpdateBuilder { + + private Long amount; + + private String currencyCode; + + private String gatewayAccountId; + + private PaymentMethodType paymentMethodType; + + private String successUrl; + + private String failureUrl; + + private PaymentIntentUpdateBuilder() {} + + public PaymentIntentUpdateBuilder amount(Long value) { + this.amount = value; + return this; + } + + public PaymentIntentUpdateBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public PaymentIntentUpdateBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentUpdateBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentUpdateBuilder successUrl(String value) { + this.successUrl = value; + return this; + } + + public PaymentIntentUpdateBuilder failureUrl(String value) { + this.failureUrl = value; + return this; + } + + public PaymentIntentUpdateParams build() { + return new PaymentIntentUpdateParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentIntent/PaymentIntentCreateResponse.java b/src/main/java/com/chargebee/v4/models/paymentIntent/responses/PaymentIntentCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentIntent/PaymentIntentCreateResponse.java rename to src/main/java/com/chargebee/v4/models/paymentIntent/responses/PaymentIntentCreateResponse.java index 930b3712..650d0317 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentIntent/PaymentIntentCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/responses/PaymentIntentCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.paymentIntent; +package com.chargebee.v4.models.paymentIntent.responses; -import com.chargebee.v4.core.models.paymentIntent.PaymentIntent; +import com.chargebee.v4.models.paymentIntent.PaymentIntent; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/paymentIntent/responses/PaymentIntentRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/paymentIntent/responses/PaymentIntentRetrieveResponse.java new file mode 100644 index 00000000..3e64050e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/responses/PaymentIntentRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.paymentIntent.responses; + +import com.chargebee.v4.models.paymentIntent.PaymentIntent; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for PaymentIntentRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class PaymentIntentRetrieveResponse extends BaseResponse { + private final PaymentIntent paymentIntent; + + private PaymentIntentRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.paymentIntent = builder.paymentIntent; + } + + /** Parse JSON response into PaymentIntentRetrieveResponse object. */ + public static PaymentIntentRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into PaymentIntentRetrieveResponse object with HTTP response. */ + public static PaymentIntentRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __paymentIntentJson = JsonUtil.getObject(json, "payment_intent"); + if (__paymentIntentJson != null) { + builder.paymentIntent(PaymentIntent.fromJson(__paymentIntentJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PaymentIntentRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for PaymentIntentRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PaymentIntentRetrieveResponse. */ + public static class Builder { + + private PaymentIntent paymentIntent; + + private Response httpResponse; + + private Builder() {} + + public Builder paymentIntent(PaymentIntent paymentIntent) { + this.paymentIntent = paymentIntent; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public PaymentIntentRetrieveResponse build() { + return new PaymentIntentRetrieveResponse(this); + } + } + + /** Get the paymentIntent from the response. */ + public PaymentIntent getPaymentIntent() { + return paymentIntent; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentIntent/PaymentIntentUpdateResponse.java b/src/main/java/com/chargebee/v4/models/paymentIntent/responses/PaymentIntentUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentIntent/PaymentIntentUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/paymentIntent/responses/PaymentIntentUpdateResponse.java index 26886222..63d1b1a6 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentIntent/PaymentIntentUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/responses/PaymentIntentUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.paymentIntent; +package com.chargebee.v4.models.paymentIntent.responses; -import com.chargebee.v4.core.models.paymentIntent.PaymentIntent; +import com.chargebee.v4.models.paymentIntent.PaymentIntent; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/paymentReferenceNumber/PaymentReferenceNumber.java b/src/main/java/com/chargebee/v4/models/paymentReferenceNumber/PaymentReferenceNumber.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/paymentReferenceNumber/PaymentReferenceNumber.java rename to src/main/java/com/chargebee/v4/models/paymentReferenceNumber/PaymentReferenceNumber.java index 8446862c..94ecc066 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentReferenceNumber/PaymentReferenceNumber.java +++ b/src/main/java/com/chargebee/v4/models/paymentReferenceNumber/PaymentReferenceNumber.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentReferenceNumber; +package com.chargebee.v4.models.paymentReferenceNumber; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSchedule/PaymentSchedule.java b/src/main/java/com/chargebee/v4/models/paymentSchedule/PaymentSchedule.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/paymentSchedule/PaymentSchedule.java rename to src/main/java/com/chargebee/v4/models/paymentSchedule/PaymentSchedule.java index 9ff32ad8..09bbbf84 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSchedule/PaymentSchedule.java +++ b/src/main/java/com/chargebee/v4/models/paymentSchedule/PaymentSchedule.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSchedule; +package com.chargebee.v4.models.paymentSchedule; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/paymentScheduleEstimate/PaymentScheduleEstimate.java b/src/main/java/com/chargebee/v4/models/paymentScheduleEstimate/PaymentScheduleEstimate.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/paymentScheduleEstimate/PaymentScheduleEstimate.java rename to src/main/java/com/chargebee/v4/models/paymentScheduleEstimate/PaymentScheduleEstimate.java index 935a9bf3..778da6dd 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentScheduleEstimate/PaymentScheduleEstimate.java +++ b/src/main/java/com/chargebee/v4/models/paymentScheduleEstimate/PaymentScheduleEstimate.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentScheduleEstimate; +package com.chargebee.v4.models.paymentScheduleEstimate; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/paymentScheduleScheme/PaymentScheduleScheme.java b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/PaymentScheduleScheme.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/paymentScheduleScheme/PaymentScheduleScheme.java rename to src/main/java/com/chargebee/v4/models/paymentScheduleScheme/PaymentScheduleScheme.java index 8c40ba53..6793f31e 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentScheduleScheme/PaymentScheduleScheme.java +++ b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/PaymentScheduleScheme.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentScheduleScheme; +package com.chargebee.v4.models.paymentScheduleScheme; import com.chargebee.v4.internal.JsonUtil; import java.math.BigDecimal; diff --git a/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/params/PaymentScheduleSchemeCreateParams.java b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/params/PaymentScheduleSchemeCreateParams.java new file mode 100644 index 00000000..d9691bab --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/params/PaymentScheduleSchemeCreateParams.java @@ -0,0 +1,251 @@ +/* + * 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.paymentScheduleScheme.params; + +import com.chargebee.v4.internal.Recommended; + +import java.math.BigDecimal; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class PaymentScheduleSchemeCreateParams { + + private final Integer numberOfSchedules; + + private final PeriodUnit periodUnit; + + private final Integer period; + + private final String name; + + private final List flexibleSchedules; + + private PaymentScheduleSchemeCreateParams(PaymentScheduleSchemeCreateBuilder builder) { + + this.numberOfSchedules = builder.numberOfSchedules; + + this.periodUnit = builder.periodUnit; + + this.period = builder.period; + + this.name = builder.name; + + this.flexibleSchedules = builder.flexibleSchedules; + } + + public Integer getNumberOfSchedules() { + return numberOfSchedules; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Integer getPeriod() { + return period; + } + + public String getName() { + return name; + } + + public List getFlexibleSchedules() { + return flexibleSchedules; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.numberOfSchedules != null) { + + formData.put("number_of_schedules", this.numberOfSchedules); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.flexibleSchedules != null) { + + // List of objects + for (int i = 0; i < this.flexibleSchedules.size(); i++) { + FlexibleSchedulesParams item = this.flexibleSchedules.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "flexible_schedules[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for PaymentScheduleSchemeCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentScheduleSchemeCreateBuilder builder() { + return new PaymentScheduleSchemeCreateBuilder(); + } + + public static final class PaymentScheduleSchemeCreateBuilder { + + private Integer numberOfSchedules; + + private PeriodUnit periodUnit; + + private Integer period; + + private String name; + + private List flexibleSchedules; + + private PaymentScheduleSchemeCreateBuilder() {} + + public PaymentScheduleSchemeCreateBuilder numberOfSchedules(Integer value) { + this.numberOfSchedules = value; + return this; + } + + public PaymentScheduleSchemeCreateBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public PaymentScheduleSchemeCreateBuilder period(Integer value) { + this.period = value; + return this; + } + + public PaymentScheduleSchemeCreateBuilder name(String value) { + this.name = value; + return this; + } + + public PaymentScheduleSchemeCreateBuilder flexibleSchedules( + List value) { + this.flexibleSchedules = value; + return this; + } + + public PaymentScheduleSchemeCreateParams build() { + return new PaymentScheduleSchemeCreateParams(this); + } + } + + public enum PeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + /** 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 FlexibleSchedulesParams { + + private final Integer period; + + private final BigDecimal amountPercentage; + + private FlexibleSchedulesParams(FlexibleSchedulesBuilder builder) { + + this.period = builder.period; + + this.amountPercentage = builder.amountPercentage; + } + + public Integer getPeriod() { + return period; + } + + public BigDecimal getAmountPercentage() { + return amountPercentage; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.amountPercentage != null) { + + formData.put("amount_percentage", this.amountPercentage); + } + + return formData; + } + + /** Create a new builder for FlexibleSchedulesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static FlexibleSchedulesBuilder builder() { + return new FlexibleSchedulesBuilder(); + } + + public static final class FlexibleSchedulesBuilder { + + private Integer period; + + private BigDecimal amountPercentage; + + private FlexibleSchedulesBuilder() {} + + public FlexibleSchedulesBuilder period(Integer value) { + this.period = value; + return this; + } + + public FlexibleSchedulesBuilder amountPercentage(BigDecimal value) { + this.amountPercentage = value; + return this; + } + + public FlexibleSchedulesParams build() { + return new FlexibleSchedulesParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentScheduleScheme/params/PaymentScheduleSchemeDeleteParams.java b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/params/PaymentScheduleSchemeDeleteParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/paymentScheduleScheme/params/PaymentScheduleSchemeDeleteParams.java rename to src/main/java/com/chargebee/v4/models/paymentScheduleScheme/params/PaymentScheduleSchemeDeleteParams.java index 6fb84611..938814c5 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentScheduleScheme/params/PaymentScheduleSchemeDeleteParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/params/PaymentScheduleSchemeDeleteParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentScheduleScheme.params; +package com.chargebee.v4.models.paymentScheduleScheme.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class PaymentScheduleSchemeDeleteParams { - private final Map formData; - - private PaymentScheduleSchemeDeleteParams(PaymentScheduleSchemeDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private PaymentScheduleSchemeDeleteParams(PaymentScheduleSchemeDeleteBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static PaymentScheduleSchemeDeleteBuilder builder() { } public static final class PaymentScheduleSchemeDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); private PaymentScheduleSchemeDeleteBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentScheduleScheme/params/PaymentScheduleSchemeRetrieveParams.java b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/params/PaymentScheduleSchemeRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/paymentScheduleScheme/params/PaymentScheduleSchemeRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/paymentScheduleScheme/params/PaymentScheduleSchemeRetrieveParams.java index 1d2a0d89..b66b861e 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentScheduleScheme/params/PaymentScheduleSchemeRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/params/PaymentScheduleSchemeRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentScheduleScheme.params; +package com.chargebee.v4.models.paymentScheduleScheme.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentScheduleScheme/PaymentScheduleSchemeCreateResponse.java b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/responses/PaymentScheduleSchemeCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentScheduleScheme/PaymentScheduleSchemeCreateResponse.java rename to src/main/java/com/chargebee/v4/models/paymentScheduleScheme/responses/PaymentScheduleSchemeCreateResponse.java index c5cf419c..bf49f412 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentScheduleScheme/PaymentScheduleSchemeCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/responses/PaymentScheduleSchemeCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.paymentScheduleScheme; +package com.chargebee.v4.models.paymentScheduleScheme.responses; -import com.chargebee.v4.core.models.paymentScheduleScheme.PaymentScheduleScheme; +import com.chargebee.v4.models.paymentScheduleScheme.PaymentScheduleScheme; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentScheduleScheme/PaymentScheduleSchemeDeleteResponse.java b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/responses/PaymentScheduleSchemeDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentScheduleScheme/PaymentScheduleSchemeDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/paymentScheduleScheme/responses/PaymentScheduleSchemeDeleteResponse.java index 5f2ae5a9..7cd070a1 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentScheduleScheme/PaymentScheduleSchemeDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/responses/PaymentScheduleSchemeDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.paymentScheduleScheme; +package com.chargebee.v4.models.paymentScheduleScheme.responses; -import com.chargebee.v4.core.models.paymentScheduleScheme.PaymentScheduleScheme; +import com.chargebee.v4.models.paymentScheduleScheme.PaymentScheduleScheme; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/responses/PaymentScheduleSchemeRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/responses/PaymentScheduleSchemeRetrieveResponse.java new file mode 100644 index 00000000..38e8a787 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/responses/PaymentScheduleSchemeRetrieveResponse.java @@ -0,0 +1,78 @@ +package com.chargebee.v4.models.paymentScheduleScheme.responses; + +import com.chargebee.v4.models.paymentScheduleScheme.PaymentScheduleScheme; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for PaymentScheduleSchemeRetrieve operation. Contains the response data + * from a single resource get operation. + */ +public final class PaymentScheduleSchemeRetrieveResponse extends BaseResponse { + private final PaymentScheduleScheme paymentScheduleScheme; + + private PaymentScheduleSchemeRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.paymentScheduleScheme = builder.paymentScheduleScheme; + } + + /** Parse JSON response into PaymentScheduleSchemeRetrieveResponse object. */ + public static PaymentScheduleSchemeRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into PaymentScheduleSchemeRetrieveResponse object with HTTP response. */ + public static PaymentScheduleSchemeRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __paymentScheduleSchemeJson = JsonUtil.getObject(json, "payment_schedule_scheme"); + if (__paymentScheduleSchemeJson != null) { + builder.paymentScheduleScheme(PaymentScheduleScheme.fromJson(__paymentScheduleSchemeJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse PaymentScheduleSchemeRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for PaymentScheduleSchemeRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PaymentScheduleSchemeRetrieveResponse. */ + public static class Builder { + + private PaymentScheduleScheme paymentScheduleScheme; + + private Response httpResponse; + + private Builder() {} + + public Builder paymentScheduleScheme(PaymentScheduleScheme paymentScheduleScheme) { + this.paymentScheduleScheme = paymentScheduleScheme; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public PaymentScheduleSchemeRetrieveResponse build() { + return new PaymentScheduleSchemeRetrieveResponse(this); + } + } + + /** Get the paymentScheduleScheme from the response. */ + public PaymentScheduleScheme getPaymentScheduleScheme() { + return paymentScheduleScheme; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/PaymentSource.java b/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/paymentSource/PaymentSource.java rename to src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java index b6b2d51e..538f752c 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/PaymentSource.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSource; +package com.chargebee.v4.models.paymentSource; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; @@ -185,6 +185,16 @@ public enum Type { PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -353,6 +363,8 @@ public enum Gateway { DEUTSCHE_BANK("deutsche_bank"), + EZIDEBIT("ezidebit"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/CreateVoucherPaymentSourceParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/CreateVoucherPaymentSourceParams.java new file mode 100644 index 00000000..8e010b62 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/CreateVoucherPaymentSourceParams.java @@ -0,0 +1,221 @@ +/* + * 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.paymentSource.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CreateVoucherPaymentSourceParams { + + private final String customerId; + + private final VoucherPaymentSourceParams voucherPaymentSource; + + private CreateVoucherPaymentSourceParams(CreateVoucherPaymentSourceBuilder builder) { + + this.customerId = builder.customerId; + + this.voucherPaymentSource = builder.voucherPaymentSource; + } + + public String getCustomerId() { + return customerId; + } + + public VoucherPaymentSourceParams getVoucherPaymentSource() { + return voucherPaymentSource; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.voucherPaymentSource != null) { + + // Single object + Map nestedData = this.voucherPaymentSource.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "voucher_payment_source[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for CreateVoucherPaymentSourceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreateVoucherPaymentSourceBuilder builder() { + return new CreateVoucherPaymentSourceBuilder(); + } + + public static final class CreateVoucherPaymentSourceBuilder { + + private String customerId; + + private VoucherPaymentSourceParams voucherPaymentSource; + + private CreateVoucherPaymentSourceBuilder() {} + + public CreateVoucherPaymentSourceBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public CreateVoucherPaymentSourceBuilder voucherPaymentSource( + VoucherPaymentSourceParams value) { + this.voucherPaymentSource = value; + return this; + } + + public CreateVoucherPaymentSourceParams build() { + return new CreateVoucherPaymentSourceParams(this); + } + } + + public static final class VoucherPaymentSourceParams { + + private final VoucherType voucherType; + + private final String gatewayAccountId; + + private final String taxId; + + private final java.util.Map billingAddress; + + private VoucherPaymentSourceParams(VoucherPaymentSourceBuilder builder) { + + this.voucherType = builder.voucherType; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.taxId = builder.taxId; + + this.billingAddress = builder.billingAddress; + } + + public VoucherType getVoucherType() { + return voucherType; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getTaxId() { + return taxId; + } + + public java.util.Map getBillingAddress() { + return billingAddress; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.voucherType != null) { + + formData.put("voucher_type", this.voucherType); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.taxId != null) { + + formData.put("tax_id", this.taxId); + } + + if (this.billingAddress != null) { + + formData.put("billing_address", JsonUtil.toJson(this.billingAddress)); + } + + return formData; + } + + /** Create a new builder for VoucherPaymentSourceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static VoucherPaymentSourceBuilder builder() { + return new VoucherPaymentSourceBuilder(); + } + + public static final class VoucherPaymentSourceBuilder { + + private VoucherType voucherType; + + private String gatewayAccountId; + + private String taxId; + + private java.util.Map billingAddress; + + private VoucherPaymentSourceBuilder() {} + + public VoucherPaymentSourceBuilder voucherType(VoucherType value) { + this.voucherType = value; + return this; + } + + public VoucherPaymentSourceBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public VoucherPaymentSourceBuilder taxId(String value) { + this.taxId = value; + return this; + } + + public VoucherPaymentSourceBuilder billingAddress(java.util.Map value) { + this.billingAddress = value; + return this; + } + + public VoucherPaymentSourceParams build() { + return new VoucherPaymentSourceParams(this); + } + } + + public enum VoucherType { + BOLETO("boleto"), + + /** An enum member indicating that VoucherType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + VoucherType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static VoucherType fromString(String value) { + if (value == null) return _UNKNOWN; + for (VoucherType enumValue : VoucherType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/ExportPaymentSourceParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/ExportPaymentSourceParams.java new file mode 100644 index 00000000..034880e9 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/ExportPaymentSourceParams.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.paymentSource.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportPaymentSourceParams { + + private final String gatewayAccountId; + + private ExportPaymentSourceParams(ExportPaymentSourceBuilder builder) { + + this.gatewayAccountId = builder.gatewayAccountId; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + return formData; + } + + /** Create a new builder for ExportPaymentSourceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportPaymentSourceBuilder builder() { + return new ExportPaymentSourceBuilder(); + } + + public static final class ExportPaymentSourceBuilder { + + private String gatewayAccountId; + + private ExportPaymentSourceBuilder() {} + + public ExportPaymentSourceBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public ExportPaymentSourceParams build() { + return new ExportPaymentSourceParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceAgreementPdfParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceAgreementPdfParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceAgreementPdfParams.java rename to src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceAgreementPdfParams.java index 8639308c..1af071fa 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceAgreementPdfParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceAgreementPdfParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSource.params; +package com.chargebee.v4.models.paymentSource.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class PaymentSourceAgreementPdfParams { - private final Map formData; - - private PaymentSourceAgreementPdfParams(PaymentSourceAgreementPdfBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private PaymentSourceAgreementPdfParams(PaymentSourceAgreementPdfBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static PaymentSourceAgreementPdfBuilder builder() { } public static final class PaymentSourceAgreementPdfBuilder { - private final Map formData = new LinkedHashMap<>(); private PaymentSourceAgreementPdfBuilder() {} diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateBankAccountParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateBankAccountParams.java new file mode 100644 index 00000000..0cd51d56 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateBankAccountParams.java @@ -0,0 +1,566 @@ +/* + * 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.paymentSource.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentSourceCreateBankAccountParams { + + private final String customerId; + + private final String issuingCountry; + + private final Boolean replacePrimaryPaymentSource; + + private final BankAccountParams bankAccount; + + private PaymentSourceCreateBankAccountParams(PaymentSourceCreateBankAccountBuilder builder) { + + this.customerId = builder.customerId; + + this.issuingCountry = builder.issuingCountry; + + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; + + this.bankAccount = builder.bankAccount; + } + + public String getCustomerId() { + return customerId; + } + + public String getIssuingCountry() { + return issuingCountry; + } + + public Boolean getReplacePrimaryPaymentSource() { + return replacePrimaryPaymentSource; + } + + public BankAccountParams getBankAccount() { + return bankAccount; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.issuingCountry != null) { + + formData.put("issuing_country", this.issuingCountry); + } + + if (this.replacePrimaryPaymentSource != null) { + + formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); + } + + if (this.bankAccount != null) { + + // Single object + Map nestedData = this.bankAccount.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "bank_account[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for PaymentSourceCreateBankAccountParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentSourceCreateBankAccountBuilder builder() { + return new PaymentSourceCreateBankAccountBuilder(); + } + + public static final class PaymentSourceCreateBankAccountBuilder { + + private String customerId; + + private String issuingCountry; + + private Boolean replacePrimaryPaymentSource; + + private BankAccountParams bankAccount; + + private PaymentSourceCreateBankAccountBuilder() {} + + public PaymentSourceCreateBankAccountBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public PaymentSourceCreateBankAccountBuilder issuingCountry(String value) { + this.issuingCountry = value; + return this; + } + + public PaymentSourceCreateBankAccountBuilder replacePrimaryPaymentSource(Boolean value) { + this.replacePrimaryPaymentSource = value; + return this; + } + + public PaymentSourceCreateBankAccountBuilder bankAccount(BankAccountParams value) { + this.bankAccount = value; + return this; + } + + public PaymentSourceCreateBankAccountParams build() { + return new PaymentSourceCreateBankAccountParams(this); + } + } + + public static final class BankAccountParams { + + private final String gatewayAccountId; + + private final String iban; + + private final String firstName; + + private final String lastName; + + private final String company; + + private final String email; + + private final String phone; + + private final String bankName; + + private final String accountNumber; + + private final String routingNumber; + + private final String bankCode; + + private final AccountType accountType; + + private final AccountHolderType accountHolderType; + + private final EcheckType echeckType; + + private final String swedishIdentityNumber; + + private final java.util.Map billingAddress; + + private BankAccountParams(BankAccountBuilder builder) { + + this.gatewayAccountId = builder.gatewayAccountId; + + this.iban = builder.iban; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.company = builder.company; + + this.email = builder.email; + + this.phone = builder.phone; + + this.bankName = builder.bankName; + + this.accountNumber = builder.accountNumber; + + this.routingNumber = builder.routingNumber; + + this.bankCode = builder.bankCode; + + this.accountType = builder.accountType; + + this.accountHolderType = builder.accountHolderType; + + this.echeckType = builder.echeckType; + + this.swedishIdentityNumber = builder.swedishIdentityNumber; + + this.billingAddress = builder.billingAddress; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getIban() { + return iban; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getCompany() { + return company; + } + + public String getEmail() { + return email; + } + + public String getPhone() { + return phone; + } + + public String getBankName() { + return bankName; + } + + public String getAccountNumber() { + return accountNumber; + } + + public String getRoutingNumber() { + return routingNumber; + } + + public String getBankCode() { + return bankCode; + } + + public AccountType getAccountType() { + return accountType; + } + + public AccountHolderType getAccountHolderType() { + return accountHolderType; + } + + public EcheckType getEcheckType() { + return echeckType; + } + + public String getSwedishIdentityNumber() { + return swedishIdentityNumber; + } + + public java.util.Map getBillingAddress() { + return billingAddress; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.iban != null) { + + formData.put("iban", this.iban); + } + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + + if (this.company != null) { + + formData.put("company", this.company); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.bankName != null) { + + formData.put("bank_name", this.bankName); + } + + if (this.accountNumber != null) { + + formData.put("account_number", this.accountNumber); + } + + if (this.routingNumber != null) { + + formData.put("routing_number", this.routingNumber); + } + + if (this.bankCode != null) { + + formData.put("bank_code", this.bankCode); + } + + if (this.accountType != null) { + + formData.put("account_type", this.accountType); + } + + if (this.accountHolderType != null) { + + formData.put("account_holder_type", this.accountHolderType); + } + + if (this.echeckType != null) { + + formData.put("echeck_type", this.echeckType); + } + + if (this.swedishIdentityNumber != null) { + + formData.put("swedish_identity_number", this.swedishIdentityNumber); + } + + if (this.billingAddress != null) { + + formData.put("billing_address", JsonUtil.toJson(this.billingAddress)); + } + + return formData; + } + + /** Create a new builder for BankAccountParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BankAccountBuilder builder() { + return new BankAccountBuilder(); + } + + public static final class BankAccountBuilder { + + private String gatewayAccountId; + + private String iban; + + private String firstName; + + private String lastName; + + private String company; + + private String email; + + private String phone; + + private String bankName; + + private String accountNumber; + + private String routingNumber; + + private String bankCode; + + private AccountType accountType; + + private AccountHolderType accountHolderType; + + private EcheckType echeckType; + + private String swedishIdentityNumber; + + private java.util.Map billingAddress; + + private BankAccountBuilder() {} + + public BankAccountBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public BankAccountBuilder iban(String value) { + this.iban = value; + return this; + } + + public BankAccountBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BankAccountBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BankAccountBuilder company(String value) { + this.company = value; + return this; + } + + public BankAccountBuilder email(String value) { + this.email = value; + return this; + } + + public BankAccountBuilder phone(String value) { + this.phone = value; + return this; + } + + public BankAccountBuilder bankName(String value) { + this.bankName = value; + return this; + } + + public BankAccountBuilder accountNumber(String value) { + this.accountNumber = value; + return this; + } + + public BankAccountBuilder routingNumber(String value) { + this.routingNumber = value; + return this; + } + + public BankAccountBuilder bankCode(String value) { + this.bankCode = value; + return this; + } + + public BankAccountBuilder accountType(AccountType value) { + this.accountType = value; + return this; + } + + public BankAccountBuilder accountHolderType(AccountHolderType value) { + this.accountHolderType = value; + return this; + } + + public BankAccountBuilder echeckType(EcheckType value) { + this.echeckType = value; + return this; + } + + public BankAccountBuilder swedishIdentityNumber(String value) { + this.swedishIdentityNumber = value; + return this; + } + + public BankAccountBuilder billingAddress(java.util.Map value) { + this.billingAddress = value; + return this; + } + + public BankAccountParams build() { + return new BankAccountParams(this); + } + } + + public enum AccountType { + CHECKING("checking"), + + SAVINGS("savings"), + + BUSINESS_CHECKING("business_checking"), + + CURRENT("current"), + + /** An enum member indicating that AccountType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AccountType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AccountType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AccountType enumValue : AccountType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AccountHolderType { + INDIVIDUAL("individual"), + + COMPANY("company"), + + /** + * An enum member indicating that AccountHolderType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + AccountHolderType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AccountHolderType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AccountHolderType enumValue : AccountHolderType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EcheckType { + WEB("web"), + + PPD("ppd"), + + CCD("ccd"), + + /** An enum member indicating that EcheckType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EcheckType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EcheckType fromString(String value) { + if (value == null) return _UNKNOWN; + for (EcheckType enumValue : EcheckType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateCardParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateCardParams.java new file mode 100644 index 00000000..12c2958f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateCardParams.java @@ -0,0 +1,484 @@ +/* + * 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.paymentSource.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentSourceCreateCardParams { + + private final String customerId; + + private final Boolean replacePrimaryPaymentSource; + + private final CardParams card; + + private PaymentSourceCreateCardParams(PaymentSourceCreateCardBuilder builder) { + + this.customerId = builder.customerId; + + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; + + this.card = builder.card; + } + + public String getCustomerId() { + return customerId; + } + + public Boolean getReplacePrimaryPaymentSource() { + return replacePrimaryPaymentSource; + } + + public CardParams getCard() { + return card; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.replacePrimaryPaymentSource != null) { + + formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for PaymentSourceCreateCardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentSourceCreateCardBuilder builder() { + return new PaymentSourceCreateCardBuilder(); + } + + public static final class PaymentSourceCreateCardBuilder { + + private String customerId; + + private Boolean replacePrimaryPaymentSource; + + private CardParams card; + + private PaymentSourceCreateCardBuilder() {} + + public PaymentSourceCreateCardBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public PaymentSourceCreateCardBuilder replacePrimaryPaymentSource(Boolean value) { + this.replacePrimaryPaymentSource = value; + return this; + } + + public PaymentSourceCreateCardBuilder card(CardParams value) { + this.card = value; + return this; + } + + public PaymentSourceCreateCardParams build() { + return new PaymentSourceCreateCardParams(this); + } + } + + public static final class CardParams { + + private final String gatewayAccountId; + + 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 java.util.Map additionalInformation; + + private CardParams(CardBuilder builder) { + + this.gatewayAccountId = builder.gatewayAccountId; + + 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.additionalInformation = builder.additionalInformation; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + 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 java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + 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.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + private String gatewayAccountId; + + 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 java.util.Map additionalInformation; + + private CardBuilder() {} + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public CardBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CardBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CardBuilder number(String value) { + this.number = value; + return this; + } + + public CardBuilder expiryMonth(Integer value) { + this.expiryMonth = value; + return this; + } + + public CardBuilder expiryYear(Integer value) { + this.expiryYear = value; + return this; + } + + public CardBuilder cvv(String value) { + this.cvv = value; + return this; + } + + public CardBuilder preferredScheme(PreferredScheme value) { + this.preferredScheme = value; + return this; + } + + public CardBuilder billingAddr1(String value) { + this.billingAddr1 = value; + return this; + } + + public CardBuilder billingAddr2(String value) { + this.billingAddr2 = value; + return this; + } + + public CardBuilder billingCity(String value) { + this.billingCity = value; + return this; + } + + public CardBuilder billingStateCode(String value) { + this.billingStateCode = value; + return this; + } + + public CardBuilder billingState(String value) { + this.billingState = value; + return this; + } + + public CardBuilder billingZip(String value) { + this.billingZip = value; + return this; + } + + public CardBuilder billingCountry(String value) { + this.billingCountry = value; + return this; + } + + public CardBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public CardParams build() { + return new CardParams(this); + } + } + + 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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPaymentIntentParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPaymentIntentParams.java new file mode 100644 index 00000000..9aeeb8c1 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPaymentIntentParams.java @@ -0,0 +1,374 @@ +/* + * 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.paymentSource.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentSourceCreateUsingPaymentIntentParams { + + private final String customerId; + + private final Boolean replacePrimaryPaymentSource; + + private final PaymentIntentParams paymentIntent; + + private PaymentSourceCreateUsingPaymentIntentParams( + PaymentSourceCreateUsingPaymentIntentBuilder builder) { + + this.customerId = builder.customerId; + + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; + + this.paymentIntent = builder.paymentIntent; + } + + public String getCustomerId() { + return customerId; + } + + public Boolean getReplacePrimaryPaymentSource() { + return replacePrimaryPaymentSource; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.replacePrimaryPaymentSource != null) { + + formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for PaymentSourceCreateUsingPaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentSourceCreateUsingPaymentIntentBuilder builder() { + return new PaymentSourceCreateUsingPaymentIntentBuilder(); + } + + public static final class PaymentSourceCreateUsingPaymentIntentBuilder { + + private String customerId; + + private Boolean replacePrimaryPaymentSource; + + private PaymentIntentParams paymentIntent; + + private PaymentSourceCreateUsingPaymentIntentBuilder() {} + + public PaymentSourceCreateUsingPaymentIntentBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public PaymentSourceCreateUsingPaymentIntentBuilder replacePrimaryPaymentSource(Boolean value) { + this.replacePrimaryPaymentSource = value; + return this; + } + + public PaymentSourceCreateUsingPaymentIntentBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public PaymentSourceCreateUsingPaymentIntentParams build() { + return new PaymentSourceCreateUsingPaymentIntentParams(this); + } + } + + public static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInfo; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInfo = builder.additionalInfo; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInfo() { + return additionalInfo; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInfo != null) { + + formData.put("additional_info", JsonUtil.toJson(this.additionalInfo)); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInfo; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInfo(java.util.Map value) { + this.additionalInfo = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPermanentTokenParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPermanentTokenParams.java new file mode 100644 index 00000000..cf3c7b10 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPermanentTokenParams.java @@ -0,0 +1,913 @@ +/* + * 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.paymentSource.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentSourceCreateUsingPermanentTokenParams { + + private final String customerId; + + private final Type type; + + private final String gatewayAccountId; + + private final String referenceId; + + private final String issuingCountry; + + private final Boolean replacePrimaryPaymentSource; + + private final String paymentMethodToken; + + private final String customerProfileToken; + + private final String networkTransactionId; + + private final String mandateId; + + private final Boolean skipRetrieval; + + private final java.util.Map additionalInformation; + + private final CardParams card; + + private final BillingAddressParams billingAddress; + + private PaymentSourceCreateUsingPermanentTokenParams( + PaymentSourceCreateUsingPermanentTokenBuilder builder) { + + this.customerId = builder.customerId; + + this.type = builder.type; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.referenceId = builder.referenceId; + + this.issuingCountry = builder.issuingCountry; + + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; + + this.paymentMethodToken = builder.paymentMethodToken; + + this.customerProfileToken = builder.customerProfileToken; + + this.networkTransactionId = builder.networkTransactionId; + + this.mandateId = builder.mandateId; + + this.skipRetrieval = builder.skipRetrieval; + + this.additionalInformation = builder.additionalInformation; + + this.card = builder.card; + + this.billingAddress = builder.billingAddress; + } + + public String getCustomerId() { + return customerId; + } + + public Type getType() { + return type; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getReferenceId() { + return referenceId; + } + + public String getIssuingCountry() { + return issuingCountry; + } + + public Boolean getReplacePrimaryPaymentSource() { + return replacePrimaryPaymentSource; + } + + public String getPaymentMethodToken() { + return paymentMethodToken; + } + + public String getCustomerProfileToken() { + return customerProfileToken; + } + + public String getNetworkTransactionId() { + return networkTransactionId; + } + + public String getMandateId() { + return mandateId; + } + + public Boolean getSkipRetrieval() { + return skipRetrieval; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + public CardParams getCard() { + return card; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.issuingCountry != null) { + + formData.put("issuing_country", this.issuingCountry); + } + + if (this.replacePrimaryPaymentSource != null) { + + formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); + } + + if (this.paymentMethodToken != null) { + + formData.put("payment_method_token", this.paymentMethodToken); + } + + if (this.customerProfileToken != null) { + + formData.put("customer_profile_token", this.customerProfileToken); + } + + if (this.networkTransactionId != null) { + + formData.put("network_transaction_id", this.networkTransactionId); + } + + if (this.mandateId != null) { + + formData.put("mandate_id", this.mandateId); + } + + if (this.skipRetrieval != null) { + + formData.put("skip_retrieval", this.skipRetrieval); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for PaymentSourceCreateUsingPermanentTokenParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentSourceCreateUsingPermanentTokenBuilder builder() { + return new PaymentSourceCreateUsingPermanentTokenBuilder(); + } + + public static final class PaymentSourceCreateUsingPermanentTokenBuilder { + + private String customerId; + + private Type type; + + private String gatewayAccountId; + + private String referenceId; + + private String issuingCountry; + + private Boolean replacePrimaryPaymentSource; + + private String paymentMethodToken; + + private String customerProfileToken; + + private String networkTransactionId; + + private String mandateId; + + private Boolean skipRetrieval; + + private java.util.Map additionalInformation; + + private CardParams card; + + private BillingAddressParams billingAddress; + + private PaymentSourceCreateUsingPermanentTokenBuilder() {} + + public PaymentSourceCreateUsingPermanentTokenBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public PaymentSourceCreateUsingPermanentTokenBuilder type(Type value) { + this.type = value; + return this; + } + + public PaymentSourceCreateUsingPermanentTokenBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentSourceCreateUsingPermanentTokenBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public PaymentSourceCreateUsingPermanentTokenBuilder issuingCountry(String value) { + this.issuingCountry = value; + return this; + } + + public PaymentSourceCreateUsingPermanentTokenBuilder replacePrimaryPaymentSource( + Boolean value) { + this.replacePrimaryPaymentSource = value; + return this; + } + + public PaymentSourceCreateUsingPermanentTokenBuilder paymentMethodToken(String value) { + this.paymentMethodToken = value; + return this; + } + + public PaymentSourceCreateUsingPermanentTokenBuilder customerProfileToken(String value) { + this.customerProfileToken = value; + return this; + } + + public PaymentSourceCreateUsingPermanentTokenBuilder networkTransactionId(String value) { + this.networkTransactionId = value; + return this; + } + + public PaymentSourceCreateUsingPermanentTokenBuilder mandateId(String value) { + this.mandateId = value; + return this; + } + + public PaymentSourceCreateUsingPermanentTokenBuilder skipRetrieval(Boolean value) { + this.skipRetrieval = value; + return this; + } + + public PaymentSourceCreateUsingPermanentTokenBuilder additionalInformation( + java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentSourceCreateUsingPermanentTokenBuilder card(CardParams value) { + this.card = value; + return this; + } + + public PaymentSourceCreateUsingPermanentTokenBuilder billingAddress( + BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public PaymentSourceCreateUsingPermanentTokenParams build() { + return new PaymentSourceCreateUsingPermanentTokenParams(this); + } + } + + public enum Type { + CARD("card"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + AMAZON_PAYMENTS("amazon_payments"), + + DIRECT_DEBIT("direct_debit"), + + GENERIC("generic"), + + ALIPAY("alipay"), + + UNIONPAY("unionpay"), + + APPLE_PAY("apple_pay"), + + WECHAT_PAY("wechat_pay"), + + IDEAL("ideal"), + + GOOGLE_PAY("google_pay"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GIROPAY("giropay"), + + DOTPAY("dotpay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + VENMO("venmo"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** 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 static final class CardParams { + + private final String last4; + + private final String iin; + + private final Integer expiryMonth; + + private final Integer expiryYear; + + private final Brand brand; + + private final FundingType fundingType; + + private CardParams(CardBuilder builder) { + + this.last4 = builder.last4; + + this.iin = builder.iin; + + this.expiryMonth = builder.expiryMonth; + + this.expiryYear = builder.expiryYear; + + this.brand = builder.brand; + + this.fundingType = builder.fundingType; + } + + public String getLast4() { + return last4; + } + + public String getIin() { + return iin; + } + + public Integer getExpiryMonth() { + return expiryMonth; + } + + public Integer getExpiryYear() { + return expiryYear; + } + + public Brand getBrand() { + return brand; + } + + public FundingType getFundingType() { + return fundingType; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.last4 != null) { + + formData.put("last4", this.last4); + } + + if (this.iin != null) { + + formData.put("iin", this.iin); + } + + if (this.expiryMonth != null) { + + formData.put("expiry_month", this.expiryMonth); + } + + if (this.expiryYear != null) { + + formData.put("expiry_year", this.expiryYear); + } + + if (this.brand != null) { + + formData.put("brand", this.brand); + } + + if (this.fundingType != null) { + + formData.put("funding_type", this.fundingType); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + private String last4; + + private String iin; + + private Integer expiryMonth; + + private Integer expiryYear; + + private Brand brand; + + private FundingType fundingType; + + private CardBuilder() {} + + public CardBuilder last4(String value) { + this.last4 = value; + return this; + } + + public CardBuilder iin(String value) { + this.iin = value; + return this; + } + + public CardBuilder expiryMonth(Integer value) { + this.expiryMonth = value; + return this; + } + + public CardBuilder expiryYear(Integer value) { + this.expiryYear = value; + return this; + } + + public CardBuilder brand(Brand value) { + this.brand = value; + return this; + } + + public CardBuilder fundingType(FundingType value) { + this.fundingType = value; + return this; + } + + public CardParams build() { + return new CardParams(this); + } + } + + public enum Brand { + VISA("visa"), + + MASTERCARD("mastercard"), + + AMERICAN_EXPRESS("american_express"), + + DISCOVER("discover"), + + JCB("jcb"), + + DINERS_CLUB("diners_club"), + + OTHER("other"), + + BANCONTACT("bancontact"), + + CMR_FALABELLA("cmr_falabella"), + + TARJETA_NARANJA("tarjeta_naranja"), + + NATIVA("nativa"), + + CENCOSUD("cencosud"), + + CABAL("cabal"), + + ARGENCARD("argencard"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + CARNET("carnet"), + + RUPAY("rupay"), + + MAESTRO("maestro"), + + DANKORT("dankort"), + + CARTES_BANCAIRES("cartes_bancaires"), + + /** An enum member indicating that Brand was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Brand(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Brand fromString(String value) { + if (value == null) return _UNKNOWN; + for (Brand enumValue : Brand.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum FundingType { + CREDIT("credit"), + + DEBIT("debit"), + + PREPAID("prepaid"), + + NOT_KNOWN("not_known"), + + /** An enum member indicating that FundingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + FundingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static FundingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (FundingType enumValue : FundingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String line1; + + private final String line2; + + private final String line3; + + private final String city; + + private final String stateCode; + + private final String state; + + private final String zip; + + private final String country; + + private BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + this.city = builder.city; + + this.stateCode = builder.stateCode; + + this.state = builder.state; + + this.zip = builder.zip; + + this.country = builder.country; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getEmail() { + return email; + } + + public String getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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); + } + + return formData; + } + + /** Create a new builder for BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTempTokenParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTempTokenParams.java new file mode 100644 index 00000000..21d2442c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTempTokenParams.java @@ -0,0 +1,267 @@ +/* + * 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.paymentSource.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentSourceCreateUsingTempTokenParams { + + private final String customerId; + + private final String gatewayAccountId; + + private final Type type; + + private final String tmpToken; + + private final String issuingCountry; + + private final Boolean replacePrimaryPaymentSource; + + private final java.util.Map additionalInformation; + + private PaymentSourceCreateUsingTempTokenParams( + PaymentSourceCreateUsingTempTokenBuilder builder) { + + this.customerId = builder.customerId; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.type = builder.type; + + this.tmpToken = builder.tmpToken; + + this.issuingCountry = builder.issuingCountry; + + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; + + this.additionalInformation = builder.additionalInformation; + } + + public String getCustomerId() { + return customerId; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public Type getType() { + return type; + } + + public String getTmpToken() { + return tmpToken; + } + + public String getIssuingCountry() { + return issuingCountry; + } + + public Boolean getReplacePrimaryPaymentSource() { + return replacePrimaryPaymentSource; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.tmpToken != null) { + + formData.put("tmp_token", this.tmpToken); + } + + if (this.issuingCountry != null) { + + formData.put("issuing_country", this.issuingCountry); + } + + if (this.replacePrimaryPaymentSource != null) { + + formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentSourceCreateUsingTempTokenParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentSourceCreateUsingTempTokenBuilder builder() { + return new PaymentSourceCreateUsingTempTokenBuilder(); + } + + public static final class PaymentSourceCreateUsingTempTokenBuilder { + + private String customerId; + + private String gatewayAccountId; + + private Type type; + + private String tmpToken; + + private String issuingCountry; + + private Boolean replacePrimaryPaymentSource; + + private java.util.Map additionalInformation; + + private PaymentSourceCreateUsingTempTokenBuilder() {} + + public PaymentSourceCreateUsingTempTokenBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public PaymentSourceCreateUsingTempTokenBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentSourceCreateUsingTempTokenBuilder type(Type value) { + this.type = value; + return this; + } + + public PaymentSourceCreateUsingTempTokenBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public PaymentSourceCreateUsingTempTokenBuilder issuingCountry(String value) { + this.issuingCountry = value; + return this; + } + + public PaymentSourceCreateUsingTempTokenBuilder replacePrimaryPaymentSource(Boolean value) { + this.replacePrimaryPaymentSource = value; + return this; + } + + public PaymentSourceCreateUsingTempTokenBuilder additionalInformation( + java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentSourceCreateUsingTempTokenParams build() { + return new PaymentSourceCreateUsingTempTokenParams(this); + } + } + + public enum Type { + CARD("card"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + AMAZON_PAYMENTS("amazon_payments"), + + DIRECT_DEBIT("direct_debit"), + + GENERIC("generic"), + + ALIPAY("alipay"), + + UNIONPAY("unionpay"), + + APPLE_PAY("apple_pay"), + + WECHAT_PAY("wechat_pay"), + + IDEAL("ideal"), + + GOOGLE_PAY("google_pay"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GIROPAY("giropay"), + + DOTPAY("dotpay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + VENMO("venmo"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** 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/paymentSource/params/PaymentSourceCreateUsingTokenParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTokenParams.java new file mode 100644 index 00000000..de6d578a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTokenParams.java @@ -0,0 +1,100 @@ +/* + * 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.paymentSource.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentSourceCreateUsingTokenParams { + + private final String customerId; + + private final Boolean replacePrimaryPaymentSource; + + private final String tokenId; + + private PaymentSourceCreateUsingTokenParams(PaymentSourceCreateUsingTokenBuilder builder) { + + this.customerId = builder.customerId; + + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; + + this.tokenId = builder.tokenId; + } + + public String getCustomerId() { + return customerId; + } + + public Boolean getReplacePrimaryPaymentSource() { + return replacePrimaryPaymentSource; + } + + public String getTokenId() { + return tokenId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.replacePrimaryPaymentSource != null) { + + formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); + } + + if (this.tokenId != null) { + + formData.put("token_id", this.tokenId); + } + + return formData; + } + + /** Create a new builder for PaymentSourceCreateUsingTokenParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentSourceCreateUsingTokenBuilder builder() { + return new PaymentSourceCreateUsingTokenBuilder(); + } + + public static final class PaymentSourceCreateUsingTokenBuilder { + + private String customerId; + + private Boolean replacePrimaryPaymentSource; + + private String tokenId; + + private PaymentSourceCreateUsingTokenBuilder() {} + + public PaymentSourceCreateUsingTokenBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public PaymentSourceCreateUsingTokenBuilder replacePrimaryPaymentSource(Boolean value) { + this.replacePrimaryPaymentSource = value; + return this; + } + + public PaymentSourceCreateUsingTokenBuilder tokenId(String value) { + this.tokenId = value; + return this; + } + + public PaymentSourceCreateUsingTokenParams build() { + return new PaymentSourceCreateUsingTokenParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceDeleteLocalParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceDeleteLocalParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceDeleteLocalParams.java rename to src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceDeleteLocalParams.java index 83addc90..6e44bac3 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceDeleteLocalParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceDeleteLocalParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSource.params; +package com.chargebee.v4.models.paymentSource.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class PaymentSourceDeleteLocalParams { - private final Map formData; - - private PaymentSourceDeleteLocalParams(PaymentSourceDeleteLocalBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private PaymentSourceDeleteLocalParams(PaymentSourceDeleteLocalBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static PaymentSourceDeleteLocalBuilder builder() { } public static final class PaymentSourceDeleteLocalBuilder { - private final Map formData = new LinkedHashMap<>(); private PaymentSourceDeleteLocalBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceDeleteParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceDeleteParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceDeleteParams.java rename to src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceDeleteParams.java index 82825c7a..241d2cd6 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceDeleteParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceDeleteParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSource.params; +package com.chargebee.v4.models.paymentSource.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class PaymentSourceDeleteParams { - private final Map formData; - - private PaymentSourceDeleteParams(PaymentSourceDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private PaymentSourceDeleteParams(PaymentSourceDeleteBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static PaymentSourceDeleteBuilder builder() { } public static final class PaymentSourceDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); private PaymentSourceDeleteBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceListParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceListParams.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceListParams.java rename to src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceListParams.java index 03e14b24..2ee7c263 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceListParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSource.params; +package com.chargebee.v4.models.paymentSource.params; import com.chargebee.v4.internal.Recommended; @@ -343,6 +343,16 @@ public enum TypeIs { PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + /** An enum member indicating that TypeIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -417,6 +427,16 @@ public enum TypeIsNot { PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + /** An enum member indicating that TypeIsNot was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceRetrieveParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceRetrieveParams.java index c48ca389..fbb9896a 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentSource/params/PaymentSourceRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentSource.params; +package com.chargebee.v4.models.paymentSource.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceSwitchGatewayAccountParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceSwitchGatewayAccountParams.java new file mode 100644 index 00000000..62c8f623 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceSwitchGatewayAccountParams.java @@ -0,0 +1,61 @@ +/* + * 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.paymentSource.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentSourceSwitchGatewayAccountParams { + + private final String gatewayAccountId; + + private PaymentSourceSwitchGatewayAccountParams( + PaymentSourceSwitchGatewayAccountBuilder builder) { + + this.gatewayAccountId = builder.gatewayAccountId; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + return formData; + } + + /** Create a new builder for PaymentSourceSwitchGatewayAccountParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentSourceSwitchGatewayAccountBuilder builder() { + return new PaymentSourceSwitchGatewayAccountBuilder(); + } + + public static final class PaymentSourceSwitchGatewayAccountBuilder { + + private String gatewayAccountId; + + private PaymentSourceSwitchGatewayAccountBuilder() {} + + public PaymentSourceSwitchGatewayAccountBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentSourceSwitchGatewayAccountParams build() { + return new PaymentSourceSwitchGatewayAccountParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceUpdateBankAccountParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceUpdateBankAccountParams.java new file mode 100644 index 00000000..060f1313 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceUpdateBankAccountParams.java @@ -0,0 +1,153 @@ +/* + * 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.paymentSource.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentSourceUpdateBankAccountParams { + + private final BankAccountParams bankAccount; + + private PaymentSourceUpdateBankAccountParams(PaymentSourceUpdateBankAccountBuilder builder) { + + this.bankAccount = builder.bankAccount; + } + + public BankAccountParams getBankAccount() { + return bankAccount; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.bankAccount != null) { + + // Single object + Map nestedData = this.bankAccount.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "bank_account[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for PaymentSourceUpdateBankAccountParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentSourceUpdateBankAccountBuilder builder() { + return new PaymentSourceUpdateBankAccountBuilder(); + } + + public static final class PaymentSourceUpdateBankAccountBuilder { + + private BankAccountParams bankAccount; + + private PaymentSourceUpdateBankAccountBuilder() {} + + public PaymentSourceUpdateBankAccountBuilder bankAccount(BankAccountParams value) { + this.bankAccount = value; + return this; + } + + public PaymentSourceUpdateBankAccountParams build() { + return new PaymentSourceUpdateBankAccountParams(this); + } + } + + public static final class BankAccountParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private BankAccountParams(BankAccountBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getEmail() { + return email; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + 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); + } + + return formData; + } + + /** Create a new builder for BankAccountParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BankAccountBuilder builder() { + return new BankAccountBuilder(); + } + + public static final class BankAccountBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private BankAccountBuilder() {} + + public BankAccountBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BankAccountBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BankAccountBuilder email(String value) { + this.email = value; + return this; + } + + public BankAccountParams build() { + return new BankAccountParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceUpdateCardParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceUpdateCardParams.java new file mode 100644 index 00000000..f453ea53 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceUpdateCardParams.java @@ -0,0 +1,374 @@ +/* + * 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.paymentSource.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentSourceUpdateCardParams { + + private final java.util.Map gatewayMetaData; + + private final String referenceTransaction; + + private final CardParams card; + + private PaymentSourceUpdateCardParams(PaymentSourceUpdateCardBuilder builder) { + + this.gatewayMetaData = builder.gatewayMetaData; + + this.referenceTransaction = builder.referenceTransaction; + + this.card = builder.card; + } + + public java.util.Map getGatewayMetaData() { + return gatewayMetaData; + } + + public String getReferenceTransaction() { + return referenceTransaction; + } + + public CardParams getCard() { + return card; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.gatewayMetaData != null) { + + formData.put("gateway_meta_data", JsonUtil.toJson(this.gatewayMetaData)); + } + + if (this.referenceTransaction != null) { + + formData.put("reference_transaction", this.referenceTransaction); + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for PaymentSourceUpdateCardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentSourceUpdateCardBuilder builder() { + return new PaymentSourceUpdateCardBuilder(); + } + + public static final class PaymentSourceUpdateCardBuilder { + + private java.util.Map gatewayMetaData; + + private String referenceTransaction; + + private CardParams card; + + private PaymentSourceUpdateCardBuilder() {} + + public PaymentSourceUpdateCardBuilder gatewayMetaData(java.util.Map value) { + this.gatewayMetaData = value; + return this; + } + + public PaymentSourceUpdateCardBuilder referenceTransaction(String value) { + this.referenceTransaction = value; + return this; + } + + public PaymentSourceUpdateCardBuilder card(CardParams value) { + this.card = value; + return this; + } + + public PaymentSourceUpdateCardParams build() { + return new PaymentSourceUpdateCardParams(this); + } + } + + public static final class CardParams { + + private final String firstName; + + private final String lastName; + + private final Integer expiryMonth; + + private final Integer expiryYear; + + private final String billingAddr1; + + private final String billingAddr2; + + private final String billingCity; + + private final String billingZip; + + private final String billingStateCode; + + private final String billingState; + + private final String billingCountry; + + private final java.util.Map additionalInformation; + + private CardParams(CardBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.expiryMonth = builder.expiryMonth; + + this.expiryYear = builder.expiryYear; + + this.billingAddr1 = builder.billingAddr1; + + this.billingAddr2 = builder.billingAddr2; + + this.billingCity = builder.billingCity; + + this.billingZip = builder.billingZip; + + this.billingStateCode = builder.billingStateCode; + + this.billingState = builder.billingState; + + this.billingCountry = builder.billingCountry; + + this.additionalInformation = builder.additionalInformation; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public Integer getExpiryMonth() { + return expiryMonth; + } + + public Integer getExpiryYear() { + return expiryYear; + } + + public String getBillingAddr1() { + return billingAddr1; + } + + public String getBillingAddr2() { + return billingAddr2; + } + + public String getBillingCity() { + return billingCity; + } + + public String getBillingZip() { + return billingZip; + } + + public String getBillingStateCode() { + return billingStateCode; + } + + public String getBillingState() { + return billingState; + } + + public String getBillingCountry() { + return billingCountry; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + + if (this.expiryMonth != null) { + + formData.put("expiry_month", this.expiryMonth); + } + + if (this.expiryYear != null) { + + formData.put("expiry_year", this.expiryYear); + } + + 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.billingZip != null) { + + formData.put("billing_zip", this.billingZip); + } + + if (this.billingStateCode != null) { + + formData.put("billing_state_code", this.billingStateCode); + } + + if (this.billingState != null) { + + formData.put("billing_state", this.billingState); + } + + if (this.billingCountry != null) { + + formData.put("billing_country", this.billingCountry); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + private String firstName; + + private String lastName; + + private Integer expiryMonth; + + private Integer expiryYear; + + private String billingAddr1; + + private String billingAddr2; + + private String billingCity; + + private String billingZip; + + private String billingStateCode; + + private String billingState; + + private String billingCountry; + + private java.util.Map additionalInformation; + + private CardBuilder() {} + + public CardBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CardBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CardBuilder expiryMonth(Integer value) { + this.expiryMonth = value; + return this; + } + + public CardBuilder expiryYear(Integer value) { + this.expiryYear = value; + return this; + } + + public CardBuilder billingAddr1(String value) { + this.billingAddr1 = value; + return this; + } + + public CardBuilder billingAddr2(String value) { + this.billingAddr2 = value; + return this; + } + + public CardBuilder billingCity(String value) { + this.billingCity = value; + return this; + } + + public CardBuilder billingZip(String value) { + this.billingZip = value; + return this; + } + + public CardBuilder billingStateCode(String value) { + this.billingStateCode = value; + return this; + } + + public CardBuilder billingState(String value) { + this.billingState = value; + return this; + } + + public CardBuilder billingCountry(String value) { + this.billingCountry = value; + return this; + } + + public CardBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public CardParams build() { + return new CardParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceVerifyBankAccountParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceVerifyBankAccountParams.java new file mode 100644 index 00000000..956a93d5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceVerifyBankAccountParams.java @@ -0,0 +1,80 @@ +/* + * 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.paymentSource.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentSourceVerifyBankAccountParams { + + private final Long amount1; + + private final Long amount2; + + private PaymentSourceVerifyBankAccountParams(PaymentSourceVerifyBankAccountBuilder builder) { + + this.amount1 = builder.amount1; + + this.amount2 = builder.amount2; + } + + public Long getAmount1() { + return amount1; + } + + public Long getAmount2() { + return amount2; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount1 != null) { + + formData.put("amount1", this.amount1); + } + + if (this.amount2 != null) { + + formData.put("amount2", this.amount2); + } + + return formData; + } + + /** Create a new builder for PaymentSourceVerifyBankAccountParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentSourceVerifyBankAccountBuilder builder() { + return new PaymentSourceVerifyBankAccountBuilder(); + } + + public static final class PaymentSourceVerifyBankAccountBuilder { + + private Long amount1; + + private Long amount2; + + private PaymentSourceVerifyBankAccountBuilder() {} + + public PaymentSourceVerifyBankAccountBuilder amount1(Long value) { + this.amount1 = value; + return this; + } + + public PaymentSourceVerifyBankAccountBuilder amount2(Long value) { + this.amount2 = value; + return this; + } + + public PaymentSourceVerifyBankAccountParams build() { + return new PaymentSourceVerifyBankAccountParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/responses/CreateVoucherPaymentSourceResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/CreateVoucherPaymentSourceResponse.java new file mode 100644 index 00000000..397135d4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/CreateVoucherPaymentSourceResponse.java @@ -0,0 +1,100 @@ +package com.chargebee.v4.models.paymentSource.responses; + +import com.chargebee.v4.models.customer.Customer; + +import com.chargebee.v4.models.paymentSource.PaymentSource; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CreateVoucherPaymentSource operation. Contains the response data + * from the API. + */ +public final class CreateVoucherPaymentSourceResponse extends BaseResponse { + private final Customer customer; + + private final PaymentSource paymentSource; + + private CreateVoucherPaymentSourceResponse(Builder builder) { + super(builder.httpResponse); + + this.customer = builder.customer; + + this.paymentSource = builder.paymentSource; + } + + /** Parse JSON response into CreateVoucherPaymentSourceResponse object. */ + public static CreateVoucherPaymentSourceResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CreateVoucherPaymentSourceResponse object with HTTP response. */ + public static CreateVoucherPaymentSourceResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __customerJson = JsonUtil.getObject(json, "customer"); + if (__customerJson != null) { + builder.customer(Customer.fromJson(__customerJson)); + } + + String __paymentSourceJson = JsonUtil.getObject(json, "payment_source"); + if (__paymentSourceJson != null) { + builder.paymentSource(PaymentSource.fromJson(__paymentSourceJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CreateVoucherPaymentSourceResponse from JSON", e); + } + } + + /** Create a new builder for CreateVoucherPaymentSourceResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CreateVoucherPaymentSourceResponse. */ + public static class Builder { + + private Customer customer; + + private PaymentSource paymentSource; + + private Response httpResponse; + + private Builder() {} + + public Builder customer(Customer customer) { + this.customer = customer; + return this; + } + + public Builder paymentSource(PaymentSource paymentSource) { + this.paymentSource = paymentSource; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CreateVoucherPaymentSourceResponse build() { + return new CreateVoucherPaymentSourceResponse(this); + } + } + + /** Get the customer from the response. */ + public Customer getCustomer() { + return customer; + } + + /** Get the paymentSource from the response. */ + public PaymentSource getPaymentSource() { + return paymentSource; + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/responses/ExportPaymentSourceResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/ExportPaymentSourceResponse.java new file mode 100644 index 00000000..6cfa323c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/ExportPaymentSourceResponse.java @@ -0,0 +1,78 @@ +package com.chargebee.v4.models.paymentSource.responses; + +import com.chargebee.v4.models.thirdPartyPaymentMethod.ThirdPartyPaymentMethod; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ExportPaymentSource operation. Contains the response data from the + * API. + */ +public final class ExportPaymentSourceResponse extends BaseResponse { + private final ThirdPartyPaymentMethod thirdPartyPaymentMethod; + + private ExportPaymentSourceResponse(Builder builder) { + super(builder.httpResponse); + + this.thirdPartyPaymentMethod = builder.thirdPartyPaymentMethod; + } + + /** Parse JSON response into ExportPaymentSourceResponse object. */ + public static ExportPaymentSourceResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ExportPaymentSourceResponse object with HTTP response. */ + public static ExportPaymentSourceResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __thirdPartyPaymentMethodJson = JsonUtil.getObject(json, "third_party_payment_method"); + if (__thirdPartyPaymentMethodJson != null) { + builder.thirdPartyPaymentMethod( + ThirdPartyPaymentMethod.fromJson(__thirdPartyPaymentMethodJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ExportPaymentSourceResponse from JSON", e); + } + } + + /** Create a new builder for ExportPaymentSourceResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ExportPaymentSourceResponse. */ + public static class Builder { + + private ThirdPartyPaymentMethod thirdPartyPaymentMethod; + + private Response httpResponse; + + private Builder() {} + + public Builder thirdPartyPaymentMethod(ThirdPartyPaymentMethod thirdPartyPaymentMethod) { + this.thirdPartyPaymentMethod = thirdPartyPaymentMethod; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ExportPaymentSourceResponse build() { + return new ExportPaymentSourceResponse(this); + } + } + + /** Get the thirdPartyPaymentMethod from the response. */ + public ThirdPartyPaymentMethod getThirdPartyPaymentMethod() { + return thirdPartyPaymentMethod; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceAgreementPdfResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceAgreementPdfResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceAgreementPdfResponse.java rename to src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceAgreementPdfResponse.java index 0ec47886..d3db8c85 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceAgreementPdfResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceAgreementPdfResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.paymentSource; +package com.chargebee.v4.models.paymentSource.responses; -import com.chargebee.v4.core.models.download.Download; +import com.chargebee.v4.models.download.Download; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateBankAccountResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateBankAccountResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateBankAccountResponse.java rename to src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateBankAccountResponse.java index 48e8c69a..45dda232 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateBankAccountResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateBankAccountResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.paymentSource; +package com.chargebee.v4.models.paymentSource.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateCardResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateCardResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateCardResponse.java rename to src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateCardResponse.java index ab16d1cd..6fd53363 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateCardResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateCardResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.paymentSource; +package com.chargebee.v4.models.paymentSource.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateUsingPaymentIntentResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateUsingPaymentIntentResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateUsingPaymentIntentResponse.java rename to src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateUsingPaymentIntentResponse.java index 3884089d..21964c3c 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateUsingPaymentIntentResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateUsingPaymentIntentResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.paymentSource; +package com.chargebee.v4.models.paymentSource.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateUsingPermanentTokenResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateUsingPermanentTokenResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateUsingPermanentTokenResponse.java rename to src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateUsingPermanentTokenResponse.java index 2885a6fa..913fbbe4 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateUsingPermanentTokenResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateUsingPermanentTokenResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.paymentSource; +package com.chargebee.v4.models.paymentSource.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateUsingTempTokenResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateUsingTempTokenResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateUsingTempTokenResponse.java rename to src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateUsingTempTokenResponse.java index d884c784..9f4c97a0 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateUsingTempTokenResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateUsingTempTokenResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.paymentSource; +package com.chargebee.v4.models.paymentSource.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateUsingTokenResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateUsingTokenResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateUsingTokenResponse.java rename to src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateUsingTokenResponse.java index ab67c8b2..199875bb 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceCreateUsingTokenResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceCreateUsingTokenResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.paymentSource; +package com.chargebee.v4.models.paymentSource.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceDeleteLocalResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceDeleteLocalResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceDeleteLocalResponse.java rename to src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceDeleteLocalResponse.java index 5fb141a8..fcc5e921 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceDeleteLocalResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceDeleteLocalResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.paymentSource; +package com.chargebee.v4.models.paymentSource.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceDeleteResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceDeleteResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceDeleteResponse.java index 3642dda1..57007979 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceDeleteResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.paymentSource; +package com.chargebee.v4.models.paymentSource.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceListResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceListResponse.java rename to src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceListResponse.java index 4b7676cd..0cd02cd0 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceListResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.paymentSource; +package com.chargebee.v4.models.paymentSource.responses; import java.util.List; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.PaymentSourceService; -import com.chargebee.v4.core.models.paymentSource.params.PaymentSourceListParams; +import com.chargebee.v4.services.PaymentSourceService; +import com.chargebee.v4.models.paymentSource.params.PaymentSourceListParams; /** Immutable response object for PaymentSourceList operation. Contains paginated list data. */ public final class PaymentSourceListResponse { @@ -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 PaymentSourceListResponse nextPage() throws Exception { + public PaymentSourceListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceRetrieveResponse.java new file mode 100644 index 00000000..6062e205 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.paymentSource.responses; + +import com.chargebee.v4.models.paymentSource.PaymentSource; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for PaymentSourceRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class PaymentSourceRetrieveResponse extends BaseResponse { + private final PaymentSource paymentSource; + + private PaymentSourceRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.paymentSource = builder.paymentSource; + } + + /** Parse JSON response into PaymentSourceRetrieveResponse object. */ + public static PaymentSourceRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into PaymentSourceRetrieveResponse object with HTTP response. */ + public static PaymentSourceRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __paymentSourceJson = JsonUtil.getObject(json, "payment_source"); + if (__paymentSourceJson != null) { + builder.paymentSource(PaymentSource.fromJson(__paymentSourceJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PaymentSourceRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for PaymentSourceRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PaymentSourceRetrieveResponse. */ + public static class Builder { + + private PaymentSource paymentSource; + + private Response httpResponse; + + private Builder() {} + + public Builder paymentSource(PaymentSource paymentSource) { + this.paymentSource = paymentSource; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public PaymentSourceRetrieveResponse build() { + return new PaymentSourceRetrieveResponse(this); + } + } + + /** Get the paymentSource from the response. */ + public PaymentSource getPaymentSource() { + return paymentSource; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceSwitchGatewayAccountResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceSwitchGatewayAccountResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceSwitchGatewayAccountResponse.java rename to src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceSwitchGatewayAccountResponse.java index 85a3a0ad..33d6c8eb 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceSwitchGatewayAccountResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceSwitchGatewayAccountResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.paymentSource; +package com.chargebee.v4.models.paymentSource.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceUpdateBankAccountResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceUpdateBankAccountResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceUpdateBankAccountResponse.java rename to src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceUpdateBankAccountResponse.java index 01059b9d..84a9d400 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceUpdateBankAccountResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceUpdateBankAccountResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.paymentSource; +package com.chargebee.v4.models.paymentSource.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceUpdateCardResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceUpdateCardResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceUpdateCardResponse.java rename to src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceUpdateCardResponse.java index 7ab659fa..1ad9fdd9 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceUpdateCardResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceUpdateCardResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.paymentSource; +package com.chargebee.v4.models.paymentSource.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceVerifyBankAccountResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceVerifyBankAccountResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceVerifyBankAccountResponse.java rename to src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceVerifyBankAccountResponse.java index 827bb5ae..f2257402 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentSource/PaymentSourceVerifyBankAccountResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/PaymentSourceVerifyBankAccountResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.paymentSource; +package com.chargebee.v4.models.paymentSource.responses; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/paymentVoucher/PaymentVoucher.java b/src/main/java/com/chargebee/v4/models/paymentVoucher/PaymentVoucher.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/paymentVoucher/PaymentVoucher.java rename to src/main/java/com/chargebee/v4/models/paymentVoucher/PaymentVoucher.java index 5f9124ac..2aa2eef7 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentVoucher/PaymentVoucher.java +++ b/src/main/java/com/chargebee/v4/models/paymentVoucher/PaymentVoucher.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentVoucher; +package com.chargebee.v4.models.paymentVoucher; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; @@ -283,6 +283,8 @@ public enum Gateway { DEUTSCHE_BANK("deutsche_bank"), + EZIDEBIT("ezidebit"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVoucherCreateParams.java b/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVoucherCreateParams.java new file mode 100644 index 00000000..cbeeb984 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVoucherCreateParams.java @@ -0,0 +1,258 @@ +/* + * 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.paymentVoucher.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class PaymentVoucherCreateParams { + + private final String customerId; + + private final String paymentSourceId; + + private final VoucherPaymentSourceParams voucherPaymentSource; + + private final List invoiceAllocations; + + private PaymentVoucherCreateParams(PaymentVoucherCreateBuilder builder) { + + this.customerId = builder.customerId; + + this.paymentSourceId = builder.paymentSourceId; + + this.voucherPaymentSource = builder.voucherPaymentSource; + + this.invoiceAllocations = builder.invoiceAllocations; + } + + public String getCustomerId() { + return customerId; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public VoucherPaymentSourceParams getVoucherPaymentSource() { + return voucherPaymentSource; + } + + public List getInvoiceAllocations() { + return invoiceAllocations; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.voucherPaymentSource != null) { + + // Single object + Map nestedData = this.voucherPaymentSource.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "voucher_payment_source[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.invoiceAllocations != null) { + + // List of objects + for (int i = 0; i < this.invoiceAllocations.size(); i++) { + InvoiceAllocationsParams item = this.invoiceAllocations.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "invoice_allocations[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for PaymentVoucherCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentVoucherCreateBuilder builder() { + return new PaymentVoucherCreateBuilder(); + } + + public static final class PaymentVoucherCreateBuilder { + + private String customerId; + + private String paymentSourceId; + + private VoucherPaymentSourceParams voucherPaymentSource; + + private List invoiceAllocations; + + private PaymentVoucherCreateBuilder() {} + + public PaymentVoucherCreateBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public PaymentVoucherCreateBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public PaymentVoucherCreateBuilder voucherPaymentSource(VoucherPaymentSourceParams value) { + this.voucherPaymentSource = value; + return this; + } + + public PaymentVoucherCreateBuilder invoiceAllocations(List value) { + this.invoiceAllocations = value; + return this; + } + + public PaymentVoucherCreateParams build() { + return new PaymentVoucherCreateParams(this); + } + } + + public static final class VoucherPaymentSourceParams { + + private final VoucherType voucherType; + + private VoucherPaymentSourceParams(VoucherPaymentSourceBuilder builder) { + + this.voucherType = builder.voucherType; + } + + public VoucherType getVoucherType() { + return voucherType; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.voucherType != null) { + + formData.put("voucher_type", this.voucherType); + } + + return formData; + } + + /** Create a new builder for VoucherPaymentSourceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static VoucherPaymentSourceBuilder builder() { + return new VoucherPaymentSourceBuilder(); + } + + public static final class VoucherPaymentSourceBuilder { + + private VoucherType voucherType; + + private VoucherPaymentSourceBuilder() {} + + public VoucherPaymentSourceBuilder voucherType(VoucherType value) { + this.voucherType = value; + return this; + } + + public VoucherPaymentSourceParams build() { + return new VoucherPaymentSourceParams(this); + } + } + + public enum VoucherType { + BOLETO("boleto"), + + /** An enum member indicating that VoucherType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + VoucherType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static VoucherType fromString(String value) { + if (value == null) return _UNKNOWN; + for (VoucherType enumValue : VoucherType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class InvoiceAllocationsParams { + + private final String invoiceId; + + private InvoiceAllocationsParams(InvoiceAllocationsBuilder builder) { + + this.invoiceId = builder.invoiceId; + } + + public String getInvoiceId() { + return invoiceId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.invoiceId != null) { + + formData.put("invoice_id", this.invoiceId); + } + + return formData; + } + + /** Create a new builder for InvoiceAllocationsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceAllocationsBuilder builder() { + return new InvoiceAllocationsBuilder(); + } + + public static final class InvoiceAllocationsBuilder { + + private String invoiceId; + + private InvoiceAllocationsBuilder() {} + + public InvoiceAllocationsBuilder invoiceId(String value) { + this.invoiceId = value; + return this; + } + + public InvoiceAllocationsParams build() { + return new InvoiceAllocationsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/paymentVoucher/params/PaymentVoucherRetrieveParams.java b/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVoucherRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/paymentVoucher/params/PaymentVoucherRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVoucherRetrieveParams.java index bf186a53..cbd78a47 100644 --- a/src/main/java/com/chargebee/v4/core/models/paymentVoucher/params/PaymentVoucherRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVoucherRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.paymentVoucher.params; +package com.chargebee.v4.models.paymentVoucher.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVouchersForCustomerParams.java b/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVouchersForCustomerParams.java new file mode 100644 index 00000000..28f7d4ba --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVouchersForCustomerParams.java @@ -0,0 +1,259 @@ +/* + * 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.paymentVoucher.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentVouchersForCustomerParams { + + private final Map queryParams; + + private PaymentVouchersForCustomerParams(PaymentVouchersForCustomerBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public PaymentVouchersForCustomerBuilder toBuilder() { + PaymentVouchersForCustomerBuilder builder = new PaymentVouchersForCustomerBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for PaymentVouchersForCustomerParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentVouchersForCustomerBuilder builder() { + return new PaymentVouchersForCustomerBuilder(); + } + + public static final class PaymentVouchersForCustomerBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private PaymentVouchersForCustomerBuilder() {} + + public PaymentVouchersForCustomerBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public PaymentVouchersForCustomerBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public StatusFilter status() { + return new StatusFilter("status", this); + } + + public SortBySortBuilder sortBy() { + return new SortBySortBuilder("sort_by", this); + } + + public PaymentVouchersForCustomerParams build() { + return new PaymentVouchersForCustomerParams(this); + } + + public static final class StatusFilter { + private final String fieldName; + private final PaymentVouchersForCustomerBuilder builder; + + StatusFilter(String fieldName, PaymentVouchersForCustomerBuilder builder) { + this.fieldName = fieldName; + this.builder = builder; + } + + public PaymentVouchersForCustomerBuilder is(String value) { + builder.queryParams.put(fieldName + "[is]", value); + return builder; + } + + public PaymentVouchersForCustomerBuilder isNot(String value) { + builder.queryParams.put(fieldName + "[is_not]", value); + return builder; + } + + public PaymentVouchersForCustomerBuilder in(String... values) { + builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + public PaymentVouchersForCustomerBuilder notIn(String... values) { + builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + + public static final class SortBySortBuilder { + private final String fieldName; + private final PaymentVouchersForCustomerBuilder builder; + + SortBySortBuilder(String fieldName, PaymentVouchersForCustomerBuilder builder) { + this.fieldName = fieldName; + this.builder = builder; + } + + public SortDirection date() { + return new SortDirection(fieldName, "date", builder); + } + + public SortDirection updated_at() { + return new SortDirection(fieldName, "updated_at", builder); + } + } + + public static final class SortDirection { + private final String fieldName; + private final String selectedField; + private final PaymentVouchersForCustomerBuilder builder; + + SortDirection( + String fieldName, String selectedField, PaymentVouchersForCustomerBuilder builder) { + this.fieldName = fieldName; + this.selectedField = selectedField; + this.builder = builder; + } + + public PaymentVouchersForCustomerBuilder asc() { + builder.queryParams.put(fieldName + "[asc]", selectedField); + return builder; + } + + public PaymentVouchersForCustomerBuilder desc() { + builder.queryParams.put(fieldName + "[desc]", selectedField); + return builder; + } + } + } + + public enum StatusIs { + ACTIVE("active"), + + CONSUMED("consumed"), + + EXPIRED("expired"), + + FAILURE("failure"), + + /** An enum member indicating that StatusIs was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + StatusIs(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static StatusIs fromString(String value) { + if (value == null) return _UNKNOWN; + for (StatusIs enumValue : StatusIs.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum StatusIsNot { + ACTIVE("active"), + + CONSUMED("consumed"), + + EXPIRED("expired"), + + FAILURE("failure"), + + /** An enum member indicating that StatusIsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + StatusIsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static StatusIsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (StatusIsNot enumValue : StatusIsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum SortByAsc { + DATE("date"), + + UPDATED_AT("updated_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 { + DATE("date"), + + UPDATED_AT("updated_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/paymentVoucher/params/PaymentVouchersForInvoiceParams.java b/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVouchersForInvoiceParams.java new file mode 100644 index 00000000..d1c9b112 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVouchersForInvoiceParams.java @@ -0,0 +1,259 @@ +/* + * 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.paymentVoucher.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentVouchersForInvoiceParams { + + private final Map queryParams; + + private PaymentVouchersForInvoiceParams(PaymentVouchersForInvoiceBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public PaymentVouchersForInvoiceBuilder toBuilder() { + PaymentVouchersForInvoiceBuilder builder = new PaymentVouchersForInvoiceBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for PaymentVouchersForInvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentVouchersForInvoiceBuilder builder() { + return new PaymentVouchersForInvoiceBuilder(); + } + + public static final class PaymentVouchersForInvoiceBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private PaymentVouchersForInvoiceBuilder() {} + + public PaymentVouchersForInvoiceBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public PaymentVouchersForInvoiceBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public StatusFilter status() { + return new StatusFilter("status", this); + } + + public SortBySortBuilder sortBy() { + return new SortBySortBuilder("sort_by", this); + } + + public PaymentVouchersForInvoiceParams build() { + return new PaymentVouchersForInvoiceParams(this); + } + + public static final class StatusFilter { + private final String fieldName; + private final PaymentVouchersForInvoiceBuilder builder; + + StatusFilter(String fieldName, PaymentVouchersForInvoiceBuilder builder) { + this.fieldName = fieldName; + this.builder = builder; + } + + public PaymentVouchersForInvoiceBuilder is(String value) { + builder.queryParams.put(fieldName + "[is]", value); + return builder; + } + + public PaymentVouchersForInvoiceBuilder isNot(String value) { + builder.queryParams.put(fieldName + "[is_not]", value); + return builder; + } + + public PaymentVouchersForInvoiceBuilder in(String... values) { + builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + public PaymentVouchersForInvoiceBuilder notIn(String... values) { + builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + + public static final class SortBySortBuilder { + private final String fieldName; + private final PaymentVouchersForInvoiceBuilder builder; + + SortBySortBuilder(String fieldName, PaymentVouchersForInvoiceBuilder builder) { + this.fieldName = fieldName; + this.builder = builder; + } + + public SortDirection date() { + return new SortDirection(fieldName, "date", builder); + } + + public SortDirection updated_at() { + return new SortDirection(fieldName, "updated_at", builder); + } + } + + public static final class SortDirection { + private final String fieldName; + private final String selectedField; + private final PaymentVouchersForInvoiceBuilder builder; + + SortDirection( + String fieldName, String selectedField, PaymentVouchersForInvoiceBuilder builder) { + this.fieldName = fieldName; + this.selectedField = selectedField; + this.builder = builder; + } + + public PaymentVouchersForInvoiceBuilder asc() { + builder.queryParams.put(fieldName + "[asc]", selectedField); + return builder; + } + + public PaymentVouchersForInvoiceBuilder desc() { + builder.queryParams.put(fieldName + "[desc]", selectedField); + return builder; + } + } + } + + public enum StatusIs { + ACTIVE("active"), + + CONSUMED("consumed"), + + EXPIRED("expired"), + + FAILURE("failure"), + + /** An enum member indicating that StatusIs was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + StatusIs(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static StatusIs fromString(String value) { + if (value == null) return _UNKNOWN; + for (StatusIs enumValue : StatusIs.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum StatusIsNot { + ACTIVE("active"), + + CONSUMED("consumed"), + + EXPIRED("expired"), + + FAILURE("failure"), + + /** An enum member indicating that StatusIsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + StatusIsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static StatusIsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (StatusIsNot enumValue : StatusIsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum SortByAsc { + DATE("date"), + + UPDATED_AT("updated_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 { + DATE("date"), + + UPDATED_AT("updated_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/core/responses/paymentVoucher/PaymentVoucherCreateResponse.java b/src/main/java/com/chargebee/v4/models/paymentVoucher/responses/PaymentVoucherCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/paymentVoucher/PaymentVoucherCreateResponse.java rename to src/main/java/com/chargebee/v4/models/paymentVoucher/responses/PaymentVoucherCreateResponse.java index 916fd4fc..3347c63d 100644 --- a/src/main/java/com/chargebee/v4/core/responses/paymentVoucher/PaymentVoucherCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/paymentVoucher/responses/PaymentVoucherCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.paymentVoucher; +package com.chargebee.v4.models.paymentVoucher.responses; -import com.chargebee.v4.core.models.paymentVoucher.PaymentVoucher; +import com.chargebee.v4.models.paymentVoucher.PaymentVoucher; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/paymentVoucher/responses/PaymentVoucherRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/paymentVoucher/responses/PaymentVoucherRetrieveResponse.java new file mode 100644 index 00000000..1884f7fa --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentVoucher/responses/PaymentVoucherRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.paymentVoucher.responses; + +import com.chargebee.v4.models.paymentVoucher.PaymentVoucher; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for PaymentVoucherRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class PaymentVoucherRetrieveResponse extends BaseResponse { + private final PaymentVoucher paymentVoucher; + + private PaymentVoucherRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.paymentVoucher = builder.paymentVoucher; + } + + /** Parse JSON response into PaymentVoucherRetrieveResponse object. */ + public static PaymentVoucherRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into PaymentVoucherRetrieveResponse object with HTTP response. */ + public static PaymentVoucherRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __paymentVoucherJson = JsonUtil.getObject(json, "payment_voucher"); + if (__paymentVoucherJson != null) { + builder.paymentVoucher(PaymentVoucher.fromJson(__paymentVoucherJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PaymentVoucherRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for PaymentVoucherRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PaymentVoucherRetrieveResponse. */ + public static class Builder { + + private PaymentVoucher paymentVoucher; + + private Response httpResponse; + + private Builder() {} + + public Builder paymentVoucher(PaymentVoucher paymentVoucher) { + this.paymentVoucher = paymentVoucher; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public PaymentVoucherRetrieveResponse build() { + return new PaymentVoucherRetrieveResponse(this); + } + } + + /** Get the paymentVoucher from the response. */ + public PaymentVoucher getPaymentVoucher() { + return paymentVoucher; + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentVoucher/responses/PaymentVouchersForCustomerResponse.java b/src/main/java/com/chargebee/v4/models/paymentVoucher/responses/PaymentVouchersForCustomerResponse.java new file mode 100644 index 00000000..90ee6b91 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentVoucher/responses/PaymentVouchersForCustomerResponse.java @@ -0,0 +1,177 @@ +package com.chargebee.v4.models.paymentVoucher.responses; + +import java.util.List; + +import com.chargebee.v4.models.paymentVoucher.PaymentVoucher; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.PaymentVoucherService; +import com.chargebee.v4.models.paymentVoucher.params.PaymentVouchersForCustomerParams; + +/** + * Immutable response object for PaymentVouchersForCustomer operation. Contains paginated list data. + */ +public final class PaymentVouchersForCustomerResponse { + + private final List list; + + private final String nextOffset; + + private final String customerId; + + private final PaymentVoucherService service; + private final PaymentVouchersForCustomerParams originalParams; + private final Response httpResponse; + + private PaymentVouchersForCustomerResponse( + List list, + String nextOffset, + String customerId, + PaymentVoucherService service, + PaymentVouchersForCustomerParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.customerId = customerId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into PaymentVouchersForCustomerResponse object (no service context). Use + * this when you only need to read a single page (no nextPage()). + */ + public static PaymentVouchersForCustomerResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(PaymentVoucherPaymentVouchersForCustomerItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new PaymentVouchersForCustomerResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PaymentVouchersForCustomerResponse from JSON", e); + } + } + + /** + * Parse JSON response into PaymentVouchersForCustomerResponse object with service context for + * pagination (enables nextPage()). + */ + public static PaymentVouchersForCustomerResponse fromJson( + String json, + PaymentVoucherService service, + PaymentVouchersForCustomerParams originalParams, + String customerId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(PaymentVoucherPaymentVouchersForCustomerItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new PaymentVouchersForCustomerResponse( + list, nextOffset, customerId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PaymentVouchersForCustomerResponse 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 PaymentVouchersForCustomerResponse 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)."); + } + + PaymentVouchersForCustomerParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : PaymentVouchersForCustomerParams.builder()) + .offset(nextOffset) + .build(); + + return service.paymentVouchersForCustomer(customerId, 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 PaymentVoucherPaymentVouchersForCustomerItem { + + private PaymentVoucher paymentVoucher; + + public PaymentVoucher getPaymentVoucher() { + return paymentVoucher; + } + + public static PaymentVoucherPaymentVouchersForCustomerItem fromJson(String json) { + PaymentVoucherPaymentVouchersForCustomerItem item = + new PaymentVoucherPaymentVouchersForCustomerItem(); + + String __paymentVoucherJson = JsonUtil.getObject(json, "payment_voucher"); + if (__paymentVoucherJson != null) { + item.paymentVoucher = PaymentVoucher.fromJson(__paymentVoucherJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentVoucher/responses/PaymentVouchersForInvoiceResponse.java b/src/main/java/com/chargebee/v4/models/paymentVoucher/responses/PaymentVouchersForInvoiceResponse.java new file mode 100644 index 00000000..09554754 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentVoucher/responses/PaymentVouchersForInvoiceResponse.java @@ -0,0 +1,177 @@ +package com.chargebee.v4.models.paymentVoucher.responses; + +import java.util.List; + +import com.chargebee.v4.models.paymentVoucher.PaymentVoucher; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.PaymentVoucherService; +import com.chargebee.v4.models.paymentVoucher.params.PaymentVouchersForInvoiceParams; + +/** + * Immutable response object for PaymentVouchersForInvoice operation. Contains paginated list data. + */ +public final class PaymentVouchersForInvoiceResponse { + + private final List list; + + private final String nextOffset; + + private final String invoiceId; + + private final PaymentVoucherService service; + private final PaymentVouchersForInvoiceParams originalParams; + private final Response httpResponse; + + private PaymentVouchersForInvoiceResponse( + List list, + String nextOffset, + String invoiceId, + PaymentVoucherService service, + PaymentVouchersForInvoiceParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.invoiceId = invoiceId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into PaymentVouchersForInvoiceResponse object (no service context). Use + * this when you only need to read a single page (no nextPage()). + */ + public static PaymentVouchersForInvoiceResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(PaymentVoucherPaymentVouchersForInvoiceItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new PaymentVouchersForInvoiceResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PaymentVouchersForInvoiceResponse from JSON", e); + } + } + + /** + * Parse JSON response into PaymentVouchersForInvoiceResponse object with service context for + * pagination (enables nextPage()). + */ + public static PaymentVouchersForInvoiceResponse fromJson( + String json, + PaymentVoucherService service, + PaymentVouchersForInvoiceParams originalParams, + String invoiceId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(PaymentVoucherPaymentVouchersForInvoiceItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new PaymentVouchersForInvoiceResponse( + list, nextOffset, invoiceId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PaymentVouchersForInvoiceResponse 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 PaymentVouchersForInvoiceResponse 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)."); + } + + PaymentVouchersForInvoiceParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : PaymentVouchersForInvoiceParams.builder()) + .offset(nextOffset) + .build(); + + return service.paymentVouchersForInvoice(invoiceId, 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 PaymentVoucherPaymentVouchersForInvoiceItem { + + private PaymentVoucher paymentVoucher; + + public PaymentVoucher getPaymentVoucher() { + return paymentVoucher; + } + + public static PaymentVoucherPaymentVouchersForInvoiceItem fromJson(String json) { + PaymentVoucherPaymentVouchersForInvoiceItem item = + new PaymentVoucherPaymentVouchersForInvoiceItem(); + + String __paymentVoucherJson = JsonUtil.getObject(json, "payment_voucher"); + if (__paymentVoucherJson != null) { + item.paymentVoucher = PaymentVoucher.fromJson(__paymentVoucherJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/pc2Migration/params/Pc2MigrationContactSupportParams.java b/src/main/java/com/chargebee/v4/models/pc2Migration/params/Pc2MigrationContactSupportParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/pc2Migration/params/Pc2MigrationContactSupportParams.java rename to src/main/java/com/chargebee/v4/models/pc2Migration/params/Pc2MigrationContactSupportParams.java index e052a65d..665e6e94 100644 --- a/src/main/java/com/chargebee/v4/core/models/pc2Migration/params/Pc2MigrationContactSupportParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2Migration/params/Pc2MigrationContactSupportParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pc2Migration.params; +package com.chargebee.v4.models.pc2Migration.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class Pc2MigrationContactSupportParams { - private final Map formData; - - private Pc2MigrationContactSupportParams(Pc2MigrationContactSupportBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private Pc2MigrationContactSupportParams(Pc2MigrationContactSupportBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static Pc2MigrationContactSupportBuilder builder() { } public static final class Pc2MigrationContactSupportBuilder { - private final Map formData = new LinkedHashMap<>(); private Pc2MigrationContactSupportBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/pc2Migration/params/Pc2MigrationCreateParams.java b/src/main/java/com/chargebee/v4/models/pc2Migration/params/Pc2MigrationCreateParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/pc2Migration/params/Pc2MigrationCreateParams.java rename to src/main/java/com/chargebee/v4/models/pc2Migration/params/Pc2MigrationCreateParams.java index bca01256..1f45a9b1 100644 --- a/src/main/java/com/chargebee/v4/core/models/pc2Migration/params/Pc2MigrationCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2Migration/params/Pc2MigrationCreateParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pc2Migration.params; +package com.chargebee.v4.models.pc2Migration.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class Pc2MigrationCreateParams { - private final Map formData; - - private Pc2MigrationCreateParams(Pc2MigrationCreateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private Pc2MigrationCreateParams(Pc2MigrationCreateBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static Pc2MigrationCreateBuilder builder() { } public static final class Pc2MigrationCreateBuilder { - private final Map formData = new LinkedHashMap<>(); private Pc2MigrationCreateBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/pc2Migration/params/Pc2MigrationInitiateParams.java b/src/main/java/com/chargebee/v4/models/pc2Migration/params/Pc2MigrationInitiateParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/pc2Migration/params/Pc2MigrationInitiateParams.java rename to src/main/java/com/chargebee/v4/models/pc2Migration/params/Pc2MigrationInitiateParams.java index b102c30d..dcd2ca04 100644 --- a/src/main/java/com/chargebee/v4/core/models/pc2Migration/params/Pc2MigrationInitiateParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2Migration/params/Pc2MigrationInitiateParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pc2Migration.params; +package com.chargebee.v4.models.pc2Migration.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class Pc2MigrationInitiateParams { - private final Map formData; - - private Pc2MigrationInitiateParams(Pc2MigrationInitiateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private Pc2MigrationInitiateParams(Pc2MigrationInitiateBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static Pc2MigrationInitiateBuilder builder() { } public static final class Pc2MigrationInitiateBuilder { - private final Map formData = new LinkedHashMap<>(); private Pc2MigrationInitiateBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/pc2Migration/params/Pc2MigrationRetrieveParams.java b/src/main/java/com/chargebee/v4/models/pc2Migration/params/Pc2MigrationRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/pc2Migration/params/Pc2MigrationRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/pc2Migration/params/Pc2MigrationRetrieveParams.java index fa923cd0..351722b6 100644 --- a/src/main/java/com/chargebee/v4/core/models/pc2Migration/params/Pc2MigrationRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2Migration/params/Pc2MigrationRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pc2Migration.params; +package com.chargebee.v4.models.pc2Migration.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2Migration/Pc2MigrationContactSupportResponse.java b/src/main/java/com/chargebee/v4/models/pc2Migration/responses/Pc2MigrationContactSupportResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/pc2Migration/Pc2MigrationContactSupportResponse.java rename to src/main/java/com/chargebee/v4/models/pc2Migration/responses/Pc2MigrationContactSupportResponse.java index 3b28aff0..5ee55101 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pc2Migration/Pc2MigrationContactSupportResponse.java +++ b/src/main/java/com/chargebee/v4/models/pc2Migration/responses/Pc2MigrationContactSupportResponse.java @@ -1,6 +1,6 @@ -package com.chargebee.v4.core.responses.pc2Migration; +package com.chargebee.v4.models.pc2Migration.responses; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.transport.Response; /** diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2Migration/Pc2MigrationCreateResponse.java b/src/main/java/com/chargebee/v4/models/pc2Migration/responses/Pc2MigrationCreateResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/pc2Migration/Pc2MigrationCreateResponse.java rename to src/main/java/com/chargebee/v4/models/pc2Migration/responses/Pc2MigrationCreateResponse.java index fb1f36eb..dcaeeda3 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pc2Migration/Pc2MigrationCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/pc2Migration/responses/Pc2MigrationCreateResponse.java @@ -1,6 +1,6 @@ -package com.chargebee.v4.core.responses.pc2Migration; +package com.chargebee.v4.models.pc2Migration.responses; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.transport.Response; /** diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2Migration/Pc2MigrationInitiateResponse.java b/src/main/java/com/chargebee/v4/models/pc2Migration/responses/Pc2MigrationInitiateResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/pc2Migration/Pc2MigrationInitiateResponse.java rename to src/main/java/com/chargebee/v4/models/pc2Migration/responses/Pc2MigrationInitiateResponse.java index 0a49ca3e..af777160 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pc2Migration/Pc2MigrationInitiateResponse.java +++ b/src/main/java/com/chargebee/v4/models/pc2Migration/responses/Pc2MigrationInitiateResponse.java @@ -1,6 +1,6 @@ -package com.chargebee.v4.core.responses.pc2Migration; +package com.chargebee.v4.models.pc2Migration.responses; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.transport.Response; /** diff --git a/src/main/java/com/chargebee/v4/models/pc2Migration/responses/Pc2MigrationRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/pc2Migration/responses/Pc2MigrationRetrieveResponse.java new file mode 100644 index 00000000..214d0338 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/pc2Migration/responses/Pc2MigrationRetrieveResponse.java @@ -0,0 +1,72 @@ +package com.chargebee.v4.models.pc2Migration.responses; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for Pc2MigrationRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class Pc2MigrationRetrieveResponse extends BaseResponse { + private final Object pc2Migration; + + private Pc2MigrationRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.pc2Migration = builder.pc2Migration; + } + + /** Parse JSON response into Pc2MigrationRetrieveResponse object. */ + public static Pc2MigrationRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into Pc2MigrationRetrieveResponse object with HTTP response. */ + public static Pc2MigrationRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + builder.pc2Migration(JsonUtil.getObject(json, "pc2_migration")); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse Pc2MigrationRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for Pc2MigrationRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for Pc2MigrationRetrieveResponse. */ + public static class Builder { + + private Object pc2Migration; + + private Response httpResponse; + + private Builder() {} + + public Builder pc2Migration(Object pc2Migration) { + this.pc2Migration = pc2Migration; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public Pc2MigrationRetrieveResponse build() { + return new Pc2MigrationRetrieveResponse(this); + } + } + + /** Get the pc2Migration from the response. */ + public Object getPc2Migration() { + return pc2Migration; + } +} diff --git a/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemCreateParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemCreateParams.java new file mode 100644 index 00000000..96d38464 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemCreateParams.java @@ -0,0 +1,548 @@ +/* + * 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.pc2MigrationItem.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class Pc2MigrationItemCreateParams { + + private final String id; + + private final String name; + + private final Pc1Type pc1Type; + + private final String pc2MigrationItemFamilyId; + + private final String pc2MigrationId; + + private final String description; + + private final String metadata; + + private final Boolean isGiftable; + + private final Boolean isShippable; + + private final Boolean enabledForCheckout; + + private final Boolean enabledInPortal; + + private final String redirectUrl; + + private final Boolean isRecurring; + + private final String giftClaimRedirectUrl; + + private final Boolean includedInMrr; + + private final String unit; + + private final List pc2MigrationItemPrices; + + private Pc2MigrationItemCreateParams(Pc2MigrationItemCreateBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.pc1Type = builder.pc1Type; + + this.pc2MigrationItemFamilyId = builder.pc2MigrationItemFamilyId; + + this.pc2MigrationId = builder.pc2MigrationId; + + this.description = builder.description; + + this.metadata = builder.metadata; + + this.isGiftable = builder.isGiftable; + + this.isShippable = builder.isShippable; + + this.enabledForCheckout = builder.enabledForCheckout; + + this.enabledInPortal = builder.enabledInPortal; + + this.redirectUrl = builder.redirectUrl; + + this.isRecurring = builder.isRecurring; + + this.giftClaimRedirectUrl = builder.giftClaimRedirectUrl; + + this.includedInMrr = builder.includedInMrr; + + this.unit = builder.unit; + + this.pc2MigrationItemPrices = builder.pc2MigrationItemPrices; + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public Pc1Type getPc1Type() { + return pc1Type; + } + + public String getPc2MigrationItemFamilyId() { + return pc2MigrationItemFamilyId; + } + + public String getPc2MigrationId() { + return pc2MigrationId; + } + + public String getDescription() { + return description; + } + + public String getMetadata() { + return metadata; + } + + public Boolean getIsGiftable() { + return isGiftable; + } + + public Boolean getIsShippable() { + return isShippable; + } + + public Boolean getEnabledForCheckout() { + return enabledForCheckout; + } + + public Boolean getEnabledInPortal() { + return enabledInPortal; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public Boolean getIsRecurring() { + return isRecurring; + } + + public String getGiftClaimRedirectUrl() { + return giftClaimRedirectUrl; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getUnit() { + return unit; + } + + public List getPc2MigrationItemPrices() { + return pc2MigrationItemPrices; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.pc1Type != null) { + + formData.put("pc1_type", this.pc1Type); + } + + if (this.pc2MigrationItemFamilyId != null) { + + formData.put("pc2_migration_item_family_id", this.pc2MigrationItemFamilyId); + } + + if (this.pc2MigrationId != null) { + + formData.put("pc2_migration_id", this.pc2MigrationId); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.metadata != null) { + + formData.put("metadata", this.metadata); + } + + if (this.isGiftable != null) { + + formData.put("is_giftable", this.isGiftable); + } + + if (this.isShippable != null) { + + formData.put("is_shippable", this.isShippable); + } + + if (this.enabledForCheckout != null) { + + formData.put("enabled_for_checkout", this.enabledForCheckout); + } + + if (this.enabledInPortal != null) { + + formData.put("enabled_in_portal", this.enabledInPortal); + } + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.isRecurring != null) { + + formData.put("is_recurring", this.isRecurring); + } + + if (this.giftClaimRedirectUrl != null) { + + formData.put("gift_claim_redirect_url", this.giftClaimRedirectUrl); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.unit != null) { + + formData.put("unit", this.unit); + } + + if (this.pc2MigrationItemPrices != null) { + + // List of objects + for (int i = 0; i < this.pc2MigrationItemPrices.size(); i++) { + Pc2MigrationItemPricesParams item = this.pc2MigrationItemPrices.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "pc2_migration_item_prices[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for Pc2MigrationItemCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static Pc2MigrationItemCreateBuilder builder() { + return new Pc2MigrationItemCreateBuilder(); + } + + public static final class Pc2MigrationItemCreateBuilder { + + private String id; + + private String name; + + private Pc1Type pc1Type; + + private String pc2MigrationItemFamilyId; + + private String pc2MigrationId; + + private String description; + + private String metadata; + + private Boolean isGiftable; + + private Boolean isShippable; + + private Boolean enabledForCheckout; + + private Boolean enabledInPortal; + + private String redirectUrl; + + private Boolean isRecurring; + + private String giftClaimRedirectUrl; + + private Boolean includedInMrr; + + private String unit; + + private List pc2MigrationItemPrices; + + private Pc2MigrationItemCreateBuilder() {} + + public Pc2MigrationItemCreateBuilder id(String value) { + this.id = value; + return this; + } + + public Pc2MigrationItemCreateBuilder name(String value) { + this.name = value; + return this; + } + + public Pc2MigrationItemCreateBuilder pc1Type(Pc1Type value) { + this.pc1Type = value; + return this; + } + + public Pc2MigrationItemCreateBuilder pc2MigrationItemFamilyId(String value) { + this.pc2MigrationItemFamilyId = value; + return this; + } + + public Pc2MigrationItemCreateBuilder pc2MigrationId(String value) { + this.pc2MigrationId = value; + return this; + } + + public Pc2MigrationItemCreateBuilder description(String value) { + this.description = value; + return this; + } + + public Pc2MigrationItemCreateBuilder metadata(String value) { + this.metadata = value; + return this; + } + + public Pc2MigrationItemCreateBuilder isGiftable(Boolean value) { + this.isGiftable = value; + return this; + } + + public Pc2MigrationItemCreateBuilder isShippable(Boolean value) { + this.isShippable = value; + return this; + } + + public Pc2MigrationItemCreateBuilder enabledForCheckout(Boolean value) { + this.enabledForCheckout = value; + return this; + } + + public Pc2MigrationItemCreateBuilder enabledInPortal(Boolean value) { + this.enabledInPortal = value; + return this; + } + + public Pc2MigrationItemCreateBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public Pc2MigrationItemCreateBuilder isRecurring(Boolean value) { + this.isRecurring = value; + return this; + } + + public Pc2MigrationItemCreateBuilder giftClaimRedirectUrl(String value) { + this.giftClaimRedirectUrl = value; + return this; + } + + public Pc2MigrationItemCreateBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public Pc2MigrationItemCreateBuilder unit(String value) { + this.unit = value; + return this; + } + + public Pc2MigrationItemCreateBuilder pc2MigrationItemPrices( + List value) { + this.pc2MigrationItemPrices = value; + return this; + } + + public Pc2MigrationItemCreateParams build() { + return new Pc2MigrationItemCreateParams(this); + } + } + + public enum Pc1Type { + PLAN("plan"), + + ADDON("addon"), + + /** An enum member indicating that Pc1Type was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Pc1Type(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Pc1Type fromString(String value) { + if (value == null) return _UNKNOWN; + for (Pc1Type enumValue : Pc1Type.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class Pc2MigrationItemPricesParams { + + private final String id; + + private final String name; + + private final String description; + + private final String metadata; + + private final String refEntityId; + + private Pc2MigrationItemPricesParams(Pc2MigrationItemPricesBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.description = builder.description; + + this.metadata = builder.metadata; + + this.refEntityId = builder.refEntityId; + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public String getMetadata() { + return metadata; + } + + public String getRefEntityId() { + return refEntityId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.metadata != null) { + + formData.put("metadata", this.metadata); + } + + if (this.refEntityId != null) { + + formData.put("ref_entity_id", this.refEntityId); + } + + return formData; + } + + /** Create a new builder for Pc2MigrationItemPricesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static Pc2MigrationItemPricesBuilder builder() { + return new Pc2MigrationItemPricesBuilder(); + } + + public static final class Pc2MigrationItemPricesBuilder { + + private String id; + + private String name; + + private String description; + + private String metadata; + + private String refEntityId; + + private Pc2MigrationItemPricesBuilder() {} + + public Pc2MigrationItemPricesBuilder id(String value) { + this.id = value; + return this; + } + + public Pc2MigrationItemPricesBuilder name(String value) { + this.name = value; + return this; + } + + public Pc2MigrationItemPricesBuilder description(String value) { + this.description = value; + return this; + } + + public Pc2MigrationItemPricesBuilder metadata(String value) { + this.metadata = value; + return this; + } + + public Pc2MigrationItemPricesBuilder refEntityId(String value) { + this.refEntityId = value; + return this; + } + + public Pc2MigrationItemPricesParams build() { + return new Pc2MigrationItemPricesParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemDeleteParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemDeleteParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemDeleteParams.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemDeleteParams.java index 4b030ec0..bc9fc58f 100644 --- a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemDeleteParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemDeleteParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pc2MigrationItem.params; +package com.chargebee.v4.models.pc2MigrationItem.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class Pc2MigrationItemDeleteParams { - private final Map formData; - - private Pc2MigrationItemDeleteParams(Pc2MigrationItemDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private Pc2MigrationItemDeleteParams(Pc2MigrationItemDeleteBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static Pc2MigrationItemDeleteBuilder builder() { } public static final class Pc2MigrationItemDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); private Pc2MigrationItemDeleteBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemListApplicableAddonsParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemListApplicableAddonsParams.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemListApplicableAddonsParams.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemListApplicableAddonsParams.java index 2186008a..ca86e143 100644 --- a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemListApplicableAddonsParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemListApplicableAddonsParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pc2MigrationItem.params; +package com.chargebee.v4.models.pc2MigrationItem.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemListParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemListParams.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemListParams.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemListParams.java index 23070d39..f60925c0 100644 --- a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemListParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pc2MigrationItem.params; +package com.chargebee.v4.models.pc2MigrationItem.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemRetrieveParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemRetrieveParams.java index dfd6afaa..30103e4b 100644 --- a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItem/params/Pc2MigrationItemRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pc2MigrationItem.params; +package com.chargebee.v4.models.pc2MigrationItem.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemUpdateParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemUpdateParams.java new file mode 100644 index 00000000..87e17f7d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemUpdateParams.java @@ -0,0 +1,480 @@ +/* + * 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.pc2MigrationItem.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class Pc2MigrationItemUpdateParams { + + private final String name; + + private final String id; + + private final String pc2MigrationItemFamilyId; + + private final String description; + + private final String metadata; + + private final Boolean isGiftable; + + private final Boolean isShippable; + + private final Boolean enabledForCheckout; + + private final Boolean enabledInPortal; + + private final String redirectUrl; + + private final Boolean isRecurring; + + private final String giftClaimRedirectUrl; + + private final Boolean includedInMrr; + + private final String unit; + + private final List pc2MigrationItemPrices; + + private Pc2MigrationItemUpdateParams(Pc2MigrationItemUpdateBuilder builder) { + + this.name = builder.name; + + this.id = builder.id; + + this.pc2MigrationItemFamilyId = builder.pc2MigrationItemFamilyId; + + this.description = builder.description; + + this.metadata = builder.metadata; + + this.isGiftable = builder.isGiftable; + + this.isShippable = builder.isShippable; + + this.enabledForCheckout = builder.enabledForCheckout; + + this.enabledInPortal = builder.enabledInPortal; + + this.redirectUrl = builder.redirectUrl; + + this.isRecurring = builder.isRecurring; + + this.giftClaimRedirectUrl = builder.giftClaimRedirectUrl; + + this.includedInMrr = builder.includedInMrr; + + this.unit = builder.unit; + + this.pc2MigrationItemPrices = builder.pc2MigrationItemPrices; + } + + public String getName() { + return name; + } + + public String getId() { + return id; + } + + public String getPc2MigrationItemFamilyId() { + return pc2MigrationItemFamilyId; + } + + public String getDescription() { + return description; + } + + public String getMetadata() { + return metadata; + } + + public Boolean getIsGiftable() { + return isGiftable; + } + + public Boolean getIsShippable() { + return isShippable; + } + + public Boolean getEnabledForCheckout() { + return enabledForCheckout; + } + + public Boolean getEnabledInPortal() { + return enabledInPortal; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public Boolean getIsRecurring() { + return isRecurring; + } + + public String getGiftClaimRedirectUrl() { + return giftClaimRedirectUrl; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getUnit() { + return unit; + } + + public List getPc2MigrationItemPrices() { + return pc2MigrationItemPrices; + } + + /** 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.id != null) { + + formData.put("id", this.id); + } + + if (this.pc2MigrationItemFamilyId != null) { + + formData.put("pc2_migration_item_family_id", this.pc2MigrationItemFamilyId); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.metadata != null) { + + formData.put("metadata", this.metadata); + } + + if (this.isGiftable != null) { + + formData.put("is_giftable", this.isGiftable); + } + + if (this.isShippable != null) { + + formData.put("is_shippable", this.isShippable); + } + + if (this.enabledForCheckout != null) { + + formData.put("enabled_for_checkout", this.enabledForCheckout); + } + + if (this.enabledInPortal != null) { + + formData.put("enabled_in_portal", this.enabledInPortal); + } + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.isRecurring != null) { + + formData.put("is_recurring", this.isRecurring); + } + + if (this.giftClaimRedirectUrl != null) { + + formData.put("gift_claim_redirect_url", this.giftClaimRedirectUrl); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.unit != null) { + + formData.put("unit", this.unit); + } + + if (this.pc2MigrationItemPrices != null) { + + // List of objects + for (int i = 0; i < this.pc2MigrationItemPrices.size(); i++) { + Pc2MigrationItemPricesParams item = this.pc2MigrationItemPrices.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "pc2_migration_item_prices[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for Pc2MigrationItemUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static Pc2MigrationItemUpdateBuilder builder() { + return new Pc2MigrationItemUpdateBuilder(); + } + + public static final class Pc2MigrationItemUpdateBuilder { + + private String name; + + private String id; + + private String pc2MigrationItemFamilyId; + + private String description; + + private String metadata; + + private Boolean isGiftable; + + private Boolean isShippable; + + private Boolean enabledForCheckout; + + private Boolean enabledInPortal; + + private String redirectUrl; + + private Boolean isRecurring; + + private String giftClaimRedirectUrl; + + private Boolean includedInMrr; + + private String unit; + + private List pc2MigrationItemPrices; + + private Pc2MigrationItemUpdateBuilder() {} + + public Pc2MigrationItemUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public Pc2MigrationItemUpdateBuilder id(String value) { + this.id = value; + return this; + } + + public Pc2MigrationItemUpdateBuilder pc2MigrationItemFamilyId(String value) { + this.pc2MigrationItemFamilyId = value; + return this; + } + + public Pc2MigrationItemUpdateBuilder description(String value) { + this.description = value; + return this; + } + + public Pc2MigrationItemUpdateBuilder metadata(String value) { + this.metadata = value; + return this; + } + + public Pc2MigrationItemUpdateBuilder isGiftable(Boolean value) { + this.isGiftable = value; + return this; + } + + public Pc2MigrationItemUpdateBuilder isShippable(Boolean value) { + this.isShippable = value; + return this; + } + + public Pc2MigrationItemUpdateBuilder enabledForCheckout(Boolean value) { + this.enabledForCheckout = value; + return this; + } + + public Pc2MigrationItemUpdateBuilder enabledInPortal(Boolean value) { + this.enabledInPortal = value; + return this; + } + + public Pc2MigrationItemUpdateBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public Pc2MigrationItemUpdateBuilder isRecurring(Boolean value) { + this.isRecurring = value; + return this; + } + + public Pc2MigrationItemUpdateBuilder giftClaimRedirectUrl(String value) { + this.giftClaimRedirectUrl = value; + return this; + } + + public Pc2MigrationItemUpdateBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public Pc2MigrationItemUpdateBuilder unit(String value) { + this.unit = value; + return this; + } + + public Pc2MigrationItemUpdateBuilder pc2MigrationItemPrices( + List value) { + this.pc2MigrationItemPrices = value; + return this; + } + + public Pc2MigrationItemUpdateParams build() { + return new Pc2MigrationItemUpdateParams(this); + } + } + + public static final class Pc2MigrationItemPricesParams { + + private final String id; + + private final String name; + + private final String description; + + private final String metadata; + + private final String refEntityId; + + private Pc2MigrationItemPricesParams(Pc2MigrationItemPricesBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.description = builder.description; + + this.metadata = builder.metadata; + + this.refEntityId = builder.refEntityId; + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public String getMetadata() { + return metadata; + } + + public String getRefEntityId() { + return refEntityId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.metadata != null) { + + formData.put("metadata", this.metadata); + } + + if (this.refEntityId != null) { + + formData.put("ref_entity_id", this.refEntityId); + } + + return formData; + } + + /** Create a new builder for Pc2MigrationItemPricesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static Pc2MigrationItemPricesBuilder builder() { + return new Pc2MigrationItemPricesBuilder(); + } + + public static final class Pc2MigrationItemPricesBuilder { + + private String id; + + private String name; + + private String description; + + private String metadata; + + private String refEntityId; + + private Pc2MigrationItemPricesBuilder() {} + + public Pc2MigrationItemPricesBuilder id(String value) { + this.id = value; + return this; + } + + public Pc2MigrationItemPricesBuilder name(String value) { + this.name = value; + return this; + } + + public Pc2MigrationItemPricesBuilder description(String value) { + this.description = value; + return this; + } + + public Pc2MigrationItemPricesBuilder metadata(String value) { + this.metadata = value; + return this; + } + + public Pc2MigrationItemPricesBuilder refEntityId(String value) { + this.refEntityId = value; + return this; + } + + public Pc2MigrationItemPricesParams build() { + return new Pc2MigrationItemPricesParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemCreateResponse.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemCreateResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemCreateResponse.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemCreateResponse.java index 5a2611f6..30746fdf 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemCreateResponse.java @@ -1,6 +1,6 @@ -package com.chargebee.v4.core.responses.pc2MigrationItem; +package com.chargebee.v4.models.pc2MigrationItem.responses; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.transport.Response; /** diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemDeleteResponse.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemDeleteResponse.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemDeleteResponse.java index 2c605d90..c0aa3803 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemDeleteResponse.java @@ -1,6 +1,6 @@ -package com.chargebee.v4.core.responses.pc2MigrationItem; +package com.chargebee.v4.models.pc2MigrationItem.responses; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemListApplicableAddonsResponse.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemListApplicableAddonsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemListApplicableAddonsResponse.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemListApplicableAddonsResponse.java index afad283f..62df4ac7 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemListApplicableAddonsResponse.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemListApplicableAddonsResponse.java @@ -1,11 +1,12 @@ -package com.chargebee.v4.core.responses.pc2MigrationItem; +package com.chargebee.v4.models.pc2MigrationItem.responses; import java.util.List; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.Pc2MigrationItemService; -import com.chargebee.v4.core.models.pc2MigrationItem.params.Pc2MigrationItemListApplicableAddonsParams; +import com.chargebee.v4.services.Pc2MigrationItemService; +import com.chargebee.v4.models.pc2MigrationItem.params.Pc2MigrationItemListApplicableAddonsParams; /** * Immutable response object for Pc2MigrationItemListApplicableAddons operation. Contains paginated @@ -102,9 +103,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 Pc2MigrationItemListApplicableAddonsResponse nextPage() throws Exception { + public Pc2MigrationItemListApplicableAddonsResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemListResponse.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemListResponse.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemListResponse.java index f512d6df..0df83f65 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemListResponse.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemListResponse.java @@ -1,11 +1,12 @@ -package com.chargebee.v4.core.responses.pc2MigrationItem; +package com.chargebee.v4.models.pc2MigrationItem.responses; import java.util.List; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.Pc2MigrationItemService; -import com.chargebee.v4.core.models.pc2MigrationItem.params.Pc2MigrationItemListParams; +import com.chargebee.v4.services.Pc2MigrationItemService; +import com.chargebee.v4.models.pc2MigrationItem.params.Pc2MigrationItemListParams; /** Immutable response object for Pc2MigrationItemList operation. Contains paginated list data. */ public final class Pc2MigrationItemListResponse { @@ -97,9 +98,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 Pc2MigrationItemListResponse nextPage() throws Exception { + public Pc2MigrationItemListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemRetrieveResponse.java new file mode 100644 index 00000000..57dc9e77 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemRetrieveResponse.java @@ -0,0 +1,72 @@ +package com.chargebee.v4.models.pc2MigrationItem.responses; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for Pc2MigrationItemRetrieve operation. Contains the response data from + * a single resource get operation. + */ +public final class Pc2MigrationItemRetrieveResponse extends BaseResponse { + private final Object pc2MigrationItem; + + private Pc2MigrationItemRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.pc2MigrationItem = builder.pc2MigrationItem; + } + + /** Parse JSON response into Pc2MigrationItemRetrieveResponse object. */ + public static Pc2MigrationItemRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into Pc2MigrationItemRetrieveResponse object with HTTP response. */ + public static Pc2MigrationItemRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + builder.pc2MigrationItem(JsonUtil.getObject(json, "pc2_migration_item")); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse Pc2MigrationItemRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for Pc2MigrationItemRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for Pc2MigrationItemRetrieveResponse. */ + public static class Builder { + + private Object pc2MigrationItem; + + private Response httpResponse; + + private Builder() {} + + public Builder pc2MigrationItem(Object pc2MigrationItem) { + this.pc2MigrationItem = pc2MigrationItem; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public Pc2MigrationItemRetrieveResponse build() { + return new Pc2MigrationItemRetrieveResponse(this); + } + } + + /** Get the pc2MigrationItem from the response. */ + public Object getPc2MigrationItem() { + return pc2MigrationItem; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemUpdateResponse.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemUpdateResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemUpdateResponse.java index 6ad6220e..153a4bb7 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItem/Pc2MigrationItemUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/responses/Pc2MigrationItemUpdateResponse.java @@ -1,6 +1,6 @@ -package com.chargebee.v4.core.responses.pc2MigrationItem; +package com.chargebee.v4.models.pc2MigrationItem.responses; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.transport.Response; /** diff --git a/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyCreateParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyCreateParams.java new file mode 100644 index 00000000..061ead60 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyCreateParams.java @@ -0,0 +1,140 @@ +/* + * 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.pc2MigrationItemFamily.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class Pc2MigrationItemFamilyCreateParams { + + private final String name; + + private final String id; + + private final String description; + + private final Boolean isDefault; + + private final String pc2MigrationId; + + private Pc2MigrationItemFamilyCreateParams(Pc2MigrationItemFamilyCreateBuilder builder) { + + this.name = builder.name; + + this.id = builder.id; + + this.description = builder.description; + + this.isDefault = builder.isDefault; + + this.pc2MigrationId = builder.pc2MigrationId; + } + + public String getName() { + return name; + } + + public String getId() { + return id; + } + + public String getDescription() { + return description; + } + + public Boolean getIsDefault() { + return isDefault; + } + + public String getPc2MigrationId() { + return pc2MigrationId; + } + + /** 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.id != null) { + + formData.put("id", this.id); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.isDefault != null) { + + formData.put("is_default", this.isDefault); + } + + if (this.pc2MigrationId != null) { + + formData.put("pc2_migration_id", this.pc2MigrationId); + } + + return formData; + } + + /** Create a new builder for Pc2MigrationItemFamilyCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static Pc2MigrationItemFamilyCreateBuilder builder() { + return new Pc2MigrationItemFamilyCreateBuilder(); + } + + public static final class Pc2MigrationItemFamilyCreateBuilder { + + private String name; + + private String id; + + private String description; + + private Boolean isDefault; + + private String pc2MigrationId; + + private Pc2MigrationItemFamilyCreateBuilder() {} + + public Pc2MigrationItemFamilyCreateBuilder name(String value) { + this.name = value; + return this; + } + + public Pc2MigrationItemFamilyCreateBuilder id(String value) { + this.id = value; + return this; + } + + public Pc2MigrationItemFamilyCreateBuilder description(String value) { + this.description = value; + return this; + } + + public Pc2MigrationItemFamilyCreateBuilder isDefault(Boolean value) { + this.isDefault = value; + return this; + } + + public Pc2MigrationItemFamilyCreateBuilder pc2MigrationId(String value) { + this.pc2MigrationId = value; + return this; + } + + public Pc2MigrationItemFamilyCreateParams build() { + return new Pc2MigrationItemFamilyCreateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyDeleteParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyDeleteParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyDeleteParams.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyDeleteParams.java index abe49523..aed845d0 100644 --- a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyDeleteParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyDeleteParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pc2MigrationItemFamily.params; +package com.chargebee.v4.models.pc2MigrationItemFamily.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class Pc2MigrationItemFamilyDeleteParams { - private final Map formData; - - private Pc2MigrationItemFamilyDeleteParams(Pc2MigrationItemFamilyDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private Pc2MigrationItemFamilyDeleteParams(Pc2MigrationItemFamilyDeleteBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static Pc2MigrationItemFamilyDeleteBuilder builder() { } public static final class Pc2MigrationItemFamilyDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); private Pc2MigrationItemFamilyDeleteBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyListParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyListParams.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyListParams.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyListParams.java index 5ece45db..6a491053 100644 --- a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyListParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pc2MigrationItemFamily.params; +package com.chargebee.v4.models.pc2MigrationItemFamily.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyRetrieveParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyRetrieveParams.java index e42558b0..779db7e3 100644 --- a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pc2MigrationItemFamily.params; +package com.chargebee.v4.models.pc2MigrationItemFamily.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyUpdateParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyUpdateParams.java new file mode 100644 index 00000000..6df48b0e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/params/Pc2MigrationItemFamilyUpdateParams.java @@ -0,0 +1,120 @@ +/* + * 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.pc2MigrationItemFamily.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class Pc2MigrationItemFamilyUpdateParams { + + private final String name; + + private final String id; + + private final Boolean isDefault; + + private final String description; + + private Pc2MigrationItemFamilyUpdateParams(Pc2MigrationItemFamilyUpdateBuilder builder) { + + this.name = builder.name; + + this.id = builder.id; + + this.isDefault = builder.isDefault; + + this.description = builder.description; + } + + public String getName() { + return name; + } + + public String getId() { + return id; + } + + public Boolean getIsDefault() { + return isDefault; + } + + public String getDescription() { + return description; + } + + /** 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.id != null) { + + formData.put("id", this.id); + } + + if (this.isDefault != null) { + + formData.put("is_default", this.isDefault); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + return formData; + } + + /** Create a new builder for Pc2MigrationItemFamilyUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static Pc2MigrationItemFamilyUpdateBuilder builder() { + return new Pc2MigrationItemFamilyUpdateBuilder(); + } + + public static final class Pc2MigrationItemFamilyUpdateBuilder { + + private String name; + + private String id; + + private Boolean isDefault; + + private String description; + + private Pc2MigrationItemFamilyUpdateBuilder() {} + + public Pc2MigrationItemFamilyUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public Pc2MigrationItemFamilyUpdateBuilder id(String value) { + this.id = value; + return this; + } + + public Pc2MigrationItemFamilyUpdateBuilder isDefault(Boolean value) { + this.isDefault = value; + return this; + } + + public Pc2MigrationItemFamilyUpdateBuilder description(String value) { + this.description = value; + return this; + } + + public Pc2MigrationItemFamilyUpdateParams build() { + return new Pc2MigrationItemFamilyUpdateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemFamily/Pc2MigrationItemFamilyCreateResponse.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/responses/Pc2MigrationItemFamilyCreateResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemFamily/Pc2MigrationItemFamilyCreateResponse.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/responses/Pc2MigrationItemFamilyCreateResponse.java index 4f207e27..91ebce5d 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemFamily/Pc2MigrationItemFamilyCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/responses/Pc2MigrationItemFamilyCreateResponse.java @@ -1,6 +1,6 @@ -package com.chargebee.v4.core.responses.pc2MigrationItemFamily; +package com.chargebee.v4.models.pc2MigrationItemFamily.responses; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.transport.Response; /** diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemFamily/Pc2MigrationItemFamilyDeleteResponse.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/responses/Pc2MigrationItemFamilyDeleteResponse.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemFamily/Pc2MigrationItemFamilyDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/responses/Pc2MigrationItemFamilyDeleteResponse.java index 03507426..7153f26e 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemFamily/Pc2MigrationItemFamilyDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/responses/Pc2MigrationItemFamilyDeleteResponse.java @@ -1,6 +1,6 @@ -package com.chargebee.v4.core.responses.pc2MigrationItemFamily; +package com.chargebee.v4.models.pc2MigrationItemFamily.responses; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemFamily/Pc2MigrationItemFamilyListResponse.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/responses/Pc2MigrationItemFamilyListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemFamily/Pc2MigrationItemFamilyListResponse.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/responses/Pc2MigrationItemFamilyListResponse.java index 77d4aa82..1f9fe18c 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemFamily/Pc2MigrationItemFamilyListResponse.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/responses/Pc2MigrationItemFamilyListResponse.java @@ -1,11 +1,12 @@ -package com.chargebee.v4.core.responses.pc2MigrationItemFamily; +package com.chargebee.v4.models.pc2MigrationItemFamily.responses; import java.util.List; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.Pc2MigrationItemFamilyService; -import com.chargebee.v4.core.models.pc2MigrationItemFamily.params.Pc2MigrationItemFamilyListParams; +import com.chargebee.v4.services.Pc2MigrationItemFamilyService; +import com.chargebee.v4.models.pc2MigrationItemFamily.params.Pc2MigrationItemFamilyListParams; /** * Immutable response object for Pc2MigrationItemFamilyList operation. Contains paginated list data. @@ -99,9 +100,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 Pc2MigrationItemFamilyListResponse nextPage() throws Exception { + public Pc2MigrationItemFamilyListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/responses/Pc2MigrationItemFamilyRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/responses/Pc2MigrationItemFamilyRetrieveResponse.java new file mode 100644 index 00000000..485bb3af --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/responses/Pc2MigrationItemFamilyRetrieveResponse.java @@ -0,0 +1,74 @@ +package com.chargebee.v4.models.pc2MigrationItemFamily.responses; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for Pc2MigrationItemFamilyRetrieve operation. Contains the response + * data from a single resource get operation. + */ +public final class Pc2MigrationItemFamilyRetrieveResponse extends BaseResponse { + private final Object pc2MigrationItemFamily; + + private Pc2MigrationItemFamilyRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.pc2MigrationItemFamily = builder.pc2MigrationItemFamily; + } + + /** Parse JSON response into Pc2MigrationItemFamilyRetrieveResponse object. */ + public static Pc2MigrationItemFamilyRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into Pc2MigrationItemFamilyRetrieveResponse object with HTTP response. */ + public static Pc2MigrationItemFamilyRetrieveResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + builder.pc2MigrationItemFamily(JsonUtil.getObject(json, "pc2_migration_item_family")); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse Pc2MigrationItemFamilyRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for Pc2MigrationItemFamilyRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for Pc2MigrationItemFamilyRetrieveResponse. */ + public static class Builder { + + private Object pc2MigrationItemFamily; + + private Response httpResponse; + + private Builder() {} + + public Builder pc2MigrationItemFamily(Object pc2MigrationItemFamily) { + this.pc2MigrationItemFamily = pc2MigrationItemFamily; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public Pc2MigrationItemFamilyRetrieveResponse build() { + return new Pc2MigrationItemFamilyRetrieveResponse(this); + } + } + + /** Get the pc2MigrationItemFamily from the response. */ + public Object getPc2MigrationItemFamily() { + return pc2MigrationItemFamily; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemFamily/Pc2MigrationItemFamilyUpdateResponse.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/responses/Pc2MigrationItemFamilyUpdateResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemFamily/Pc2MigrationItemFamilyUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/responses/Pc2MigrationItemFamilyUpdateResponse.java index 034810f0..92aedb32 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemFamily/Pc2MigrationItemFamilyUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemFamily/responses/Pc2MigrationItemFamilyUpdateResponse.java @@ -1,6 +1,6 @@ -package com.chargebee.v4.core.responses.pc2MigrationItemFamily; +package com.chargebee.v4.models.pc2MigrationItemFamily.responses; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.transport.Response; /** diff --git a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceDeleteParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceDeleteParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceDeleteParams.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceDeleteParams.java index d4bf2cb3..a072d92f 100644 --- a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceDeleteParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceDeleteParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pc2MigrationItemPrice.params; +package com.chargebee.v4.models.pc2MigrationItemPrice.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class Pc2MigrationItemPriceDeleteParams { - private final Map formData; - - private Pc2MigrationItemPriceDeleteParams(Pc2MigrationItemPriceDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private Pc2MigrationItemPriceDeleteParams(Pc2MigrationItemPriceDeleteBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static Pc2MigrationItemPriceDeleteBuilder builder() { } public static final class Pc2MigrationItemPriceDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); private Pc2MigrationItemPriceDeleteBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceListParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceListParams.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceListParams.java index 597a0f0b..8a9f9922 100644 --- a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceListParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pc2MigrationItemPrice.params; +package com.chargebee.v4.models.pc2MigrationItemPrice.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceRetrieveParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceRetrieveParams.java index c545a4a7..b43acaef 100644 --- a/src/main/java/com/chargebee/v4/core/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pc2MigrationItemPrice.params; +package com.chargebee.v4.models.pc2MigrationItemPrice.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceUpdateParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceUpdateParams.java new file mode 100644 index 00000000..9e3ea147 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceUpdateParams.java @@ -0,0 +1,160 @@ +/* + * 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.pc2MigrationItemPrice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class Pc2MigrationItemPriceUpdateParams { + + private final String name; + + private final String pc2MigrationItemId; + + private final String description; + + private final String metadata; + + private final String sanitizedPc1Id; + + private final Boolean isPrimaryAttachedItem; + + private Pc2MigrationItemPriceUpdateParams(Pc2MigrationItemPriceUpdateBuilder builder) { + + this.name = builder.name; + + this.pc2MigrationItemId = builder.pc2MigrationItemId; + + this.description = builder.description; + + this.metadata = builder.metadata; + + this.sanitizedPc1Id = builder.sanitizedPc1Id; + + this.isPrimaryAttachedItem = builder.isPrimaryAttachedItem; + } + + public String getName() { + return name; + } + + public String getPc2MigrationItemId() { + return pc2MigrationItemId; + } + + public String getDescription() { + return description; + } + + public String getMetadata() { + return metadata; + } + + public String getSanitizedPc1Id() { + return sanitizedPc1Id; + } + + public Boolean getIsPrimaryAttachedItem() { + return isPrimaryAttachedItem; + } + + /** 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.pc2MigrationItemId != null) { + + formData.put("pc2_migration_item_id", this.pc2MigrationItemId); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.metadata != null) { + + formData.put("metadata", this.metadata); + } + + if (this.sanitizedPc1Id != null) { + + formData.put("sanitized_pc1_id", this.sanitizedPc1Id); + } + + if (this.isPrimaryAttachedItem != null) { + + formData.put("is_primary_attached_item", this.isPrimaryAttachedItem); + } + + return formData; + } + + /** Create a new builder for Pc2MigrationItemPriceUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static Pc2MigrationItemPriceUpdateBuilder builder() { + return new Pc2MigrationItemPriceUpdateBuilder(); + } + + public static final class Pc2MigrationItemPriceUpdateBuilder { + + private String name; + + private String pc2MigrationItemId; + + private String description; + + private String metadata; + + private String sanitizedPc1Id; + + private Boolean isPrimaryAttachedItem; + + private Pc2MigrationItemPriceUpdateBuilder() {} + + public Pc2MigrationItemPriceUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public Pc2MigrationItemPriceUpdateBuilder pc2MigrationItemId(String value) { + this.pc2MigrationItemId = value; + return this; + } + + public Pc2MigrationItemPriceUpdateBuilder description(String value) { + this.description = value; + return this; + } + + public Pc2MigrationItemPriceUpdateBuilder metadata(String value) { + this.metadata = value; + return this; + } + + public Pc2MigrationItemPriceUpdateBuilder sanitizedPc1Id(String value) { + this.sanitizedPc1Id = value; + return this; + } + + public Pc2MigrationItemPriceUpdateBuilder isPrimaryAttachedItem(Boolean value) { + this.isPrimaryAttachedItem = value; + return this; + } + + public Pc2MigrationItemPriceUpdateParams build() { + return new Pc2MigrationItemPriceUpdateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemPrice/Pc2MigrationItemPriceDeleteResponse.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/responses/Pc2MigrationItemPriceDeleteResponse.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemPrice/Pc2MigrationItemPriceDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/responses/Pc2MigrationItemPriceDeleteResponse.java index 90beef1f..4f9bec27 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemPrice/Pc2MigrationItemPriceDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/responses/Pc2MigrationItemPriceDeleteResponse.java @@ -1,6 +1,6 @@ -package com.chargebee.v4.core.responses.pc2MigrationItemPrice; +package com.chargebee.v4.models.pc2MigrationItemPrice.responses; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemPrice/Pc2MigrationItemPriceListResponse.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/responses/Pc2MigrationItemPriceListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemPrice/Pc2MigrationItemPriceListResponse.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/responses/Pc2MigrationItemPriceListResponse.java index a62ac7e6..58fbc675 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemPrice/Pc2MigrationItemPriceListResponse.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/responses/Pc2MigrationItemPriceListResponse.java @@ -1,11 +1,12 @@ -package com.chargebee.v4.core.responses.pc2MigrationItemPrice; +package com.chargebee.v4.models.pc2MigrationItemPrice.responses; import java.util.List; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.Pc2MigrationItemPriceService; -import com.chargebee.v4.core.models.pc2MigrationItemPrice.params.Pc2MigrationItemPriceListParams; +import com.chargebee.v4.services.Pc2MigrationItemPriceService; +import com.chargebee.v4.models.pc2MigrationItemPrice.params.Pc2MigrationItemPriceListParams; /** * Immutable response object for Pc2MigrationItemPriceList operation. Contains paginated list data. @@ -99,9 +100,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 Pc2MigrationItemPriceListResponse nextPage() throws Exception { + public Pc2MigrationItemPriceListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/responses/Pc2MigrationItemPriceRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/responses/Pc2MigrationItemPriceRetrieveResponse.java new file mode 100644 index 00000000..0fb13626 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/responses/Pc2MigrationItemPriceRetrieveResponse.java @@ -0,0 +1,73 @@ +package com.chargebee.v4.models.pc2MigrationItemPrice.responses; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for Pc2MigrationItemPriceRetrieve operation. Contains the response data + * from a single resource get operation. + */ +public final class Pc2MigrationItemPriceRetrieveResponse extends BaseResponse { + private final Object pc2MigrationItemPrice; + + private Pc2MigrationItemPriceRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.pc2MigrationItemPrice = builder.pc2MigrationItemPrice; + } + + /** Parse JSON response into Pc2MigrationItemPriceRetrieveResponse object. */ + public static Pc2MigrationItemPriceRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into Pc2MigrationItemPriceRetrieveResponse object with HTTP response. */ + public static Pc2MigrationItemPriceRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + builder.pc2MigrationItemPrice(JsonUtil.getObject(json, "pc2_migration_item_price")); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse Pc2MigrationItemPriceRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for Pc2MigrationItemPriceRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for Pc2MigrationItemPriceRetrieveResponse. */ + public static class Builder { + + private Object pc2MigrationItemPrice; + + private Response httpResponse; + + private Builder() {} + + public Builder pc2MigrationItemPrice(Object pc2MigrationItemPrice) { + this.pc2MigrationItemPrice = pc2MigrationItemPrice; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public Pc2MigrationItemPriceRetrieveResponse build() { + return new Pc2MigrationItemPriceRetrieveResponse(this); + } + } + + /** Get the pc2MigrationItemPrice from the response. */ + public Object getPc2MigrationItemPrice() { + return pc2MigrationItemPrice; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemPrice/Pc2MigrationItemPriceUpdateResponse.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/responses/Pc2MigrationItemPriceUpdateResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemPrice/Pc2MigrationItemPriceUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/responses/Pc2MigrationItemPriceUpdateResponse.java index 1e1ac1de..f5bdb021 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pc2MigrationItemPrice/Pc2MigrationItemPriceUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/responses/Pc2MigrationItemPriceUpdateResponse.java @@ -1,6 +1,6 @@ -package com.chargebee.v4.core.responses.pc2MigrationItemPrice; +package com.chargebee.v4.models.pc2MigrationItemPrice.responses; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.transport.Response; /** diff --git a/src/main/java/com/chargebee/v4/core/models/personalizedOffer/PersonalizedOffer.java b/src/main/java/com/chargebee/v4/models/personalizedOffer/PersonalizedOffer.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/personalizedOffer/PersonalizedOffer.java rename to src/main/java/com/chargebee/v4/models/personalizedOffer/PersonalizedOffer.java index 56c3b88c..4aa779b1 100644 --- a/src/main/java/com/chargebee/v4/core/models/personalizedOffer/PersonalizedOffer.java +++ b/src/main/java/com/chargebee/v4/models/personalizedOffer/PersonalizedOffer.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.personalizedOffer; +package com.chargebee.v4.models.personalizedOffer; import com.chargebee.v4.internal.JsonUtil; import java.util.List; diff --git a/src/main/java/com/chargebee/v4/models/personalizedOffer/params/PersonalizedOffersParams.java b/src/main/java/com/chargebee/v4/models/personalizedOffer/params/PersonalizedOffersParams.java new file mode 100644 index 00000000..cba1109a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/personalizedOffer/params/PersonalizedOffersParams.java @@ -0,0 +1,355 @@ +/* + * 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.personalizedOffer.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class PersonalizedOffersParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final List roles; + + private final String externalUserId; + + private final String subscriptionId; + + private final String customerId; + + private final java.util.Map custom; + + private final RequestContextParams requestContext; + + private PersonalizedOffersParams(PersonalizedOffersBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.roles = builder.roles; + + this.externalUserId = builder.externalUserId; + + this.subscriptionId = builder.subscriptionId; + + this.customerId = builder.customerId; + + this.custom = builder.custom; + + this.requestContext = builder.requestContext; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getEmail() { + return email; + } + + public List getRoles() { + return roles; + } + + public String getExternalUserId() { + return externalUserId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getCustomerId() { + return customerId; + } + + public java.util.Map getCustom() { + return custom; + } + + public RequestContextParams getRequestContext() { + return requestContext; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + 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.roles != null) { + + formData.put("roles", this.roles); + } + + if (this.externalUserId != null) { + + formData.put("external_user_id", this.externalUserId); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.custom != null) { + + formData.put("custom", JsonUtil.toJson(this.custom)); + } + + if (this.requestContext != null) { + + // Single object + Map nestedData = this.requestContext.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "request_context[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for PersonalizedOffersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PersonalizedOffersBuilder builder() { + return new PersonalizedOffersBuilder(); + } + + public static final class PersonalizedOffersBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private List roles; + + private String externalUserId; + + private String subscriptionId; + + private String customerId; + + private java.util.Map custom; + + private RequestContextParams requestContext; + + private PersonalizedOffersBuilder() {} + + public PersonalizedOffersBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public PersonalizedOffersBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public PersonalizedOffersBuilder email(String value) { + this.email = value; + return this; + } + + public PersonalizedOffersBuilder roles(List value) { + this.roles = value; + return this; + } + + public PersonalizedOffersBuilder externalUserId(String value) { + this.externalUserId = value; + return this; + } + + public PersonalizedOffersBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public PersonalizedOffersBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public PersonalizedOffersBuilder custom(java.util.Map value) { + this.custom = value; + return this; + } + + public PersonalizedOffersBuilder requestContext(RequestContextParams value) { + this.requestContext = value; + return this; + } + + public PersonalizedOffersParams build() { + return new PersonalizedOffersParams(this); + } + } + + public static final class RequestContextParams { + + private final String userAgent; + + private final String locale; + + private final String timezone; + + private final String url; + + private final String referrerUrl; + + private RequestContextParams(RequestContextBuilder builder) { + + this.userAgent = builder.userAgent; + + this.locale = builder.locale; + + this.timezone = builder.timezone; + + this.url = builder.url; + + this.referrerUrl = builder.referrerUrl; + } + + public String getUserAgent() { + return userAgent; + } + + public String getLocale() { + return locale; + } + + public String getTimezone() { + return timezone; + } + + public String getUrl() { + return url; + } + + public String getReferrerUrl() { + return referrerUrl; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.userAgent != null) { + + formData.put("user_agent", this.userAgent); + } + + if (this.locale != null) { + + formData.put("locale", this.locale); + } + + if (this.timezone != null) { + + formData.put("timezone", this.timezone); + } + + if (this.url != null) { + + formData.put("url", this.url); + } + + if (this.referrerUrl != null) { + + formData.put("referrer_url", this.referrerUrl); + } + + return formData; + } + + /** Create a new builder for RequestContextParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RequestContextBuilder builder() { + return new RequestContextBuilder(); + } + + public static final class RequestContextBuilder { + + private String userAgent; + + private String locale; + + private String timezone; + + private String url; + + private String referrerUrl; + + private RequestContextBuilder() {} + + public RequestContextBuilder userAgent(String value) { + this.userAgent = value; + return this; + } + + public RequestContextBuilder locale(String value) { + this.locale = value; + return this; + } + + public RequestContextBuilder timezone(String value) { + this.timezone = value; + return this; + } + + public RequestContextBuilder url(String value) { + this.url = value; + return this; + } + + public RequestContextBuilder referrerUrl(String value) { + this.referrerUrl = value; + return this; + } + + public RequestContextParams build() { + return new RequestContextParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/personalizedOffer/responses/PersonalizedOffersResponse.java b/src/main/java/com/chargebee/v4/models/personalizedOffer/responses/PersonalizedOffersResponse.java new file mode 100644 index 00000000..1266a53f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/personalizedOffer/responses/PersonalizedOffersResponse.java @@ -0,0 +1,121 @@ +package com.chargebee.v4.models.personalizedOffer.responses; + +import java.util.List; + +import com.chargebee.v4.models.brand.Brand; + +import com.chargebee.v4.models.personalizedOffer.PersonalizedOffer; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import java.sql.Timestamp; + +/** + * Immutable response object for PersonalizedOffers operation. Contains the response data from the + * API. + */ +public final class PersonalizedOffersResponse extends BaseResponse { + private final List personalizedOffers; + + private final Brand brand; + + private final Timestamp expiresAt; + + private PersonalizedOffersResponse(Builder builder) { + super(builder.httpResponse); + + this.personalizedOffers = builder.personalizedOffers; + + this.brand = builder.brand; + + this.expiresAt = builder.expiresAt; + } + + /** Parse JSON response into PersonalizedOffersResponse object. */ + public static PersonalizedOffersResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into PersonalizedOffersResponse object with HTTP response. */ + public static PersonalizedOffersResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + builder.personalizedOffers( + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "personalized_offers")).stream() + .map(PersonalizedOffer::fromJson) + .collect(java.util.stream.Collectors.toList())); + + String __brandJson = JsonUtil.getObject(json, "brand"); + if (__brandJson != null) { + builder.brand(Brand.fromJson(__brandJson)); + } + + builder.expiresAt(JsonUtil.getTimestamp(json, "expires_at")); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PersonalizedOffersResponse from JSON", e); + } + } + + /** Create a new builder for PersonalizedOffersResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PersonalizedOffersResponse. */ + public static class Builder { + + private List personalizedOffers; + + private Brand brand; + + private Timestamp expiresAt; + + private Response httpResponse; + + private Builder() {} + + public Builder personalizedOffers(List personalizedOffers) { + this.personalizedOffers = personalizedOffers; + return this; + } + + public Builder brand(Brand brand) { + this.brand = brand; + return this; + } + + public Builder expiresAt(Timestamp expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public PersonalizedOffersResponse build() { + return new PersonalizedOffersResponse(this); + } + } + + /** Get the personalizedOffers from the response. */ + public List getPersonalizedOffers() { + return personalizedOffers; + } + + /** Get the brand from the response. */ + public Brand getBrand() { + return brand; + } + + /** Get the expiresAt from the response. */ + public Timestamp getExpiresAt() { + return expiresAt; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/plan/Plan.java b/src/main/java/com/chargebee/v4/models/plan/Plan.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/plan/Plan.java rename to src/main/java/com/chargebee/v4/models/plan/Plan.java index 9ac59dfe..e309f21f 100644 --- a/src/main/java/com/chargebee/v4/core/models/plan/Plan.java +++ b/src/main/java/com/chargebee/v4/models/plan/Plan.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.plan; +package com.chargebee.v4.models.plan; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; @@ -70,7 +70,7 @@ public class Plan { private List attachedAddons; private List eventBasedAddons; - private java.util.Map customFields = new java.util.HashMap<>(); + private java.util.Map customFields = new java.util.HashMap<>(); public String getId() { return id; @@ -304,7 +304,7 @@ public List getEventBasedAddons() { * * @return map containing all custom fields */ - public java.util.Map getCustomFields() { + public java.util.Map getCustomFields() { return customFields; } @@ -314,7 +314,7 @@ public java.util.Map getCustomFields() { * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") * @return the value of the custom field, or null if not present */ - public Object getCustomField(String fieldName) { + public String getCustomField(String fieldName) { return customFields.get(fieldName); } @@ -634,7 +634,7 @@ public static Channel fromString(String value) { public static Plan fromJson(String json) { Plan obj = new Plan(); - // Parse JSON to extract all keys + // Parse JSON to extract all keys for custom field extraction java.util.Set knownFields = new java.util.HashSet<>(); knownFields.add("id"); @@ -897,9 +897,9 @@ public static Plan fromJson(String json) { * @param knownFields set of known field names * @return map of custom fields */ - private static java.util.Map extractCustomFields( + private static java.util.Map extractCustomFields( String json, java.util.Set knownFields) { - java.util.Map customFields = new java.util.HashMap<>(); + java.util.Map customFields = new java.util.HashMap<>(); try { // Parse the entire JSON as a map java.util.Map allFields = JsonUtil.parseJsonObjectToMap(json); @@ -908,7 +908,8 @@ private static java.util.Map extractCustomFields( String key = entry.getKey(); // Include fields that start with "cf_" and are not in knownFields if (key != null && key.startsWith("cf_") && !knownFields.contains(key)) { - customFields.put(key, entry.getValue()); + customFields.put( + key, entry.getValue() != null ? String.valueOf(entry.getValue()) : null); } } } diff --git a/src/main/java/com/chargebee/v4/models/plan/params/PlanCopyParams.java b/src/main/java/com/chargebee/v4/models/plan/params/PlanCopyParams.java new file mode 100644 index 00000000..dc9218d4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/plan/params/PlanCopyParams.java @@ -0,0 +1,120 @@ +/* + * 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.plan.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PlanCopyParams { + + private final String fromSite; + + private final String idAtFromSite; + + private final String id; + + private final Boolean forSiteMerging; + + private PlanCopyParams(PlanCopyBuilder builder) { + + this.fromSite = builder.fromSite; + + this.idAtFromSite = builder.idAtFromSite; + + this.id = builder.id; + + this.forSiteMerging = builder.forSiteMerging; + } + + public String getFromSite() { + return fromSite; + } + + public String getIdAtFromSite() { + return idAtFromSite; + } + + public String getId() { + return id; + } + + public Boolean getForSiteMerging() { + return forSiteMerging; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.fromSite != null) { + + formData.put("from_site", this.fromSite); + } + + if (this.idAtFromSite != null) { + + formData.put("id_at_from_site", this.idAtFromSite); + } + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.forSiteMerging != null) { + + formData.put("for_site_merging", this.forSiteMerging); + } + + return formData; + } + + /** Create a new builder for PlanCopyParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PlanCopyBuilder builder() { + return new PlanCopyBuilder(); + } + + public static final class PlanCopyBuilder { + + private String fromSite; + + private String idAtFromSite; + + private String id; + + private Boolean forSiteMerging; + + private PlanCopyBuilder() {} + + public PlanCopyBuilder fromSite(String value) { + this.fromSite = value; + return this; + } + + public PlanCopyBuilder idAtFromSite(String value) { + this.idAtFromSite = value; + return this; + } + + public PlanCopyBuilder id(String value) { + this.id = value; + return this; + } + + public PlanCopyBuilder forSiteMerging(Boolean value) { + this.forSiteMerging = value; + return this; + } + + public PlanCopyParams build() { + return new PlanCopyParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/plan/params/PlanCreateParams.java b/src/main/java/com/chargebee/v4/models/plan/params/PlanCreateParams.java new file mode 100644 index 00000000..5a2486f6 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/plan/params/PlanCreateParams.java @@ -0,0 +1,2069 @@ +/* + * 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.plan.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; + +public final class PlanCreateParams { + + private final String id; + + private final String name; + + private final String invoiceName; + + private final String description; + + private final Integer trialPeriod; + + private final TrialPeriodUnit trialPeriodUnit; + + private final TrialEndAction trialEndAction; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Long setupCost; + + private final Long price; + + private final String priceInDecimal; + + private final String currencyCode; + + private final Integer billingCycles; + + private final PricingModel pricingModel; + + private final ChargeModel chargeModel; + + private final Integer freeQuantity; + + private final String freeQuantityInDecimal; + + private final AddonApplicability addonApplicability; + + private final Number downgradePenalty; + + private final String redirectUrl; + + private final Boolean enabledInHostedPages; + + private final Boolean enabledInPortal; + + private final Boolean taxable; + + private final String taxProfileId; + + private final String taxCode; + + private final String hsnCode; + + private final String taxjarProductCode; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final String sku; + + private final String accountingCode; + + private final String accountingCategory1; + + private final String accountingCategory2; + + private final String accountingCategory3; + + private final String accountingCategory4; + + private final Boolean isShippable; + + private final Integer shippingFrequencyPeriod; + + private final ShippingFrequencyPeriodUnit shippingFrequencyPeriodUnit; + + private final String invoiceNotes; + + private final java.util.Map metaData; + + private final Boolean showDescriptionInInvoices; + + private final Boolean showDescriptionInQuotes; + + private final Boolean giftable; + + private final Status status; + + private final String claimUrl; + + private final List tiers; + + private final List taxProvidersFields; + + private final List applicableAddons; + + private final List eventBasedAddons; + + private final List attachedAddons; + + private final Map customFields; + + private PlanCreateParams(PlanCreateBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.invoiceName = builder.invoiceName; + + this.description = builder.description; + + this.trialPeriod = builder.trialPeriod; + + this.trialPeriodUnit = builder.trialPeriodUnit; + + this.trialEndAction = builder.trialEndAction; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.setupCost = builder.setupCost; + + this.price = builder.price; + + this.priceInDecimal = builder.priceInDecimal; + + this.currencyCode = builder.currencyCode; + + this.billingCycles = builder.billingCycles; + + this.pricingModel = builder.pricingModel; + + this.chargeModel = builder.chargeModel; + + this.freeQuantity = builder.freeQuantity; + + this.freeQuantityInDecimal = builder.freeQuantityInDecimal; + + this.addonApplicability = builder.addonApplicability; + + this.downgradePenalty = builder.downgradePenalty; + + this.redirectUrl = builder.redirectUrl; + + this.enabledInHostedPages = builder.enabledInHostedPages; + + this.enabledInPortal = builder.enabledInPortal; + + this.taxable = builder.taxable; + + this.taxProfileId = builder.taxProfileId; + + this.taxCode = builder.taxCode; + + this.hsnCode = builder.hsnCode; + + this.taxjarProductCode = builder.taxjarProductCode; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.sku = builder.sku; + + this.accountingCode = builder.accountingCode; + + this.accountingCategory1 = builder.accountingCategory1; + + this.accountingCategory2 = builder.accountingCategory2; + + this.accountingCategory3 = builder.accountingCategory3; + + this.accountingCategory4 = builder.accountingCategory4; + + this.isShippable = builder.isShippable; + + this.shippingFrequencyPeriod = builder.shippingFrequencyPeriod; + + this.shippingFrequencyPeriodUnit = builder.shippingFrequencyPeriodUnit; + + this.invoiceNotes = builder.invoiceNotes; + + this.metaData = builder.metaData; + + this.showDescriptionInInvoices = builder.showDescriptionInInvoices; + + this.showDescriptionInQuotes = builder.showDescriptionInQuotes; + + this.giftable = builder.giftable; + + this.status = builder.status; + + this.claimUrl = builder.claimUrl; + + this.tiers = builder.tiers; + + this.taxProvidersFields = builder.taxProvidersFields; + + this.applicableAddons = builder.applicableAddons; + + this.eventBasedAddons = builder.eventBasedAddons; + + this.attachedAddons = builder.attachedAddons; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getInvoiceName() { + return invoiceName; + } + + public String getDescription() { + return description; + } + + public Integer getTrialPeriod() { + return trialPeriod; + } + + public TrialPeriodUnit getTrialPeriodUnit() { + return trialPeriodUnit; + } + + public TrialEndAction getTrialEndAction() { + return trialEndAction; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Long getSetupCost() { + return setupCost; + } + + public Long getPrice() { + return price; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public PricingModel getPricingModel() { + return pricingModel; + } + + public ChargeModel getChargeModel() { + return chargeModel; + } + + public Integer getFreeQuantity() { + return freeQuantity; + } + + public String getFreeQuantityInDecimal() { + return freeQuantityInDecimal; + } + + public AddonApplicability getAddonApplicability() { + return addonApplicability; + } + + public Number getDowngradePenalty() { + return downgradePenalty; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public Boolean getEnabledInHostedPages() { + return enabledInHostedPages; + } + + public Boolean getEnabledInPortal() { + return enabledInPortal; + } + + public Boolean getTaxable() { + return taxable; + } + + public String getTaxProfileId() { + return taxProfileId; + } + + public String getTaxCode() { + return taxCode; + } + + public String getHsnCode() { + return hsnCode; + } + + public String getTaxjarProductCode() { + return taxjarProductCode; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public String getSku() { + return sku; + } + + public String getAccountingCode() { + return accountingCode; + } + + public String getAccountingCategory1() { + return accountingCategory1; + } + + public String getAccountingCategory2() { + return accountingCategory2; + } + + public String getAccountingCategory3() { + return accountingCategory3; + } + + public String getAccountingCategory4() { + return accountingCategory4; + } + + public Boolean getIsShippable() { + return isShippable; + } + + public Integer getShippingFrequencyPeriod() { + return shippingFrequencyPeriod; + } + + public ShippingFrequencyPeriodUnit getShippingFrequencyPeriodUnit() { + return shippingFrequencyPeriodUnit; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public java.util.Map getMetaData() { + return metaData; + } + + public Boolean getShowDescriptionInInvoices() { + return showDescriptionInInvoices; + } + + public Boolean getShowDescriptionInQuotes() { + return showDescriptionInQuotes; + } + + public Boolean getGiftable() { + return giftable; + } + + public Status getStatus() { + return status; + } + + public String getClaimUrl() { + return claimUrl; + } + + public List getTiers() { + return tiers; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + public List getApplicableAddons() { + return applicableAddons; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + public List getAttachedAddons() { + return attachedAddons; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.invoiceName != null) { + + formData.put("invoice_name", this.invoiceName); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.trialPeriod != null) { + + formData.put("trial_period", this.trialPeriod); + } + + if (this.trialPeriodUnit != null) { + + formData.put("trial_period_unit", this.trialPeriodUnit); + } + + if (this.trialEndAction != null) { + + formData.put("trial_end_action", this.trialEndAction); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.setupCost != null) { + + formData.put("setup_cost", this.setupCost); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.pricingModel != null) { + + formData.put("pricing_model", this.pricingModel); + } + + if (this.chargeModel != null) { + + formData.put("charge_model", this.chargeModel); + } + + if (this.freeQuantity != null) { + + formData.put("free_quantity", this.freeQuantity); + } + + if (this.freeQuantityInDecimal != null) { + + formData.put("free_quantity_in_decimal", this.freeQuantityInDecimal); + } + + if (this.addonApplicability != null) { + + formData.put("addon_applicability", this.addonApplicability); + } + + if (this.downgradePenalty != null) { + + formData.put("downgrade_penalty", this.downgradePenalty); + } + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.enabledInHostedPages != null) { + + formData.put("enabled_in_hosted_pages", this.enabledInHostedPages); + } + + if (this.enabledInPortal != null) { + + formData.put("enabled_in_portal", this.enabledInPortal); + } + + if (this.taxable != null) { + + formData.put("taxable", this.taxable); + } + + if (this.taxProfileId != null) { + + formData.put("tax_profile_id", this.taxProfileId); + } + + if (this.taxCode != null) { + + formData.put("tax_code", this.taxCode); + } + + if (this.hsnCode != null) { + + formData.put("hsn_code", this.hsnCode); + } + + if (this.taxjarProductCode != null) { + + formData.put("taxjar_product_code", this.taxjarProductCode); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.sku != null) { + + formData.put("sku", this.sku); + } + + if (this.accountingCode != null) { + + formData.put("accounting_code", this.accountingCode); + } + + if (this.accountingCategory1 != null) { + + formData.put("accounting_category1", this.accountingCategory1); + } + + if (this.accountingCategory2 != null) { + + formData.put("accounting_category2", this.accountingCategory2); + } + + if (this.accountingCategory3 != null) { + + formData.put("accounting_category3", this.accountingCategory3); + } + + if (this.accountingCategory4 != null) { + + formData.put("accounting_category4", this.accountingCategory4); + } + + if (this.isShippable != null) { + + formData.put("is_shippable", this.isShippable); + } + + if (this.shippingFrequencyPeriod != null) { + + formData.put("shipping_frequency_period", this.shippingFrequencyPeriod); + } + + if (this.shippingFrequencyPeriodUnit != null) { + + formData.put("shipping_frequency_period_unit", this.shippingFrequencyPeriodUnit); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + if (this.showDescriptionInInvoices != null) { + + formData.put("show_description_in_invoices", this.showDescriptionInInvoices); + } + + if (this.showDescriptionInQuotes != null) { + + formData.put("show_description_in_quotes", this.showDescriptionInQuotes); + } + + if (this.giftable != null) { + + formData.put("giftable", this.giftable); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.claimUrl != null) { + + formData.put("claim_url", this.claimUrl); + } + + if (this.tiers != null) { + + // List of objects + for (int i = 0; i < this.tiers.size(); i++) { + TiersParams item = this.tiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.applicableAddons != null) { + + // List of objects + for (int i = 0; i < this.applicableAddons.size(); i++) { + ApplicableAddonsParams item = this.applicableAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "applicable_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.attachedAddons != null) { + + // List of objects + for (int i = 0; i < this.attachedAddons.size(); i++) { + AttachedAddonsParams item = this.attachedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "attached_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for PlanCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PlanCreateBuilder builder() { + return new PlanCreateBuilder(); + } + + public static final class PlanCreateBuilder { + + private String id; + + private String name; + + private String invoiceName; + + private String description; + + private Integer trialPeriod; + + private TrialPeriodUnit trialPeriodUnit; + + private TrialEndAction trialEndAction; + + private Integer period; + + private PeriodUnit periodUnit; + + private Long setupCost; + + private Long price; + + private String priceInDecimal; + + private String currencyCode; + + private Integer billingCycles; + + private PricingModel pricingModel; + + private ChargeModel chargeModel; + + private Integer freeQuantity; + + private String freeQuantityInDecimal; + + private AddonApplicability addonApplicability; + + private Number downgradePenalty; + + private String redirectUrl; + + private Boolean enabledInHostedPages; + + private Boolean enabledInPortal; + + private Boolean taxable; + + private String taxProfileId; + + private String taxCode; + + private String hsnCode; + + private String taxjarProductCode; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private String sku; + + private String accountingCode; + + private String accountingCategory1; + + private String accountingCategory2; + + private String accountingCategory3; + + private String accountingCategory4; + + private Boolean isShippable; + + private Integer shippingFrequencyPeriod; + + private ShippingFrequencyPeriodUnit shippingFrequencyPeriodUnit; + + private String invoiceNotes; + + private java.util.Map metaData; + + private Boolean showDescriptionInInvoices; + + private Boolean showDescriptionInQuotes; + + private Boolean giftable; + + private Status status; + + private String claimUrl; + + private List tiers; + + private List taxProvidersFields; + + private List applicableAddons; + + private List eventBasedAddons; + + private List attachedAddons; + + private Map customFields = new LinkedHashMap<>(); + + private PlanCreateBuilder() {} + + public PlanCreateBuilder id(String value) { + this.id = value; + return this; + } + + public PlanCreateBuilder name(String value) { + this.name = value; + return this; + } + + public PlanCreateBuilder invoiceName(String value) { + this.invoiceName = value; + return this; + } + + public PlanCreateBuilder description(String value) { + this.description = value; + return this; + } + + public PlanCreateBuilder trialPeriod(Integer value) { + this.trialPeriod = value; + return this; + } + + public PlanCreateBuilder trialPeriodUnit(TrialPeriodUnit value) { + this.trialPeriodUnit = value; + return this; + } + + public PlanCreateBuilder trialEndAction(TrialEndAction value) { + this.trialEndAction = value; + return this; + } + + public PlanCreateBuilder period(Integer value) { + this.period = value; + return this; + } + + public PlanCreateBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public PlanCreateBuilder setupCost(Long value) { + this.setupCost = value; + return this; + } + + public PlanCreateBuilder price(Long value) { + this.price = value; + return this; + } + + public PlanCreateBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public PlanCreateBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public PlanCreateBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public PlanCreateBuilder pricingModel(PricingModel value) { + this.pricingModel = value; + return this; + } + + @Deprecated + public PlanCreateBuilder chargeModel(ChargeModel value) { + this.chargeModel = value; + return this; + } + + public PlanCreateBuilder freeQuantity(Integer value) { + this.freeQuantity = value; + return this; + } + + public PlanCreateBuilder freeQuantityInDecimal(String value) { + this.freeQuantityInDecimal = value; + return this; + } + + public PlanCreateBuilder addonApplicability(AddonApplicability value) { + this.addonApplicability = value; + return this; + } + + @Deprecated + public PlanCreateBuilder downgradePenalty(Number value) { + this.downgradePenalty = value; + return this; + } + + public PlanCreateBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public PlanCreateBuilder enabledInHostedPages(Boolean value) { + this.enabledInHostedPages = value; + return this; + } + + public PlanCreateBuilder enabledInPortal(Boolean value) { + this.enabledInPortal = value; + return this; + } + + public PlanCreateBuilder taxable(Boolean value) { + this.taxable = value; + return this; + } + + public PlanCreateBuilder taxProfileId(String value) { + this.taxProfileId = value; + return this; + } + + public PlanCreateBuilder taxCode(String value) { + this.taxCode = value; + return this; + } + + public PlanCreateBuilder hsnCode(String value) { + this.hsnCode = value; + return this; + } + + public PlanCreateBuilder taxjarProductCode(String value) { + this.taxjarProductCode = value; + return this; + } + + public PlanCreateBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public PlanCreateBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public PlanCreateBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public PlanCreateBuilder sku(String value) { + this.sku = value; + return this; + } + + public PlanCreateBuilder accountingCode(String value) { + this.accountingCode = value; + return this; + } + + public PlanCreateBuilder accountingCategory1(String value) { + this.accountingCategory1 = value; + return this; + } + + public PlanCreateBuilder accountingCategory2(String value) { + this.accountingCategory2 = value; + return this; + } + + public PlanCreateBuilder accountingCategory3(String value) { + this.accountingCategory3 = value; + return this; + } + + public PlanCreateBuilder accountingCategory4(String value) { + this.accountingCategory4 = value; + return this; + } + + public PlanCreateBuilder isShippable(Boolean value) { + this.isShippable = value; + return this; + } + + public PlanCreateBuilder shippingFrequencyPeriod(Integer value) { + this.shippingFrequencyPeriod = value; + return this; + } + + public PlanCreateBuilder shippingFrequencyPeriodUnit(ShippingFrequencyPeriodUnit value) { + this.shippingFrequencyPeriodUnit = value; + return this; + } + + public PlanCreateBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public PlanCreateBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public PlanCreateBuilder showDescriptionInInvoices(Boolean value) { + this.showDescriptionInInvoices = value; + return this; + } + + public PlanCreateBuilder showDescriptionInQuotes(Boolean value) { + this.showDescriptionInQuotes = value; + return this; + } + + public PlanCreateBuilder giftable(Boolean value) { + this.giftable = value; + return this; + } + + public PlanCreateBuilder status(Status value) { + this.status = value; + return this; + } + + public PlanCreateBuilder claimUrl(String value) { + this.claimUrl = value; + return this; + } + + public PlanCreateBuilder tiers(List value) { + this.tiers = value; + return this; + } + + public PlanCreateBuilder taxProvidersFields(List value) { + this.taxProvidersFields = value; + return this; + } + + public PlanCreateBuilder applicableAddons(List value) { + this.applicableAddons = value; + return this; + } + + public PlanCreateBuilder eventBasedAddons(List value) { + this.eventBasedAddons = value; + return this; + } + + public PlanCreateBuilder attachedAddons(List value) { + this.attachedAddons = 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 PlanCreateBuilder 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 PlanCreateBuilder 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 PlanCreateParams build() { + return new PlanCreateParams(this); + } + } + + public enum TrialPeriodUnit { + DAY("day"), + + MONTH("month"), + + /** An enum member indicating that TrialPeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialPeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialPeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialPeriodUnit enumValue : TrialPeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialEndAction { + SITE_DEFAULT("site_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialEndAction enumValue : TrialEndAction.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 enum PricingModel { + FLAT_FEE("flat_fee"), + + PER_UNIT("per_unit"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** An enum member indicating that PricingModel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingModel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingModel fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingModel enumValue : PricingModel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChargeModel { + FLAT_FEE("flat_fee"), + + PER_UNIT("per_unit"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** An enum member indicating that ChargeModel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeModel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeModel fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeModel enumValue : ChargeModel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AddonApplicability { + ALL("all"), + + RESTRICTED("restricted"), + + /** An enum member indicating that AddonApplicability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AddonApplicability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AddonApplicability fromString(String value) { + if (value == null) return _UNKNOWN; + for (AddonApplicability enumValue : AddonApplicability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ShippingFrequencyPeriodUnit { + YEAR("year"), + + MONTH("month"), + + WEEK("week"), + + DAY("day"), + + /** + * An enum member indicating that ShippingFrequencyPeriodUnit was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + ShippingFrequencyPeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ShippingFrequencyPeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (ShippingFrequencyPeriodUnit enumValue : ShippingFrequencyPeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + ACTIVE("active"), + + ARCHIVED("archived"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class TiersParams { + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private TiersParams(TiersBuilder builder) { + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + return formData; + } + + /** Create a new builder for TiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TiersBuilder builder() { + return new TiersBuilder(); + } + + public static final class TiersBuilder { + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private TiersBuilder() {} + + public TiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public TiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public TiersBuilder price(Long value) { + this.price = value; + return this; + } + + public TiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public TiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public TiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public TiersParams build() { + return new TiersParams(this); + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } + + public static final class ApplicableAddonsParams { + + private final String id; + + private ApplicableAddonsParams(ApplicableAddonsBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for ApplicableAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ApplicableAddonsBuilder builder() { + return new ApplicableAddonsBuilder(); + } + + public static final class ApplicableAddonsBuilder { + + private String id; + + private ApplicableAddonsBuilder() {} + + public ApplicableAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public ApplicableAddonsParams build() { + return new ApplicableAddonsParams(this); + } + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final OnEvent onEvent; + + private final Boolean chargeOnce; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.onEvent = builder.onEvent; + + this.chargeOnce = builder.chargeOnce; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public OnEvent getOnEvent() { + return onEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.onEvent != null) { + + formData.put("on_event", this.onEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private OnEvent onEvent; + + private Boolean chargeOnce; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder onEvent(OnEvent value) { + this.onEvent = value; + return this; + } + + public EventBasedAddonsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + + public enum OnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** An enum member indicating that OnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (OnEvent enumValue : OnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AttachedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Integer billingCycles; + + private final Type type; + + private AttachedAddonsParams(AttachedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.billingCycles = builder.billingCycles; + + this.type = builder.type; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Type getType() { + return type; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.type != null) { + + formData.put("type", this.type); + } + + return formData; + } + + /** Create a new builder for AttachedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AttachedAddonsBuilder builder() { + return new AttachedAddonsBuilder(); + } + + public static final class AttachedAddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private Integer billingCycles; + + private Type type; + + private AttachedAddonsBuilder() {} + + public AttachedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AttachedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AttachedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AttachedAddonsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AttachedAddonsBuilder type(Type value) { + this.type = value; + return this; + } + + public AttachedAddonsParams build() { + return new AttachedAddonsParams(this); + } + } + + public enum Type { + RECOMMENDED("recommended"), + + MANDATORY("mandatory"), + + /** 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/plan/params/PlanDeleteParams.java b/src/main/java/com/chargebee/v4/models/plan/params/PlanDeleteParams.java new file mode 100644 index 00000000..e2ae1078 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/plan/params/PlanDeleteParams.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.plan.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PlanDeleteParams { + + private PlanDeleteParams(PlanDeleteBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for PlanDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PlanDeleteBuilder builder() { + return new PlanDeleteBuilder(); + } + + public static final class PlanDeleteBuilder { + + private PlanDeleteBuilder() {} + + public PlanDeleteParams build() { + return new PlanDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/plan/params/PlanListParams.java b/src/main/java/com/chargebee/v4/models/plan/params/PlanListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/plan/params/PlanListParams.java rename to src/main/java/com/chargebee/v4/models/plan/params/PlanListParams.java index df8c5bb4..8b7fc77d 100644 --- a/src/main/java/com/chargebee/v4/core/models/plan/params/PlanListParams.java +++ b/src/main/java/com/chargebee/v4/models/plan/params/PlanListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.plan.params; +package com.chargebee.v4.models.plan.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/plan/params/PlanRetrieveParams.java b/src/main/java/com/chargebee/v4/models/plan/params/PlanRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/plan/params/PlanRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/plan/params/PlanRetrieveParams.java index 568bffe5..68d6b85a 100644 --- a/src/main/java/com/chargebee/v4/core/models/plan/params/PlanRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/plan/params/PlanRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.plan.params; +package com.chargebee.v4.models.plan.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/plan/params/PlanUnarchiveParams.java b/src/main/java/com/chargebee/v4/models/plan/params/PlanUnarchiveParams.java new file mode 100644 index 00000000..11f7724b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/plan/params/PlanUnarchiveParams.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.plan.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PlanUnarchiveParams { + + private PlanUnarchiveParams(PlanUnarchiveBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for PlanUnarchiveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PlanUnarchiveBuilder builder() { + return new PlanUnarchiveBuilder(); + } + + public static final class PlanUnarchiveBuilder { + + private PlanUnarchiveBuilder() {} + + public PlanUnarchiveParams build() { + return new PlanUnarchiveParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/plan/params/PlanUpdateParams.java b/src/main/java/com/chargebee/v4/models/plan/params/PlanUpdateParams.java new file mode 100644 index 00000000..4a2e1083 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/plan/params/PlanUpdateParams.java @@ -0,0 +1,1961 @@ +/* + * 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.plan.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; + +public final class PlanUpdateParams { + + private final String name; + + private final String invoiceName; + + private final String description; + + private final Integer trialPeriod; + + private final TrialPeriodUnit trialPeriodUnit; + + private final TrialEndAction trialEndAction; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Long setupCost; + + private final Long price; + + private final String priceInDecimal; + + private final String currencyCode; + + private final Integer billingCycles; + + private final PricingModel pricingModel; + + private final ChargeModel chargeModel; + + private final Integer freeQuantity; + + private final String freeQuantityInDecimal; + + private final AddonApplicability addonApplicability; + + private final Number downgradePenalty; + + private final String redirectUrl; + + private final Boolean enabledInHostedPages; + + private final Boolean enabledInPortal; + + private final Boolean taxable; + + private final String taxProfileId; + + private final String taxCode; + + private final String hsnCode; + + private final String taxjarProductCode; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final String sku; + + private final String accountingCode; + + private final String accountingCategory1; + + private final String accountingCategory2; + + private final String accountingCategory3; + + private final String accountingCategory4; + + private final Boolean isShippable; + + private final Integer shippingFrequencyPeriod; + + private final ShippingFrequencyPeriodUnit shippingFrequencyPeriodUnit; + + private final String invoiceNotes; + + private final java.util.Map metaData; + + private final Boolean showDescriptionInInvoices; + + private final Boolean showDescriptionInQuotes; + + private final List tiers; + + private final List taxProvidersFields; + + private final List applicableAddons; + + private final List eventBasedAddons; + + private final List attachedAddons; + + private final Map customFields; + + private PlanUpdateParams(PlanUpdateBuilder builder) { + + this.name = builder.name; + + this.invoiceName = builder.invoiceName; + + this.description = builder.description; + + this.trialPeriod = builder.trialPeriod; + + this.trialPeriodUnit = builder.trialPeriodUnit; + + this.trialEndAction = builder.trialEndAction; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.setupCost = builder.setupCost; + + this.price = builder.price; + + this.priceInDecimal = builder.priceInDecimal; + + this.currencyCode = builder.currencyCode; + + this.billingCycles = builder.billingCycles; + + this.pricingModel = builder.pricingModel; + + this.chargeModel = builder.chargeModel; + + this.freeQuantity = builder.freeQuantity; + + this.freeQuantityInDecimal = builder.freeQuantityInDecimal; + + this.addonApplicability = builder.addonApplicability; + + this.downgradePenalty = builder.downgradePenalty; + + this.redirectUrl = builder.redirectUrl; + + this.enabledInHostedPages = builder.enabledInHostedPages; + + this.enabledInPortal = builder.enabledInPortal; + + this.taxable = builder.taxable; + + this.taxProfileId = builder.taxProfileId; + + this.taxCode = builder.taxCode; + + this.hsnCode = builder.hsnCode; + + this.taxjarProductCode = builder.taxjarProductCode; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.sku = builder.sku; + + this.accountingCode = builder.accountingCode; + + this.accountingCategory1 = builder.accountingCategory1; + + this.accountingCategory2 = builder.accountingCategory2; + + this.accountingCategory3 = builder.accountingCategory3; + + this.accountingCategory4 = builder.accountingCategory4; + + this.isShippable = builder.isShippable; + + this.shippingFrequencyPeriod = builder.shippingFrequencyPeriod; + + this.shippingFrequencyPeriodUnit = builder.shippingFrequencyPeriodUnit; + + this.invoiceNotes = builder.invoiceNotes; + + this.metaData = builder.metaData; + + this.showDescriptionInInvoices = builder.showDescriptionInInvoices; + + this.showDescriptionInQuotes = builder.showDescriptionInQuotes; + + this.tiers = builder.tiers; + + this.taxProvidersFields = builder.taxProvidersFields; + + this.applicableAddons = builder.applicableAddons; + + this.eventBasedAddons = builder.eventBasedAddons; + + this.attachedAddons = builder.attachedAddons; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getName() { + return name; + } + + public String getInvoiceName() { + return invoiceName; + } + + public String getDescription() { + return description; + } + + public Integer getTrialPeriod() { + return trialPeriod; + } + + public TrialPeriodUnit getTrialPeriodUnit() { + return trialPeriodUnit; + } + + public TrialEndAction getTrialEndAction() { + return trialEndAction; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Long getSetupCost() { + return setupCost; + } + + public Long getPrice() { + return price; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public PricingModel getPricingModel() { + return pricingModel; + } + + public ChargeModel getChargeModel() { + return chargeModel; + } + + public Integer getFreeQuantity() { + return freeQuantity; + } + + public String getFreeQuantityInDecimal() { + return freeQuantityInDecimal; + } + + public AddonApplicability getAddonApplicability() { + return addonApplicability; + } + + public Number getDowngradePenalty() { + return downgradePenalty; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public Boolean getEnabledInHostedPages() { + return enabledInHostedPages; + } + + public Boolean getEnabledInPortal() { + return enabledInPortal; + } + + public Boolean getTaxable() { + return taxable; + } + + public String getTaxProfileId() { + return taxProfileId; + } + + public String getTaxCode() { + return taxCode; + } + + public String getHsnCode() { + return hsnCode; + } + + public String getTaxjarProductCode() { + return taxjarProductCode; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public String getSku() { + return sku; + } + + public String getAccountingCode() { + return accountingCode; + } + + public String getAccountingCategory1() { + return accountingCategory1; + } + + public String getAccountingCategory2() { + return accountingCategory2; + } + + public String getAccountingCategory3() { + return accountingCategory3; + } + + public String getAccountingCategory4() { + return accountingCategory4; + } + + public Boolean getIsShippable() { + return isShippable; + } + + public Integer getShippingFrequencyPeriod() { + return shippingFrequencyPeriod; + } + + public ShippingFrequencyPeriodUnit getShippingFrequencyPeriodUnit() { + return shippingFrequencyPeriodUnit; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public java.util.Map getMetaData() { + return metaData; + } + + public Boolean getShowDescriptionInInvoices() { + return showDescriptionInInvoices; + } + + public Boolean getShowDescriptionInQuotes() { + return showDescriptionInQuotes; + } + + public List getTiers() { + return tiers; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + public List getApplicableAddons() { + return applicableAddons; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + public List getAttachedAddons() { + return attachedAddons; + } + + 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.description != null) { + + formData.put("description", this.description); + } + + if (this.trialPeriod != null) { + + formData.put("trial_period", this.trialPeriod); + } + + if (this.trialPeriodUnit != null) { + + formData.put("trial_period_unit", this.trialPeriodUnit); + } + + if (this.trialEndAction != null) { + + formData.put("trial_end_action", this.trialEndAction); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.setupCost != null) { + + formData.put("setup_cost", this.setupCost); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.pricingModel != null) { + + formData.put("pricing_model", this.pricingModel); + } + + if (this.chargeModel != null) { + + formData.put("charge_model", this.chargeModel); + } + + if (this.freeQuantity != null) { + + formData.put("free_quantity", this.freeQuantity); + } + + if (this.freeQuantityInDecimal != null) { + + formData.put("free_quantity_in_decimal", this.freeQuantityInDecimal); + } + + if (this.addonApplicability != null) { + + formData.put("addon_applicability", this.addonApplicability); + } + + if (this.downgradePenalty != null) { + + formData.put("downgrade_penalty", this.downgradePenalty); + } + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.enabledInHostedPages != null) { + + formData.put("enabled_in_hosted_pages", this.enabledInHostedPages); + } + + if (this.enabledInPortal != null) { + + formData.put("enabled_in_portal", this.enabledInPortal); + } + + if (this.taxable != null) { + + formData.put("taxable", this.taxable); + } + + if (this.taxProfileId != null) { + + formData.put("tax_profile_id", this.taxProfileId); + } + + if (this.taxCode != null) { + + formData.put("tax_code", this.taxCode); + } + + if (this.hsnCode != null) { + + formData.put("hsn_code", this.hsnCode); + } + + if (this.taxjarProductCode != null) { + + formData.put("taxjar_product_code", this.taxjarProductCode); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.sku != null) { + + formData.put("sku", this.sku); + } + + if (this.accountingCode != null) { + + formData.put("accounting_code", this.accountingCode); + } + + if (this.accountingCategory1 != null) { + + formData.put("accounting_category1", this.accountingCategory1); + } + + if (this.accountingCategory2 != null) { + + formData.put("accounting_category2", this.accountingCategory2); + } + + if (this.accountingCategory3 != null) { + + formData.put("accounting_category3", this.accountingCategory3); + } + + if (this.accountingCategory4 != null) { + + formData.put("accounting_category4", this.accountingCategory4); + } + + if (this.isShippable != null) { + + formData.put("is_shippable", this.isShippable); + } + + if (this.shippingFrequencyPeriod != null) { + + formData.put("shipping_frequency_period", this.shippingFrequencyPeriod); + } + + if (this.shippingFrequencyPeriodUnit != null) { + + formData.put("shipping_frequency_period_unit", this.shippingFrequencyPeriodUnit); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + if (this.showDescriptionInInvoices != null) { + + formData.put("show_description_in_invoices", this.showDescriptionInInvoices); + } + + if (this.showDescriptionInQuotes != null) { + + formData.put("show_description_in_quotes", this.showDescriptionInQuotes); + } + + if (this.tiers != null) { + + // List of objects + for (int i = 0; i < this.tiers.size(); i++) { + TiersParams item = this.tiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.applicableAddons != null) { + + // List of objects + for (int i = 0; i < this.applicableAddons.size(); i++) { + ApplicableAddonsParams item = this.applicableAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "applicable_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.attachedAddons != null) { + + // List of objects + for (int i = 0; i < this.attachedAddons.size(); i++) { + AttachedAddonsParams item = this.attachedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "attached_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for PlanUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PlanUpdateBuilder builder() { + return new PlanUpdateBuilder(); + } + + public static final class PlanUpdateBuilder { + + private String name; + + private String invoiceName; + + private String description; + + private Integer trialPeriod; + + private TrialPeriodUnit trialPeriodUnit; + + private TrialEndAction trialEndAction; + + private Integer period; + + private PeriodUnit periodUnit; + + private Long setupCost; + + private Long price; + + private String priceInDecimal; + + private String currencyCode; + + private Integer billingCycles; + + private PricingModel pricingModel; + + private ChargeModel chargeModel; + + private Integer freeQuantity; + + private String freeQuantityInDecimal; + + private AddonApplicability addonApplicability; + + private Number downgradePenalty; + + private String redirectUrl; + + private Boolean enabledInHostedPages; + + private Boolean enabledInPortal; + + private Boolean taxable; + + private String taxProfileId; + + private String taxCode; + + private String hsnCode; + + private String taxjarProductCode; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private String sku; + + private String accountingCode; + + private String accountingCategory1; + + private String accountingCategory2; + + private String accountingCategory3; + + private String accountingCategory4; + + private Boolean isShippable; + + private Integer shippingFrequencyPeriod; + + private ShippingFrequencyPeriodUnit shippingFrequencyPeriodUnit; + + private String invoiceNotes; + + private java.util.Map metaData; + + private Boolean showDescriptionInInvoices; + + private Boolean showDescriptionInQuotes; + + private List tiers; + + private List taxProvidersFields; + + private List applicableAddons; + + private List eventBasedAddons; + + private List attachedAddons; + + private Map customFields = new LinkedHashMap<>(); + + private PlanUpdateBuilder() {} + + public PlanUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public PlanUpdateBuilder invoiceName(String value) { + this.invoiceName = value; + return this; + } + + public PlanUpdateBuilder description(String value) { + this.description = value; + return this; + } + + public PlanUpdateBuilder trialPeriod(Integer value) { + this.trialPeriod = value; + return this; + } + + public PlanUpdateBuilder trialPeriodUnit(TrialPeriodUnit value) { + this.trialPeriodUnit = value; + return this; + } + + public PlanUpdateBuilder trialEndAction(TrialEndAction value) { + this.trialEndAction = value; + return this; + } + + public PlanUpdateBuilder period(Integer value) { + this.period = value; + return this; + } + + public PlanUpdateBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public PlanUpdateBuilder setupCost(Long value) { + this.setupCost = value; + return this; + } + + public PlanUpdateBuilder price(Long value) { + this.price = value; + return this; + } + + public PlanUpdateBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public PlanUpdateBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public PlanUpdateBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public PlanUpdateBuilder pricingModel(PricingModel value) { + this.pricingModel = value; + return this; + } + + @Deprecated + public PlanUpdateBuilder chargeModel(ChargeModel value) { + this.chargeModel = value; + return this; + } + + public PlanUpdateBuilder freeQuantity(Integer value) { + this.freeQuantity = value; + return this; + } + + public PlanUpdateBuilder freeQuantityInDecimal(String value) { + this.freeQuantityInDecimal = value; + return this; + } + + public PlanUpdateBuilder addonApplicability(AddonApplicability value) { + this.addonApplicability = value; + return this; + } + + @Deprecated + public PlanUpdateBuilder downgradePenalty(Number value) { + this.downgradePenalty = value; + return this; + } + + public PlanUpdateBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public PlanUpdateBuilder enabledInHostedPages(Boolean value) { + this.enabledInHostedPages = value; + return this; + } + + public PlanUpdateBuilder enabledInPortal(Boolean value) { + this.enabledInPortal = value; + return this; + } + + public PlanUpdateBuilder taxable(Boolean value) { + this.taxable = value; + return this; + } + + public PlanUpdateBuilder taxProfileId(String value) { + this.taxProfileId = value; + return this; + } + + public PlanUpdateBuilder taxCode(String value) { + this.taxCode = value; + return this; + } + + public PlanUpdateBuilder hsnCode(String value) { + this.hsnCode = value; + return this; + } + + public PlanUpdateBuilder taxjarProductCode(String value) { + this.taxjarProductCode = value; + return this; + } + + public PlanUpdateBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public PlanUpdateBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public PlanUpdateBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public PlanUpdateBuilder sku(String value) { + this.sku = value; + return this; + } + + public PlanUpdateBuilder accountingCode(String value) { + this.accountingCode = value; + return this; + } + + public PlanUpdateBuilder accountingCategory1(String value) { + this.accountingCategory1 = value; + return this; + } + + public PlanUpdateBuilder accountingCategory2(String value) { + this.accountingCategory2 = value; + return this; + } + + public PlanUpdateBuilder accountingCategory3(String value) { + this.accountingCategory3 = value; + return this; + } + + public PlanUpdateBuilder accountingCategory4(String value) { + this.accountingCategory4 = value; + return this; + } + + public PlanUpdateBuilder isShippable(Boolean value) { + this.isShippable = value; + return this; + } + + public PlanUpdateBuilder shippingFrequencyPeriod(Integer value) { + this.shippingFrequencyPeriod = value; + return this; + } + + public PlanUpdateBuilder shippingFrequencyPeriodUnit(ShippingFrequencyPeriodUnit value) { + this.shippingFrequencyPeriodUnit = value; + return this; + } + + public PlanUpdateBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public PlanUpdateBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public PlanUpdateBuilder showDescriptionInInvoices(Boolean value) { + this.showDescriptionInInvoices = value; + return this; + } + + public PlanUpdateBuilder showDescriptionInQuotes(Boolean value) { + this.showDescriptionInQuotes = value; + return this; + } + + public PlanUpdateBuilder tiers(List value) { + this.tiers = value; + return this; + } + + public PlanUpdateBuilder taxProvidersFields(List value) { + this.taxProvidersFields = value; + return this; + } + + public PlanUpdateBuilder applicableAddons(List value) { + this.applicableAddons = value; + return this; + } + + public PlanUpdateBuilder eventBasedAddons(List value) { + this.eventBasedAddons = value; + return this; + } + + public PlanUpdateBuilder attachedAddons(List value) { + this.attachedAddons = 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 PlanUpdateBuilder 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 PlanUpdateBuilder 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 PlanUpdateParams build() { + return new PlanUpdateParams(this); + } + } + + public enum TrialPeriodUnit { + DAY("day"), + + MONTH("month"), + + /** An enum member indicating that TrialPeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialPeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialPeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialPeriodUnit enumValue : TrialPeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialEndAction { + SITE_DEFAULT("site_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialEndAction enumValue : TrialEndAction.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 enum PricingModel { + FLAT_FEE("flat_fee"), + + PER_UNIT("per_unit"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** An enum member indicating that PricingModel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingModel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingModel fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingModel enumValue : PricingModel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChargeModel { + FLAT_FEE("flat_fee"), + + PER_UNIT("per_unit"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** An enum member indicating that ChargeModel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeModel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeModel fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeModel enumValue : ChargeModel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AddonApplicability { + ALL("all"), + + RESTRICTED("restricted"), + + /** An enum member indicating that AddonApplicability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AddonApplicability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AddonApplicability fromString(String value) { + if (value == null) return _UNKNOWN; + for (AddonApplicability enumValue : AddonApplicability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ShippingFrequencyPeriodUnit { + YEAR("year"), + + MONTH("month"), + + WEEK("week"), + + DAY("day"), + + /** + * An enum member indicating that ShippingFrequencyPeriodUnit was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + ShippingFrequencyPeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ShippingFrequencyPeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (ShippingFrequencyPeriodUnit enumValue : ShippingFrequencyPeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class TiersParams { + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private TiersParams(TiersBuilder builder) { + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + return formData; + } + + /** Create a new builder for TiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TiersBuilder builder() { + return new TiersBuilder(); + } + + public static final class TiersBuilder { + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private TiersBuilder() {} + + public TiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public TiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public TiersBuilder price(Long value) { + this.price = value; + return this; + } + + public TiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public TiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public TiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public TiersParams build() { + return new TiersParams(this); + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } + + public static final class ApplicableAddonsParams { + + private final String id; + + private ApplicableAddonsParams(ApplicableAddonsBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for ApplicableAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ApplicableAddonsBuilder builder() { + return new ApplicableAddonsBuilder(); + } + + public static final class ApplicableAddonsBuilder { + + private String id; + + private ApplicableAddonsBuilder() {} + + public ApplicableAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public ApplicableAddonsParams build() { + return new ApplicableAddonsParams(this); + } + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final OnEvent onEvent; + + private final Boolean chargeOnce; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.onEvent = builder.onEvent; + + this.chargeOnce = builder.chargeOnce; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public OnEvent getOnEvent() { + return onEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.onEvent != null) { + + formData.put("on_event", this.onEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private OnEvent onEvent; + + private Boolean chargeOnce; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder onEvent(OnEvent value) { + this.onEvent = value; + return this; + } + + public EventBasedAddonsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + + public enum OnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** An enum member indicating that OnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (OnEvent enumValue : OnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AttachedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Integer billingCycles; + + private final Type type; + + private AttachedAddonsParams(AttachedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.billingCycles = builder.billingCycles; + + this.type = builder.type; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Type getType() { + return type; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.type != null) { + + formData.put("type", this.type); + } + + return formData; + } + + /** Create a new builder for AttachedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AttachedAddonsBuilder builder() { + return new AttachedAddonsBuilder(); + } + + public static final class AttachedAddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private Integer billingCycles; + + private Type type; + + private AttachedAddonsBuilder() {} + + public AttachedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AttachedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AttachedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AttachedAddonsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AttachedAddonsBuilder type(Type value) { + this.type = value; + return this; + } + + public AttachedAddonsParams build() { + return new AttachedAddonsParams(this); + } + } + + public enum Type { + RECOMMENDED("recommended"), + + MANDATORY("mandatory"), + + /** 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/core/responses/plan/PlanCopyResponse.java b/src/main/java/com/chargebee/v4/models/plan/responses/PlanCopyResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/plan/PlanCopyResponse.java rename to src/main/java/com/chargebee/v4/models/plan/responses/PlanCopyResponse.java index cec4eaab..ef8f64c9 100644 --- a/src/main/java/com/chargebee/v4/core/responses/plan/PlanCopyResponse.java +++ b/src/main/java/com/chargebee/v4/models/plan/responses/PlanCopyResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.plan; +package com.chargebee.v4.models.plan.responses; -import com.chargebee.v4.core.models.plan.Plan; +import com.chargebee.v4.models.plan.Plan; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/plan/PlanCreateResponse.java b/src/main/java/com/chargebee/v4/models/plan/responses/PlanCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/plan/PlanCreateResponse.java rename to src/main/java/com/chargebee/v4/models/plan/responses/PlanCreateResponse.java index d5bbae6c..86c2d363 100644 --- a/src/main/java/com/chargebee/v4/core/responses/plan/PlanCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/plan/responses/PlanCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.plan; +package com.chargebee.v4.models.plan.responses; -import com.chargebee.v4.core.models.plan.Plan; +import com.chargebee.v4.models.plan.Plan; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/plan/PlanDeleteResponse.java b/src/main/java/com/chargebee/v4/models/plan/responses/PlanDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/plan/PlanDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/plan/responses/PlanDeleteResponse.java index 6ba2b209..0aeec263 100644 --- a/src/main/java/com/chargebee/v4/core/responses/plan/PlanDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/plan/responses/PlanDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.plan; +package com.chargebee.v4.models.plan.responses; -import com.chargebee.v4.core.models.plan.Plan; +import com.chargebee.v4.models.plan.Plan; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/plan/PlanListResponse.java b/src/main/java/com/chargebee/v4/models/plan/responses/PlanListResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/plan/PlanListResponse.java rename to src/main/java/com/chargebee/v4/models/plan/responses/PlanListResponse.java index 211a4ae9..293c8686 100644 --- a/src/main/java/com/chargebee/v4/core/responses/plan/PlanListResponse.java +++ b/src/main/java/com/chargebee/v4/models/plan/responses/PlanListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.plan; +package com.chargebee.v4.models.plan.responses; import java.util.List; -import com.chargebee.v4.core.models.plan.Plan; +import com.chargebee.v4.models.plan.Plan; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.PlanService; -import com.chargebee.v4.core.models.plan.params.PlanListParams; +import com.chargebee.v4.services.PlanService; +import com.chargebee.v4.models.plan.params.PlanListParams; /** Immutable response object for PlanList operation. Contains paginated list data. */ public final class PlanListResponse { @@ -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 PlanListResponse nextPage() throws Exception { + public PlanListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/plan/responses/PlanRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/plan/responses/PlanRetrieveResponse.java new file mode 100644 index 00000000..68f8a7ea --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/plan/responses/PlanRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.plan.responses; + +import com.chargebee.v4.models.plan.Plan; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for PlanRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class PlanRetrieveResponse extends BaseResponse { + private final Plan plan; + + private PlanRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.plan = builder.plan; + } + + /** Parse JSON response into PlanRetrieveResponse object. */ + public static PlanRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into PlanRetrieveResponse object with HTTP response. */ + public static PlanRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __planJson = JsonUtil.getObject(json, "plan"); + if (__planJson != null) { + builder.plan(Plan.fromJson(__planJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PlanRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for PlanRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PlanRetrieveResponse. */ + public static class Builder { + + private Plan plan; + + private Response httpResponse; + + private Builder() {} + + public Builder plan(Plan plan) { + this.plan = plan; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public PlanRetrieveResponse build() { + return new PlanRetrieveResponse(this); + } + } + + /** Get the plan from the response. */ + public Plan getPlan() { + return plan; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/plan/PlanUnarchiveResponse.java b/src/main/java/com/chargebee/v4/models/plan/responses/PlanUnarchiveResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/plan/PlanUnarchiveResponse.java rename to src/main/java/com/chargebee/v4/models/plan/responses/PlanUnarchiveResponse.java index 2f7fb3f7..53571a40 100644 --- a/src/main/java/com/chargebee/v4/core/responses/plan/PlanUnarchiveResponse.java +++ b/src/main/java/com/chargebee/v4/models/plan/responses/PlanUnarchiveResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.plan; +package com.chargebee.v4.models.plan.responses; -import com.chargebee.v4.core.models.plan.Plan; +import com.chargebee.v4.models.plan.Plan; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/plan/PlanUpdateResponse.java b/src/main/java/com/chargebee/v4/models/plan/responses/PlanUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/plan/PlanUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/plan/responses/PlanUpdateResponse.java index 53d4b4e9..924af649 100644 --- a/src/main/java/com/chargebee/v4/core/responses/plan/PlanUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/plan/responses/PlanUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.plan; +package com.chargebee.v4.models.plan.responses; -import com.chargebee.v4.core.models.plan.Plan; +import com.chargebee.v4.models.plan.Plan; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/portalSession/PortalSession.java b/src/main/java/com/chargebee/v4/models/portalSession/PortalSession.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/portalSession/PortalSession.java rename to src/main/java/com/chargebee/v4/models/portalSession/PortalSession.java index bb3efaa1..35958d6c 100644 --- a/src/main/java/com/chargebee/v4/core/models/portalSession/PortalSession.java +++ b/src/main/java/com/chargebee/v4/models/portalSession/PortalSession.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.portalSession; +package com.chargebee.v4.models.portalSession; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/portalSession/params/PortalSessionActivateParams.java b/src/main/java/com/chargebee/v4/models/portalSession/params/PortalSessionActivateParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/portalSession/params/PortalSessionActivateParams.java rename to src/main/java/com/chargebee/v4/models/portalSession/params/PortalSessionActivateParams.java index 45ca9439..49f466b1 100644 --- a/src/main/java/com/chargebee/v4/core/models/portalSession/params/PortalSessionActivateParams.java +++ b/src/main/java/com/chargebee/v4/models/portalSession/params/PortalSessionActivateParams.java @@ -4,24 +4,35 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.portalSession.params; +package com.chargebee.v4.models.portalSession.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class PortalSessionActivateParams { - private final Map formData; + private final String token; private PortalSessionActivateParams(PortalSessionActivateBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); + + this.token = builder.token; + } + + public String getToken() { + return token; } /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.token != null) { + + formData.put("token", this.token); + } + return formData; } @@ -32,14 +43,13 @@ public static PortalSessionActivateBuilder builder() { } public static final class PortalSessionActivateBuilder { - private final Map formData = new LinkedHashMap<>(); + + private String token; private PortalSessionActivateBuilder() {} public PortalSessionActivateBuilder token(String value) { - - formData.put("token", value); - + this.token = value; return this; } diff --git a/src/main/java/com/chargebee/v4/models/portalSession/params/PortalSessionCreateParams.java b/src/main/java/com/chargebee/v4/models/portalSession/params/PortalSessionCreateParams.java new file mode 100644 index 00000000..5937c06a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/portalSession/params/PortalSessionCreateParams.java @@ -0,0 +1,153 @@ +/* + * 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.portalSession.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PortalSessionCreateParams { + + private final String redirectUrl; + + private final String forwardUrl; + + private final CustomerParams customer; + + private PortalSessionCreateParams(PortalSessionCreateBuilder builder) { + + this.redirectUrl = builder.redirectUrl; + + this.forwardUrl = builder.forwardUrl; + + this.customer = builder.customer; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public String getForwardUrl() { + return forwardUrl; + } + + public CustomerParams getCustomer() { + return customer; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.forwardUrl != null) { + + formData.put("forward_url", this.forwardUrl); + } + + 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 PortalSessionCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PortalSessionCreateBuilder builder() { + return new PortalSessionCreateBuilder(); + } + + public static final class PortalSessionCreateBuilder { + + private String redirectUrl; + + private String forwardUrl; + + private CustomerParams customer; + + private PortalSessionCreateBuilder() {} + + public PortalSessionCreateBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public PortalSessionCreateBuilder forwardUrl(String value) { + this.forwardUrl = value; + return this; + } + + public PortalSessionCreateBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public PortalSessionCreateParams build() { + return new PortalSessionCreateParams(this); + } + } + + public static final class CustomerParams { + + private final String id; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + 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 id; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/portalSession/params/PortalSessionLogoutParams.java b/src/main/java/com/chargebee/v4/models/portalSession/params/PortalSessionLogoutParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/portalSession/params/PortalSessionLogoutParams.java rename to src/main/java/com/chargebee/v4/models/portalSession/params/PortalSessionLogoutParams.java index 8c0fa6f3..8e61b2e6 100644 --- a/src/main/java/com/chargebee/v4/core/models/portalSession/params/PortalSessionLogoutParams.java +++ b/src/main/java/com/chargebee/v4/models/portalSession/params/PortalSessionLogoutParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.portalSession.params; +package com.chargebee.v4.models.portalSession.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class PortalSessionLogoutParams { - private final Map formData; - - private PortalSessionLogoutParams(PortalSessionLogoutBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private PortalSessionLogoutParams(PortalSessionLogoutBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static PortalSessionLogoutBuilder builder() { } public static final class PortalSessionLogoutBuilder { - private final Map formData = new LinkedHashMap<>(); private PortalSessionLogoutBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/portalSession/params/PortalSessionRetrieveParams.java b/src/main/java/com/chargebee/v4/models/portalSession/params/PortalSessionRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/portalSession/params/PortalSessionRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/portalSession/params/PortalSessionRetrieveParams.java index ea3e22af..4c20abc0 100644 --- a/src/main/java/com/chargebee/v4/core/models/portalSession/params/PortalSessionRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/portalSession/params/PortalSessionRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.portalSession.params; +package com.chargebee.v4.models.portalSession.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/responses/portalSession/PortalSessionActivateResponse.java b/src/main/java/com/chargebee/v4/models/portalSession/responses/PortalSessionActivateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/portalSession/PortalSessionActivateResponse.java rename to src/main/java/com/chargebee/v4/models/portalSession/responses/PortalSessionActivateResponse.java index 210e3150..de9ba2a1 100644 --- a/src/main/java/com/chargebee/v4/core/responses/portalSession/PortalSessionActivateResponse.java +++ b/src/main/java/com/chargebee/v4/models/portalSession/responses/PortalSessionActivateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.portalSession; +package com.chargebee.v4.models.portalSession.responses; -import com.chargebee.v4.core.models.portalSession.PortalSession; +import com.chargebee.v4.models.portalSession.PortalSession; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/portalSession/PortalSessionCreateResponse.java b/src/main/java/com/chargebee/v4/models/portalSession/responses/PortalSessionCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/portalSession/PortalSessionCreateResponse.java rename to src/main/java/com/chargebee/v4/models/portalSession/responses/PortalSessionCreateResponse.java index c9ebd9a0..9621b09f 100644 --- a/src/main/java/com/chargebee/v4/core/responses/portalSession/PortalSessionCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/portalSession/responses/PortalSessionCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.portalSession; +package com.chargebee.v4.models.portalSession.responses; -import com.chargebee.v4.core.models.portalSession.PortalSession; +import com.chargebee.v4.models.portalSession.PortalSession; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/portalSession/PortalSessionLogoutResponse.java b/src/main/java/com/chargebee/v4/models/portalSession/responses/PortalSessionLogoutResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/portalSession/PortalSessionLogoutResponse.java rename to src/main/java/com/chargebee/v4/models/portalSession/responses/PortalSessionLogoutResponse.java index e85ece65..9bf9c474 100644 --- a/src/main/java/com/chargebee/v4/core/responses/portalSession/PortalSessionLogoutResponse.java +++ b/src/main/java/com/chargebee/v4/models/portalSession/responses/PortalSessionLogoutResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.portalSession; +package com.chargebee.v4.models.portalSession.responses; -import com.chargebee.v4.core.models.portalSession.PortalSession; +import com.chargebee.v4.models.portalSession.PortalSession; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/portalSession/responses/PortalSessionRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/portalSession/responses/PortalSessionRetrieveResponse.java new file mode 100644 index 00000000..e26e5b43 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/portalSession/responses/PortalSessionRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.portalSession.responses; + +import com.chargebee.v4.models.portalSession.PortalSession; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for PortalSessionRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class PortalSessionRetrieveResponse extends BaseResponse { + private final PortalSession portalSession; + + private PortalSessionRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.portalSession = builder.portalSession; + } + + /** Parse JSON response into PortalSessionRetrieveResponse object. */ + public static PortalSessionRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into PortalSessionRetrieveResponse object with HTTP response. */ + public static PortalSessionRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __portalSessionJson = JsonUtil.getObject(json, "portal_session"); + if (__portalSessionJson != null) { + builder.portalSession(PortalSession.fromJson(__portalSessionJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PortalSessionRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for PortalSessionRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PortalSessionRetrieveResponse. */ + public static class Builder { + + private PortalSession portalSession; + + private Response httpResponse; + + private Builder() {} + + public Builder portalSession(PortalSession portalSession) { + this.portalSession = portalSession; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public PortalSessionRetrieveResponse build() { + return new PortalSessionRetrieveResponse(this); + } + } + + /** Get the portalSession from the response. */ + public PortalSession getPortalSession() { + return portalSession; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/priceVariant/PriceVariant.java b/src/main/java/com/chargebee/v4/models/priceVariant/PriceVariant.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/priceVariant/PriceVariant.java rename to src/main/java/com/chargebee/v4/models/priceVariant/PriceVariant.java index 984adba5..aa928918 100644 --- a/src/main/java/com/chargebee/v4/core/models/priceVariant/PriceVariant.java +++ b/src/main/java/com/chargebee/v4/models/priceVariant/PriceVariant.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.priceVariant; +package com.chargebee.v4.models.priceVariant; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantCreateParams.java b/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantCreateParams.java new file mode 100644 index 00000000..a2100343 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantCreateParams.java @@ -0,0 +1,259 @@ +/* + * 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.priceVariant.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class PriceVariantCreateParams { + + private final String id; + + private final String name; + + private final String externalName; + + private final String description; + + private final String variantGroup; + + private final String businessEntityId; + + private final List attributes; + + private PriceVariantCreateParams(PriceVariantCreateBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.externalName = builder.externalName; + + this.description = builder.description; + + this.variantGroup = builder.variantGroup; + + this.businessEntityId = builder.businessEntityId; + + this.attributes = builder.attributes; + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getExternalName() { + return externalName; + } + + public String getDescription() { + return description; + } + + public String getVariantGroup() { + return variantGroup; + } + + public String getBusinessEntityId() { + return businessEntityId; + } + + public List getAttributes() { + return attributes; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.externalName != null) { + + formData.put("external_name", this.externalName); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.variantGroup != null) { + + formData.put("variant_group", this.variantGroup); + } + + if (this.businessEntityId != null) { + + formData.put("business_entity_id", this.businessEntityId); + } + + if (this.attributes != null) { + + // List of objects + for (int i = 0; i < this.attributes.size(); i++) { + AttributesParams item = this.attributes.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "attributes[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for PriceVariantCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PriceVariantCreateBuilder builder() { + return new PriceVariantCreateBuilder(); + } + + public static final class PriceVariantCreateBuilder { + + private String id; + + private String name; + + private String externalName; + + private String description; + + private String variantGroup; + + private String businessEntityId; + + private List attributes; + + private PriceVariantCreateBuilder() {} + + public PriceVariantCreateBuilder id(String value) { + this.id = value; + return this; + } + + public PriceVariantCreateBuilder name(String value) { + this.name = value; + return this; + } + + public PriceVariantCreateBuilder externalName(String value) { + this.externalName = value; + return this; + } + + public PriceVariantCreateBuilder description(String value) { + this.description = value; + return this; + } + + public PriceVariantCreateBuilder variantGroup(String value) { + this.variantGroup = value; + return this; + } + + public PriceVariantCreateBuilder businessEntityId(String value) { + this.businessEntityId = value; + return this; + } + + public PriceVariantCreateBuilder attributes(List value) { + this.attributes = value; + return this; + } + + public PriceVariantCreateParams build() { + return new PriceVariantCreateParams(this); + } + } + + public static final class AttributesParams { + + private final String name; + + private final String value; + + private AttributesParams(AttributesBuilder builder) { + + this.name = builder.name; + + this.value = builder.value; + } + + public String getName() { + return name; + } + + public String getValue() { + return value; + } + + /** 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.value != null) { + + formData.put("value", this.value); + } + + return formData; + } + + /** Create a new builder for AttributesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AttributesBuilder builder() { + return new AttributesBuilder(); + } + + public static final class AttributesBuilder { + + private String name; + + private String value; + + private AttributesBuilder() {} + + public AttributesBuilder name(String value) { + this.name = value; + return this; + } + + public AttributesBuilder value(String value) { + this.value = value; + return this; + } + + public AttributesParams build() { + return new AttributesParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/priceVariant/params/PriceVariantDeleteParams.java b/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantDeleteParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/priceVariant/params/PriceVariantDeleteParams.java rename to src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantDeleteParams.java index dea2c4e8..bc75b902 100644 --- a/src/main/java/com/chargebee/v4/core/models/priceVariant/params/PriceVariantDeleteParams.java +++ b/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantDeleteParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.priceVariant.params; +package com.chargebee.v4.models.priceVariant.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class PriceVariantDeleteParams { - private final Map formData; - - private PriceVariantDeleteParams(PriceVariantDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private PriceVariantDeleteParams(PriceVariantDeleteBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static PriceVariantDeleteBuilder builder() { } public static final class PriceVariantDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); private PriceVariantDeleteBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/priceVariant/params/PriceVariantListParams.java b/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/priceVariant/params/PriceVariantListParams.java rename to src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantListParams.java index f0e70edf..741750ee 100644 --- a/src/main/java/com/chargebee/v4/core/models/priceVariant/params/PriceVariantListParams.java +++ b/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.priceVariant.params; +package com.chargebee.v4.models.priceVariant.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/priceVariant/params/PriceVariantRetrieveParams.java b/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/priceVariant/params/PriceVariantRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantRetrieveParams.java index 37885298..5871846d 100644 --- a/src/main/java/com/chargebee/v4/core/models/priceVariant/params/PriceVariantRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.priceVariant.params; +package com.chargebee.v4.models.priceVariant.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantUpdateParams.java b/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantUpdateParams.java new file mode 100644 index 00000000..4f66a5d5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantUpdateParams.java @@ -0,0 +1,267 @@ +/* + * 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.priceVariant.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class PriceVariantUpdateParams { + + private final String name; + + private final String externalName; + + private final String description; + + private final String variantGroup; + + private final Status status; + + private final List attributes; + + private PriceVariantUpdateParams(PriceVariantUpdateBuilder builder) { + + this.name = builder.name; + + this.externalName = builder.externalName; + + this.description = builder.description; + + this.variantGroup = builder.variantGroup; + + this.status = builder.status; + + this.attributes = builder.attributes; + } + + public String getName() { + return name; + } + + public String getExternalName() { + return externalName; + } + + public String getDescription() { + return description; + } + + public String getVariantGroup() { + return variantGroup; + } + + public Status getStatus() { + return status; + } + + public List getAttributes() { + return attributes; + } + + /** 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.externalName != null) { + + formData.put("external_name", this.externalName); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.variantGroup != null) { + + formData.put("variant_group", this.variantGroup); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.attributes != null) { + + // List of objects + for (int i = 0; i < this.attributes.size(); i++) { + AttributesParams item = this.attributes.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "attributes[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for PriceVariantUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PriceVariantUpdateBuilder builder() { + return new PriceVariantUpdateBuilder(); + } + + public static final class PriceVariantUpdateBuilder { + + private String name; + + private String externalName; + + private String description; + + private String variantGroup; + + private Status status; + + private List attributes; + + private PriceVariantUpdateBuilder() {} + + public PriceVariantUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public PriceVariantUpdateBuilder externalName(String value) { + this.externalName = value; + return this; + } + + public PriceVariantUpdateBuilder description(String value) { + this.description = value; + return this; + } + + public PriceVariantUpdateBuilder variantGroup(String value) { + this.variantGroup = value; + return this; + } + + public PriceVariantUpdateBuilder status(Status value) { + this.status = value; + return this; + } + + public PriceVariantUpdateBuilder attributes(List value) { + this.attributes = value; + return this; + } + + public PriceVariantUpdateParams build() { + return new PriceVariantUpdateParams(this); + } + } + + public enum Status { + ACTIVE("active"), + + ARCHIVED("archived"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class AttributesParams { + + private final String name; + + private final String value; + + private AttributesParams(AttributesBuilder builder) { + + this.name = builder.name; + + this.value = builder.value; + } + + public String getName() { + return name; + } + + public String getValue() { + return value; + } + + /** 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.value != null) { + + formData.put("value", this.value); + } + + return formData; + } + + /** Create a new builder for AttributesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AttributesBuilder builder() { + return new AttributesBuilder(); + } + + public static final class AttributesBuilder { + + private String name; + + private String value; + + private AttributesBuilder() {} + + public AttributesBuilder name(String value) { + this.name = value; + return this; + } + + public AttributesBuilder value(String value) { + this.value = value; + return this; + } + + public AttributesParams build() { + return new AttributesParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/priceVariant/PriceVariantCreateResponse.java b/src/main/java/com/chargebee/v4/models/priceVariant/responses/PriceVariantCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/priceVariant/PriceVariantCreateResponse.java rename to src/main/java/com/chargebee/v4/models/priceVariant/responses/PriceVariantCreateResponse.java index e274bebd..c1f7b216 100644 --- a/src/main/java/com/chargebee/v4/core/responses/priceVariant/PriceVariantCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/priceVariant/responses/PriceVariantCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.priceVariant; +package com.chargebee.v4.models.priceVariant.responses; -import com.chargebee.v4.core.models.priceVariant.PriceVariant; +import com.chargebee.v4.models.priceVariant.PriceVariant; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/priceVariant/PriceVariantDeleteResponse.java b/src/main/java/com/chargebee/v4/models/priceVariant/responses/PriceVariantDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/priceVariant/PriceVariantDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/priceVariant/responses/PriceVariantDeleteResponse.java index 2222c7ba..82bd3b6a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/priceVariant/PriceVariantDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/priceVariant/responses/PriceVariantDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.priceVariant; +package com.chargebee.v4.models.priceVariant.responses; -import com.chargebee.v4.core.models.priceVariant.PriceVariant; +import com.chargebee.v4.models.priceVariant.PriceVariant; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/priceVariant/PriceVariantListResponse.java b/src/main/java/com/chargebee/v4/models/priceVariant/responses/PriceVariantListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/priceVariant/PriceVariantListResponse.java rename to src/main/java/com/chargebee/v4/models/priceVariant/responses/PriceVariantListResponse.java index c8eaeb4c..bc9ca0a7 100644 --- a/src/main/java/com/chargebee/v4/core/responses/priceVariant/PriceVariantListResponse.java +++ b/src/main/java/com/chargebee/v4/models/priceVariant/responses/PriceVariantListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.priceVariant; +package com.chargebee.v4.models.priceVariant.responses; import java.util.List; -import com.chargebee.v4.core.models.priceVariant.PriceVariant; +import com.chargebee.v4.models.priceVariant.PriceVariant; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.PriceVariantService; -import com.chargebee.v4.core.models.priceVariant.params.PriceVariantListParams; +import com.chargebee.v4.services.PriceVariantService; +import com.chargebee.v4.models.priceVariant.params.PriceVariantListParams; /** Immutable response object for PriceVariantList operation. Contains paginated list data. */ public final class PriceVariantListResponse { @@ -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 PriceVariantListResponse nextPage() throws Exception { + public PriceVariantListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/priceVariant/responses/PriceVariantRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/priceVariant/responses/PriceVariantRetrieveResponse.java new file mode 100644 index 00000000..94bff51a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/priceVariant/responses/PriceVariantRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.priceVariant.responses; + +import com.chargebee.v4.models.priceVariant.PriceVariant; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for PriceVariantRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class PriceVariantRetrieveResponse extends BaseResponse { + private final PriceVariant priceVariant; + + private PriceVariantRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.priceVariant = builder.priceVariant; + } + + /** Parse JSON response into PriceVariantRetrieveResponse object. */ + public static PriceVariantRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into PriceVariantRetrieveResponse object with HTTP response. */ + public static PriceVariantRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __priceVariantJson = JsonUtil.getObject(json, "price_variant"); + if (__priceVariantJson != null) { + builder.priceVariant(PriceVariant.fromJson(__priceVariantJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PriceVariantRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for PriceVariantRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PriceVariantRetrieveResponse. */ + public static class Builder { + + private PriceVariant priceVariant; + + private Response httpResponse; + + private Builder() {} + + public Builder priceVariant(PriceVariant priceVariant) { + this.priceVariant = priceVariant; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public PriceVariantRetrieveResponse build() { + return new PriceVariantRetrieveResponse(this); + } + } + + /** Get the priceVariant from the response. */ + public PriceVariant getPriceVariant() { + return priceVariant; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/priceVariant/PriceVariantUpdateResponse.java b/src/main/java/com/chargebee/v4/models/priceVariant/responses/PriceVariantUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/priceVariant/PriceVariantUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/priceVariant/responses/PriceVariantUpdateResponse.java index 6433127f..4a267ee9 100644 --- a/src/main/java/com/chargebee/v4/core/responses/priceVariant/PriceVariantUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/priceVariant/responses/PriceVariantUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.priceVariant; +package com.chargebee.v4.models.priceVariant.responses; -import com.chargebee.v4.core.models.priceVariant.PriceVariant; +import com.chargebee.v4.models.priceVariant.PriceVariant; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/pricingPageSession/PricingPageSession.java b/src/main/java/com/chargebee/v4/models/pricingPageSession/PricingPageSession.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/pricingPageSession/PricingPageSession.java rename to src/main/java/com/chargebee/v4/models/pricingPageSession/PricingPageSession.java index 19717f8d..b232e221 100644 --- a/src/main/java/com/chargebee/v4/core/models/pricingPageSession/PricingPageSession.java +++ b/src/main/java/com/chargebee/v4/models/pricingPageSession/PricingPageSession.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.pricingPageSession; +package com.chargebee.v4.models.pricingPageSession; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/pricingPageSession/params/PricingPageSessionCreateForExistingSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/pricingPageSession/params/PricingPageSessionCreateForExistingSubscriptionParams.java new file mode 100644 index 00000000..486537e9 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/pricingPageSession/params/PricingPageSessionCreateForExistingSubscriptionParams.java @@ -0,0 +1,581 @@ +/* + * 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.pricingPageSession.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class PricingPageSessionCreateForExistingSubscriptionParams { + + private final String redirectUrl; + + private final java.util.Map custom; + + private final PricingPageParams pricingPage; + + private final SubscriptionParams subscription; + + private final List discounts; + + private PricingPageSessionCreateForExistingSubscriptionParams( + PricingPageSessionCreateForExistingSubscriptionBuilder builder) { + + this.redirectUrl = builder.redirectUrl; + + this.custom = builder.custom; + + this.pricingPage = builder.pricingPage; + + this.subscription = builder.subscription; + + this.discounts = builder.discounts; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public java.util.Map getCustom() { + return custom; + } + + public PricingPageParams getPricingPage() { + return pricingPage; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public List getDiscounts() { + return discounts; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.custom != null) { + + formData.put("custom", JsonUtil.toJson(this.custom)); + } + + if (this.pricingPage != null) { + + // Single object + Map nestedData = this.pricingPage.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "pricing_page[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for PricingPageSessionCreateForExistingSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PricingPageSessionCreateForExistingSubscriptionBuilder builder() { + return new PricingPageSessionCreateForExistingSubscriptionBuilder(); + } + + public static final class PricingPageSessionCreateForExistingSubscriptionBuilder { + + private String redirectUrl; + + private java.util.Map custom; + + private PricingPageParams pricingPage; + + private SubscriptionParams subscription; + + private List discounts; + + private PricingPageSessionCreateForExistingSubscriptionBuilder() {} + + public PricingPageSessionCreateForExistingSubscriptionBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public PricingPageSessionCreateForExistingSubscriptionBuilder custom( + java.util.Map value) { + this.custom = value; + return this; + } + + public PricingPageSessionCreateForExistingSubscriptionBuilder pricingPage( + PricingPageParams value) { + this.pricingPage = value; + return this; + } + + public PricingPageSessionCreateForExistingSubscriptionBuilder subscription( + SubscriptionParams value) { + this.subscription = value; + return this; + } + + public PricingPageSessionCreateForExistingSubscriptionBuilder discounts( + List value) { + this.discounts = value; + return this; + } + + public PricingPageSessionCreateForExistingSubscriptionParams build() { + return new PricingPageSessionCreateForExistingSubscriptionParams(this); + } + } + + public static final class PricingPageParams { + + private final String id; + + private PricingPageParams(PricingPageBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for PricingPageParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PricingPageBuilder builder() { + return new PricingPageBuilder(); + } + + public static final class PricingPageBuilder { + + private String id; + + private PricingPageBuilder() {} + + public PricingPageBuilder id(String value) { + this.id = value; + return this; + } + + public PricingPageParams build() { + return new PricingPageParams(this); + } + } + } + + public static final class SubscriptionParams { + + private final String id; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + } + + public static final class DiscountsParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private final Integer quantity; + + private final String label; + + private DiscountsParams(DiscountsBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.label = builder.label; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getLabel() { + return label; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.label != null) { + + formData.put("label", this.label); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private Integer quantity; + + private String label; + + private DiscountsBuilder() {} + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder label(String value) { + this.label = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/pricingPageSession/params/PricingPageSessionCreateForNewSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/pricingPageSession/params/PricingPageSessionCreateForNewSubscriptionParams.java new file mode 100644 index 00000000..7114c853 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/pricingPageSession/params/PricingPageSessionCreateForNewSubscriptionParams.java @@ -0,0 +1,1546 @@ +/* + * 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.pricingPageSession.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class PricingPageSessionCreateForNewSubscriptionParams { + + private final String redirectUrl; + + private final String businessEntityId; + + private final Boolean autoSelectLocalCurrency; + + private final java.util.Map custom; + + private final PricingPageParams pricingPage; + + private final SubscriptionParams subscription; + + private final CustomerParams customer; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final List discounts; + + private PricingPageSessionCreateForNewSubscriptionParams( + PricingPageSessionCreateForNewSubscriptionBuilder builder) { + + this.redirectUrl = builder.redirectUrl; + + this.businessEntityId = builder.businessEntityId; + + this.autoSelectLocalCurrency = builder.autoSelectLocalCurrency; + + this.custom = builder.custom; + + this.pricingPage = builder.pricingPage; + + this.subscription = builder.subscription; + + this.customer = builder.customer; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.discounts = builder.discounts; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public String getBusinessEntityId() { + return businessEntityId; + } + + public Boolean getAutoSelectLocalCurrency() { + return autoSelectLocalCurrency; + } + + public java.util.Map getCustom() { + return custom; + } + + public PricingPageParams getPricingPage() { + return pricingPage; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public CustomerParams getCustomer() { + return customer; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public List getDiscounts() { + return discounts; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.redirectUrl != null) { + + formData.put("redirect_url", this.redirectUrl); + } + + if (this.businessEntityId != null) { + + formData.put("business_entity_id", this.businessEntityId); + } + + if (this.autoSelectLocalCurrency != null) { + + formData.put("auto_select_local_currency", this.autoSelectLocalCurrency); + } + + if (this.custom != null) { + + formData.put("custom", JsonUtil.toJson(this.custom)); + } + + if (this.pricingPage != null) { + + // Single object + Map nestedData = this.pricingPage.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "pricing_page[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for PricingPageSessionCreateForNewSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PricingPageSessionCreateForNewSubscriptionBuilder builder() { + return new PricingPageSessionCreateForNewSubscriptionBuilder(); + } + + public static final class PricingPageSessionCreateForNewSubscriptionBuilder { + + private String redirectUrl; + + private String businessEntityId; + + private Boolean autoSelectLocalCurrency; + + private java.util.Map custom; + + private PricingPageParams pricingPage; + + private SubscriptionParams subscription; + + private CustomerParams customer; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private List discounts; + + private PricingPageSessionCreateForNewSubscriptionBuilder() {} + + public PricingPageSessionCreateForNewSubscriptionBuilder redirectUrl(String value) { + this.redirectUrl = value; + return this; + } + + public PricingPageSessionCreateForNewSubscriptionBuilder businessEntityId(String value) { + this.businessEntityId = value; + return this; + } + + public PricingPageSessionCreateForNewSubscriptionBuilder autoSelectLocalCurrency( + Boolean value) { + this.autoSelectLocalCurrency = value; + return this; + } + + public PricingPageSessionCreateForNewSubscriptionBuilder custom( + java.util.Map value) { + this.custom = value; + return this; + } + + public PricingPageSessionCreateForNewSubscriptionBuilder pricingPage(PricingPageParams value) { + this.pricingPage = value; + return this; + } + + public PricingPageSessionCreateForNewSubscriptionBuilder subscription( + SubscriptionParams value) { + this.subscription = value; + return this; + } + + public PricingPageSessionCreateForNewSubscriptionBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public PricingPageSessionCreateForNewSubscriptionBuilder billingAddress( + BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public PricingPageSessionCreateForNewSubscriptionBuilder shippingAddress( + ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public PricingPageSessionCreateForNewSubscriptionBuilder discounts( + List value) { + this.discounts = value; + return this; + } + + public PricingPageSessionCreateForNewSubscriptionParams build() { + return new PricingPageSessionCreateForNewSubscriptionParams(this); + } + } + + public static final class PricingPageParams { + + private final String id; + + private PricingPageParams(PricingPageBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for PricingPageParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PricingPageBuilder builder() { + return new PricingPageBuilder(); + } + + public static final class PricingPageBuilder { + + private String id; + + private PricingPageBuilder() {} + + public PricingPageBuilder id(String value) { + this.id = value; + return this; + } + + public PricingPageParams build() { + return new PricingPageParams(this); + } + } + } + + public static final class SubscriptionParams { + + private final String id; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + } + + public static final class CustomerParams { + + private final String id; + + private final String email; + + private final String firstName; + + private final String lastName; + + private final String company; + + private final String phone; + + private final String locale; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.email = builder.email; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.company = builder.company; + + this.phone = builder.phone; + + this.locale = builder.locale; + } + + public String getId() { + return id; + } + + public String getEmail() { + return email; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getCompany() { + return company; + } + + public String getPhone() { + return phone; + } + + public String getLocale() { + return locale; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + + if (this.company != null) { + + formData.put("company", this.company); + } + + if (this.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.locale != null) { + + formData.put("locale", this.locale); + } + + 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 id; + + private String email; + + private String firstName; + + private String lastName; + + private String company; + + private String phone; + + private String locale; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerBuilder email(String value) { + this.email = value; + return this; + } + + public CustomerBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CustomerBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CustomerBuilder company(String value) { + this.company = value; + return this; + } + + public CustomerBuilder phone(String value) { + this.phone = value; + return this; + } + + public CustomerBuilder locale(String value) { + this.locale = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class DiscountsParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private final Integer quantity; + + private final String label; + + private DiscountsParams(DiscountsBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.label = builder.label; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getLabel() { + return label; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.label != null) { + + formData.put("label", this.label); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private Integer quantity; + + private String label; + + private DiscountsBuilder() {} + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder label(String value) { + this.label = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/pricingPageSession/PricingPageSessionCreateForExistingSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/pricingPageSession/responses/PricingPageSessionCreateForExistingSubscriptionResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/pricingPageSession/PricingPageSessionCreateForExistingSubscriptionResponse.java rename to src/main/java/com/chargebee/v4/models/pricingPageSession/responses/PricingPageSessionCreateForExistingSubscriptionResponse.java index ce49e46c..85dde8be 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pricingPageSession/PricingPageSessionCreateForExistingSubscriptionResponse.java +++ b/src/main/java/com/chargebee/v4/models/pricingPageSession/responses/PricingPageSessionCreateForExistingSubscriptionResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.pricingPageSession; +package com.chargebee.v4.models.pricingPageSession.responses; -import com.chargebee.v4.core.models.pricingPageSession.PricingPageSession; +import com.chargebee.v4.models.pricingPageSession.PricingPageSession; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/pricingPageSession/PricingPageSessionCreateForNewSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/pricingPageSession/responses/PricingPageSessionCreateForNewSubscriptionResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/pricingPageSession/PricingPageSessionCreateForNewSubscriptionResponse.java rename to src/main/java/com/chargebee/v4/models/pricingPageSession/responses/PricingPageSessionCreateForNewSubscriptionResponse.java index d3a215db..d5800888 100644 --- a/src/main/java/com/chargebee/v4/core/responses/pricingPageSession/PricingPageSessionCreateForNewSubscriptionResponse.java +++ b/src/main/java/com/chargebee/v4/models/pricingPageSession/responses/PricingPageSessionCreateForNewSubscriptionResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.pricingPageSession; +package com.chargebee.v4.models.pricingPageSession.responses; -import com.chargebee.v4.core.models.pricingPageSession.PricingPageSession; +import com.chargebee.v4.models.pricingPageSession.PricingPageSession; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/product/Product.java b/src/main/java/com/chargebee/v4/models/product/Product.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/product/Product.java rename to src/main/java/com/chargebee/v4/models/product/Product.java index 3bcd9e8d..10f8b0db 100644 --- a/src/main/java/com/chargebee/v4/core/models/product/Product.java +++ b/src/main/java/com/chargebee/v4/models/product/Product.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.product; +package com.chargebee.v4.models.product; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/product/params/ProductCreateParams.java b/src/main/java/com/chargebee/v4/models/product/params/ProductCreateParams.java new file mode 100644 index 00000000..89dea02b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/product/params/ProductCreateParams.java @@ -0,0 +1,229 @@ +/* + * 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.product.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ProductCreateParams { + + private final String name; + + private final String externalName; + + private final Status status; + + private final String id; + + private final String description; + + private final String sku; + + private final java.util.Map metadata; + + private final Boolean shippable; + + private ProductCreateParams(ProductCreateBuilder builder) { + + this.name = builder.name; + + this.externalName = builder.externalName; + + this.status = builder.status; + + this.id = builder.id; + + this.description = builder.description; + + this.sku = builder.sku; + + this.metadata = builder.metadata; + + this.shippable = builder.shippable; + } + + public String getName() { + return name; + } + + public String getExternalName() { + return externalName; + } + + public Status getStatus() { + return status; + } + + public String getId() { + return id; + } + + public String getDescription() { + return description; + } + + public String getSku() { + return sku; + } + + public java.util.Map getMetadata() { + return metadata; + } + + public Boolean getShippable() { + return shippable; + } + + /** 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.externalName != null) { + + formData.put("external_name", this.externalName); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.sku != null) { + + formData.put("sku", this.sku); + } + + if (this.metadata != null) { + + formData.put("metadata", JsonUtil.toJson(this.metadata)); + } + + if (this.shippable != null) { + + formData.put("shippable", this.shippable); + } + + return formData; + } + + /** Create a new builder for ProductCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ProductCreateBuilder builder() { + return new ProductCreateBuilder(); + } + + public static final class ProductCreateBuilder { + + private String name; + + private String externalName; + + private Status status; + + private String id; + + private String description; + + private String sku; + + private java.util.Map metadata; + + private Boolean shippable; + + private ProductCreateBuilder() {} + + public ProductCreateBuilder name(String value) { + this.name = value; + return this; + } + + public ProductCreateBuilder externalName(String value) { + this.externalName = value; + return this; + } + + public ProductCreateBuilder status(Status value) { + this.status = value; + return this; + } + + public ProductCreateBuilder id(String value) { + this.id = value; + return this; + } + + public ProductCreateBuilder description(String value) { + this.description = value; + return this; + } + + public ProductCreateBuilder sku(String value) { + this.sku = value; + return this; + } + + public ProductCreateBuilder metadata(java.util.Map value) { + this.metadata = value; + return this; + } + + public ProductCreateBuilder shippable(Boolean value) { + this.shippable = value; + return this; + } + + public ProductCreateParams build() { + return new ProductCreateParams(this); + } + } + + public enum Status { + ACTIVE("active"), + + INACTIVE("inactive"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/product/params/ProductDeleteParams.java b/src/main/java/com/chargebee/v4/models/product/params/ProductDeleteParams.java new file mode 100644 index 00000000..44f74240 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/product/params/ProductDeleteParams.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.product.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ProductDeleteParams { + + private ProductDeleteParams(ProductDeleteBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for ProductDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ProductDeleteBuilder builder() { + return new ProductDeleteBuilder(); + } + + public static final class ProductDeleteBuilder { + + private ProductDeleteBuilder() {} + + public ProductDeleteParams build() { + return new ProductDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/product/params/ProductListParams.java b/src/main/java/com/chargebee/v4/models/product/params/ProductListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/product/params/ProductListParams.java rename to src/main/java/com/chargebee/v4/models/product/params/ProductListParams.java index e50ce3c9..f709cd9e 100644 --- a/src/main/java/com/chargebee/v4/core/models/product/params/ProductListParams.java +++ b/src/main/java/com/chargebee/v4/models/product/params/ProductListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.product.params; +package com.chargebee.v4.models.product.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/product/params/ProductRetrieveParams.java b/src/main/java/com/chargebee/v4/models/product/params/ProductRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/product/params/ProductRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/product/params/ProductRetrieveParams.java index 389c9f82..a58c6bf9 100644 --- a/src/main/java/com/chargebee/v4/core/models/product/params/ProductRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/product/params/ProductRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.product.params; +package com.chargebee.v4.models.product.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/product/params/ProductUpdateOptionsParams.java b/src/main/java/com/chargebee/v4/models/product/params/ProductUpdateOptionsParams.java new file mode 100644 index 00000000..8d5066f7 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/product/params/ProductUpdateOptionsParams.java @@ -0,0 +1,180 @@ +/* + * 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.product.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class ProductUpdateOptionsParams { + + private final List removeOptions; + + private final List options; + + private ProductUpdateOptionsParams(ProductUpdateOptionsBuilder builder) { + + this.removeOptions = builder.removeOptions; + + this.options = builder.options; + } + + public List getRemoveOptions() { + return removeOptions; + } + + public List getOptions() { + return options; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.removeOptions != null) { + + formData.put("remove_options", this.removeOptions); + } + + if (this.options != null) { + + // List of objects + for (int i = 0; i < this.options.size(); i++) { + OptionsParams item = this.options.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "options[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for ProductUpdateOptionsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ProductUpdateOptionsBuilder builder() { + return new ProductUpdateOptionsBuilder(); + } + + public static final class ProductUpdateOptionsBuilder { + + private List removeOptions; + + private List options; + + private ProductUpdateOptionsBuilder() {} + + public ProductUpdateOptionsBuilder removeOptions(List value) { + this.removeOptions = value; + return this; + } + + public ProductUpdateOptionsBuilder options(List value) { + this.options = value; + return this; + } + + public ProductUpdateOptionsParams build() { + return new ProductUpdateOptionsParams(this); + } + } + + public static final class OptionsParams { + + private final String name; + + private final List values; + + private final String defaultValue; + + private OptionsParams(OptionsBuilder builder) { + + this.name = builder.name; + + this.values = builder.values; + + this.defaultValue = builder.defaultValue; + } + + public String getName() { + return name; + } + + public List getValues() { + return values; + } + + public String getDefaultValue() { + return defaultValue; + } + + /** 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.values != null) { + + formData.put("values", JsonUtil.toJson(this.values)); + } + + if (this.defaultValue != null) { + + formData.put("default_value", this.defaultValue); + } + + return formData; + } + + /** Create a new builder for OptionsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OptionsBuilder builder() { + return new OptionsBuilder(); + } + + public static final class OptionsBuilder { + + private String name; + + private List values; + + private String defaultValue; + + private OptionsBuilder() {} + + public OptionsBuilder name(String value) { + this.name = value; + return this; + } + + public OptionsBuilder values(List value) { + this.values = value; + return this; + } + + public OptionsBuilder defaultValue(String value) { + this.defaultValue = value; + return this; + } + + public OptionsParams build() { + return new OptionsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/product/params/ProductUpdateParams.java b/src/main/java/com/chargebee/v4/models/product/params/ProductUpdateParams.java new file mode 100644 index 00000000..98c506f9 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/product/params/ProductUpdateParams.java @@ -0,0 +1,209 @@ +/* + * 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.product.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ProductUpdateParams { + + private final String name; + + private final String externalName; + + private final String description; + + private final Status status; + + private final String sku; + + private final Boolean shippable; + + private final java.util.Map metadata; + + private ProductUpdateParams(ProductUpdateBuilder builder) { + + this.name = builder.name; + + this.externalName = builder.externalName; + + this.description = builder.description; + + this.status = builder.status; + + this.sku = builder.sku; + + this.shippable = builder.shippable; + + this.metadata = builder.metadata; + } + + public String getName() { + return name; + } + + public String getExternalName() { + return externalName; + } + + public String getDescription() { + return description; + } + + public Status getStatus() { + return status; + } + + public String getSku() { + return sku; + } + + public Boolean getShippable() { + return shippable; + } + + public java.util.Map getMetadata() { + return metadata; + } + + /** 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.externalName != null) { + + formData.put("external_name", this.externalName); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.sku != null) { + + formData.put("sku", this.sku); + } + + if (this.shippable != null) { + + formData.put("shippable", this.shippable); + } + + if (this.metadata != null) { + + formData.put("metadata", JsonUtil.toJson(this.metadata)); + } + + return formData; + } + + /** Create a new builder for ProductUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ProductUpdateBuilder builder() { + return new ProductUpdateBuilder(); + } + + public static final class ProductUpdateBuilder { + + private String name; + + private String externalName; + + private String description; + + private Status status; + + private String sku; + + private Boolean shippable; + + private java.util.Map metadata; + + private ProductUpdateBuilder() {} + + public ProductUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public ProductUpdateBuilder externalName(String value) { + this.externalName = value; + return this; + } + + public ProductUpdateBuilder description(String value) { + this.description = value; + return this; + } + + public ProductUpdateBuilder status(Status value) { + this.status = value; + return this; + } + + public ProductUpdateBuilder sku(String value) { + this.sku = value; + return this; + } + + public ProductUpdateBuilder shippable(Boolean value) { + this.shippable = value; + return this; + } + + public ProductUpdateBuilder metadata(java.util.Map value) { + this.metadata = value; + return this; + } + + public ProductUpdateParams build() { + return new ProductUpdateParams(this); + } + } + + public enum Status { + ACTIVE("active"), + + INACTIVE("inactive"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/product/ProductCreateResponse.java b/src/main/java/com/chargebee/v4/models/product/responses/ProductCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/product/ProductCreateResponse.java rename to src/main/java/com/chargebee/v4/models/product/responses/ProductCreateResponse.java index 89ff75cc..f3f73539 100644 --- a/src/main/java/com/chargebee/v4/core/responses/product/ProductCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/product/responses/ProductCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.product; +package com.chargebee.v4.models.product.responses; -import com.chargebee.v4.core.models.product.Product; +import com.chargebee.v4.models.product.Product; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/product/ProductDeleteResponse.java b/src/main/java/com/chargebee/v4/models/product/responses/ProductDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/product/ProductDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/product/responses/ProductDeleteResponse.java index a8496e60..ea97ef40 100644 --- a/src/main/java/com/chargebee/v4/core/responses/product/ProductDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/product/responses/ProductDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.product; +package com.chargebee.v4.models.product.responses; -import com.chargebee.v4.core.models.product.Product; +import com.chargebee.v4.models.product.Product; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/product/ProductListResponse.java b/src/main/java/com/chargebee/v4/models/product/responses/ProductListResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/product/ProductListResponse.java rename to src/main/java/com/chargebee/v4/models/product/responses/ProductListResponse.java index 59959489..44ae3df3 100644 --- a/src/main/java/com/chargebee/v4/core/responses/product/ProductListResponse.java +++ b/src/main/java/com/chargebee/v4/models/product/responses/ProductListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.product; +package com.chargebee.v4.models.product.responses; import java.util.List; -import com.chargebee.v4.core.models.product.Product; +import com.chargebee.v4.models.product.Product; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.ProductService; -import com.chargebee.v4.core.models.product.params.ProductListParams; +import com.chargebee.v4.services.ProductService; +import com.chargebee.v4.models.product.params.ProductListParams; /** Immutable response object for ProductList operation. Contains paginated list data. */ public final class ProductListResponse { @@ -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 ProductListResponse nextPage() throws Exception { + public ProductListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/product/responses/ProductRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/product/responses/ProductRetrieveResponse.java new file mode 100644 index 00000000..33941460 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/product/responses/ProductRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.product.responses; + +import com.chargebee.v4.models.product.Product; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ProductRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class ProductRetrieveResponse extends BaseResponse { + private final Product product; + + private ProductRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.product = builder.product; + } + + /** Parse JSON response into ProductRetrieveResponse object. */ + public static ProductRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ProductRetrieveResponse object with HTTP response. */ + public static ProductRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __productJson = JsonUtil.getObject(json, "product"); + if (__productJson != null) { + builder.product(Product.fromJson(__productJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ProductRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for ProductRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ProductRetrieveResponse. */ + public static class Builder { + + private Product product; + + private Response httpResponse; + + private Builder() {} + + public Builder product(Product product) { + this.product = product; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ProductRetrieveResponse build() { + return new ProductRetrieveResponse(this); + } + } + + /** Get the product from the response. */ + public Product getProduct() { + return product; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/product/ProductUpdateOptionsResponse.java b/src/main/java/com/chargebee/v4/models/product/responses/ProductUpdateOptionsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/product/ProductUpdateOptionsResponse.java rename to src/main/java/com/chargebee/v4/models/product/responses/ProductUpdateOptionsResponse.java index c5dac157..6ad2d74e 100644 --- a/src/main/java/com/chargebee/v4/core/responses/product/ProductUpdateOptionsResponse.java +++ b/src/main/java/com/chargebee/v4/models/product/responses/ProductUpdateOptionsResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.product; +package com.chargebee.v4.models.product.responses; -import com.chargebee.v4.core.models.product.Product; +import com.chargebee.v4.models.product.Product; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/product/ProductUpdateResponse.java b/src/main/java/com/chargebee/v4/models/product/responses/ProductUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/product/ProductUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/product/responses/ProductUpdateResponse.java index 8accd94c..4f5b5740 100644 --- a/src/main/java/com/chargebee/v4/core/responses/product/ProductUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/product/responses/ProductUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.product; +package com.chargebee.v4.models.product.responses; -import com.chargebee.v4.core.models.product.Product; +import com.chargebee.v4.models.product.Product; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/promotionalCredit/PromotionalCredit.java b/src/main/java/com/chargebee/v4/models/promotionalCredit/PromotionalCredit.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/promotionalCredit/PromotionalCredit.java rename to src/main/java/com/chargebee/v4/models/promotionalCredit/PromotionalCredit.java index da9212fc..2442fb8f 100644 --- a/src/main/java/com/chargebee/v4/core/models/promotionalCredit/PromotionalCredit.java +++ b/src/main/java/com/chargebee/v4/models/promotionalCredit/PromotionalCredit.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.promotionalCredit; +package com.chargebee.v4.models.promotionalCredit; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditAddParams.java b/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditAddParams.java new file mode 100644 index 00000000..43f2fc85 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditAddParams.java @@ -0,0 +1,210 @@ +/* + * 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.promotionalCredit.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PromotionalCreditAddParams { + + private final String customerId; + + private final Long amount; + + private final String amountInDecimal; + + private final String currencyCode; + + private final String description; + + private final CreditType creditType; + + private final String reference; + + private PromotionalCreditAddParams(PromotionalCreditAddBuilder builder) { + + this.customerId = builder.customerId; + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.currencyCode = builder.currencyCode; + + this.description = builder.description; + + this.creditType = builder.creditType; + + this.reference = builder.reference; + } + + public String getCustomerId() { + return customerId; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getDescription() { + return description; + } + + public CreditType getCreditType() { + return creditType; + } + + public String getReference() { + return reference; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.creditType != null) { + + formData.put("credit_type", this.creditType); + } + + if (this.reference != null) { + + formData.put("reference", this.reference); + } + + return formData; + } + + /** Create a new builder for PromotionalCreditAddParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PromotionalCreditAddBuilder builder() { + return new PromotionalCreditAddBuilder(); + } + + public static final class PromotionalCreditAddBuilder { + + private String customerId; + + private Long amount; + + private String amountInDecimal; + + private String currencyCode; + + private String description; + + private CreditType creditType; + + private String reference; + + private PromotionalCreditAddBuilder() {} + + public PromotionalCreditAddBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public PromotionalCreditAddBuilder amount(Long value) { + this.amount = value; + return this; + } + + public PromotionalCreditAddBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public PromotionalCreditAddBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public PromotionalCreditAddBuilder description(String value) { + this.description = value; + return this; + } + + public PromotionalCreditAddBuilder creditType(CreditType value) { + this.creditType = value; + return this; + } + + public PromotionalCreditAddBuilder reference(String value) { + this.reference = value; + return this; + } + + public PromotionalCreditAddParams build() { + return new PromotionalCreditAddParams(this); + } + } + + public enum CreditType { + LOYALTY_CREDITS("loyalty_credits"), + + REFERRAL_REWARDS("referral_rewards"), + + GENERAL("general"), + + /** An enum member indicating that CreditType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CreditType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CreditType fromString(String value) { + if (value == null) return _UNKNOWN; + for (CreditType enumValue : CreditType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditDeductParams.java b/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditDeductParams.java new file mode 100644 index 00000000..540e8cac --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditDeductParams.java @@ -0,0 +1,210 @@ +/* + * 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.promotionalCredit.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PromotionalCreditDeductParams { + + private final String customerId; + + private final Long amount; + + private final String amountInDecimal; + + private final String currencyCode; + + private final String description; + + private final CreditType creditType; + + private final String reference; + + private PromotionalCreditDeductParams(PromotionalCreditDeductBuilder builder) { + + this.customerId = builder.customerId; + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.currencyCode = builder.currencyCode; + + this.description = builder.description; + + this.creditType = builder.creditType; + + this.reference = builder.reference; + } + + public String getCustomerId() { + return customerId; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getDescription() { + return description; + } + + public CreditType getCreditType() { + return creditType; + } + + public String getReference() { + return reference; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.creditType != null) { + + formData.put("credit_type", this.creditType); + } + + if (this.reference != null) { + + formData.put("reference", this.reference); + } + + return formData; + } + + /** Create a new builder for PromotionalCreditDeductParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PromotionalCreditDeductBuilder builder() { + return new PromotionalCreditDeductBuilder(); + } + + public static final class PromotionalCreditDeductBuilder { + + private String customerId; + + private Long amount; + + private String amountInDecimal; + + private String currencyCode; + + private String description; + + private CreditType creditType; + + private String reference; + + private PromotionalCreditDeductBuilder() {} + + public PromotionalCreditDeductBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public PromotionalCreditDeductBuilder amount(Long value) { + this.amount = value; + return this; + } + + public PromotionalCreditDeductBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public PromotionalCreditDeductBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public PromotionalCreditDeductBuilder description(String value) { + this.description = value; + return this; + } + + public PromotionalCreditDeductBuilder creditType(CreditType value) { + this.creditType = value; + return this; + } + + public PromotionalCreditDeductBuilder reference(String value) { + this.reference = value; + return this; + } + + public PromotionalCreditDeductParams build() { + return new PromotionalCreditDeductParams(this); + } + } + + public enum CreditType { + LOYALTY_CREDITS("loyalty_credits"), + + REFERRAL_REWARDS("referral_rewards"), + + GENERAL("general"), + + /** An enum member indicating that CreditType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CreditType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CreditType fromString(String value) { + if (value == null) return _UNKNOWN; + for (CreditType enumValue : CreditType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/promotionalCredit/params/PromotionalCreditListParams.java b/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/promotionalCredit/params/PromotionalCreditListParams.java rename to src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditListParams.java index 18828dca..c949984f 100644 --- a/src/main/java/com/chargebee/v4/core/models/promotionalCredit/params/PromotionalCreditListParams.java +++ b/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.promotionalCredit.params; +package com.chargebee.v4.models.promotionalCredit.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/promotionalCredit/params/PromotionalCreditRetrieveParams.java b/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/promotionalCredit/params/PromotionalCreditRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditRetrieveParams.java index 739e901f..bacc1ad8 100644 --- a/src/main/java/com/chargebee/v4/core/models/promotionalCredit/params/PromotionalCreditRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.promotionalCredit.params; +package com.chargebee.v4.models.promotionalCredit.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditSetParams.java b/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditSetParams.java new file mode 100644 index 00000000..829ab233 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditSetParams.java @@ -0,0 +1,210 @@ +/* + * 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.promotionalCredit.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PromotionalCreditSetParams { + + private final String customerId; + + private final Long amount; + + private final String amountInDecimal; + + private final String currencyCode; + + private final String description; + + private final CreditType creditType; + + private final String reference; + + private PromotionalCreditSetParams(PromotionalCreditSetBuilder builder) { + + this.customerId = builder.customerId; + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.currencyCode = builder.currencyCode; + + this.description = builder.description; + + this.creditType = builder.creditType; + + this.reference = builder.reference; + } + + public String getCustomerId() { + return customerId; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getDescription() { + return description; + } + + public CreditType getCreditType() { + return creditType; + } + + public String getReference() { + return reference; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.creditType != null) { + + formData.put("credit_type", this.creditType); + } + + if (this.reference != null) { + + formData.put("reference", this.reference); + } + + return formData; + } + + /** Create a new builder for PromotionalCreditSetParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PromotionalCreditSetBuilder builder() { + return new PromotionalCreditSetBuilder(); + } + + public static final class PromotionalCreditSetBuilder { + + private String customerId; + + private Long amount; + + private String amountInDecimal; + + private String currencyCode; + + private String description; + + private CreditType creditType; + + private String reference; + + private PromotionalCreditSetBuilder() {} + + public PromotionalCreditSetBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public PromotionalCreditSetBuilder amount(Long value) { + this.amount = value; + return this; + } + + public PromotionalCreditSetBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public PromotionalCreditSetBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public PromotionalCreditSetBuilder description(String value) { + this.description = value; + return this; + } + + public PromotionalCreditSetBuilder creditType(CreditType value) { + this.creditType = value; + return this; + } + + public PromotionalCreditSetBuilder reference(String value) { + this.reference = value; + return this; + } + + public PromotionalCreditSetParams build() { + return new PromotionalCreditSetParams(this); + } + } + + public enum CreditType { + LOYALTY_CREDITS("loyalty_credits"), + + REFERRAL_REWARDS("referral_rewards"), + + GENERAL("general"), + + /** An enum member indicating that CreditType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CreditType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CreditType fromString(String value) { + if (value == null) return _UNKNOWN; + for (CreditType enumValue : CreditType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/promotionalCredit/PromotionalCreditAddResponse.java b/src/main/java/com/chargebee/v4/models/promotionalCredit/responses/PromotionalCreditAddResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/promotionalCredit/PromotionalCreditAddResponse.java rename to src/main/java/com/chargebee/v4/models/promotionalCredit/responses/PromotionalCreditAddResponse.java index dce10236..d9f048f6 100644 --- a/src/main/java/com/chargebee/v4/core/responses/promotionalCredit/PromotionalCreditAddResponse.java +++ b/src/main/java/com/chargebee/v4/models/promotionalCredit/responses/PromotionalCreditAddResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.promotionalCredit; +package com.chargebee.v4.models.promotionalCredit.responses; -import com.chargebee.v4.core.models.promotionalCredit.PromotionalCredit; +import com.chargebee.v4.models.promotionalCredit.PromotionalCredit; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/promotionalCredit/PromotionalCreditDeductResponse.java b/src/main/java/com/chargebee/v4/models/promotionalCredit/responses/PromotionalCreditDeductResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/promotionalCredit/PromotionalCreditDeductResponse.java rename to src/main/java/com/chargebee/v4/models/promotionalCredit/responses/PromotionalCreditDeductResponse.java index 9a037d1a..b1b26542 100644 --- a/src/main/java/com/chargebee/v4/core/responses/promotionalCredit/PromotionalCreditDeductResponse.java +++ b/src/main/java/com/chargebee/v4/models/promotionalCredit/responses/PromotionalCreditDeductResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.promotionalCredit; +package com.chargebee.v4.models.promotionalCredit.responses; -import com.chargebee.v4.core.models.promotionalCredit.PromotionalCredit; +import com.chargebee.v4.models.promotionalCredit.PromotionalCredit; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/promotionalCredit/PromotionalCreditListResponse.java b/src/main/java/com/chargebee/v4/models/promotionalCredit/responses/PromotionalCreditListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/promotionalCredit/PromotionalCreditListResponse.java rename to src/main/java/com/chargebee/v4/models/promotionalCredit/responses/PromotionalCreditListResponse.java index bf6f690b..a67c08c2 100644 --- a/src/main/java/com/chargebee/v4/core/responses/promotionalCredit/PromotionalCreditListResponse.java +++ b/src/main/java/com/chargebee/v4/models/promotionalCredit/responses/PromotionalCreditListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.promotionalCredit; +package com.chargebee.v4.models.promotionalCredit.responses; import java.util.List; -import com.chargebee.v4.core.models.promotionalCredit.PromotionalCredit; +import com.chargebee.v4.models.promotionalCredit.PromotionalCredit; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.PromotionalCreditService; -import com.chargebee.v4.core.models.promotionalCredit.params.PromotionalCreditListParams; +import com.chargebee.v4.services.PromotionalCreditService; +import com.chargebee.v4.models.promotionalCredit.params.PromotionalCreditListParams; /** Immutable response object for PromotionalCreditList operation. Contains paginated list data. */ public final class PromotionalCreditListResponse { @@ -99,9 +100,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 PromotionalCreditListResponse nextPage() throws Exception { + public PromotionalCreditListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/promotionalCredit/responses/PromotionalCreditRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/promotionalCredit/responses/PromotionalCreditRetrieveResponse.java new file mode 100644 index 00000000..5838b132 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/promotionalCredit/responses/PromotionalCreditRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.promotionalCredit.responses; + +import com.chargebee.v4.models.promotionalCredit.PromotionalCredit; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for PromotionalCreditRetrieve operation. Contains the response data + * from a single resource get operation. + */ +public final class PromotionalCreditRetrieveResponse extends BaseResponse { + private final PromotionalCredit promotionalCredit; + + private PromotionalCreditRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.promotionalCredit = builder.promotionalCredit; + } + + /** Parse JSON response into PromotionalCreditRetrieveResponse object. */ + public static PromotionalCreditRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into PromotionalCreditRetrieveResponse object with HTTP response. */ + public static PromotionalCreditRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __promotionalCreditJson = JsonUtil.getObject(json, "promotional_credit"); + if (__promotionalCreditJson != null) { + builder.promotionalCredit(PromotionalCredit.fromJson(__promotionalCreditJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PromotionalCreditRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for PromotionalCreditRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PromotionalCreditRetrieveResponse. */ + public static class Builder { + + private PromotionalCredit promotionalCredit; + + private Response httpResponse; + + private Builder() {} + + public Builder promotionalCredit(PromotionalCredit promotionalCredit) { + this.promotionalCredit = promotionalCredit; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public PromotionalCreditRetrieveResponse build() { + return new PromotionalCreditRetrieveResponse(this); + } + } + + /** Get the promotionalCredit from the response. */ + public PromotionalCredit getPromotionalCredit() { + return promotionalCredit; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/promotionalCredit/PromotionalCreditSetResponse.java b/src/main/java/com/chargebee/v4/models/promotionalCredit/responses/PromotionalCreditSetResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/promotionalCredit/PromotionalCreditSetResponse.java rename to src/main/java/com/chargebee/v4/models/promotionalCredit/responses/PromotionalCreditSetResponse.java index 77908ee8..4ea3a6cf 100644 --- a/src/main/java/com/chargebee/v4/core/responses/promotionalCredit/PromotionalCreditSetResponse.java +++ b/src/main/java/com/chargebee/v4/models/promotionalCredit/responses/PromotionalCreditSetResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.promotionalCredit; +package com.chargebee.v4.models.promotionalCredit.responses; -import com.chargebee.v4.core.models.promotionalCredit.PromotionalCredit; +import com.chargebee.v4.models.promotionalCredit.PromotionalCredit; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/purchase/Purchase.java b/src/main/java/com/chargebee/v4/models/purchase/Purchase.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/purchase/Purchase.java rename to src/main/java/com/chargebee/v4/models/purchase/Purchase.java index 7532f110..00a73bc3 100644 --- a/src/main/java/com/chargebee/v4/core/models/purchase/Purchase.java +++ b/src/main/java/com/chargebee/v4/models/purchase/Purchase.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.purchase; +package com.chargebee.v4.models.purchase; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseCreateParams.java b/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseCreateParams.java new file mode 100644 index 00000000..2258af26 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseCreateParams.java @@ -0,0 +1,1886 @@ +/* + * 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.purchase.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class PurchaseCreateParams { + + private final String customerId; + + private final String paymentSourceId; + + private final Boolean replacePrimaryPaymentSource; + + private final InvoiceInfoParams invoiceInfo; + + private final PaymentScheduleParams paymentSchedule; + + private final StatementDescriptorParams statementDescriptor; + + private final PaymentIntentParams paymentIntent; + + private final List purchaseItems; + + private final List itemTiers; + + private final List shippingAddresses; + + private final List discounts; + + private final List subscriptionInfo; + + private final List contractTerms; + + private PurchaseCreateParams(PurchaseCreateBuilder builder) { + + this.customerId = builder.customerId; + + this.paymentSourceId = builder.paymentSourceId; + + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; + + this.invoiceInfo = builder.invoiceInfo; + + this.paymentSchedule = builder.paymentSchedule; + + this.statementDescriptor = builder.statementDescriptor; + + this.paymentIntent = builder.paymentIntent; + + this.purchaseItems = builder.purchaseItems; + + this.itemTiers = builder.itemTiers; + + this.shippingAddresses = builder.shippingAddresses; + + this.discounts = builder.discounts; + + this.subscriptionInfo = builder.subscriptionInfo; + + this.contractTerms = builder.contractTerms; + } + + public String getCustomerId() { + return customerId; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public Boolean getReplacePrimaryPaymentSource() { + return replacePrimaryPaymentSource; + } + + public InvoiceInfoParams getInvoiceInfo() { + return invoiceInfo; + } + + public PaymentScheduleParams getPaymentSchedule() { + return paymentSchedule; + } + + public StatementDescriptorParams getStatementDescriptor() { + return statementDescriptor; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + public List getPurchaseItems() { + return purchaseItems; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getShippingAddresses() { + return shippingAddresses; + } + + public List getDiscounts() { + return discounts; + } + + public List getSubscriptionInfo() { + return subscriptionInfo; + } + + public List getContractTerms() { + return contractTerms; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.replacePrimaryPaymentSource != null) { + + formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); + } + + if (this.invoiceInfo != null) { + + // Single object + Map nestedData = this.invoiceInfo.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "invoice_info[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentSchedule != null) { + + // Single object + Map nestedData = this.paymentSchedule.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_schedule[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.statementDescriptor != null) { + + // Single object + Map nestedData = this.statementDescriptor.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.purchaseItems != null) { + + // List of objects + for (int i = 0; i < this.purchaseItems.size(); i++) { + PurchaseItemsParams item = this.purchaseItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "purchase_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.shippingAddresses != null) { + + // List of objects + for (int i = 0; i < this.shippingAddresses.size(); i++) { + ShippingAddressesParams item = this.shippingAddresses.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "shipping_addresses[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.subscriptionInfo != null) { + + // List of objects + for (int i = 0; i < this.subscriptionInfo.size(); i++) { + SubscriptionInfoParams item = this.subscriptionInfo.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_info[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.contractTerms != null) { + + // List of objects + for (int i = 0; i < this.contractTerms.size(); i++) { + ContractTermsParams item = this.contractTerms.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "contract_terms[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for PurchaseCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PurchaseCreateBuilder builder() { + return new PurchaseCreateBuilder(); + } + + public static final class PurchaseCreateBuilder { + + private String customerId; + + private String paymentSourceId; + + private Boolean replacePrimaryPaymentSource; + + private InvoiceInfoParams invoiceInfo; + + private PaymentScheduleParams paymentSchedule; + + private StatementDescriptorParams statementDescriptor; + + private PaymentIntentParams paymentIntent; + + private List purchaseItems; + + private List itemTiers; + + private List shippingAddresses; + + private List discounts; + + private List subscriptionInfo; + + private List contractTerms; + + private PurchaseCreateBuilder() {} + + public PurchaseCreateBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public PurchaseCreateBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public PurchaseCreateBuilder replacePrimaryPaymentSource(Boolean value) { + this.replacePrimaryPaymentSource = value; + return this; + } + + public PurchaseCreateBuilder invoiceInfo(InvoiceInfoParams value) { + this.invoiceInfo = value; + return this; + } + + public PurchaseCreateBuilder paymentSchedule(PaymentScheduleParams value) { + this.paymentSchedule = value; + return this; + } + + public PurchaseCreateBuilder statementDescriptor(StatementDescriptorParams value) { + this.statementDescriptor = value; + return this; + } + + public PurchaseCreateBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public PurchaseCreateBuilder purchaseItems(List value) { + this.purchaseItems = value; + return this; + } + + public PurchaseCreateBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public PurchaseCreateBuilder shippingAddresses(List value) { + this.shippingAddresses = value; + return this; + } + + public PurchaseCreateBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public PurchaseCreateBuilder subscriptionInfo(List value) { + this.subscriptionInfo = value; + return this; + } + + public PurchaseCreateBuilder contractTerms(List value) { + this.contractTerms = value; + return this; + } + + public PurchaseCreateParams build() { + return new PurchaseCreateParams(this); + } + } + + public static final class InvoiceInfoParams { + + private final String poNumber; + + private final String notes; + + private InvoiceInfoParams(InvoiceInfoBuilder builder) { + + this.poNumber = builder.poNumber; + + this.notes = builder.notes; + } + + public String getPoNumber() { + return poNumber; + } + + public String getNotes() { + return notes; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.notes != null) { + + formData.put("notes", this.notes); + } + + return formData; + } + + /** Create a new builder for InvoiceInfoParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceInfoBuilder builder() { + return new InvoiceInfoBuilder(); + } + + public static final class InvoiceInfoBuilder { + + private String poNumber; + + private String notes; + + private InvoiceInfoBuilder() {} + + public InvoiceInfoBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public InvoiceInfoBuilder notes(String value) { + this.notes = value; + return this; + } + + public InvoiceInfoParams build() { + return new InvoiceInfoParams(this); + } + } + } + + public static final class PaymentScheduleParams { + + private final String schemeId; + + private final Long amount; + + private PaymentScheduleParams(PaymentScheduleBuilder builder) { + + this.schemeId = builder.schemeId; + + this.amount = builder.amount; + } + + public String getSchemeId() { + return schemeId; + } + + public Long getAmount() { + return amount; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.schemeId != null) { + + formData.put("scheme_id", this.schemeId); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + return formData; + } + + /** Create a new builder for PaymentScheduleParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentScheduleBuilder builder() { + return new PaymentScheduleBuilder(); + } + + public static final class PaymentScheduleBuilder { + + private String schemeId; + + private Long amount; + + private PaymentScheduleBuilder() {} + + public PaymentScheduleBuilder schemeId(String value) { + this.schemeId = value; + return this; + } + + public PaymentScheduleBuilder amount(Long value) { + this.amount = value; + return this; + } + + public PaymentScheduleParams build() { + return new PaymentScheduleParams(this); + } + } + } + + public static final class StatementDescriptorParams { + + private final String descriptor; + + private StatementDescriptorParams(StatementDescriptorBuilder builder) { + + this.descriptor = builder.descriptor; + } + + public String getDescriptor() { + return descriptor; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.descriptor != null) { + + formData.put("descriptor", this.descriptor); + } + + return formData; + } + + /** Create a new builder for StatementDescriptorParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatementDescriptorBuilder builder() { + return new StatementDescriptorBuilder(); + } + + public static final class StatementDescriptorBuilder { + + private String descriptor; + + private StatementDescriptorBuilder() {} + + public StatementDescriptorBuilder descriptor(String value) { + this.descriptor = value; + return this; + } + + public StatementDescriptorParams build() { + return new StatementDescriptorParams(this); + } + } + } + + public static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PurchaseItemsParams { + + private final Integer index; + + private final String itemPriceId; + + private final Integer quantity; + + private final Integer unitAmount; + + private final String unitAmountInDecimal; + + private final String quantityInDecimal; + + private PurchaseItemsParams(PurchaseItemsBuilder builder) { + + this.index = builder.index; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.unitAmount = builder.unitAmount; + + this.unitAmountInDecimal = builder.unitAmountInDecimal; + + this.quantityInDecimal = builder.quantityInDecimal; + } + + public Integer getIndex() { + return index; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public Integer getUnitAmount() { + return unitAmount; + } + + public String getUnitAmountInDecimal() { + return unitAmountInDecimal; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.index != null) { + + formData.put("index", this.index); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitAmount != null) { + + formData.put("unit_amount", this.unitAmount); + } + + if (this.unitAmountInDecimal != null) { + + formData.put("unit_amount_in_decimal", this.unitAmountInDecimal); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + return formData; + } + + /** Create a new builder for PurchaseItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PurchaseItemsBuilder builder() { + return new PurchaseItemsBuilder(); + } + + public static final class PurchaseItemsBuilder { + + private Integer index; + + private String itemPriceId; + + private Integer quantity; + + private Integer unitAmount; + + private String unitAmountInDecimal; + + private String quantityInDecimal; + + private PurchaseItemsBuilder() {} + + public PurchaseItemsBuilder index(Integer value) { + this.index = value; + return this; + } + + public PurchaseItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public PurchaseItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public PurchaseItemsBuilder unitAmount(Integer value) { + this.unitAmount = value; + return this; + } + + public PurchaseItemsBuilder unitAmountInDecimal(String value) { + this.unitAmountInDecimal = value; + return this; + } + + public PurchaseItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public PurchaseItemsParams build() { + return new PurchaseItemsParams(this); + } + } + } + + public static final class ItemTiersParams { + + private final Integer index; + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.index = builder.index; + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + } + + public Integer getIndex() { + return index; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.index != null) { + + formData.put("index", this.index); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private Integer index; + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder index(Integer value) { + this.index = value; + return this; + } + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + } + + public static final class ShippingAddressesParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + private final String city; + + private final String state; + + private final String stateCode; + + private final String country; + + private final String zip; + + private final ValidationStatus validationStatus; + + private ShippingAddressesParams(ShippingAddressesBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + this.city = builder.city; + + this.state = builder.state; + + this.stateCode = builder.stateCode; + + this.country = builder.country; + + this.zip = builder.zip; + + this.validationStatus = builder.validationStatus; + } + + 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + public String getCity() { + return city; + } + + public String getState() { + return state; + } + + public String getStateCode() { + return stateCode; + } + + public String getCountry() { + return country; + } + + public String getZip() { + return zip; + } + + public ValidationStatus getValidationStatus() { + return validationStatus; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + if (this.city != null) { + + formData.put("city", this.city); + } + + if (this.state != null) { + + formData.put("state", this.state); + } + + if (this.stateCode != null) { + + formData.put("state_code", this.stateCode); + } + + if (this.country != null) { + + formData.put("country", this.country); + } + + if (this.zip != null) { + + formData.put("zip", this.zip); + } + + if (this.validationStatus != null) { + + formData.put("validation_status", this.validationStatus); + } + + return formData; + } + + /** Create a new builder for ShippingAddressesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressesBuilder builder() { + return new ShippingAddressesBuilder(); + } + + public static final class ShippingAddressesBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String state; + + private String stateCode; + + private String country; + + private String zip; + + private ValidationStatus validationStatus; + + private ShippingAddressesBuilder() {} + + public ShippingAddressesBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressesBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressesBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressesBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressesBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressesBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressesBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressesBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressesBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressesBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressesBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressesBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressesBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressesBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressesParams build() { + return new ShippingAddressesParams(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; + } + } + } + + public static final class DiscountsParams { + + private final Integer index; + + private final String couponId; + + private final Number percentage; + + private final Integer quantity; + + private final Long amount; + + private final Boolean includedInMrr; + + private DiscountsParams(DiscountsBuilder builder) { + + this.index = builder.index; + + this.couponId = builder.couponId; + + this.percentage = builder.percentage; + + this.quantity = builder.quantity; + + this.amount = builder.amount; + + this.includedInMrr = builder.includedInMrr; + } + + public Integer getIndex() { + return index; + } + + public String getCouponId() { + return couponId; + } + + public Number getPercentage() { + return percentage; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getAmount() { + return amount; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.index != null) { + + formData.put("index", this.index); + } + + if (this.couponId != null) { + + formData.put("coupon_id", this.couponId); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private Integer index; + + private String couponId; + + private Number percentage; + + private Integer quantity; + + private Long amount; + + private Boolean includedInMrr; + + private DiscountsBuilder() {} + + public DiscountsBuilder index(Integer value) { + this.index = value; + return this; + } + + public DiscountsBuilder couponId(String value) { + this.couponId = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + } + + public static final class SubscriptionInfoParams { + + private final Integer index; + + private final String subscriptionId; + + private final Integer billingCycles; + + private final Integer contractTermBillingCycleOnRenewal; + + private final java.util.Map metaData; + + private SubscriptionInfoParams(SubscriptionInfoBuilder builder) { + + this.index = builder.index; + + this.subscriptionId = builder.subscriptionId; + + this.billingCycles = builder.billingCycles; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + + this.metaData = builder.metaData; + } + + public Integer getIndex() { + return index; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + public java.util.Map getMetaData() { + return metaData; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.index != null) { + + formData.put("index", this.index); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + return formData; + } + + /** Create a new builder for SubscriptionInfoParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionInfoBuilder builder() { + return new SubscriptionInfoBuilder(); + } + + public static final class SubscriptionInfoBuilder { + + private Integer index; + + private String subscriptionId; + + private Integer billingCycles; + + private Integer contractTermBillingCycleOnRenewal; + + private java.util.Map metaData; + + private SubscriptionInfoBuilder() {} + + public SubscriptionInfoBuilder index(Integer value) { + this.index = value; + return this; + } + + public SubscriptionInfoBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public SubscriptionInfoBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionInfoBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionInfoBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public SubscriptionInfoParams build() { + return new SubscriptionInfoParams(this); + } + } + } + + public static final class ContractTermsParams { + + private final Integer index; + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermsParams(ContractTermsBuilder builder) { + + this.index = builder.index; + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public Integer getIndex() { + return index; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.index != null) { + + formData.put("index", this.index); + } + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermsBuilder builder() { + return new ContractTermsBuilder(); + } + + public static final class ContractTermsBuilder { + + private Integer index; + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermsBuilder() {} + + public ContractTermsBuilder index(Integer value) { + this.index = value; + return this; + } + + public ContractTermsBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermsBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermsParams build() { + return new ContractTermsParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + RENEW_ONCE("renew_once"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseEstimateParams.java b/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseEstimateParams.java new file mode 100644 index 00000000..97327d73 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseEstimateParams.java @@ -0,0 +1,1895 @@ +/* + * 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.purchase.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class PurchaseEstimateParams { + + private final String clientProfileId; + + private final String customerId; + + private final CustomerParams customer; + + private final BillingAddressParams billingAddress; + + private final List purchaseItems; + + private final List itemTiers; + + private final List shippingAddresses; + + private final List discounts; + + private final List subscriptionInfo; + + private final List contractTerms; + + private PurchaseEstimateParams(PurchaseEstimateBuilder builder) { + + this.clientProfileId = builder.clientProfileId; + + this.customerId = builder.customerId; + + this.customer = builder.customer; + + this.billingAddress = builder.billingAddress; + + this.purchaseItems = builder.purchaseItems; + + this.itemTiers = builder.itemTiers; + + this.shippingAddresses = builder.shippingAddresses; + + this.discounts = builder.discounts; + + this.subscriptionInfo = builder.subscriptionInfo; + + this.contractTerms = builder.contractTerms; + } + + public String getClientProfileId() { + return clientProfileId; + } + + public String getCustomerId() { + return customerId; + } + + public CustomerParams getCustomer() { + return customer; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public List getPurchaseItems() { + return purchaseItems; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getShippingAddresses() { + return shippingAddresses; + } + + public List getDiscounts() { + return discounts; + } + + public List getSubscriptionInfo() { + return subscriptionInfo; + } + + public List getContractTerms() { + return contractTerms; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.clientProfileId != null) { + + formData.put("client_profile_id", this.clientProfileId); + } + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + 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()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.purchaseItems != null) { + + // List of objects + for (int i = 0; i < this.purchaseItems.size(); i++) { + PurchaseItemsParams item = this.purchaseItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "purchase_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.shippingAddresses != null) { + + // List of objects + for (int i = 0; i < this.shippingAddresses.size(); i++) { + ShippingAddressesParams item = this.shippingAddresses.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "shipping_addresses[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.subscriptionInfo != null) { + + // List of objects + for (int i = 0; i < this.subscriptionInfo.size(); i++) { + SubscriptionInfoParams item = this.subscriptionInfo.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_info[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.contractTerms != null) { + + // List of objects + for (int i = 0; i < this.contractTerms.size(); i++) { + ContractTermsParams item = this.contractTerms.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "contract_terms[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for PurchaseEstimateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PurchaseEstimateBuilder builder() { + return new PurchaseEstimateBuilder(); + } + + public static final class PurchaseEstimateBuilder { + + private String clientProfileId; + + private String customerId; + + private CustomerParams customer; + + private BillingAddressParams billingAddress; + + private List purchaseItems; + + private List itemTiers; + + private List shippingAddresses; + + private List discounts; + + private List subscriptionInfo; + + private List contractTerms; + + private PurchaseEstimateBuilder() {} + + public PurchaseEstimateBuilder clientProfileId(String value) { + this.clientProfileId = value; + return this; + } + + public PurchaseEstimateBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public PurchaseEstimateBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public PurchaseEstimateBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public PurchaseEstimateBuilder purchaseItems(List value) { + this.purchaseItems = value; + return this; + } + + public PurchaseEstimateBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public PurchaseEstimateBuilder shippingAddresses(List value) { + this.shippingAddresses = value; + return this; + } + + public PurchaseEstimateBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public PurchaseEstimateBuilder subscriptionInfo(List value) { + this.subscriptionInfo = value; + return this; + } + + public PurchaseEstimateBuilder contractTerms(List value) { + this.contractTerms = value; + return this; + } + + public PurchaseEstimateParams build() { + return new PurchaseEstimateParams(this); + } + } + + public static final class CustomerParams { + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final Boolean registeredForGst; + + private final Taxability taxability; + + private final EntityCode entityCode; + + private final String exemptNumber; + + private final List exemptionDetails; + + private final CustomerType customerType; + + private CustomerParams(CustomerBuilder builder) { + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.registeredForGst = builder.registeredForGst; + + this.taxability = builder.taxability; + + this.entityCode = builder.entityCode; + + this.exemptNumber = builder.exemptNumber; + + this.exemptionDetails = builder.exemptionDetails; + + this.customerType = builder.customerType; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public Boolean getRegisteredForGst() { + return registeredForGst; + } + + public Taxability getTaxability() { + return taxability; + } + + public EntityCode getEntityCode() { + return entityCode; + } + + public String getExemptNumber() { + return exemptNumber; + } + + public List getExemptionDetails() { + return exemptionDetails; + } + + public CustomerType getCustomerType() { + return customerType; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.registeredForGst != null) { + + formData.put("registered_for_gst", this.registeredForGst); + } + + if (this.taxability != null) { + + formData.put("taxability", this.taxability); + } + + if (this.entityCode != null) { + + formData.put("entity_code", this.entityCode); + } + + if (this.exemptNumber != null) { + + formData.put("exempt_number", this.exemptNumber); + } + + if (this.exemptionDetails != null) { + + formData.put("exemption_details", JsonUtil.toJson(this.exemptionDetails)); + } + + if (this.customerType != null) { + + formData.put("customer_type", this.customerType); + } + + 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 String vatNumberPrefix; + + private Boolean registeredForGst; + + private Taxability taxability; + + private EntityCode entityCode; + + private String exemptNumber; + + private List exemptionDetails; + + private CustomerType customerType; + + private CustomerBuilder() {} + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder registeredForGst(Boolean value) { + this.registeredForGst = value; + return this; + } + + public CustomerBuilder taxability(Taxability value) { + this.taxability = value; + return this; + } + + public CustomerBuilder entityCode(EntityCode value) { + this.entityCode = value; + return this; + } + + public CustomerBuilder exemptNumber(String value) { + this.exemptNumber = value; + return this; + } + + public CustomerBuilder exemptionDetails(List value) { + this.exemptionDetails = value; + return this; + } + + public CustomerBuilder customerType(CustomerType value) { + this.customerType = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + + public enum Taxability { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Taxability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Taxability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Taxability fromString(String value) { + if (value == null) return _UNKNOWN; + for (Taxability enumValue : Taxability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EntityCode { + A("a"), + + B("b"), + + C("c"), + + D("d"), + + E("e"), + + F("f"), + + G("g"), + + H("h"), + + I("i"), + + J("j"), + + K("k"), + + L("l"), + + M("m"), + + N("n"), + + P("p"), + + Q("q"), + + R("r"), + + MED_1("med1"), + + MED_2("med2"), + + /** An enum member indicating that EntityCode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EntityCode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EntityCode fromString(String value) { + if (value == null) return _UNKNOWN; + for (EntityCode enumValue : EntityCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum CustomerType { + RESIDENTIAL("residential"), + + BUSINESS("business"), + + SENIOR_CITIZEN("senior_citizen"), + + INDUSTRIAL("industrial"), + + /** An enum member indicating that CustomerType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CustomerType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CustomerType fromString(String value) { + if (value == null) return _UNKNOWN; + for (CustomerType enumValue : CustomerType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String line1; + + private final String line2; + + private final String line3; + + private final String city; + + private final String stateCode; + + private final String zip; + + private final String country; + + private final ValidationStatus validationStatus; + + private BillingAddressParams(BillingAddressBuilder builder) { + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + this.city = builder.city; + + this.stateCode = builder.stateCode; + + this.zip = builder.zip; + + this.country = builder.country; + + this.validationStatus = builder.validationStatus; + } + + public String getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + public String getCity() { + return city; + } + + public String getStateCode() { + return stateCode; + } + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + if (this.city != null) { + + formData.put("city", this.city); + } + + if (this.stateCode != null) { + + formData.put("state_code", this.stateCode); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class PurchaseItemsParams { + + private final Integer index; + + private final String itemPriceId; + + private final Integer quantity; + + private final Integer unitAmount; + + private final String unitAmountInDecimal; + + private final String quantityInDecimal; + + private PurchaseItemsParams(PurchaseItemsBuilder builder) { + + this.index = builder.index; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.unitAmount = builder.unitAmount; + + this.unitAmountInDecimal = builder.unitAmountInDecimal; + + this.quantityInDecimal = builder.quantityInDecimal; + } + + public Integer getIndex() { + return index; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public Integer getUnitAmount() { + return unitAmount; + } + + public String getUnitAmountInDecimal() { + return unitAmountInDecimal; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.index != null) { + + formData.put("index", this.index); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitAmount != null) { + + formData.put("unit_amount", this.unitAmount); + } + + if (this.unitAmountInDecimal != null) { + + formData.put("unit_amount_in_decimal", this.unitAmountInDecimal); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + return formData; + } + + /** Create a new builder for PurchaseItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PurchaseItemsBuilder builder() { + return new PurchaseItemsBuilder(); + } + + public static final class PurchaseItemsBuilder { + + private Integer index; + + private String itemPriceId; + + private Integer quantity; + + private Integer unitAmount; + + private String unitAmountInDecimal; + + private String quantityInDecimal; + + private PurchaseItemsBuilder() {} + + public PurchaseItemsBuilder index(Integer value) { + this.index = value; + return this; + } + + public PurchaseItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public PurchaseItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public PurchaseItemsBuilder unitAmount(Integer value) { + this.unitAmount = value; + return this; + } + + public PurchaseItemsBuilder unitAmountInDecimal(String value) { + this.unitAmountInDecimal = value; + return this; + } + + public PurchaseItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public PurchaseItemsParams build() { + return new PurchaseItemsParams(this); + } + } + } + + public static final class ItemTiersParams { + + private final Integer index; + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.index = builder.index; + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + } + + public Integer getIndex() { + return index; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.index != null) { + + formData.put("index", this.index); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private Integer index; + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder index(Integer value) { + this.index = value; + return this; + } + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + } + + public static final class ShippingAddressesParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + private final String city; + + private final String state; + + private final String stateCode; + + private final String country; + + private final String zip; + + private final ValidationStatus validationStatus; + + private ShippingAddressesParams(ShippingAddressesBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + this.city = builder.city; + + this.state = builder.state; + + this.stateCode = builder.stateCode; + + this.country = builder.country; + + this.zip = builder.zip; + + this.validationStatus = builder.validationStatus; + } + + 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + public String getCity() { + return city; + } + + public String getState() { + return state; + } + + public String getStateCode() { + return stateCode; + } + + public String getCountry() { + return country; + } + + public String getZip() { + return zip; + } + + public ValidationStatus getValidationStatus() { + return validationStatus; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + 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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + if (this.city != null) { + + formData.put("city", this.city); + } + + if (this.state != null) { + + formData.put("state", this.state); + } + + if (this.stateCode != null) { + + formData.put("state_code", this.stateCode); + } + + if (this.country != null) { + + formData.put("country", this.country); + } + + if (this.zip != null) { + + formData.put("zip", this.zip); + } + + if (this.validationStatus != null) { + + formData.put("validation_status", this.validationStatus); + } + + return formData; + } + + /** Create a new builder for ShippingAddressesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressesBuilder builder() { + return new ShippingAddressesBuilder(); + } + + public static final class ShippingAddressesBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String state; + + private String stateCode; + + private String country; + + private String zip; + + private ValidationStatus validationStatus; + + private ShippingAddressesBuilder() {} + + public ShippingAddressesBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressesBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressesBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressesBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressesBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressesBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressesBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressesBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressesBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressesBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressesBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressesBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressesBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressesBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressesParams build() { + return new ShippingAddressesParams(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; + } + } + } + + public static final class DiscountsParams { + + private final Integer index; + + private final String couponId; + + private final Number percentage; + + private final Integer quantity; + + private final Long amount; + + private final Boolean includedInMrr; + + private DiscountsParams(DiscountsBuilder builder) { + + this.index = builder.index; + + this.couponId = builder.couponId; + + this.percentage = builder.percentage; + + this.quantity = builder.quantity; + + this.amount = builder.amount; + + this.includedInMrr = builder.includedInMrr; + } + + public Integer getIndex() { + return index; + } + + public String getCouponId() { + return couponId; + } + + public Number getPercentage() { + return percentage; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getAmount() { + return amount; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.index != null) { + + formData.put("index", this.index); + } + + if (this.couponId != null) { + + formData.put("coupon_id", this.couponId); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private Integer index; + + private String couponId; + + private Number percentage; + + private Integer quantity; + + private Long amount; + + private Boolean includedInMrr; + + private DiscountsBuilder() {} + + public DiscountsBuilder index(Integer value) { + this.index = value; + return this; + } + + public DiscountsBuilder couponId(String value) { + this.couponId = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + } + + public static final class SubscriptionInfoParams { + + private final Integer index; + + private final String subscriptionId; + + private final Integer billingCycles; + + private final Integer contractTermBillingCycleOnRenewal; + + private SubscriptionInfoParams(SubscriptionInfoBuilder builder) { + + this.index = builder.index; + + this.subscriptionId = builder.subscriptionId; + + this.billingCycles = builder.billingCycles; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + } + + public Integer getIndex() { + return index; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.index != null) { + + formData.put("index", this.index); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + return formData; + } + + /** Create a new builder for SubscriptionInfoParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionInfoBuilder builder() { + return new SubscriptionInfoBuilder(); + } + + public static final class SubscriptionInfoBuilder { + + private Integer index; + + private String subscriptionId; + + private Integer billingCycles; + + private Integer contractTermBillingCycleOnRenewal; + + private SubscriptionInfoBuilder() {} + + public SubscriptionInfoBuilder index(Integer value) { + this.index = value; + return this; + } + + public SubscriptionInfoBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public SubscriptionInfoBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionInfoBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionInfoParams build() { + return new SubscriptionInfoParams(this); + } + } + } + + public static final class ContractTermsParams { + + private final Integer index; + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermsParams(ContractTermsBuilder builder) { + + this.index = builder.index; + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public Integer getIndex() { + return index; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.index != null) { + + formData.put("index", this.index); + } + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermsBuilder builder() { + return new ContractTermsBuilder(); + } + + public static final class ContractTermsBuilder { + + private Integer index; + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermsBuilder() {} + + public ContractTermsBuilder index(Integer value) { + this.index = value; + return this; + } + + public ContractTermsBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermsBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermsParams build() { + return new ContractTermsParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + RENEW_ONCE("renew_once"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/purchase/PurchaseCreateResponse.java b/src/main/java/com/chargebee/v4/models/purchase/responses/PurchaseCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/purchase/PurchaseCreateResponse.java rename to src/main/java/com/chargebee/v4/models/purchase/responses/PurchaseCreateResponse.java index 515cd16f..d508aa9d 100644 --- a/src/main/java/com/chargebee/v4/core/responses/purchase/PurchaseCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/purchase/responses/PurchaseCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.purchase; +package com.chargebee.v4.models.purchase.responses; -import com.chargebee.v4.core.models.purchase.Purchase; +import com.chargebee.v4.models.purchase.Purchase; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/purchase/PurchaseEstimateResponse.java b/src/main/java/com/chargebee/v4/models/purchase/responses/PurchaseEstimateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/purchase/PurchaseEstimateResponse.java rename to src/main/java/com/chargebee/v4/models/purchase/responses/PurchaseEstimateResponse.java index f59fe530..c459c299 100644 --- a/src/main/java/com/chargebee/v4/core/responses/purchase/PurchaseEstimateResponse.java +++ b/src/main/java/com/chargebee/v4/models/purchase/responses/PurchaseEstimateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.purchase; +package com.chargebee.v4.models.purchase.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/quote/Quote.java b/src/main/java/com/chargebee/v4/models/quote/Quote.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/quote/Quote.java rename to src/main/java/com/chargebee/v4/models/quote/Quote.java index ca4f3567..45a575c5 100644 --- a/src/main/java/com/chargebee/v4/core/models/quote/Quote.java +++ b/src/main/java/com/chargebee/v4/models/quote/Quote.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.quote; +package com.chargebee.v4.models.quote; import com.chargebee.v4.internal.JsonUtil; import java.math.BigDecimal; @@ -56,7 +56,7 @@ public class Quote { private ShippingAddress shippingAddress; private BillingAddress billingAddress; - private java.util.Map customFields = new java.util.HashMap<>(); + private java.util.Map customFields = new java.util.HashMap<>(); public String getId() { return id; @@ -228,7 +228,7 @@ public BillingAddress getBillingAddress() { * * @return map containing all custom fields */ - public java.util.Map getCustomFields() { + public java.util.Map getCustomFields() { return customFields; } @@ -238,7 +238,7 @@ public java.util.Map getCustomFields() { * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") * @return the value of the custom field, or null if not present */ - public Object getCustomField(String fieldName) { + public String getCustomField(String fieldName) { return customFields.get(fieldName); } @@ -349,7 +349,7 @@ public static PriceType fromString(String value) { public static Quote fromJson(String json) { Quote obj = new Quote(); - // Parse JSON to extract all keys + // Parse JSON to extract all keys for custom field extraction java.util.Set knownFields = new java.util.HashSet<>(); knownFields.add("id"); @@ -560,9 +560,9 @@ public static Quote fromJson(String json) { * @param knownFields set of known field names * @return map of custom fields */ - private static java.util.Map extractCustomFields( + private static java.util.Map extractCustomFields( String json, java.util.Set knownFields) { - java.util.Map customFields = new java.util.HashMap<>(); + java.util.Map customFields = new java.util.HashMap<>(); try { // Parse the entire JSON as a map java.util.Map allFields = JsonUtil.parseJsonObjectToMap(json); @@ -571,7 +571,8 @@ private static java.util.Map extractCustomFields( String key = entry.getKey(); // Include fields that start with "cf_" and are not in knownFields if (key != null && key.startsWith("cf_") && !knownFields.contains(key)) { - customFields.put(key, entry.getValue()); + customFields.put( + key, entry.getValue() != null ? String.valueOf(entry.getValue()) : null); } } } @@ -1240,6 +1241,7 @@ public static class Discounts { private Long amount; private String description; + private String lineItemId; private EntityType entityType; private DiscountType discountType; private String entityId; @@ -1253,6 +1255,10 @@ public String getDescription() { return description; } + public String getLineItemId() { + return lineItemId; + } + public EntityType getEntityType() { return entityType; } @@ -1340,6 +1346,8 @@ public static Discounts fromJson(String json) { obj.description = JsonUtil.getString(json, "description"); + obj.lineItemId = JsonUtil.getString(json, "line_item_id"); + obj.entityType = EntityType.fromString(JsonUtil.getString(json, "entity_type")); obj.discountType = DiscountType.fromString(JsonUtil.getString(json, "discount_type")); diff --git a/src/main/java/com/chargebee/v4/models/quote/params/CreateSubscriptionForCustomerQuoteParams.java b/src/main/java/com/chargebee/v4/models/quote/params/CreateSubscriptionForCustomerQuoteParams.java new file mode 100644 index 00000000..810f7c00 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/CreateSubscriptionForCustomerQuoteParams.java @@ -0,0 +1,1567 @@ +/* + * 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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class CreateSubscriptionForCustomerQuoteParams { + + private final String name; + + private final String notes; + + private final Timestamp expiresAt; + + private final Integer billingCycles; + + private final List mandatoryAddonsToRemove; + + private final Integer termsToCharge; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final SubscriptionParams subscription; + + private final ShippingAddressParams shippingAddress; + + private final ContractTermParams contractTerm; + + private final List addons; + + private final List eventBasedAddons; + + private CreateSubscriptionForCustomerQuoteParams( + CreateSubscriptionForCustomerQuoteBuilder builder) { + + this.name = builder.name; + + this.notes = builder.notes; + + this.expiresAt = builder.expiresAt; + + this.billingCycles = builder.billingCycles; + + this.mandatoryAddonsToRemove = builder.mandatoryAddonsToRemove; + + this.termsToCharge = builder.termsToCharge; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.subscription = builder.subscription; + + this.shippingAddress = builder.shippingAddress; + + this.contractTerm = builder.contractTerm; + + this.addons = builder.addons; + + this.eventBasedAddons = builder.eventBasedAddons; + } + + public String getName() { + return name; + } + + public String getNotes() { + return notes; + } + + public Timestamp getExpiresAt() { + return expiresAt; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public List getMandatoryAddonsToRemove() { + return mandatoryAddonsToRemove; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getAddons() { + return addons; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + /** 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.notes != null) { + + formData.put("notes", this.notes); + } + + if (this.expiresAt != null) { + + formData.put("expires_at", this.expiresAt); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.mandatoryAddonsToRemove != null) { + + formData.put("mandatory_addons_to_remove", this.mandatoryAddonsToRemove); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for CreateSubscriptionForCustomerQuoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreateSubscriptionForCustomerQuoteBuilder builder() { + return new CreateSubscriptionForCustomerQuoteBuilder(); + } + + public static final class CreateSubscriptionForCustomerQuoteBuilder { + + private String name; + + private String notes; + + private Timestamp expiresAt; + + private Integer billingCycles; + + private List mandatoryAddonsToRemove; + + private Integer termsToCharge; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private SubscriptionParams subscription; + + private ShippingAddressParams shippingAddress; + + private ContractTermParams contractTerm; + + private List addons; + + private List eventBasedAddons; + + private CreateSubscriptionForCustomerQuoteBuilder() {} + + public CreateSubscriptionForCustomerQuoteBuilder name(String value) { + this.name = value; + return this; + } + + public CreateSubscriptionForCustomerQuoteBuilder notes(String value) { + this.notes = value; + return this; + } + + public CreateSubscriptionForCustomerQuoteBuilder expiresAt(Timestamp value) { + this.expiresAt = value; + return this; + } + + public CreateSubscriptionForCustomerQuoteBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public CreateSubscriptionForCustomerQuoteBuilder mandatoryAddonsToRemove(List value) { + this.mandatoryAddonsToRemove = value; + return this; + } + + public CreateSubscriptionForCustomerQuoteBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public CreateSubscriptionForCustomerQuoteBuilder billingAlignmentMode( + BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public CreateSubscriptionForCustomerQuoteBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public CreateSubscriptionForCustomerQuoteBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public CreateSubscriptionForCustomerQuoteBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public CreateSubscriptionForCustomerQuoteBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public CreateSubscriptionForCustomerQuoteBuilder addons(List value) { + this.addons = value; + return this; + } + + public CreateSubscriptionForCustomerQuoteBuilder eventBasedAddons( + List value) { + this.eventBasedAddons = value; + return this; + } + + public CreateSubscriptionForCustomerQuoteParams build() { + return new CreateSubscriptionForCustomerQuoteParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final String poNumber; + + private final String planId; + + private final Integer planQuantity; + + private final String planQuantityInDecimal; + + private final Long planUnitPrice; + + private final String planUnitPriceInDecimal; + + private final Long setupFee; + + private final Timestamp trialEnd; + + private final Timestamp startDate; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final Integer contractTermBillingCycleOnRenewal; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.poNumber = builder.poNumber; + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + + this.planUnitPrice = builder.planUnitPrice; + + this.planUnitPriceInDecimal = builder.planUnitPriceInDecimal; + + this.setupFee = builder.setupFee; + + this.trialEnd = builder.trialEnd; + + this.startDate = builder.startDate; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + } + + public String getId() { + return id; + } + + public String getPoNumber() { + return poNumber; + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + public Long getPlanUnitPrice() { + return planUnitPrice; + } + + public String getPlanUnitPriceInDecimal() { + return planUnitPriceInDecimal; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Timestamp getStartDate() { + return startDate; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + if (this.planUnitPrice != null) { + + formData.put("plan_unit_price", this.planUnitPrice); + } + + if (this.planUnitPriceInDecimal != null) { + + formData.put("plan_unit_price_in_decimal", this.planUnitPriceInDecimal); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private String poNumber; + + private String planId; + + private Integer planQuantity; + + private String planQuantityInDecimal; + + private Long planUnitPrice; + + private String planUnitPriceInDecimal; + + private Long setupFee; + + private Timestamp trialEnd; + + private Timestamp startDate; + + private OfflinePaymentMethod offlinePaymentMethod; + + private Integer contractTermBillingCycleOnRenewal; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public SubscriptionBuilder planId(String value) { + this.planId = value; + return this; + } + + public SubscriptionBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public SubscriptionBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + public SubscriptionBuilder planUnitPrice(Long value) { + this.planUnitPrice = value; + return this; + } + + public SubscriptionBuilder planUnitPriceInDecimal(String value) { + this.planUnitPriceInDecimal = value; + return this; + } + + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AddonsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private final Integer servicePeriodInDays; + + private final OnEvent onEvent; + + private final Boolean chargeOnce; + + private final ChargeOn chargeOn; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.servicePeriodInDays = builder.servicePeriodInDays; + + this.onEvent = builder.onEvent; + + this.chargeOnce = builder.chargeOnce; + + this.chargeOn = builder.chargeOn; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getServicePeriodInDays() { + return servicePeriodInDays; + } + + public OnEvent getOnEvent() { + return onEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ChargeOn getChargeOn() { + return chargeOn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.servicePeriodInDays != null) { + + formData.put("service_period_in_days", this.servicePeriodInDays); + } + + if (this.onEvent != null) { + + formData.put("on_event", this.onEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.chargeOn != null) { + + formData.put("charge_on", this.chargeOn); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private Integer servicePeriodInDays; + + private OnEvent onEvent; + + private Boolean chargeOnce; + + private ChargeOn chargeOn; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { + this.servicePeriodInDays = value; + return this; + } + + public EventBasedAddonsBuilder onEvent(OnEvent value) { + this.onEvent = value; + return this; + } + + public EventBasedAddonsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public EventBasedAddonsBuilder chargeOn(ChargeOn value) { + this.chargeOn = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + + public enum OnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** An enum member indicating that OnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (OnEvent enumValue : OnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChargeOn { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOn fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOn enumValue : ChargeOn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/params/CreateSubscriptionItemsForCustomerQuoteParams.java b/src/main/java/com/chargebee/v4/models/quote/params/CreateSubscriptionItemsForCustomerQuoteParams.java new file mode 100644 index 00000000..df6d21e5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/CreateSubscriptionItemsForCustomerQuoteParams.java @@ -0,0 +1,2685 @@ +/* + * 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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class CreateSubscriptionItemsForCustomerQuoteParams { + + private final String name; + + private final String notes; + + private final Timestamp expiresAt; + + private final Integer billingCycles; + + private final List mandatoryItemsToRemove; + + private final Integer termsToCharge; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final BillingStartOption billingStartOption; + + private final Integer netTermDays; + + private final SubscriptionParams subscription; + + private final ShippingAddressParams shippingAddress; + + private final ContractTermParams contractTerm; + + private final BillingAddressParams billingAddress; + + private final List subscriptionItems; + + private final List discounts; + + private final List itemTiers; + + private final List coupons; + + private final Map customFields; + + private CreateSubscriptionItemsForCustomerQuoteParams( + CreateSubscriptionItemsForCustomerQuoteBuilder builder) { + + this.name = builder.name; + + this.notes = builder.notes; + + this.expiresAt = builder.expiresAt; + + this.billingCycles = builder.billingCycles; + + this.mandatoryItemsToRemove = builder.mandatoryItemsToRemove; + + this.termsToCharge = builder.termsToCharge; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.billingStartOption = builder.billingStartOption; + + this.netTermDays = builder.netTermDays; + + this.subscription = builder.subscription; + + this.shippingAddress = builder.shippingAddress; + + this.contractTerm = builder.contractTerm; + + this.billingAddress = builder.billingAddress; + + this.subscriptionItems = builder.subscriptionItems; + + this.discounts = builder.discounts; + + this.itemTiers = builder.itemTiers; + + this.coupons = builder.coupons; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getName() { + return name; + } + + public String getNotes() { + return notes; + } + + public Timestamp getExpiresAt() { + return expiresAt; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public List getMandatoryItemsToRemove() { + return mandatoryItemsToRemove; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public BillingStartOption getBillingStartOption() { + return billingStartOption; + } + + public Integer getNetTermDays() { + return netTermDays; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + public List getDiscounts() { + return discounts; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getCoupons() { + return coupons; + } + + 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.notes != null) { + + formData.put("notes", this.notes); + } + + if (this.expiresAt != null) { + + formData.put("expires_at", this.expiresAt); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.mandatoryItemsToRemove != null) { + + formData.put("mandatory_items_to_remove", this.mandatoryItemsToRemove); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.billingStartOption != null) { + + formData.put("billing_start_option", this.billingStartOption); + } + + if (this.netTermDays != null) { + + formData.put("net_term_days", this.netTermDays); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.coupons != null) { + + // List of objects + for (int i = 0; i < this.coupons.size(); i++) { + CouponsParams item = this.coupons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for CreateSubscriptionItemsForCustomerQuoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreateSubscriptionItemsForCustomerQuoteBuilder builder() { + return new CreateSubscriptionItemsForCustomerQuoteBuilder(); + } + + public static final class CreateSubscriptionItemsForCustomerQuoteBuilder { + + private String name; + + private String notes; + + private Timestamp expiresAt; + + private Integer billingCycles; + + private List mandatoryItemsToRemove; + + private Integer termsToCharge; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private BillingStartOption billingStartOption; + + private Integer netTermDays; + + private SubscriptionParams subscription; + + private ShippingAddressParams shippingAddress; + + private ContractTermParams contractTerm; + + private BillingAddressParams billingAddress; + + private List subscriptionItems; + + private List discounts; + + private List itemTiers; + + private List coupons; + + private Map customFields = new LinkedHashMap<>(); + + private CreateSubscriptionItemsForCustomerQuoteBuilder() {} + + public CreateSubscriptionItemsForCustomerQuoteBuilder name(String value) { + this.name = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder notes(String value) { + this.notes = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder expiresAt(Timestamp value) { + this.expiresAt = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder mandatoryItemsToRemove( + List value) { + this.mandatoryItemsToRemove = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder billingAlignmentMode( + BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder billingStartOption( + BillingStartOption value) { + this.billingStartOption = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder netTermDays(Integer value) { + this.netTermDays = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder shippingAddress( + ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder billingAddress( + BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteBuilder coupons(List value) { + this.coupons = 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 CreateSubscriptionItemsForCustomerQuoteBuilder 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 CreateSubscriptionItemsForCustomerQuoteBuilder 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 CreateSubscriptionItemsForCustomerQuoteParams build() { + return new CreateSubscriptionItemsForCustomerQuoteParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum BillingStartOption { + IMMEDIATELY("immediately"), + + ON_SPECIFIC_DATE("on_specific_date"), + + /** An enum member indicating that BillingStartOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + BillingStartOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingStartOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingStartOption enumValue : BillingStartOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final String poNumber; + + private final Timestamp trialEnd; + + private final Long setupFee; + + private final Timestamp startDate; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final Integer contractTermBillingCycleOnRenewal; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.poNumber = builder.poNumber; + + this.trialEnd = builder.trialEnd; + + this.setupFee = builder.setupFee; + + this.startDate = builder.startDate; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + } + + public String getId() { + return id; + } + + public String getPoNumber() { + return poNumber; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getStartDate() { + return startDate; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private String poNumber; + + private Timestamp trialEnd; + + private Long setupFee; + + private Timestamp startDate; + + private OfflinePaymentMethod offlinePaymentMethod; + + private Integer contractTermBillingCycleOnRenewal; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + @Deprecated + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ItemType itemType; + + private final ChargeOnOption chargeOnOption; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private final String rampTierId; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.itemType = builder.itemType; + + this.chargeOnOption = builder.chargeOnOption; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + + this.rampTierId = builder.rampTierId; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ItemType getItemType() { + return itemType; + } + + public ChargeOnOption getChargeOnOption() { + return chargeOnOption; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + public String getRampTierId() { + return rampTierId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.itemType != null) { + + formData.put("item_type", this.itemType); + } + + if (this.chargeOnOption != null) { + + formData.put("charge_on_option", this.chargeOnOption); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + if (this.rampTierId != null) { + + formData.put("ramp_tier_id", this.rampTierId); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ItemType itemType; + + private ChargeOnOption chargeOnOption; + + private Timestamp startDate; + + private Timestamp endDate; + + private String rampTierId; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionItemsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionItemsBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public SubscriptionItemsBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { + this.chargeOnOption = value; + return this; + } + + public SubscriptionItemsBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionItemsBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public SubscriptionItemsBuilder rampTierId(String value) { + this.rampTierId = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + + 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"), + + /** 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; + } + } + + 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 enum ChargeOnOption { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnOption enumValue : ChargeOnOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DiscountsParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private final Integer quantity; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private DiscountsParams(DiscountsBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private Integer quantity; + + private Timestamp startDate; + + private Timestamp endDate; + + private DiscountsBuilder() {} + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public DiscountsBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private final String rampTierId; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + + this.rampTierId = builder.rampTierId; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + public String getRampTierId() { + return rampTierId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + if (this.rampTierId != null) { + + formData.put("ramp_tier_id", this.rampTierId); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private String rampTierId; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersBuilder rampTierId(String value) { + this.rampTierId = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CouponsParams { + + private final String id; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private CouponsParams(CouponsBuilder builder) { + + this.id = builder.id; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + } + + public String getId() { + return id; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + return formData; + } + + /** Create a new builder for CouponsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponsBuilder builder() { + return new CouponsBuilder(); + } + + public static final class CouponsBuilder { + + private String id; + + private Timestamp startDate; + + private Timestamp endDate; + + private CouponsBuilder() {} + + public CouponsBuilder id(String value) { + this.id = value; + return this; + } + + public CouponsBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public CouponsBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public CouponsParams build() { + return new CouponsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/params/EditCreateSubscriptionCustomerQuoteForItemsParams.java b/src/main/java/com/chargebee/v4/models/quote/params/EditCreateSubscriptionCustomerQuoteForItemsParams.java new file mode 100644 index 00000000..26e467b5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/EditCreateSubscriptionCustomerQuoteForItemsParams.java @@ -0,0 +1,2669 @@ +/* + * 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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class EditCreateSubscriptionCustomerQuoteForItemsParams { + + private final String notes; + + private final Timestamp expiresAt; + + private final Integer billingCycles; + + private final List mandatoryItemsToRemove; + + private final Integer termsToCharge; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final BillingStartOption billingStartOption; + + private final Integer netTermDays; + + private final SubscriptionParams subscription; + + private final ShippingAddressParams shippingAddress; + + private final ContractTermParams contractTerm; + + private final BillingAddressParams billingAddress; + + private final List subscriptionItems; + + private final List discounts; + + private final List itemTiers; + + private final List coupons; + + private final Map customFields; + + private EditCreateSubscriptionCustomerQuoteForItemsParams( + EditCreateSubscriptionCustomerQuoteForItemsBuilder builder) { + + this.notes = builder.notes; + + this.expiresAt = builder.expiresAt; + + this.billingCycles = builder.billingCycles; + + this.mandatoryItemsToRemove = builder.mandatoryItemsToRemove; + + this.termsToCharge = builder.termsToCharge; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.billingStartOption = builder.billingStartOption; + + this.netTermDays = builder.netTermDays; + + this.subscription = builder.subscription; + + this.shippingAddress = builder.shippingAddress; + + this.contractTerm = builder.contractTerm; + + this.billingAddress = builder.billingAddress; + + this.subscriptionItems = builder.subscriptionItems; + + this.discounts = builder.discounts; + + this.itemTiers = builder.itemTiers; + + this.coupons = builder.coupons; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getNotes() { + return notes; + } + + public Timestamp getExpiresAt() { + return expiresAt; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public List getMandatoryItemsToRemove() { + return mandatoryItemsToRemove; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public BillingStartOption getBillingStartOption() { + return billingStartOption; + } + + public Integer getNetTermDays() { + return netTermDays; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + public List getDiscounts() { + return discounts; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getCoupons() { + return coupons; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.notes != null) { + + formData.put("notes", this.notes); + } + + if (this.expiresAt != null) { + + formData.put("expires_at", this.expiresAt); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.mandatoryItemsToRemove != null) { + + formData.put("mandatory_items_to_remove", this.mandatoryItemsToRemove); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.billingStartOption != null) { + + formData.put("billing_start_option", this.billingStartOption); + } + + if (this.netTermDays != null) { + + formData.put("net_term_days", this.netTermDays); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.coupons != null) { + + // List of objects + for (int i = 0; i < this.coupons.size(); i++) { + CouponsParams item = this.coupons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for EditCreateSubscriptionCustomerQuoteForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EditCreateSubscriptionCustomerQuoteForItemsBuilder builder() { + return new EditCreateSubscriptionCustomerQuoteForItemsBuilder(); + } + + public static final class EditCreateSubscriptionCustomerQuoteForItemsBuilder { + + private String notes; + + private Timestamp expiresAt; + + private Integer billingCycles; + + private List mandatoryItemsToRemove; + + private Integer termsToCharge; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private BillingStartOption billingStartOption; + + private Integer netTermDays; + + private SubscriptionParams subscription; + + private ShippingAddressParams shippingAddress; + + private ContractTermParams contractTerm; + + private BillingAddressParams billingAddress; + + private List subscriptionItems; + + private List discounts; + + private List itemTiers; + + private List coupons; + + private Map customFields = new LinkedHashMap<>(); + + private EditCreateSubscriptionCustomerQuoteForItemsBuilder() {} + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder notes(String value) { + this.notes = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder expiresAt(Timestamp value) { + this.expiresAt = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder mandatoryItemsToRemove( + List value) { + this.mandatoryItemsToRemove = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder billingAlignmentMode( + BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder billingStartOption( + BillingStartOption value) { + this.billingStartOption = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder netTermDays(Integer value) { + this.netTermDays = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder subscription( + SubscriptionParams value) { + this.subscription = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder shippingAddress( + ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder contractTerm( + ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder billingAddress( + BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder discounts( + List value) { + this.discounts = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder itemTiers( + List value) { + this.itemTiers = value; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsBuilder coupons(List value) { + this.coupons = 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 EditCreateSubscriptionCustomerQuoteForItemsBuilder 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 EditCreateSubscriptionCustomerQuoteForItemsBuilder 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 EditCreateSubscriptionCustomerQuoteForItemsParams build() { + return new EditCreateSubscriptionCustomerQuoteForItemsParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum BillingStartOption { + IMMEDIATELY("immediately"), + + ON_SPECIFIC_DATE("on_specific_date"), + + /** An enum member indicating that BillingStartOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + BillingStartOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingStartOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingStartOption enumValue : BillingStartOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final String poNumber; + + private final Timestamp trialEnd; + + private final Long setupFee; + + private final Timestamp startDate; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final Integer contractTermBillingCycleOnRenewal; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.poNumber = builder.poNumber; + + this.trialEnd = builder.trialEnd; + + this.setupFee = builder.setupFee; + + this.startDate = builder.startDate; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + } + + public String getId() { + return id; + } + + public String getPoNumber() { + return poNumber; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getStartDate() { + return startDate; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private String poNumber; + + private Timestamp trialEnd; + + private Long setupFee; + + private Timestamp startDate; + + private OfflinePaymentMethod offlinePaymentMethod; + + private Integer contractTermBillingCycleOnRenewal; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + @Deprecated + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ItemType itemType; + + private final ChargeOnOption chargeOnOption; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private final String rampTierId; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.itemType = builder.itemType; + + this.chargeOnOption = builder.chargeOnOption; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + + this.rampTierId = builder.rampTierId; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ItemType getItemType() { + return itemType; + } + + public ChargeOnOption getChargeOnOption() { + return chargeOnOption; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + public String getRampTierId() { + return rampTierId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.itemType != null) { + + formData.put("item_type", this.itemType); + } + + if (this.chargeOnOption != null) { + + formData.put("charge_on_option", this.chargeOnOption); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + if (this.rampTierId != null) { + + formData.put("ramp_tier_id", this.rampTierId); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ItemType itemType; + + private ChargeOnOption chargeOnOption; + + private Timestamp startDate; + + private Timestamp endDate; + + private String rampTierId; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionItemsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionItemsBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public SubscriptionItemsBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { + this.chargeOnOption = value; + return this; + } + + public SubscriptionItemsBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionItemsBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public SubscriptionItemsBuilder rampTierId(String value) { + this.rampTierId = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + + 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"), + + /** 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; + } + } + + 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 enum ChargeOnOption { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnOption enumValue : ChargeOnOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DiscountsParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private final Integer quantity; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private DiscountsParams(DiscountsBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private Integer quantity; + + private Timestamp startDate; + + private Timestamp endDate; + + private DiscountsBuilder() {} + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public DiscountsBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private final String rampTierId; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + + this.rampTierId = builder.rampTierId; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + public String getRampTierId() { + return rampTierId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + if (this.rampTierId != null) { + + formData.put("ramp_tier_id", this.rampTierId); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private String rampTierId; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersBuilder rampTierId(String value) { + this.rampTierId = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CouponsParams { + + private final String id; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private CouponsParams(CouponsBuilder builder) { + + this.id = builder.id; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + } + + public String getId() { + return id; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + return formData; + } + + /** Create a new builder for CouponsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponsBuilder builder() { + return new CouponsBuilder(); + } + + public static final class CouponsBuilder { + + private String id; + + private Timestamp startDate; + + private Timestamp endDate; + + private CouponsBuilder() {} + + public CouponsBuilder id(String value) { + this.id = value; + return this; + } + + public CouponsBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public CouponsBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public CouponsParams build() { + return new CouponsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/params/EditCreateSubscriptionForCustomerQuoteParams.java b/src/main/java/com/chargebee/v4/models/quote/params/EditCreateSubscriptionForCustomerQuoteParams.java new file mode 100644 index 00000000..d961d2bf --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/EditCreateSubscriptionForCustomerQuoteParams.java @@ -0,0 +1,1549 @@ +/* + * 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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class EditCreateSubscriptionForCustomerQuoteParams { + + private final String notes; + + private final Timestamp expiresAt; + + private final Integer billingCycles; + + private final List mandatoryAddonsToRemove; + + private final Integer termsToCharge; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final SubscriptionParams subscription; + + private final ShippingAddressParams shippingAddress; + + private final ContractTermParams contractTerm; + + private final List addons; + + private final List eventBasedAddons; + + private EditCreateSubscriptionForCustomerQuoteParams( + EditCreateSubscriptionForCustomerQuoteBuilder builder) { + + this.notes = builder.notes; + + this.expiresAt = builder.expiresAt; + + this.billingCycles = builder.billingCycles; + + this.mandatoryAddonsToRemove = builder.mandatoryAddonsToRemove; + + this.termsToCharge = builder.termsToCharge; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.subscription = builder.subscription; + + this.shippingAddress = builder.shippingAddress; + + this.contractTerm = builder.contractTerm; + + this.addons = builder.addons; + + this.eventBasedAddons = builder.eventBasedAddons; + } + + public String getNotes() { + return notes; + } + + public Timestamp getExpiresAt() { + return expiresAt; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public List getMandatoryAddonsToRemove() { + return mandatoryAddonsToRemove; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getAddons() { + return addons; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.notes != null) { + + formData.put("notes", this.notes); + } + + if (this.expiresAt != null) { + + formData.put("expires_at", this.expiresAt); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.mandatoryAddonsToRemove != null) { + + formData.put("mandatory_addons_to_remove", this.mandatoryAddonsToRemove); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for EditCreateSubscriptionForCustomerQuoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EditCreateSubscriptionForCustomerQuoteBuilder builder() { + return new EditCreateSubscriptionForCustomerQuoteBuilder(); + } + + public static final class EditCreateSubscriptionForCustomerQuoteBuilder { + + private String notes; + + private Timestamp expiresAt; + + private Integer billingCycles; + + private List mandatoryAddonsToRemove; + + private Integer termsToCharge; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private SubscriptionParams subscription; + + private ShippingAddressParams shippingAddress; + + private ContractTermParams contractTerm; + + private List addons; + + private List eventBasedAddons; + + private EditCreateSubscriptionForCustomerQuoteBuilder() {} + + public EditCreateSubscriptionForCustomerQuoteBuilder notes(String value) { + this.notes = value; + return this; + } + + public EditCreateSubscriptionForCustomerQuoteBuilder expiresAt(Timestamp value) { + this.expiresAt = value; + return this; + } + + public EditCreateSubscriptionForCustomerQuoteBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public EditCreateSubscriptionForCustomerQuoteBuilder mandatoryAddonsToRemove( + List value) { + this.mandatoryAddonsToRemove = value; + return this; + } + + public EditCreateSubscriptionForCustomerQuoteBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public EditCreateSubscriptionForCustomerQuoteBuilder billingAlignmentMode( + BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public EditCreateSubscriptionForCustomerQuoteBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public EditCreateSubscriptionForCustomerQuoteBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public EditCreateSubscriptionForCustomerQuoteBuilder shippingAddress( + ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public EditCreateSubscriptionForCustomerQuoteBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public EditCreateSubscriptionForCustomerQuoteBuilder addons(List value) { + this.addons = value; + return this; + } + + public EditCreateSubscriptionForCustomerQuoteBuilder eventBasedAddons( + List value) { + this.eventBasedAddons = value; + return this; + } + + public EditCreateSubscriptionForCustomerQuoteParams build() { + return new EditCreateSubscriptionForCustomerQuoteParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final String poNumber; + + private final String planId; + + private final Integer planQuantity; + + private final String planQuantityInDecimal; + + private final Long planUnitPrice; + + private final String planUnitPriceInDecimal; + + private final Long setupFee; + + private final Timestamp trialEnd; + + private final Timestamp startDate; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final Integer contractTermBillingCycleOnRenewal; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.poNumber = builder.poNumber; + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + + this.planUnitPrice = builder.planUnitPrice; + + this.planUnitPriceInDecimal = builder.planUnitPriceInDecimal; + + this.setupFee = builder.setupFee; + + this.trialEnd = builder.trialEnd; + + this.startDate = builder.startDate; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + } + + public String getId() { + return id; + } + + public String getPoNumber() { + return poNumber; + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + public Long getPlanUnitPrice() { + return planUnitPrice; + } + + public String getPlanUnitPriceInDecimal() { + return planUnitPriceInDecimal; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Timestamp getStartDate() { + return startDate; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + if (this.planUnitPrice != null) { + + formData.put("plan_unit_price", this.planUnitPrice); + } + + if (this.planUnitPriceInDecimal != null) { + + formData.put("plan_unit_price_in_decimal", this.planUnitPriceInDecimal); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private String poNumber; + + private String planId; + + private Integer planQuantity; + + private String planQuantityInDecimal; + + private Long planUnitPrice; + + private String planUnitPriceInDecimal; + + private Long setupFee; + + private Timestamp trialEnd; + + private Timestamp startDate; + + private OfflinePaymentMethod offlinePaymentMethod; + + private Integer contractTermBillingCycleOnRenewal; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public SubscriptionBuilder planId(String value) { + this.planId = value; + return this; + } + + public SubscriptionBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public SubscriptionBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + public SubscriptionBuilder planUnitPrice(Long value) { + this.planUnitPrice = value; + return this; + } + + public SubscriptionBuilder planUnitPriceInDecimal(String value) { + this.planUnitPriceInDecimal = value; + return this; + } + + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AddonsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private final Integer servicePeriodInDays; + + private final OnEvent onEvent; + + private final Boolean chargeOnce; + + private final ChargeOn chargeOn; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.servicePeriodInDays = builder.servicePeriodInDays; + + this.onEvent = builder.onEvent; + + this.chargeOnce = builder.chargeOnce; + + this.chargeOn = builder.chargeOn; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getServicePeriodInDays() { + return servicePeriodInDays; + } + + public OnEvent getOnEvent() { + return onEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ChargeOn getChargeOn() { + return chargeOn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.servicePeriodInDays != null) { + + formData.put("service_period_in_days", this.servicePeriodInDays); + } + + if (this.onEvent != null) { + + formData.put("on_event", this.onEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.chargeOn != null) { + + formData.put("charge_on", this.chargeOn); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private Integer servicePeriodInDays; + + private OnEvent onEvent; + + private Boolean chargeOnce; + + private ChargeOn chargeOn; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { + this.servicePeriodInDays = value; + return this; + } + + public EventBasedAddonsBuilder onEvent(OnEvent value) { + this.onEvent = value; + return this; + } + + public EventBasedAddonsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public EventBasedAddonsBuilder chargeOn(ChargeOn value) { + this.chargeOn = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + + public enum OnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** An enum member indicating that OnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (OnEvent enumValue : OnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChargeOn { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOn fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOn enumValue : ChargeOn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/params/EditOneTimeQuoteParams.java b/src/main/java/com/chargebee/v4/models/quote/params/EditOneTimeQuoteParams.java new file mode 100644 index 00000000..6052be7a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/EditOneTimeQuoteParams.java @@ -0,0 +1,1053 @@ +/* + * 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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class EditOneTimeQuoteParams { + + private final String poNumber; + + private final String notes; + + private final Timestamp expiresAt; + + private final String currencyCode; + + private final String coupon; + + private final List couponIds; + + private final ShippingAddressParams shippingAddress; + + private final List addons; + + private final List charges; + + private final List taxProvidersFields; + + private EditOneTimeQuoteParams(EditOneTimeQuoteBuilder builder) { + + this.poNumber = builder.poNumber; + + this.notes = builder.notes; + + this.expiresAt = builder.expiresAt; + + this.currencyCode = builder.currencyCode; + + this.coupon = builder.coupon; + + this.couponIds = builder.couponIds; + + this.shippingAddress = builder.shippingAddress; + + this.addons = builder.addons; + + this.charges = builder.charges; + + this.taxProvidersFields = builder.taxProvidersFields; + } + + public String getPoNumber() { + return poNumber; + } + + public String getNotes() { + return notes; + } + + public Timestamp getExpiresAt() { + return expiresAt; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getCoupon() { + return coupon; + } + + public List getCouponIds() { + return couponIds; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public List getAddons() { + return addons; + } + + public List getCharges() { + return charges; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.notes != null) { + + formData.put("notes", this.notes); + } + + if (this.expiresAt != null) { + + formData.put("expires_at", this.expiresAt); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.charges != null) { + + // List of objects + for (int i = 0; i < this.charges.size(); i++) { + ChargesParams item = this.charges.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for EditOneTimeQuoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EditOneTimeQuoteBuilder builder() { + return new EditOneTimeQuoteBuilder(); + } + + public static final class EditOneTimeQuoteBuilder { + + private String poNumber; + + private String notes; + + private Timestamp expiresAt; + + private String currencyCode; + + private String coupon; + + private List couponIds; + + private ShippingAddressParams shippingAddress; + + private List addons; + + private List charges; + + private List taxProvidersFields; + + private EditOneTimeQuoteBuilder() {} + + public EditOneTimeQuoteBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public EditOneTimeQuoteBuilder notes(String value) { + this.notes = value; + return this; + } + + public EditOneTimeQuoteBuilder expiresAt(Timestamp value) { + this.expiresAt = value; + return this; + } + + public EditOneTimeQuoteBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public EditOneTimeQuoteBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public EditOneTimeQuoteBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public EditOneTimeQuoteBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public EditOneTimeQuoteBuilder addons(List value) { + this.addons = value; + return this; + } + + public EditOneTimeQuoteBuilder charges(List value) { + this.charges = value; + return this; + } + + public EditOneTimeQuoteBuilder taxProvidersFields(List value) { + this.taxProvidersFields = value; + return this; + } + + public EditOneTimeQuoteParams build() { + return new EditOneTimeQuoteParams(this); + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer servicePeriod; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.servicePeriod = builder.servicePeriod; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getServicePeriod() { + return servicePeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.servicePeriod != null) { + + formData.put("service_period", this.servicePeriod); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer servicePeriod; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder servicePeriod(Integer value) { + this.servicePeriod = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class ChargesParams { + + private final Long amount; + + private final String amountInDecimal; + + private final String description; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final Integer servicePeriod; + + private ChargesParams(ChargesBuilder builder) { + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.description = builder.description; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.servicePeriod = builder.servicePeriod; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getDescription() { + return description; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public Integer getServicePeriod() { + return servicePeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.servicePeriod != null) { + + formData.put("service_period", this.servicePeriod); + } + + return formData; + } + + /** Create a new builder for ChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargesBuilder builder() { + return new ChargesBuilder(); + } + + public static final class ChargesBuilder { + + private Long amount; + + private String amountInDecimal; + + private String description; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private Integer servicePeriod; + + private ChargesBuilder() {} + + public ChargesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public ChargesBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public ChargesBuilder description(String value) { + this.description = value; + return this; + } + + public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public ChargesBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public ChargesBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public ChargesBuilder servicePeriod(Integer value) { + this.servicePeriod = value; + return this; + } + + public ChargesParams build() { + return new ChargesParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/params/EditUpdateSubscriptionQuoteForItemsParams.java b/src/main/java/com/chargebee/v4/models/quote/params/EditUpdateSubscriptionQuoteForItemsParams.java new file mode 100644 index 00000000..f9937815 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/EditUpdateSubscriptionQuoteForItemsParams.java @@ -0,0 +1,2992 @@ +/* + * 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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class EditUpdateSubscriptionQuoteForItemsParams { + + private final String notes; + + private final Timestamp expiresAt; + + private final List mandatoryItemsToRemove; + + private final Boolean replaceItemsList; + + private final Integer billingCycles; + + private final Integer termsToCharge; + + private final Timestamp reactivateFrom; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final Boolean replaceCouponList; + + private final ChangeOption changeOption; + + private final Timestamp changesScheduledAt; + + private final Boolean forceTermReset; + + private final Boolean reactivate; + + private final Integer netTermDays; + + private final SubscriptionParams subscription; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final CustomerParams customer; + + private final ContractTermParams contractTerm; + + private final List subscriptionItems; + + private final List discounts; + + private final List itemTiers; + + private final List coupons; + + private final Map customFields; + + private EditUpdateSubscriptionQuoteForItemsParams( + EditUpdateSubscriptionQuoteForItemsBuilder builder) { + + this.notes = builder.notes; + + this.expiresAt = builder.expiresAt; + + this.mandatoryItemsToRemove = builder.mandatoryItemsToRemove; + + this.replaceItemsList = builder.replaceItemsList; + + this.billingCycles = builder.billingCycles; + + this.termsToCharge = builder.termsToCharge; + + this.reactivateFrom = builder.reactivateFrom; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.replaceCouponList = builder.replaceCouponList; + + this.changeOption = builder.changeOption; + + this.changesScheduledAt = builder.changesScheduledAt; + + this.forceTermReset = builder.forceTermReset; + + this.reactivate = builder.reactivate; + + this.netTermDays = builder.netTermDays; + + this.subscription = builder.subscription; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.customer = builder.customer; + + this.contractTerm = builder.contractTerm; + + this.subscriptionItems = builder.subscriptionItems; + + this.discounts = builder.discounts; + + this.itemTiers = builder.itemTiers; + + this.coupons = builder.coupons; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getNotes() { + return notes; + } + + public Timestamp getExpiresAt() { + return expiresAt; + } + + public List getMandatoryItemsToRemove() { + return mandatoryItemsToRemove; + } + + public Boolean getReplaceItemsList() { + return replaceItemsList; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Timestamp getReactivateFrom() { + return reactivateFrom; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public Boolean getReplaceCouponList() { + return replaceCouponList; + } + + public ChangeOption getChangeOption() { + return changeOption; + } + + public Timestamp getChangesScheduledAt() { + return changesScheduledAt; + } + + public Boolean getForceTermReset() { + return forceTermReset; + } + + public Boolean getReactivate() { + return reactivate; + } + + public Integer getNetTermDays() { + return netTermDays; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public CustomerParams getCustomer() { + return customer; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + public List getDiscounts() { + return discounts; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getCoupons() { + return coupons; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.notes != null) { + + formData.put("notes", this.notes); + } + + if (this.expiresAt != null) { + + formData.put("expires_at", this.expiresAt); + } + + if (this.mandatoryItemsToRemove != null) { + + formData.put("mandatory_items_to_remove", this.mandatoryItemsToRemove); + } + + if (this.replaceItemsList != null) { + + formData.put("replace_items_list", this.replaceItemsList); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.reactivateFrom != null) { + + formData.put("reactivate_from", this.reactivateFrom); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.replaceCouponList != null) { + + formData.put("replace_coupon_list", this.replaceCouponList); + } + + if (this.changeOption != null) { + + formData.put("change_option", this.changeOption); + } + + if (this.changesScheduledAt != null) { + + formData.put("changes_scheduled_at", this.changesScheduledAt); + } + + if (this.forceTermReset != null) { + + formData.put("force_term_reset", this.forceTermReset); + } + + if (this.reactivate != null) { + + formData.put("reactivate", this.reactivate); + } + + if (this.netTermDays != null) { + + formData.put("net_term_days", this.netTermDays); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.coupons != null) { + + // List of objects + for (int i = 0; i < this.coupons.size(); i++) { + CouponsParams item = this.coupons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for EditUpdateSubscriptionQuoteForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EditUpdateSubscriptionQuoteForItemsBuilder builder() { + return new EditUpdateSubscriptionQuoteForItemsBuilder(); + } + + public static final class EditUpdateSubscriptionQuoteForItemsBuilder { + + private String notes; + + private Timestamp expiresAt; + + private List mandatoryItemsToRemove; + + private Boolean replaceItemsList; + + private Integer billingCycles; + + private Integer termsToCharge; + + private Timestamp reactivateFrom; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private Boolean replaceCouponList; + + private ChangeOption changeOption; + + private Timestamp changesScheduledAt; + + private Boolean forceTermReset; + + private Boolean reactivate; + + private Integer netTermDays; + + private SubscriptionParams subscription; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private CustomerParams customer; + + private ContractTermParams contractTerm; + + private List subscriptionItems; + + private List discounts; + + private List itemTiers; + + private List coupons; + + private Map customFields = new LinkedHashMap<>(); + + private EditUpdateSubscriptionQuoteForItemsBuilder() {} + + public EditUpdateSubscriptionQuoteForItemsBuilder notes(String value) { + this.notes = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder expiresAt(Timestamp value) { + this.expiresAt = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder mandatoryItemsToRemove(List value) { + this.mandatoryItemsToRemove = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder replaceItemsList(Boolean value) { + this.replaceItemsList = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder reactivateFrom(Timestamp value) { + this.reactivateFrom = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder billingAlignmentMode( + BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder replaceCouponList(Boolean value) { + this.replaceCouponList = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder changeOption(ChangeOption value) { + this.changeOption = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder changesScheduledAt(Timestamp value) { + this.changesScheduledAt = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder forceTermReset(Boolean value) { + this.forceTermReset = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder reactivate(Boolean value) { + this.reactivate = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder netTermDays(Integer value) { + this.netTermDays = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsBuilder coupons(List value) { + this.coupons = 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 EditUpdateSubscriptionQuoteForItemsBuilder 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 EditUpdateSubscriptionQuoteForItemsBuilder 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 EditUpdateSubscriptionQuoteForItemsParams build() { + return new EditUpdateSubscriptionQuoteForItemsParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChangeOption { + IMMEDIATELY("immediately"), + + SPECIFIC_DATE("specific_date"), + + /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChangeOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChangeOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChangeOption enumValue : ChangeOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final Long setupFee; + + private final Timestamp startDate; + + private final Timestamp trialEnd; + + private final String coupon; + + private final AutoCollection autoCollection; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final Integer contractTermBillingCycleOnRenewal; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.setupFee = builder.setupFee; + + this.startDate = builder.startDate; + + this.trialEnd = builder.trialEnd; + + this.coupon = builder.coupon; + + this.autoCollection = builder.autoCollection; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public String getCoupon() { + return coupon; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private Long setupFee; + + private Timestamp startDate; + + private Timestamp trialEnd; + + private String coupon; + + private AutoCollection autoCollection; + + private OfflinePaymentMethod offlinePaymentMethod; + + private Integer contractTermBillingCycleOnRenewal; + + private SubscriptionBuilder() {} + + @Deprecated + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + @Deprecated + public SubscriptionBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class CustomerParams { + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final Boolean registeredForGst; + + private CustomerParams(CustomerBuilder builder) { + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.registeredForGst = builder.registeredForGst; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public Boolean getRegisteredForGst() { + return registeredForGst; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.registeredForGst != null) { + + formData.put("registered_for_gst", this.registeredForGst); + } + + 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 String vatNumberPrefix; + + private Boolean registeredForGst; + + private CustomerBuilder() {} + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder registeredForGst(Boolean value) { + this.registeredForGst = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + RENEW_ONCE("renew_once"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ChargeOnOption chargeOnOption; + + private final ItemType itemType; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private final String rampTierId; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.chargeOnOption = builder.chargeOnOption; + + this.itemType = builder.itemType; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + + this.rampTierId = builder.rampTierId; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ChargeOnOption getChargeOnOption() { + return chargeOnOption; + } + + public ItemType getItemType() { + return itemType; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + public String getRampTierId() { + return rampTierId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.chargeOnOption != null) { + + formData.put("charge_on_option", this.chargeOnOption); + } + + if (this.itemType != null) { + + formData.put("item_type", this.itemType); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + if (this.rampTierId != null) { + + formData.put("ramp_tier_id", this.rampTierId); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ChargeOnOption chargeOnOption; + + private ItemType itemType; + + private Timestamp startDate; + + private Timestamp endDate; + + private String rampTierId; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionItemsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionItemsBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { + this.chargeOnOption = value; + return this; + } + + public SubscriptionItemsBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public SubscriptionItemsBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionItemsBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public SubscriptionItemsBuilder rampTierId(String value) { + this.rampTierId = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + + 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"), + + /** 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; + } + } + + public enum ChargeOnOption { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnOption enumValue : ChargeOnOption.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 DiscountsParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private final Integer quantity; + + private final OperationType operationType; + + private final String id; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private DiscountsParams(DiscountsBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.operationType = builder.operationType; + + this.id = builder.id; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public OperationType getOperationType() { + return operationType; + } + + public String getId() { + return id; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.operationType != null) { + + formData.put("operation_type", this.operationType); + } + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private Integer quantity; + + private OperationType operationType; + + private String id; + + private Timestamp startDate; + + private Timestamp endDate; + + private DiscountsBuilder() {} + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder operationType(OperationType value) { + this.operationType = value; + return this; + } + + public DiscountsBuilder id(String value) { + this.id = value; + return this; + } + + public DiscountsBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public DiscountsBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 enum OperationType { + ADD("add"), + + REMOVE("remove"), + + /** An enum member indicating that OperationType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OperationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OperationType fromString(String value) { + if (value == null) return _UNKNOWN; + for (OperationType enumValue : OperationType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private final String rampTierId; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + + this.rampTierId = builder.rampTierId; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + public String getRampTierId() { + return rampTierId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + if (this.rampTierId != null) { + + formData.put("ramp_tier_id", this.rampTierId); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private String rampTierId; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersBuilder rampTierId(String value) { + this.rampTierId = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CouponsParams { + + private final String id; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private CouponsParams(CouponsBuilder builder) { + + this.id = builder.id; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + } + + public String getId() { + return id; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + return formData; + } + + /** Create a new builder for CouponsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponsBuilder builder() { + return new CouponsBuilder(); + } + + public static final class CouponsBuilder { + + private String id; + + private Timestamp startDate; + + private Timestamp endDate; + + private CouponsBuilder() {} + + public CouponsBuilder id(String value) { + this.id = value; + return this; + } + + public CouponsBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public CouponsBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public CouponsParams build() { + return new CouponsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/params/EditUpdateSubscriptionQuoteParams.java b/src/main/java/com/chargebee/v4/models/quote/params/EditUpdateSubscriptionQuoteParams.java new file mode 100644 index 00000000..6a2298d5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/EditUpdateSubscriptionQuoteParams.java @@ -0,0 +1,2221 @@ +/* + * 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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class EditUpdateSubscriptionQuoteParams { + + private final String notes; + + private final Timestamp expiresAt; + + private final Boolean replaceAddonList; + + private final List mandatoryAddonsToRemove; + + private final Integer billingCycles; + + private final Integer termsToCharge; + + private final Timestamp reactivateFrom; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final Boolean replaceCouponList; + + private final ChangeOption changeOption; + + private final Timestamp changesScheduledAt; + + private final Boolean forceTermReset; + + private final Boolean reactivate; + + private final SubscriptionParams subscription; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final CustomerParams customer; + + private final ContractTermParams contractTerm; + + private final List addons; + + private final List eventBasedAddons; + + private EditUpdateSubscriptionQuoteParams(EditUpdateSubscriptionQuoteBuilder builder) { + + this.notes = builder.notes; + + this.expiresAt = builder.expiresAt; + + this.replaceAddonList = builder.replaceAddonList; + + this.mandatoryAddonsToRemove = builder.mandatoryAddonsToRemove; + + this.billingCycles = builder.billingCycles; + + this.termsToCharge = builder.termsToCharge; + + this.reactivateFrom = builder.reactivateFrom; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.replaceCouponList = builder.replaceCouponList; + + this.changeOption = builder.changeOption; + + this.changesScheduledAt = builder.changesScheduledAt; + + this.forceTermReset = builder.forceTermReset; + + this.reactivate = builder.reactivate; + + this.subscription = builder.subscription; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.customer = builder.customer; + + this.contractTerm = builder.contractTerm; + + this.addons = builder.addons; + + this.eventBasedAddons = builder.eventBasedAddons; + } + + public String getNotes() { + return notes; + } + + public Timestamp getExpiresAt() { + return expiresAt; + } + + public Boolean getReplaceAddonList() { + return replaceAddonList; + } + + public List getMandatoryAddonsToRemove() { + return mandatoryAddonsToRemove; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Timestamp getReactivateFrom() { + return reactivateFrom; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public Boolean getReplaceCouponList() { + return replaceCouponList; + } + + public ChangeOption getChangeOption() { + return changeOption; + } + + public Timestamp getChangesScheduledAt() { + return changesScheduledAt; + } + + public Boolean getForceTermReset() { + return forceTermReset; + } + + public Boolean getReactivate() { + return reactivate; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public CustomerParams getCustomer() { + return customer; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getAddons() { + return addons; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.notes != null) { + + formData.put("notes", this.notes); + } + + if (this.expiresAt != null) { + + formData.put("expires_at", this.expiresAt); + } + + if (this.replaceAddonList != null) { + + formData.put("replace_addon_list", this.replaceAddonList); + } + + if (this.mandatoryAddonsToRemove != null) { + + formData.put("mandatory_addons_to_remove", this.mandatoryAddonsToRemove); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.reactivateFrom != null) { + + formData.put("reactivate_from", this.reactivateFrom); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.replaceCouponList != null) { + + formData.put("replace_coupon_list", this.replaceCouponList); + } + + if (this.changeOption != null) { + + formData.put("change_option", this.changeOption); + } + + if (this.changesScheduledAt != null) { + + formData.put("changes_scheduled_at", this.changesScheduledAt); + } + + if (this.forceTermReset != null) { + + formData.put("force_term_reset", this.forceTermReset); + } + + if (this.reactivate != null) { + + formData.put("reactivate", this.reactivate); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for EditUpdateSubscriptionQuoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EditUpdateSubscriptionQuoteBuilder builder() { + return new EditUpdateSubscriptionQuoteBuilder(); + } + + public static final class EditUpdateSubscriptionQuoteBuilder { + + private String notes; + + private Timestamp expiresAt; + + private Boolean replaceAddonList; + + private List mandatoryAddonsToRemove; + + private Integer billingCycles; + + private Integer termsToCharge; + + private Timestamp reactivateFrom; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private Boolean replaceCouponList; + + private ChangeOption changeOption; + + private Timestamp changesScheduledAt; + + private Boolean forceTermReset; + + private Boolean reactivate; + + private SubscriptionParams subscription; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private CustomerParams customer; + + private ContractTermParams contractTerm; + + private List addons; + + private List eventBasedAddons; + + private EditUpdateSubscriptionQuoteBuilder() {} + + public EditUpdateSubscriptionQuoteBuilder notes(String value) { + this.notes = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder expiresAt(Timestamp value) { + this.expiresAt = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder replaceAddonList(Boolean value) { + this.replaceAddonList = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder mandatoryAddonsToRemove(List value) { + this.mandatoryAddonsToRemove = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder reactivateFrom(Timestamp value) { + this.reactivateFrom = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder billingAlignmentMode(BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder replaceCouponList(Boolean value) { + this.replaceCouponList = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder changeOption(ChangeOption value) { + this.changeOption = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder changesScheduledAt(Timestamp value) { + this.changesScheduledAt = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder forceTermReset(Boolean value) { + this.forceTermReset = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder reactivate(Boolean value) { + this.reactivate = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder addons(List value) { + this.addons = value; + return this; + } + + public EditUpdateSubscriptionQuoteBuilder eventBasedAddons(List value) { + this.eventBasedAddons = value; + return this; + } + + public EditUpdateSubscriptionQuoteParams build() { + return new EditUpdateSubscriptionQuoteParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChangeOption { + IMMEDIATELY("immediately"), + + SPECIFIC_DATE("specific_date"), + + /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChangeOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChangeOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChangeOption enumValue : ChangeOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String planId; + + private final Integer planQuantity; + + private final Long planUnitPrice; + + private final Long setupFee; + + private final String planQuantityInDecimal; + + private final String planUnitPriceInDecimal; + + private final Timestamp startDate; + + private final Timestamp trialEnd; + + private final String coupon; + + private final AutoCollection autoCollection; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final Integer contractTermBillingCycleOnRenewal; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planUnitPrice = builder.planUnitPrice; + + this.setupFee = builder.setupFee; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + + this.planUnitPriceInDecimal = builder.planUnitPriceInDecimal; + + this.startDate = builder.startDate; + + this.trialEnd = builder.trialEnd; + + this.coupon = builder.coupon; + + this.autoCollection = builder.autoCollection; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public Long getPlanUnitPrice() { + return planUnitPrice; + } + + public Long getSetupFee() { + return setupFee; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + public String getPlanUnitPriceInDecimal() { + return planUnitPriceInDecimal; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public String getCoupon() { + return coupon; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planUnitPrice != null) { + + formData.put("plan_unit_price", this.planUnitPrice); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + if (this.planUnitPriceInDecimal != null) { + + formData.put("plan_unit_price_in_decimal", this.planUnitPriceInDecimal); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String planId; + + private Integer planQuantity; + + private Long planUnitPrice; + + private Long setupFee; + + private String planQuantityInDecimal; + + private String planUnitPriceInDecimal; + + private Timestamp startDate; + + private Timestamp trialEnd; + + private String coupon; + + private AutoCollection autoCollection; + + private OfflinePaymentMethod offlinePaymentMethod; + + private Integer contractTermBillingCycleOnRenewal; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder planId(String value) { + this.planId = value; + return this; + } + + public SubscriptionBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public SubscriptionBuilder planUnitPrice(Long value) { + this.planUnitPrice = value; + return this; + } + + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + public SubscriptionBuilder planUnitPriceInDecimal(String value) { + this.planUnitPriceInDecimal = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + @Deprecated + public SubscriptionBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class CustomerParams { + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final Boolean registeredForGst; + + private CustomerParams(CustomerBuilder builder) { + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.registeredForGst = builder.registeredForGst; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public Boolean getRegisteredForGst() { + return registeredForGst; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.registeredForGst != null) { + + formData.put("registered_for_gst", this.registeredForGst); + } + + 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 String vatNumberPrefix; + + private Boolean registeredForGst; + + private CustomerBuilder() {} + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder registeredForGst(Boolean value) { + this.registeredForGst = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + RENEW_ONCE("renew_once"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final Integer billingCycles; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private final Timestamp trialEnd; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.billingCycles = builder.billingCycles; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.trialEnd = builder.trialEnd; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private Integer billingCycles; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private Timestamp trialEnd; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final Integer servicePeriodInDays; + + private final ChargeOn chargeOn; + + private final OnEvent onEvent; + + private final Boolean chargeOnce; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.servicePeriodInDays = builder.servicePeriodInDays; + + this.chargeOn = builder.chargeOn; + + this.onEvent = builder.onEvent; + + this.chargeOnce = builder.chargeOnce; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public Integer getServicePeriodInDays() { + return servicePeriodInDays; + } + + public ChargeOn getChargeOn() { + return chargeOn; + } + + public OnEvent getOnEvent() { + return onEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.servicePeriodInDays != null) { + + formData.put("service_period_in_days", this.servicePeriodInDays); + } + + if (this.chargeOn != null) { + + formData.put("charge_on", this.chargeOn); + } + + if (this.onEvent != null) { + + formData.put("on_event", this.onEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private Integer servicePeriodInDays; + + private ChargeOn chargeOn; + + private OnEvent onEvent; + + private Boolean chargeOnce; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { + this.servicePeriodInDays = value; + return this; + } + + public EventBasedAddonsBuilder chargeOn(ChargeOn value) { + this.chargeOn = value; + return this; + } + + public EventBasedAddonsBuilder onEvent(OnEvent value) { + this.onEvent = value; + return this; + } + + public EventBasedAddonsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + + public enum ChargeOn { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOn fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOn enumValue : ChargeOn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** An enum member indicating that OnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (OnEvent enumValue : OnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/params/QuoteConvertParams.java b/src/main/java/com/chargebee/v4/models/quote/params/QuoteConvertParams.java new file mode 100644 index 00000000..2855df84 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/QuoteConvertParams.java @@ -0,0 +1,282 @@ +/* + * 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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class QuoteConvertParams { + + private final Timestamp invoiceDate; + + private final Boolean invoiceImmediately; + + private final Boolean createPendingInvoices; + + private final Boolean firstInvoicePending; + + private final SubscriptionParams subscription; + + private QuoteConvertParams(QuoteConvertBuilder builder) { + + this.invoiceDate = builder.invoiceDate; + + this.invoiceImmediately = builder.invoiceImmediately; + + this.createPendingInvoices = builder.createPendingInvoices; + + this.firstInvoicePending = builder.firstInvoicePending; + + this.subscription = builder.subscription; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + public Boolean getCreatePendingInvoices() { + return createPendingInvoices; + } + + public Boolean getFirstInvoicePending() { + return firstInvoicePending; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + if (this.createPendingInvoices != null) { + + formData.put("create_pending_invoices", this.createPendingInvoices); + } + + if (this.firstInvoicePending != null) { + + formData.put("first_invoice_pending", this.firstInvoicePending); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for QuoteConvertParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static QuoteConvertBuilder builder() { + return new QuoteConvertBuilder(); + } + + public static final class QuoteConvertBuilder { + + private Timestamp invoiceDate; + + private Boolean invoiceImmediately; + + private Boolean createPendingInvoices; + + private Boolean firstInvoicePending; + + private SubscriptionParams subscription; + + private QuoteConvertBuilder() {} + + public QuoteConvertBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public QuoteConvertBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public QuoteConvertBuilder createPendingInvoices(Boolean value) { + this.createPendingInvoices = value; + return this; + } + + public QuoteConvertBuilder firstInvoicePending(Boolean value) { + this.firstInvoicePending = value; + return this; + } + + public QuoteConvertBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public QuoteConvertParams build() { + return new QuoteConvertParams(this); + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final AutoCollection autoCollection; + + private final String poNumber; + + private final Boolean autoCloseInvoices; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.autoCollection = builder.autoCollection; + + this.poNumber = builder.poNumber; + + this.autoCloseInvoices = builder.autoCloseInvoices; + } + + public String getId() { + return id; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public String getPoNumber() { + return poNumber; + } + + public Boolean getAutoCloseInvoices() { + return autoCloseInvoices; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.autoCloseInvoices != null) { + + formData.put("auto_close_invoices", this.autoCloseInvoices); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private AutoCollection autoCollection; + + private String poNumber; + + private Boolean autoCloseInvoices; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public SubscriptionBuilder autoCloseInvoices(Boolean value) { + this.autoCloseInvoices = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/params/QuoteCreateForChargeItemsAndChargesParams.java b/src/main/java/com/chargebee/v4/models/quote/params/QuoteCreateForChargeItemsAndChargesParams.java new file mode 100644 index 00000000..f4f2e3a5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/QuoteCreateForChargeItemsAndChargesParams.java @@ -0,0 +1,1914 @@ +/* + * 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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class QuoteCreateForChargeItemsAndChargesParams { + + private final String name; + + private final String customerId; + + private final String poNumber; + + private final String notes; + + private final Timestamp expiresAt; + + private final String currencyCode; + + private final String coupon; + + private final List couponIds; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final List itemPrices; + + private final List itemTiers; + + private final List charges; + + private final List discounts; + + private final List taxProvidersFields; + + private QuoteCreateForChargeItemsAndChargesParams( + QuoteCreateForChargeItemsAndChargesBuilder builder) { + + this.name = builder.name; + + this.customerId = builder.customerId; + + this.poNumber = builder.poNumber; + + this.notes = builder.notes; + + this.expiresAt = builder.expiresAt; + + this.currencyCode = builder.currencyCode; + + this.coupon = builder.coupon; + + this.couponIds = builder.couponIds; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.itemPrices = builder.itemPrices; + + this.itemTiers = builder.itemTiers; + + this.charges = builder.charges; + + this.discounts = builder.discounts; + + this.taxProvidersFields = builder.taxProvidersFields; + } + + public String getName() { + return name; + } + + public String getCustomerId() { + return customerId; + } + + public String getPoNumber() { + return poNumber; + } + + public String getNotes() { + return notes; + } + + public Timestamp getExpiresAt() { + return expiresAt; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getCoupon() { + return coupon; + } + + public List getCouponIds() { + return couponIds; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public List getItemPrices() { + return itemPrices; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getCharges() { + return charges; + } + + public List getDiscounts() { + return discounts; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + /** 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.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.notes != null) { + + formData.put("notes", this.notes); + } + + if (this.expiresAt != null) { + + formData.put("expires_at", this.expiresAt); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemPrices != null) { + + // List of objects + for (int i = 0; i < this.itemPrices.size(); i++) { + ItemPricesParams item = this.itemPrices.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_prices[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.charges != null) { + + // List of objects + for (int i = 0; i < this.charges.size(); i++) { + ChargesParams item = this.charges.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for QuoteCreateForChargeItemsAndChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static QuoteCreateForChargeItemsAndChargesBuilder builder() { + return new QuoteCreateForChargeItemsAndChargesBuilder(); + } + + public static final class QuoteCreateForChargeItemsAndChargesBuilder { + + private String name; + + private String customerId; + + private String poNumber; + + private String notes; + + private Timestamp expiresAt; + + private String currencyCode; + + private String coupon; + + private List couponIds; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private List itemPrices; + + private List itemTiers; + + private List charges; + + private List discounts; + + private List taxProvidersFields; + + private QuoteCreateForChargeItemsAndChargesBuilder() {} + + public QuoteCreateForChargeItemsAndChargesBuilder name(String value) { + this.name = value; + return this; + } + + public QuoteCreateForChargeItemsAndChargesBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public QuoteCreateForChargeItemsAndChargesBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public QuoteCreateForChargeItemsAndChargesBuilder notes(String value) { + this.notes = value; + return this; + } + + public QuoteCreateForChargeItemsAndChargesBuilder expiresAt(Timestamp value) { + this.expiresAt = value; + return this; + } + + public QuoteCreateForChargeItemsAndChargesBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public QuoteCreateForChargeItemsAndChargesBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public QuoteCreateForChargeItemsAndChargesBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public QuoteCreateForChargeItemsAndChargesBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public QuoteCreateForChargeItemsAndChargesBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public QuoteCreateForChargeItemsAndChargesBuilder itemPrices(List value) { + this.itemPrices = value; + return this; + } + + public QuoteCreateForChargeItemsAndChargesBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public QuoteCreateForChargeItemsAndChargesBuilder charges(List value) { + this.charges = value; + return this; + } + + public QuoteCreateForChargeItemsAndChargesBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public QuoteCreateForChargeItemsAndChargesBuilder taxProvidersFields( + List value) { + this.taxProvidersFields = value; + return this; + } + + public QuoteCreateForChargeItemsAndChargesParams build() { + return new QuoteCreateForChargeItemsAndChargesParams(this); + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class ItemPricesParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer servicePeriodDays; + + private ItemPricesParams(ItemPricesBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.servicePeriodDays = builder.servicePeriodDays; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + return formData; + } + + /** Create a new builder for ItemPricesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemPricesBuilder builder() { + return new ItemPricesBuilder(); + } + + public static final class ItemPricesBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer servicePeriodDays; + + private ItemPricesBuilder() {} + + public ItemPricesBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemPricesBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public ItemPricesBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public ItemPricesBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public ItemPricesBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public ItemPricesBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public ItemPricesParams build() { + return new ItemPricesParams(this); + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ChargesParams { + + private final Long amount; + + private final String amountInDecimal; + + private final String description; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final Integer servicePeriod; + + private ChargesParams(ChargesBuilder builder) { + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.description = builder.description; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.servicePeriod = builder.servicePeriod; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getDescription() { + return description; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public Integer getServicePeriod() { + return servicePeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.servicePeriod != null) { + + formData.put("service_period", this.servicePeriod); + } + + return formData; + } + + /** Create a new builder for ChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargesBuilder builder() { + return new ChargesBuilder(); + } + + public static final class ChargesBuilder { + + private Long amount; + + private String amountInDecimal; + + private String description; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private Integer servicePeriod; + + private ChargesBuilder() {} + + public ChargesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public ChargesBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public ChargesBuilder description(String value) { + this.description = value; + return this; + } + + public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public ChargesBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public ChargesBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public ChargesBuilder servicePeriod(Integer value) { + this.servicePeriod = value; + return this; + } + + public ChargesParams build() { + return new ChargesParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DiscountsParams { + + private final Number percentage; + + private final Integer quantity; + + private final Long amount; + + private final ApplyOn applyOn; + + private final String itemPriceId; + + private DiscountsParams(DiscountsBuilder builder) { + + this.percentage = builder.percentage; + + this.quantity = builder.quantity; + + this.amount = builder.amount; + + this.applyOn = builder.applyOn; + + this.itemPriceId = builder.itemPriceId; + } + + public Number getPercentage() { + return percentage; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getAmount() { + return amount; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public String getItemPriceId() { + return itemPriceId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private Number percentage; + + private Integer quantity; + + private Long amount; + + private ApplyOn applyOn; + + private String itemPriceId; + + private DiscountsBuilder() {} + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/params/QuoteCreateForOnetimeChargesParams.java b/src/main/java/com/chargebee/v4/models/quote/params/QuoteCreateForOnetimeChargesParams.java new file mode 100644 index 00000000..1ba3b8f2 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/QuoteCreateForOnetimeChargesParams.java @@ -0,0 +1,1094 @@ +/* + * 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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class QuoteCreateForOnetimeChargesParams { + + private final String name; + + private final String customerId; + + private final String poNumber; + + private final String notes; + + private final Timestamp expiresAt; + + private final String currencyCode; + + private final String coupon; + + private final List couponIds; + + private final ShippingAddressParams shippingAddress; + + private final List addons; + + private final List charges; + + private final List taxProvidersFields; + + private QuoteCreateForOnetimeChargesParams(QuoteCreateForOnetimeChargesBuilder builder) { + + this.name = builder.name; + + this.customerId = builder.customerId; + + this.poNumber = builder.poNumber; + + this.notes = builder.notes; + + this.expiresAt = builder.expiresAt; + + this.currencyCode = builder.currencyCode; + + this.coupon = builder.coupon; + + this.couponIds = builder.couponIds; + + this.shippingAddress = builder.shippingAddress; + + this.addons = builder.addons; + + this.charges = builder.charges; + + this.taxProvidersFields = builder.taxProvidersFields; + } + + public String getName() { + return name; + } + + public String getCustomerId() { + return customerId; + } + + public String getPoNumber() { + return poNumber; + } + + public String getNotes() { + return notes; + } + + public Timestamp getExpiresAt() { + return expiresAt; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getCoupon() { + return coupon; + } + + public List getCouponIds() { + return couponIds; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public List getAddons() { + return addons; + } + + public List getCharges() { + return charges; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + /** 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.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.notes != null) { + + formData.put("notes", this.notes); + } + + if (this.expiresAt != null) { + + formData.put("expires_at", this.expiresAt); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.charges != null) { + + // List of objects + for (int i = 0; i < this.charges.size(); i++) { + ChargesParams item = this.charges.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for QuoteCreateForOnetimeChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static QuoteCreateForOnetimeChargesBuilder builder() { + return new QuoteCreateForOnetimeChargesBuilder(); + } + + public static final class QuoteCreateForOnetimeChargesBuilder { + + private String name; + + private String customerId; + + private String poNumber; + + private String notes; + + private Timestamp expiresAt; + + private String currencyCode; + + private String coupon; + + private List couponIds; + + private ShippingAddressParams shippingAddress; + + private List addons; + + private List charges; + + private List taxProvidersFields; + + private QuoteCreateForOnetimeChargesBuilder() {} + + public QuoteCreateForOnetimeChargesBuilder name(String value) { + this.name = value; + return this; + } + + public QuoteCreateForOnetimeChargesBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public QuoteCreateForOnetimeChargesBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public QuoteCreateForOnetimeChargesBuilder notes(String value) { + this.notes = value; + return this; + } + + public QuoteCreateForOnetimeChargesBuilder expiresAt(Timestamp value) { + this.expiresAt = value; + return this; + } + + public QuoteCreateForOnetimeChargesBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public QuoteCreateForOnetimeChargesBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public QuoteCreateForOnetimeChargesBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public QuoteCreateForOnetimeChargesBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public QuoteCreateForOnetimeChargesBuilder addons(List value) { + this.addons = value; + return this; + } + + public QuoteCreateForOnetimeChargesBuilder charges(List value) { + this.charges = value; + return this; + } + + public QuoteCreateForOnetimeChargesBuilder taxProvidersFields( + List value) { + this.taxProvidersFields = value; + return this; + } + + public QuoteCreateForOnetimeChargesParams build() { + return new QuoteCreateForOnetimeChargesParams(this); + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer servicePeriod; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.servicePeriod = builder.servicePeriod; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getServicePeriod() { + return servicePeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.servicePeriod != null) { + + formData.put("service_period", this.servicePeriod); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer servicePeriod; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder servicePeriod(Integer value) { + this.servicePeriod = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class ChargesParams { + + private final Long amount; + + private final String amountInDecimal; + + private final String description; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final Integer servicePeriod; + + private ChargesParams(ChargesBuilder builder) { + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.description = builder.description; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.servicePeriod = builder.servicePeriod; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getDescription() { + return description; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public Integer getServicePeriod() { + return servicePeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.servicePeriod != null) { + + formData.put("service_period", this.servicePeriod); + } + + return formData; + } + + /** Create a new builder for ChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargesBuilder builder() { + return new ChargesBuilder(); + } + + public static final class ChargesBuilder { + + private Long amount; + + private String amountInDecimal; + + private String description; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private Integer servicePeriod; + + private ChargesBuilder() {} + + public ChargesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public ChargesBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public ChargesBuilder description(String value) { + this.description = value; + return this; + } + + public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public ChargesBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public ChargesBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public ChargesBuilder servicePeriod(Integer value) { + this.servicePeriod = value; + return this; + } + + public ChargesParams build() { + return new ChargesParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/params/QuoteDeleteParams.java b/src/main/java/com/chargebee/v4/models/quote/params/QuoteDeleteParams.java new file mode 100644 index 00000000..ab86bfc3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/QuoteDeleteParams.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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class QuoteDeleteParams { + + private final String comment; + + private QuoteDeleteParams(QuoteDeleteBuilder builder) { + + this.comment = builder.comment; + } + + public String getComment() { + return comment; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + return formData; + } + + /** Create a new builder for QuoteDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static QuoteDeleteBuilder builder() { + return new QuoteDeleteBuilder(); + } + + public static final class QuoteDeleteBuilder { + + private String comment; + + private QuoteDeleteBuilder() {} + + public QuoteDeleteBuilder comment(String value) { + this.comment = value; + return this; + } + + public QuoteDeleteParams build() { + return new QuoteDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/params/QuoteEditForChargeItemsAndChargesParams.java b/src/main/java/com/chargebee/v4/models/quote/params/QuoteEditForChargeItemsAndChargesParams.java new file mode 100644 index 00000000..3f2475c2 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/QuoteEditForChargeItemsAndChargesParams.java @@ -0,0 +1,1874 @@ +/* + * 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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class QuoteEditForChargeItemsAndChargesParams { + + private final String poNumber; + + private final String notes; + + private final Timestamp expiresAt; + + private final String currencyCode; + + private final String coupon; + + private final List couponIds; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final List itemPrices; + + private final List itemTiers; + + private final List charges; + + private final List discounts; + + private final List taxProvidersFields; + + private QuoteEditForChargeItemsAndChargesParams( + QuoteEditForChargeItemsAndChargesBuilder builder) { + + this.poNumber = builder.poNumber; + + this.notes = builder.notes; + + this.expiresAt = builder.expiresAt; + + this.currencyCode = builder.currencyCode; + + this.coupon = builder.coupon; + + this.couponIds = builder.couponIds; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.itemPrices = builder.itemPrices; + + this.itemTiers = builder.itemTiers; + + this.charges = builder.charges; + + this.discounts = builder.discounts; + + this.taxProvidersFields = builder.taxProvidersFields; + } + + public String getPoNumber() { + return poNumber; + } + + public String getNotes() { + return notes; + } + + public Timestamp getExpiresAt() { + return expiresAt; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public String getCoupon() { + return coupon; + } + + public List getCouponIds() { + return couponIds; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public List getItemPrices() { + return itemPrices; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getCharges() { + return charges; + } + + public List getDiscounts() { + return discounts; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.notes != null) { + + formData.put("notes", this.notes); + } + + if (this.expiresAt != null) { + + formData.put("expires_at", this.expiresAt); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemPrices != null) { + + // List of objects + for (int i = 0; i < this.itemPrices.size(); i++) { + ItemPricesParams item = this.itemPrices.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_prices[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.charges != null) { + + // List of objects + for (int i = 0; i < this.charges.size(); i++) { + ChargesParams item = this.charges.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for QuoteEditForChargeItemsAndChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static QuoteEditForChargeItemsAndChargesBuilder builder() { + return new QuoteEditForChargeItemsAndChargesBuilder(); + } + + public static final class QuoteEditForChargeItemsAndChargesBuilder { + + private String poNumber; + + private String notes; + + private Timestamp expiresAt; + + private String currencyCode; + + private String coupon; + + private List couponIds; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private List itemPrices; + + private List itemTiers; + + private List charges; + + private List discounts; + + private List taxProvidersFields; + + private QuoteEditForChargeItemsAndChargesBuilder() {} + + public QuoteEditForChargeItemsAndChargesBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public QuoteEditForChargeItemsAndChargesBuilder notes(String value) { + this.notes = value; + return this; + } + + public QuoteEditForChargeItemsAndChargesBuilder expiresAt(Timestamp value) { + this.expiresAt = value; + return this; + } + + public QuoteEditForChargeItemsAndChargesBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public QuoteEditForChargeItemsAndChargesBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public QuoteEditForChargeItemsAndChargesBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public QuoteEditForChargeItemsAndChargesBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public QuoteEditForChargeItemsAndChargesBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public QuoteEditForChargeItemsAndChargesBuilder itemPrices(List value) { + this.itemPrices = value; + return this; + } + + public QuoteEditForChargeItemsAndChargesBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public QuoteEditForChargeItemsAndChargesBuilder charges(List value) { + this.charges = value; + return this; + } + + public QuoteEditForChargeItemsAndChargesBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public QuoteEditForChargeItemsAndChargesBuilder taxProvidersFields( + List value) { + this.taxProvidersFields = value; + return this; + } + + public QuoteEditForChargeItemsAndChargesParams build() { + return new QuoteEditForChargeItemsAndChargesParams(this); + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class ItemPricesParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer servicePeriodDays; + + private ItemPricesParams(ItemPricesBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.servicePeriodDays = builder.servicePeriodDays; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + return formData; + } + + /** Create a new builder for ItemPricesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemPricesBuilder builder() { + return new ItemPricesBuilder(); + } + + public static final class ItemPricesBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer servicePeriodDays; + + private ItemPricesBuilder() {} + + public ItemPricesBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemPricesBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public ItemPricesBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public ItemPricesBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public ItemPricesBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public ItemPricesBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public ItemPricesParams build() { + return new ItemPricesParams(this); + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ChargesParams { + + private final Long amount; + + private final String amountInDecimal; + + private final String description; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final Integer servicePeriod; + + private ChargesParams(ChargesBuilder builder) { + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.description = builder.description; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.servicePeriod = builder.servicePeriod; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getDescription() { + return description; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public Integer getServicePeriod() { + return servicePeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.servicePeriod != null) { + + formData.put("service_period", this.servicePeriod); + } + + return formData; + } + + /** Create a new builder for ChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargesBuilder builder() { + return new ChargesBuilder(); + } + + public static final class ChargesBuilder { + + private Long amount; + + private String amountInDecimal; + + private String description; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private Integer servicePeriod; + + private ChargesBuilder() {} + + public ChargesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public ChargesBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public ChargesBuilder description(String value) { + this.description = value; + return this; + } + + public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public ChargesBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public ChargesBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public ChargesBuilder servicePeriod(Integer value) { + this.servicePeriod = value; + return this; + } + + public ChargesParams build() { + return new ChargesParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DiscountsParams { + + private final Number percentage; + + private final Integer quantity; + + private final Long amount; + + private final ApplyOn applyOn; + + private final String itemPriceId; + + private DiscountsParams(DiscountsBuilder builder) { + + this.percentage = builder.percentage; + + this.quantity = builder.quantity; + + this.amount = builder.amount; + + this.applyOn = builder.applyOn; + + this.itemPriceId = builder.itemPriceId; + } + + public Number getPercentage() { + return percentage; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getAmount() { + return amount; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public String getItemPriceId() { + return itemPriceId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private Number percentage; + + private Integer quantity; + + private Long amount; + + private ApplyOn applyOn; + + private String itemPriceId; + + private DiscountsBuilder() {} + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/params/QuoteExtendExpiryDateParams.java b/src/main/java/com/chargebee/v4/models/quote/params/QuoteExtendExpiryDateParams.java new file mode 100644 index 00000000..2b3d4b54 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/QuoteExtendExpiryDateParams.java @@ -0,0 +1,61 @@ +/* + * 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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class QuoteExtendExpiryDateParams { + + private final Timestamp validTill; + + private QuoteExtendExpiryDateParams(QuoteExtendExpiryDateBuilder builder) { + + this.validTill = builder.validTill; + } + + public Timestamp getValidTill() { + return validTill; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.validTill != null) { + + formData.put("valid_till", this.validTill); + } + + return formData; + } + + /** Create a new builder for QuoteExtendExpiryDateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static QuoteExtendExpiryDateBuilder builder() { + return new QuoteExtendExpiryDateBuilder(); + } + + public static final class QuoteExtendExpiryDateBuilder { + + private Timestamp validTill; + + private QuoteExtendExpiryDateBuilder() {} + + public QuoteExtendExpiryDateBuilder validTill(Timestamp value) { + this.validTill = value; + return this; + } + + public QuoteExtendExpiryDateParams build() { + return new QuoteExtendExpiryDateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/params/QuoteLineGroupsForQuoteParams.java b/src/main/java/com/chargebee/v4/models/quote/params/QuoteLineGroupsForQuoteParams.java new file mode 100644 index 00000000..b254a6a5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/QuoteLineGroupsForQuoteParams.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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class QuoteLineGroupsForQuoteParams { + + private final Map queryParams; + + private QuoteLineGroupsForQuoteParams(QuoteLineGroupsForQuoteBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public QuoteLineGroupsForQuoteBuilder toBuilder() { + QuoteLineGroupsForQuoteBuilder builder = new QuoteLineGroupsForQuoteBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for QuoteLineGroupsForQuoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static QuoteLineGroupsForQuoteBuilder builder() { + return new QuoteLineGroupsForQuoteBuilder(); + } + + public static final class QuoteLineGroupsForQuoteBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private QuoteLineGroupsForQuoteBuilder() {} + + public QuoteLineGroupsForQuoteBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public QuoteLineGroupsForQuoteBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public QuoteLineGroupsForQuoteParams build() { + return new QuoteLineGroupsForQuoteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteListParams.java b/src/main/java/com/chargebee/v4/models/quote/params/QuoteListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/quote/params/QuoteListParams.java rename to src/main/java/com/chargebee/v4/models/quote/params/QuoteListParams.java index 95eaf22a..3945c6fb 100644 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteListParams.java +++ b/src/main/java/com/chargebee/v4/models/quote/params/QuoteListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.quote.params; +package com.chargebee.v4.models.quote.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/quote/params/QuotePdfParams.java b/src/main/java/com/chargebee/v4/models/quote/params/QuotePdfParams.java new file mode 100644 index 00000000..e3cc6816 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/QuotePdfParams.java @@ -0,0 +1,108 @@ +/* + * 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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class QuotePdfParams { + + private final Boolean consolidatedView; + + private final DispositionType dispositionType; + + private QuotePdfParams(QuotePdfBuilder builder) { + + this.consolidatedView = builder.consolidatedView; + + this.dispositionType = builder.dispositionType; + } + + public Boolean getConsolidatedView() { + return consolidatedView; + } + + public DispositionType getDispositionType() { + return dispositionType; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.consolidatedView != null) { + + formData.put("consolidated_view", this.consolidatedView); + } + + if (this.dispositionType != null) { + + formData.put("disposition_type", this.dispositionType); + } + + return formData; + } + + /** Create a new builder for QuotePdfParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static QuotePdfBuilder builder() { + return new QuotePdfBuilder(); + } + + public static final class QuotePdfBuilder { + + private Boolean consolidatedView; + + private DispositionType dispositionType; + + private QuotePdfBuilder() {} + + public QuotePdfBuilder consolidatedView(Boolean value) { + this.consolidatedView = value; + return this; + } + + public QuotePdfBuilder dispositionType(DispositionType value) { + this.dispositionType = value; + return this; + } + + public QuotePdfParams build() { + return new QuotePdfParams(this); + } + } + + public enum DispositionType { + ATTACHMENT("attachment"), + + INLINE("inline"), + + /** An enum member indicating that DispositionType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + DispositionType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static DispositionType fromString(String value) { + if (value == null) return _UNKNOWN; + for (DispositionType enumValue : DispositionType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteRetrieveParams.java b/src/main/java/com/chargebee/v4/models/quote/params/QuoteRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/quote/params/QuoteRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/quote/params/QuoteRetrieveParams.java index 89837c07..601da363 100644 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/quote/params/QuoteRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.quote.params; +package com.chargebee.v4.models.quote.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteUpdateStatusParams.java b/src/main/java/com/chargebee/v4/models/quote/params/QuoteUpdateStatusParams.java similarity index 75% rename from src/main/java/com/chargebee/v4/core/models/quote/params/QuoteUpdateStatusParams.java rename to src/main/java/com/chargebee/v4/models/quote/params/QuoteUpdateStatusParams.java index 46328e70..e4b48999 100644 --- a/src/main/java/com/chargebee/v4/core/models/quote/params/QuoteUpdateStatusParams.java +++ b/src/main/java/com/chargebee/v4/models/quote/params/QuoteUpdateStatusParams.java @@ -4,24 +4,48 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.quote.params; +package com.chargebee.v4.models.quote.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class QuoteUpdateStatusParams { - private final Map formData; + private final Status status; + + private final String comment; private QuoteUpdateStatusParams(QuoteUpdateStatusBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); + + this.status = builder.status; + + this.comment = builder.comment; + } + + public Status getStatus() { + return status; + } + + public String getComment() { + return comment; } /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + return formData; } @@ -32,21 +56,20 @@ public static QuoteUpdateStatusBuilder builder() { } public static final class QuoteUpdateStatusBuilder { - private final Map formData = new LinkedHashMap<>(); - private QuoteUpdateStatusBuilder() {} + private Status status; - public QuoteUpdateStatusBuilder status(Status value) { + private String comment; - formData.put("status", value); + private QuoteUpdateStatusBuilder() {} + public QuoteUpdateStatusBuilder status(Status value) { + this.status = value; return this; } public QuoteUpdateStatusBuilder comment(String value) { - - formData.put("comment", value); - + this.comment = value; return this; } diff --git a/src/main/java/com/chargebee/v4/models/quote/params/UpdateSubscriptionQuoteForItemsParams.java b/src/main/java/com/chargebee/v4/models/quote/params/UpdateSubscriptionQuoteForItemsParams.java new file mode 100644 index 00000000..08cbbec3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/UpdateSubscriptionQuoteForItemsParams.java @@ -0,0 +1,3029 @@ +/* + * 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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class UpdateSubscriptionQuoteForItemsParams { + + private final String name; + + private final String notes; + + private final Timestamp expiresAt; + + private final List mandatoryItemsToRemove; + + private final Boolean replaceItemsList; + + private final Integer billingCycles; + + private final Integer termsToCharge; + + private final Timestamp reactivateFrom; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final Boolean replaceCouponList; + + private final ChangeOption changeOption; + + private final Timestamp changesScheduledAt; + + private final Boolean forceTermReset; + + private final Boolean reactivate; + + private final Integer netTermDays; + + private final SubscriptionParams subscription; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final CustomerParams customer; + + private final ContractTermParams contractTerm; + + private final List subscriptionItems; + + private final List discounts; + + private final List itemTiers; + + private final List coupons; + + private final Map customFields; + + private UpdateSubscriptionQuoteForItemsParams(UpdateSubscriptionQuoteForItemsBuilder builder) { + + this.name = builder.name; + + this.notes = builder.notes; + + this.expiresAt = builder.expiresAt; + + this.mandatoryItemsToRemove = builder.mandatoryItemsToRemove; + + this.replaceItemsList = builder.replaceItemsList; + + this.billingCycles = builder.billingCycles; + + this.termsToCharge = builder.termsToCharge; + + this.reactivateFrom = builder.reactivateFrom; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.replaceCouponList = builder.replaceCouponList; + + this.changeOption = builder.changeOption; + + this.changesScheduledAt = builder.changesScheduledAt; + + this.forceTermReset = builder.forceTermReset; + + this.reactivate = builder.reactivate; + + this.netTermDays = builder.netTermDays; + + this.subscription = builder.subscription; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.customer = builder.customer; + + this.contractTerm = builder.contractTerm; + + this.subscriptionItems = builder.subscriptionItems; + + this.discounts = builder.discounts; + + this.itemTiers = builder.itemTiers; + + this.coupons = builder.coupons; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getName() { + return name; + } + + public String getNotes() { + return notes; + } + + public Timestamp getExpiresAt() { + return expiresAt; + } + + public List getMandatoryItemsToRemove() { + return mandatoryItemsToRemove; + } + + public Boolean getReplaceItemsList() { + return replaceItemsList; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Timestamp getReactivateFrom() { + return reactivateFrom; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public Boolean getReplaceCouponList() { + return replaceCouponList; + } + + public ChangeOption getChangeOption() { + return changeOption; + } + + public Timestamp getChangesScheduledAt() { + return changesScheduledAt; + } + + public Boolean getForceTermReset() { + return forceTermReset; + } + + public Boolean getReactivate() { + return reactivate; + } + + public Integer getNetTermDays() { + return netTermDays; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public CustomerParams getCustomer() { + return customer; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + public List getDiscounts() { + return discounts; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getCoupons() { + return coupons; + } + + 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.notes != null) { + + formData.put("notes", this.notes); + } + + if (this.expiresAt != null) { + + formData.put("expires_at", this.expiresAt); + } + + if (this.mandatoryItemsToRemove != null) { + + formData.put("mandatory_items_to_remove", this.mandatoryItemsToRemove); + } + + if (this.replaceItemsList != null) { + + formData.put("replace_items_list", this.replaceItemsList); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.reactivateFrom != null) { + + formData.put("reactivate_from", this.reactivateFrom); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.replaceCouponList != null) { + + formData.put("replace_coupon_list", this.replaceCouponList); + } + + if (this.changeOption != null) { + + formData.put("change_option", this.changeOption); + } + + if (this.changesScheduledAt != null) { + + formData.put("changes_scheduled_at", this.changesScheduledAt); + } + + if (this.forceTermReset != null) { + + formData.put("force_term_reset", this.forceTermReset); + } + + if (this.reactivate != null) { + + formData.put("reactivate", this.reactivate); + } + + if (this.netTermDays != null) { + + formData.put("net_term_days", this.netTermDays); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.coupons != null) { + + // List of objects + for (int i = 0; i < this.coupons.size(); i++) { + CouponsParams item = this.coupons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for UpdateSubscriptionQuoteForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdateSubscriptionQuoteForItemsBuilder builder() { + return new UpdateSubscriptionQuoteForItemsBuilder(); + } + + public static final class UpdateSubscriptionQuoteForItemsBuilder { + + private String name; + + private String notes; + + private Timestamp expiresAt; + + private List mandatoryItemsToRemove; + + private Boolean replaceItemsList; + + private Integer billingCycles; + + private Integer termsToCharge; + + private Timestamp reactivateFrom; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private Boolean replaceCouponList; + + private ChangeOption changeOption; + + private Timestamp changesScheduledAt; + + private Boolean forceTermReset; + + private Boolean reactivate; + + private Integer netTermDays; + + private SubscriptionParams subscription; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private CustomerParams customer; + + private ContractTermParams contractTerm; + + private List subscriptionItems; + + private List discounts; + + private List itemTiers; + + private List coupons; + + private Map customFields = new LinkedHashMap<>(); + + private UpdateSubscriptionQuoteForItemsBuilder() {} + + public UpdateSubscriptionQuoteForItemsBuilder name(String value) { + this.name = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder notes(String value) { + this.notes = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder expiresAt(Timestamp value) { + this.expiresAt = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder mandatoryItemsToRemove(List value) { + this.mandatoryItemsToRemove = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder replaceItemsList(Boolean value) { + this.replaceItemsList = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder reactivateFrom(Timestamp value) { + this.reactivateFrom = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder billingAlignmentMode(BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder replaceCouponList(Boolean value) { + this.replaceCouponList = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder changeOption(ChangeOption value) { + this.changeOption = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder changesScheduledAt(Timestamp value) { + this.changesScheduledAt = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder forceTermReset(Boolean value) { + this.forceTermReset = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder reactivate(Boolean value) { + this.reactivate = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder netTermDays(Integer value) { + this.netTermDays = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public UpdateSubscriptionQuoteForItemsBuilder coupons(List value) { + this.coupons = 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 UpdateSubscriptionQuoteForItemsBuilder 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 UpdateSubscriptionQuoteForItemsBuilder 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 UpdateSubscriptionQuoteForItemsParams build() { + return new UpdateSubscriptionQuoteForItemsParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChangeOption { + IMMEDIATELY("immediately"), + + SPECIFIC_DATE("specific_date"), + + /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChangeOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChangeOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChangeOption enumValue : ChangeOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final Long setupFee; + + private final Timestamp startDate; + + private final Timestamp trialEnd; + + private final String coupon; + + private final AutoCollection autoCollection; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final Integer contractTermBillingCycleOnRenewal; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.setupFee = builder.setupFee; + + this.startDate = builder.startDate; + + this.trialEnd = builder.trialEnd; + + this.coupon = builder.coupon; + + this.autoCollection = builder.autoCollection; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + } + + public String getId() { + return id; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public String getCoupon() { + return coupon; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private Long setupFee; + + private Timestamp startDate; + + private Timestamp trialEnd; + + private String coupon; + + private AutoCollection autoCollection; + + private OfflinePaymentMethod offlinePaymentMethod; + + private Integer contractTermBillingCycleOnRenewal; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + @Deprecated + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + @Deprecated + public SubscriptionBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class CustomerParams { + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final Boolean registeredForGst; + + private CustomerParams(CustomerBuilder builder) { + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.registeredForGst = builder.registeredForGst; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public Boolean getRegisteredForGst() { + return registeredForGst; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.registeredForGst != null) { + + formData.put("registered_for_gst", this.registeredForGst); + } + + 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 String vatNumberPrefix; + + private Boolean registeredForGst; + + private CustomerBuilder() {} + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder registeredForGst(Boolean value) { + this.registeredForGst = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + RENEW_ONCE("renew_once"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ChargeOnOption chargeOnOption; + + private final ItemType itemType; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private final String rampTierId; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.chargeOnOption = builder.chargeOnOption; + + this.itemType = builder.itemType; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + + this.rampTierId = builder.rampTierId; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ChargeOnOption getChargeOnOption() { + return chargeOnOption; + } + + public ItemType getItemType() { + return itemType; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + public String getRampTierId() { + return rampTierId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.chargeOnOption != null) { + + formData.put("charge_on_option", this.chargeOnOption); + } + + if (this.itemType != null) { + + formData.put("item_type", this.itemType); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + if (this.rampTierId != null) { + + formData.put("ramp_tier_id", this.rampTierId); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ChargeOnOption chargeOnOption; + + private ItemType itemType; + + private Timestamp startDate; + + private Timestamp endDate; + + private String rampTierId; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionItemsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionItemsBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { + this.chargeOnOption = value; + return this; + } + + public SubscriptionItemsBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public SubscriptionItemsBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionItemsBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public SubscriptionItemsBuilder rampTierId(String value) { + this.rampTierId = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + + 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"), + + /** 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; + } + } + + public enum ChargeOnOption { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnOption enumValue : ChargeOnOption.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 DiscountsParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private final Integer quantity; + + private final OperationType operationType; + + private final String id; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private DiscountsParams(DiscountsBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.operationType = builder.operationType; + + this.id = builder.id; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public OperationType getOperationType() { + return operationType; + } + + public String getId() { + return id; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.operationType != null) { + + formData.put("operation_type", this.operationType); + } + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private Integer quantity; + + private OperationType operationType; + + private String id; + + private Timestamp startDate; + + private Timestamp endDate; + + private DiscountsBuilder() {} + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder operationType(OperationType value) { + this.operationType = value; + return this; + } + + public DiscountsBuilder id(String value) { + this.id = value; + return this; + } + + public DiscountsBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public DiscountsBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 enum OperationType { + ADD("add"), + + REMOVE("remove"), + + /** An enum member indicating that OperationType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OperationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OperationType fromString(String value) { + if (value == null) return _UNKNOWN; + for (OperationType enumValue : OperationType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private final String rampTierId; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + + this.rampTierId = builder.rampTierId; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + public String getRampTierId() { + return rampTierId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + if (this.rampTierId != null) { + + formData.put("ramp_tier_id", this.rampTierId); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private String rampTierId; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersBuilder rampTierId(String value) { + this.rampTierId = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CouponsParams { + + private final String id; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private CouponsParams(CouponsBuilder builder) { + + this.id = builder.id; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + } + + public String getId() { + return id; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + return formData; + } + + /** Create a new builder for CouponsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponsBuilder builder() { + return new CouponsBuilder(); + } + + public static final class CouponsBuilder { + + private String id; + + private Timestamp startDate; + + private Timestamp endDate; + + private CouponsBuilder() {} + + public CouponsBuilder id(String value) { + this.id = value; + return this; + } + + public CouponsBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public CouponsBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public CouponsParams build() { + return new CouponsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/params/UpdateSubscriptionQuoteParams.java b/src/main/java/com/chargebee/v4/models/quote/params/UpdateSubscriptionQuoteParams.java new file mode 100644 index 00000000..6d160db1 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/params/UpdateSubscriptionQuoteParams.java @@ -0,0 +1,2261 @@ +/* + * 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.quote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class UpdateSubscriptionQuoteParams { + + private final String name; + + private final String notes; + + private final Timestamp expiresAt; + + private final Boolean replaceAddonList; + + private final List mandatoryAddonsToRemove; + + private final Integer billingCycles; + + private final Integer termsToCharge; + + private final Timestamp reactivateFrom; + + private final BillingAlignmentMode billingAlignmentMode; + + private final List couponIds; + + private final Boolean replaceCouponList; + + private final ChangeOption changeOption; + + private final Timestamp changesScheduledAt; + + private final Boolean forceTermReset; + + private final Boolean reactivate; + + private final SubscriptionParams subscription; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final CustomerParams customer; + + private final ContractTermParams contractTerm; + + private final List addons; + + private final List eventBasedAddons; + + private UpdateSubscriptionQuoteParams(UpdateSubscriptionQuoteBuilder builder) { + + this.name = builder.name; + + this.notes = builder.notes; + + this.expiresAt = builder.expiresAt; + + this.replaceAddonList = builder.replaceAddonList; + + this.mandatoryAddonsToRemove = builder.mandatoryAddonsToRemove; + + this.billingCycles = builder.billingCycles; + + this.termsToCharge = builder.termsToCharge; + + this.reactivateFrom = builder.reactivateFrom; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.couponIds = builder.couponIds; + + this.replaceCouponList = builder.replaceCouponList; + + this.changeOption = builder.changeOption; + + this.changesScheduledAt = builder.changesScheduledAt; + + this.forceTermReset = builder.forceTermReset; + + this.reactivate = builder.reactivate; + + this.subscription = builder.subscription; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.customer = builder.customer; + + this.contractTerm = builder.contractTerm; + + this.addons = builder.addons; + + this.eventBasedAddons = builder.eventBasedAddons; + } + + public String getName() { + return name; + } + + public String getNotes() { + return notes; + } + + public Timestamp getExpiresAt() { + return expiresAt; + } + + public Boolean getReplaceAddonList() { + return replaceAddonList; + } + + public List getMandatoryAddonsToRemove() { + return mandatoryAddonsToRemove; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Timestamp getReactivateFrom() { + return reactivateFrom; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public List getCouponIds() { + return couponIds; + } + + public Boolean getReplaceCouponList() { + return replaceCouponList; + } + + public ChangeOption getChangeOption() { + return changeOption; + } + + public Timestamp getChangesScheduledAt() { + return changesScheduledAt; + } + + public Boolean getForceTermReset() { + return forceTermReset; + } + + public Boolean getReactivate() { + return reactivate; + } + + public SubscriptionParams getSubscription() { + return subscription; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public CustomerParams getCustomer() { + return customer; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getAddons() { + return addons; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + /** 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.notes != null) { + + formData.put("notes", this.notes); + } + + if (this.expiresAt != null) { + + formData.put("expires_at", this.expiresAt); + } + + if (this.replaceAddonList != null) { + + formData.put("replace_addon_list", this.replaceAddonList); + } + + if (this.mandatoryAddonsToRemove != null) { + + formData.put("mandatory_addons_to_remove", this.mandatoryAddonsToRemove); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.reactivateFrom != null) { + + formData.put("reactivate_from", this.reactivateFrom); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.replaceCouponList != null) { + + formData.put("replace_coupon_list", this.replaceCouponList); + } + + if (this.changeOption != null) { + + formData.put("change_option", this.changeOption); + } + + if (this.changesScheduledAt != null) { + + formData.put("changes_scheduled_at", this.changesScheduledAt); + } + + if (this.forceTermReset != null) { + + formData.put("force_term_reset", this.forceTermReset); + } + + if (this.reactivate != null) { + + formData.put("reactivate", this.reactivate); + } + + if (this.subscription != null) { + + // Single object + Map nestedData = this.subscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for UpdateSubscriptionQuoteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UpdateSubscriptionQuoteBuilder builder() { + return new UpdateSubscriptionQuoteBuilder(); + } + + public static final class UpdateSubscriptionQuoteBuilder { + + private String name; + + private String notes; + + private Timestamp expiresAt; + + private Boolean replaceAddonList; + + private List mandatoryAddonsToRemove; + + private Integer billingCycles; + + private Integer termsToCharge; + + private Timestamp reactivateFrom; + + private BillingAlignmentMode billingAlignmentMode; + + private List couponIds; + + private Boolean replaceCouponList; + + private ChangeOption changeOption; + + private Timestamp changesScheduledAt; + + private Boolean forceTermReset; + + private Boolean reactivate; + + private SubscriptionParams subscription; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private CustomerParams customer; + + private ContractTermParams contractTerm; + + private List addons; + + private List eventBasedAddons; + + private UpdateSubscriptionQuoteBuilder() {} + + public UpdateSubscriptionQuoteBuilder name(String value) { + this.name = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder notes(String value) { + this.notes = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder expiresAt(Timestamp value) { + this.expiresAt = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder replaceAddonList(Boolean value) { + this.replaceAddonList = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder mandatoryAddonsToRemove(List value) { + this.mandatoryAddonsToRemove = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder reactivateFrom(Timestamp value) { + this.reactivateFrom = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder billingAlignmentMode(BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder replaceCouponList(Boolean value) { + this.replaceCouponList = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder changeOption(ChangeOption value) { + this.changeOption = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder changesScheduledAt(Timestamp value) { + this.changesScheduledAt = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder forceTermReset(Boolean value) { + this.forceTermReset = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder reactivate(Boolean value) { + this.reactivate = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder subscription(SubscriptionParams value) { + this.subscription = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder addons(List value) { + this.addons = value; + return this; + } + + public UpdateSubscriptionQuoteBuilder eventBasedAddons(List value) { + this.eventBasedAddons = value; + return this; + } + + public UpdateSubscriptionQuoteParams build() { + return new UpdateSubscriptionQuoteParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChangeOption { + IMMEDIATELY("immediately"), + + SPECIFIC_DATE("specific_date"), + + /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChangeOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChangeOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChangeOption enumValue : ChangeOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionParams { + + private final String id; + + private final String planId; + + private final Integer planQuantity; + + private final Long planUnitPrice; + + private final Long setupFee; + + private final String planQuantityInDecimal; + + private final String planUnitPriceInDecimal; + + private final Timestamp startDate; + + private final Timestamp trialEnd; + + private final String coupon; + + private final AutoCollection autoCollection; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final Integer contractTermBillingCycleOnRenewal; + + private SubscriptionParams(SubscriptionBuilder builder) { + + this.id = builder.id; + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planUnitPrice = builder.planUnitPrice; + + this.setupFee = builder.setupFee; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + + this.planUnitPriceInDecimal = builder.planUnitPriceInDecimal; + + this.startDate = builder.startDate; + + this.trialEnd = builder.trialEnd; + + this.coupon = builder.coupon; + + this.autoCollection = builder.autoCollection; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + } + + public String getId() { + return id; + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public Long getPlanUnitPrice() { + return planUnitPrice; + } + + public Long getSetupFee() { + return setupFee; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + public String getPlanUnitPriceInDecimal() { + return planUnitPriceInDecimal; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public String getCoupon() { + return coupon; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planUnitPrice != null) { + + formData.put("plan_unit_price", this.planUnitPrice); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + if (this.planUnitPriceInDecimal != null) { + + formData.put("plan_unit_price_in_decimal", this.planUnitPriceInDecimal); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + return formData; + } + + /** Create a new builder for SubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionBuilder builder() { + return new SubscriptionBuilder(); + } + + public static final class SubscriptionBuilder { + + private String id; + + private String planId; + + private Integer planQuantity; + + private Long planUnitPrice; + + private Long setupFee; + + private String planQuantityInDecimal; + + private String planUnitPriceInDecimal; + + private Timestamp startDate; + + private Timestamp trialEnd; + + private String coupon; + + private AutoCollection autoCollection; + + private OfflinePaymentMethod offlinePaymentMethod; + + private Integer contractTermBillingCycleOnRenewal; + + private SubscriptionBuilder() {} + + public SubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionBuilder planId(String value) { + this.planId = value; + return this; + } + + public SubscriptionBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public SubscriptionBuilder planUnitPrice(Long value) { + this.planUnitPrice = value; + return this; + } + + public SubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + public SubscriptionBuilder planUnitPriceInDecimal(String value) { + this.planUnitPriceInDecimal = value; + return this; + } + + public SubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + @Deprecated + public SubscriptionBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionParams build() { + return new SubscriptionParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class CustomerParams { + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final Boolean registeredForGst; + + private CustomerParams(CustomerBuilder builder) { + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.registeredForGst = builder.registeredForGst; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public Boolean getRegisteredForGst() { + return registeredForGst; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.registeredForGst != null) { + + formData.put("registered_for_gst", this.registeredForGst); + } + + 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 String vatNumberPrefix; + + private Boolean registeredForGst; + + private CustomerBuilder() {} + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder registeredForGst(Boolean value) { + this.registeredForGst = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + RENEW_ONCE("renew_once"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final Integer billingCycles; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private final Timestamp trialEnd; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.billingCycles = builder.billingCycles; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.trialEnd = builder.trialEnd; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private Integer billingCycles; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private Timestamp trialEnd; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final Integer servicePeriodInDays; + + private final ChargeOn chargeOn; + + private final OnEvent onEvent; + + private final Boolean chargeOnce; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.servicePeriodInDays = builder.servicePeriodInDays; + + this.chargeOn = builder.chargeOn; + + this.onEvent = builder.onEvent; + + this.chargeOnce = builder.chargeOnce; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public Integer getServicePeriodInDays() { + return servicePeriodInDays; + } + + public ChargeOn getChargeOn() { + return chargeOn; + } + + public OnEvent getOnEvent() { + return onEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.servicePeriodInDays != null) { + + formData.put("service_period_in_days", this.servicePeriodInDays); + } + + if (this.chargeOn != null) { + + formData.put("charge_on", this.chargeOn); + } + + if (this.onEvent != null) { + + formData.put("on_event", this.onEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private Integer servicePeriodInDays; + + private ChargeOn chargeOn; + + private OnEvent onEvent; + + private Boolean chargeOnce; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { + this.servicePeriodInDays = value; + return this; + } + + public EventBasedAddonsBuilder chargeOn(ChargeOn value) { + this.chargeOn = value; + return this; + } + + public EventBasedAddonsBuilder onEvent(OnEvent value) { + this.onEvent = value; + return this; + } + + public EventBasedAddonsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + + public enum ChargeOn { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOn fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOn enumValue : ChargeOn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** An enum member indicating that OnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (OnEvent enumValue : OnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/responses/CreateSubscriptionForCustomerQuoteResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/CreateSubscriptionForCustomerQuoteResponse.java new file mode 100644 index 00000000..16663ef1 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/responses/CreateSubscriptionForCustomerQuoteResponse.java @@ -0,0 +1,104 @@ +package com.chargebee.v4.models.quote.responses; + +import com.chargebee.v4.models.quote.Quote; + +import com.chargebee.v4.models.quotedSubscription.QuotedSubscription; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CreateSubscriptionForCustomerQuote operation. Contains the response + * data from the API. + */ +public final class CreateSubscriptionForCustomerQuoteResponse extends BaseResponse { + private final Quote quote; + + private final QuotedSubscription quotedSubscription; + + private CreateSubscriptionForCustomerQuoteResponse(Builder builder) { + super(builder.httpResponse); + + this.quote = builder.quote; + + this.quotedSubscription = builder.quotedSubscription; + } + + /** Parse JSON response into CreateSubscriptionForCustomerQuoteResponse object. */ + public static CreateSubscriptionForCustomerQuoteResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into CreateSubscriptionForCustomerQuoteResponse object with HTTP response. + */ + public static CreateSubscriptionForCustomerQuoteResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __quoteJson = JsonUtil.getObject(json, "quote"); + if (__quoteJson != null) { + builder.quote(Quote.fromJson(__quoteJson)); + } + + String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); + if (__quotedSubscriptionJson != null) { + builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse CreateSubscriptionForCustomerQuoteResponse from JSON", e); + } + } + + /** Create a new builder for CreateSubscriptionForCustomerQuoteResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CreateSubscriptionForCustomerQuoteResponse. */ + public static class Builder { + + private Quote quote; + + private QuotedSubscription quotedSubscription; + + private Response httpResponse; + + private Builder() {} + + public Builder quote(Quote quote) { + this.quote = quote; + return this; + } + + public Builder quotedSubscription(QuotedSubscription quotedSubscription) { + this.quotedSubscription = quotedSubscription; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CreateSubscriptionForCustomerQuoteResponse build() { + return new CreateSubscriptionForCustomerQuoteResponse(this); + } + } + + /** Get the quote from the response. */ + public Quote getQuote() { + return quote; + } + + /** Get the quotedSubscription from the response. */ + public QuotedSubscription getQuotedSubscription() { + return quotedSubscription; + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/responses/CreateSubscriptionItemsForCustomerQuoteResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/CreateSubscriptionItemsForCustomerQuoteResponse.java new file mode 100644 index 00000000..190bcb6e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/responses/CreateSubscriptionItemsForCustomerQuoteResponse.java @@ -0,0 +1,128 @@ +package com.chargebee.v4.models.quote.responses; + +import com.chargebee.v4.models.quote.Quote; + +import com.chargebee.v4.models.quotedRamp.QuotedRamp; + +import com.chargebee.v4.models.quotedSubscription.QuotedSubscription; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CreateSubscriptionItemsForCustomerQuote operation. Contains the + * response data from the API. + */ +public final class CreateSubscriptionItemsForCustomerQuoteResponse extends BaseResponse { + private final Quote quote; + + private final QuotedSubscription quotedSubscription; + + private final QuotedRamp quotedRamp; + + private CreateSubscriptionItemsForCustomerQuoteResponse(Builder builder) { + super(builder.httpResponse); + + this.quote = builder.quote; + + this.quotedSubscription = builder.quotedSubscription; + + this.quotedRamp = builder.quotedRamp; + } + + /** Parse JSON response into CreateSubscriptionItemsForCustomerQuoteResponse object. */ + public static CreateSubscriptionItemsForCustomerQuoteResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into CreateSubscriptionItemsForCustomerQuoteResponse object with HTTP + * response. + */ + public static CreateSubscriptionItemsForCustomerQuoteResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __quoteJson = JsonUtil.getObject(json, "quote"); + if (__quoteJson != null) { + builder.quote(Quote.fromJson(__quoteJson)); + } + + String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); + if (__quotedSubscriptionJson != null) { + builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); + } + + String __quotedRampJson = JsonUtil.getObject(json, "quoted_ramp"); + if (__quotedRampJson != null) { + builder.quotedRamp(QuotedRamp.fromJson(__quotedRampJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse CreateSubscriptionItemsForCustomerQuoteResponse from JSON", e); + } + } + + /** Create a new builder for CreateSubscriptionItemsForCustomerQuoteResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CreateSubscriptionItemsForCustomerQuoteResponse. */ + public static class Builder { + + private Quote quote; + + private QuotedSubscription quotedSubscription; + + private QuotedRamp quotedRamp; + + private Response httpResponse; + + private Builder() {} + + public Builder quote(Quote quote) { + this.quote = quote; + return this; + } + + public Builder quotedSubscription(QuotedSubscription quotedSubscription) { + this.quotedSubscription = quotedSubscription; + return this; + } + + public Builder quotedRamp(QuotedRamp quotedRamp) { + this.quotedRamp = quotedRamp; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CreateSubscriptionItemsForCustomerQuoteResponse build() { + return new CreateSubscriptionItemsForCustomerQuoteResponse(this); + } + } + + /** Get the quote from the response. */ + public Quote getQuote() { + return quote; + } + + /** Get the quotedSubscription from the response. */ + public QuotedSubscription getQuotedSubscription() { + return quotedSubscription; + } + + /** Get the quotedRamp from the response. */ + public QuotedRamp getQuotedRamp() { + return quotedRamp; + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/responses/EditCreateSubscriptionCustomerQuoteForItemsResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/EditCreateSubscriptionCustomerQuoteForItemsResponse.java new file mode 100644 index 00000000..d081dc1e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/responses/EditCreateSubscriptionCustomerQuoteForItemsResponse.java @@ -0,0 +1,128 @@ +package com.chargebee.v4.models.quote.responses; + +import com.chargebee.v4.models.quote.Quote; + +import com.chargebee.v4.models.quotedRamp.QuotedRamp; + +import com.chargebee.v4.models.quotedSubscription.QuotedSubscription; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for EditCreateSubscriptionCustomerQuoteForItems operation. Contains the + * response data from the API. + */ +public final class EditCreateSubscriptionCustomerQuoteForItemsResponse extends BaseResponse { + private final Quote quote; + + private final QuotedSubscription quotedSubscription; + + private final QuotedRamp quotedRamp; + + private EditCreateSubscriptionCustomerQuoteForItemsResponse(Builder builder) { + super(builder.httpResponse); + + this.quote = builder.quote; + + this.quotedSubscription = builder.quotedSubscription; + + this.quotedRamp = builder.quotedRamp; + } + + /** Parse JSON response into EditCreateSubscriptionCustomerQuoteForItemsResponse object. */ + public static EditCreateSubscriptionCustomerQuoteForItemsResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into EditCreateSubscriptionCustomerQuoteForItemsResponse object with HTTP + * response. + */ + public static EditCreateSubscriptionCustomerQuoteForItemsResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __quoteJson = JsonUtil.getObject(json, "quote"); + if (__quoteJson != null) { + builder.quote(Quote.fromJson(__quoteJson)); + } + + String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); + if (__quotedSubscriptionJson != null) { + builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); + } + + String __quotedRampJson = JsonUtil.getObject(json, "quoted_ramp"); + if (__quotedRampJson != null) { + builder.quotedRamp(QuotedRamp.fromJson(__quotedRampJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse EditCreateSubscriptionCustomerQuoteForItemsResponse from JSON", e); + } + } + + /** Create a new builder for EditCreateSubscriptionCustomerQuoteForItemsResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for EditCreateSubscriptionCustomerQuoteForItemsResponse. */ + public static class Builder { + + private Quote quote; + + private QuotedSubscription quotedSubscription; + + private QuotedRamp quotedRamp; + + private Response httpResponse; + + private Builder() {} + + public Builder quote(Quote quote) { + this.quote = quote; + return this; + } + + public Builder quotedSubscription(QuotedSubscription quotedSubscription) { + this.quotedSubscription = quotedSubscription; + return this; + } + + public Builder quotedRamp(QuotedRamp quotedRamp) { + this.quotedRamp = quotedRamp; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public EditCreateSubscriptionCustomerQuoteForItemsResponse build() { + return new EditCreateSubscriptionCustomerQuoteForItemsResponse(this); + } + } + + /** Get the quote from the response. */ + public Quote getQuote() { + return quote; + } + + /** Get the quotedSubscription from the response. */ + public QuotedSubscription getQuotedSubscription() { + return quotedSubscription; + } + + /** Get the quotedRamp from the response. */ + public QuotedRamp getQuotedRamp() { + return quotedRamp; + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/responses/EditCreateSubscriptionForCustomerQuoteResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/EditCreateSubscriptionForCustomerQuoteResponse.java new file mode 100644 index 00000000..159d51d1 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/responses/EditCreateSubscriptionForCustomerQuoteResponse.java @@ -0,0 +1,105 @@ +package com.chargebee.v4.models.quote.responses; + +import com.chargebee.v4.models.quote.Quote; + +import com.chargebee.v4.models.quotedSubscription.QuotedSubscription; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for EditCreateSubscriptionForCustomerQuote operation. Contains the + * response data from the API. + */ +public final class EditCreateSubscriptionForCustomerQuoteResponse extends BaseResponse { + private final Quote quote; + + private final QuotedSubscription quotedSubscription; + + private EditCreateSubscriptionForCustomerQuoteResponse(Builder builder) { + super(builder.httpResponse); + + this.quote = builder.quote; + + this.quotedSubscription = builder.quotedSubscription; + } + + /** Parse JSON response into EditCreateSubscriptionForCustomerQuoteResponse object. */ + public static EditCreateSubscriptionForCustomerQuoteResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into EditCreateSubscriptionForCustomerQuoteResponse object with HTTP + * response. + */ + public static EditCreateSubscriptionForCustomerQuoteResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __quoteJson = JsonUtil.getObject(json, "quote"); + if (__quoteJson != null) { + builder.quote(Quote.fromJson(__quoteJson)); + } + + String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); + if (__quotedSubscriptionJson != null) { + builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse EditCreateSubscriptionForCustomerQuoteResponse from JSON", e); + } + } + + /** Create a new builder for EditCreateSubscriptionForCustomerQuoteResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for EditCreateSubscriptionForCustomerQuoteResponse. */ + public static class Builder { + + private Quote quote; + + private QuotedSubscription quotedSubscription; + + private Response httpResponse; + + private Builder() {} + + public Builder quote(Quote quote) { + this.quote = quote; + return this; + } + + public Builder quotedSubscription(QuotedSubscription quotedSubscription) { + this.quotedSubscription = quotedSubscription; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public EditCreateSubscriptionForCustomerQuoteResponse build() { + return new EditCreateSubscriptionForCustomerQuoteResponse(this); + } + } + + /** Get the quote from the response. */ + public Quote getQuote() { + return quote; + } + + /** Get the quotedSubscription from the response. */ + public QuotedSubscription getQuotedSubscription() { + return quotedSubscription; + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/responses/EditOneTimeQuoteResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/EditOneTimeQuoteResponse.java new file mode 100644 index 00000000..b0290dee --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/responses/EditOneTimeQuoteResponse.java @@ -0,0 +1,100 @@ +package com.chargebee.v4.models.quote.responses; + +import com.chargebee.v4.models.quote.Quote; + +import com.chargebee.v4.models.quotedCharge.QuotedCharge; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for EditOneTimeQuote operation. Contains the response data from the + * API. + */ +public final class EditOneTimeQuoteResponse extends BaseResponse { + private final Quote quote; + + private final QuotedCharge quotedCharge; + + private EditOneTimeQuoteResponse(Builder builder) { + super(builder.httpResponse); + + this.quote = builder.quote; + + this.quotedCharge = builder.quotedCharge; + } + + /** Parse JSON response into EditOneTimeQuoteResponse object. */ + public static EditOneTimeQuoteResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into EditOneTimeQuoteResponse object with HTTP response. */ + public static EditOneTimeQuoteResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __quoteJson = JsonUtil.getObject(json, "quote"); + if (__quoteJson != null) { + builder.quote(Quote.fromJson(__quoteJson)); + } + + String __quotedChargeJson = JsonUtil.getObject(json, "quoted_charge"); + if (__quotedChargeJson != null) { + builder.quotedCharge(QuotedCharge.fromJson(__quotedChargeJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse EditOneTimeQuoteResponse from JSON", e); + } + } + + /** Create a new builder for EditOneTimeQuoteResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for EditOneTimeQuoteResponse. */ + public static class Builder { + + private Quote quote; + + private QuotedCharge quotedCharge; + + private Response httpResponse; + + private Builder() {} + + public Builder quote(Quote quote) { + this.quote = quote; + return this; + } + + public Builder quotedCharge(QuotedCharge quotedCharge) { + this.quotedCharge = quotedCharge; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public EditOneTimeQuoteResponse build() { + return new EditOneTimeQuoteResponse(this); + } + } + + /** Get the quote from the response. */ + public Quote getQuote() { + return quote; + } + + /** Get the quotedCharge from the response. */ + public QuotedCharge getQuotedCharge() { + return quotedCharge; + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/responses/EditUpdateSubscriptionQuoteForItemsResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/EditUpdateSubscriptionQuoteForItemsResponse.java new file mode 100644 index 00000000..8c2efa35 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/responses/EditUpdateSubscriptionQuoteForItemsResponse.java @@ -0,0 +1,127 @@ +package com.chargebee.v4.models.quote.responses; + +import com.chargebee.v4.models.quote.Quote; + +import com.chargebee.v4.models.quotedRamp.QuotedRamp; + +import com.chargebee.v4.models.quotedSubscription.QuotedSubscription; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for EditUpdateSubscriptionQuoteForItems operation. Contains the + * response data from the API. + */ +public final class EditUpdateSubscriptionQuoteForItemsResponse extends BaseResponse { + private final Quote quote; + + private final QuotedSubscription quotedSubscription; + + private final QuotedRamp quotedRamp; + + private EditUpdateSubscriptionQuoteForItemsResponse(Builder builder) { + super(builder.httpResponse); + + this.quote = builder.quote; + + this.quotedSubscription = builder.quotedSubscription; + + this.quotedRamp = builder.quotedRamp; + } + + /** Parse JSON response into EditUpdateSubscriptionQuoteForItemsResponse object. */ + public static EditUpdateSubscriptionQuoteForItemsResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into EditUpdateSubscriptionQuoteForItemsResponse object with HTTP response. + */ + public static EditUpdateSubscriptionQuoteForItemsResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __quoteJson = JsonUtil.getObject(json, "quote"); + if (__quoteJson != null) { + builder.quote(Quote.fromJson(__quoteJson)); + } + + String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); + if (__quotedSubscriptionJson != null) { + builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); + } + + String __quotedRampJson = JsonUtil.getObject(json, "quoted_ramp"); + if (__quotedRampJson != null) { + builder.quotedRamp(QuotedRamp.fromJson(__quotedRampJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse EditUpdateSubscriptionQuoteForItemsResponse from JSON", e); + } + } + + /** Create a new builder for EditUpdateSubscriptionQuoteForItemsResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for EditUpdateSubscriptionQuoteForItemsResponse. */ + public static class Builder { + + private Quote quote; + + private QuotedSubscription quotedSubscription; + + private QuotedRamp quotedRamp; + + private Response httpResponse; + + private Builder() {} + + public Builder quote(Quote quote) { + this.quote = quote; + return this; + } + + public Builder quotedSubscription(QuotedSubscription quotedSubscription) { + this.quotedSubscription = quotedSubscription; + return this; + } + + public Builder quotedRamp(QuotedRamp quotedRamp) { + this.quotedRamp = quotedRamp; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public EditUpdateSubscriptionQuoteForItemsResponse build() { + return new EditUpdateSubscriptionQuoteForItemsResponse(this); + } + } + + /** Get the quote from the response. */ + public Quote getQuote() { + return quote; + } + + /** Get the quotedSubscription from the response. */ + public QuotedSubscription getQuotedSubscription() { + return quotedSubscription; + } + + /** Get the quotedRamp from the response. */ + public QuotedRamp getQuotedRamp() { + return quotedRamp; + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/responses/EditUpdateSubscriptionQuoteResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/EditUpdateSubscriptionQuoteResponse.java new file mode 100644 index 00000000..210a425a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/responses/EditUpdateSubscriptionQuoteResponse.java @@ -0,0 +1,101 @@ +package com.chargebee.v4.models.quote.responses; + +import com.chargebee.v4.models.quote.Quote; + +import com.chargebee.v4.models.quotedSubscription.QuotedSubscription; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for EditUpdateSubscriptionQuote operation. Contains the response data + * from the API. + */ +public final class EditUpdateSubscriptionQuoteResponse extends BaseResponse { + private final Quote quote; + + private final QuotedSubscription quotedSubscription; + + private EditUpdateSubscriptionQuoteResponse(Builder builder) { + super(builder.httpResponse); + + this.quote = builder.quote; + + this.quotedSubscription = builder.quotedSubscription; + } + + /** Parse JSON response into EditUpdateSubscriptionQuoteResponse object. */ + public static EditUpdateSubscriptionQuoteResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into EditUpdateSubscriptionQuoteResponse object with HTTP response. */ + public static EditUpdateSubscriptionQuoteResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __quoteJson = JsonUtil.getObject(json, "quote"); + if (__quoteJson != null) { + builder.quote(Quote.fromJson(__quoteJson)); + } + + String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); + if (__quotedSubscriptionJson != null) { + builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse EditUpdateSubscriptionQuoteResponse from JSON", e); + } + } + + /** Create a new builder for EditUpdateSubscriptionQuoteResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for EditUpdateSubscriptionQuoteResponse. */ + public static class Builder { + + private Quote quote; + + private QuotedSubscription quotedSubscription; + + private Response httpResponse; + + private Builder() {} + + public Builder quote(Quote quote) { + this.quote = quote; + return this; + } + + public Builder quotedSubscription(QuotedSubscription quotedSubscription) { + this.quotedSubscription = quotedSubscription; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public EditUpdateSubscriptionQuoteResponse build() { + return new EditUpdateSubscriptionQuoteResponse(this); + } + } + + /** Get the quote from the response. */ + public Quote getQuote() { + return quote; + } + + /** Get the quotedSubscription from the response. */ + public QuotedSubscription getQuotedSubscription() { + return quotedSubscription; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteConvertResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteConvertResponse.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/responses/quote/QuoteConvertResponse.java rename to src/main/java/com/chargebee/v4/models/quote/responses/QuoteConvertResponse.java index 59976147..da4b9d86 100644 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteConvertResponse.java +++ b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteConvertResponse.java @@ -1,26 +1,26 @@ -package com.chargebee.v4.core.responses.quote; +package com.chargebee.v4.models.quote.responses; import java.util.List; -import com.chargebee.v4.core.models.quote.Quote; +import com.chargebee.v4.models.quote.Quote; -import com.chargebee.v4.core.models.quotedRamp.QuotedRamp; +import com.chargebee.v4.models.quotedRamp.QuotedRamp; -import com.chargebee.v4.core.models.quotedSubscription.QuotedSubscription; +import com.chargebee.v4.models.quotedSubscription.QuotedSubscription; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.quotedCharge.QuotedCharge; +import com.chargebee.v4.models.quotedCharge.QuotedCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteCreateForChargeItemsAndChargesResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteCreateForChargeItemsAndChargesResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/quote/QuoteCreateForChargeItemsAndChargesResponse.java rename to src/main/java/com/chargebee/v4/models/quote/responses/QuoteCreateForChargeItemsAndChargesResponse.java index 8eb13627..fad0c50b 100644 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteCreateForChargeItemsAndChargesResponse.java +++ b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteCreateForChargeItemsAndChargesResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.quote; +package com.chargebee.v4.models.quote.responses; -import com.chargebee.v4.core.models.quote.Quote; +import com.chargebee.v4.models.quote.Quote; -import com.chargebee.v4.core.models.quotedCharge.QuotedCharge; +import com.chargebee.v4.models.quotedCharge.QuotedCharge; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteCreateForOnetimeChargesResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteCreateForOnetimeChargesResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/quote/QuoteCreateForOnetimeChargesResponse.java rename to src/main/java/com/chargebee/v4/models/quote/responses/QuoteCreateForOnetimeChargesResponse.java index 79603870..5e29ddc8 100644 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteCreateForOnetimeChargesResponse.java +++ b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteCreateForOnetimeChargesResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.quote; +package com.chargebee.v4.models.quote.responses; -import com.chargebee.v4.core.models.quote.Quote; +import com.chargebee.v4.models.quote.Quote; -import com.chargebee.v4.core.models.quotedCharge.QuotedCharge; +import com.chargebee.v4.models.quotedCharge.QuotedCharge; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteDeleteResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteDeleteResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/quote/QuoteDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/quote/responses/QuoteDeleteResponse.java index 51dc2ad2..863df81b 100644 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteDeleteResponse.java @@ -1,14 +1,14 @@ -package com.chargebee.v4.core.responses.quote; +package com.chargebee.v4.models.quote.responses; -import com.chargebee.v4.core.models.quote.Quote; +import com.chargebee.v4.models.quote.Quote; -import com.chargebee.v4.core.models.quotedRamp.QuotedRamp; +import com.chargebee.v4.models.quotedRamp.QuotedRamp; -import com.chargebee.v4.core.models.quotedSubscription.QuotedSubscription; +import com.chargebee.v4.models.quotedSubscription.QuotedSubscription; -import com.chargebee.v4.core.models.quotedCharge.QuotedCharge; +import com.chargebee.v4.models.quotedCharge.QuotedCharge; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditForChargeItemsAndChargesResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteEditForChargeItemsAndChargesResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditForChargeItemsAndChargesResponse.java rename to src/main/java/com/chargebee/v4/models/quote/responses/QuoteEditForChargeItemsAndChargesResponse.java index fd16721c..76f9c521 100644 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteEditForChargeItemsAndChargesResponse.java +++ b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteEditForChargeItemsAndChargesResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.quote; +package com.chargebee.v4.models.quote.responses; -import com.chargebee.v4.core.models.quote.Quote; +import com.chargebee.v4.models.quote.Quote; -import com.chargebee.v4.core.models.quotedCharge.QuotedCharge; +import com.chargebee.v4.models.quotedCharge.QuotedCharge; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteExtendExpiryDateResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteExtendExpiryDateResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/quote/QuoteExtendExpiryDateResponse.java rename to src/main/java/com/chargebee/v4/models/quote/responses/QuoteExtendExpiryDateResponse.java index 060406e2..88a36f7b 100644 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteExtendExpiryDateResponse.java +++ b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteExtendExpiryDateResponse.java @@ -1,14 +1,14 @@ -package com.chargebee.v4.core.responses.quote; +package com.chargebee.v4.models.quote.responses; -import com.chargebee.v4.core.models.quote.Quote; +import com.chargebee.v4.models.quote.Quote; -import com.chargebee.v4.core.models.quotedRamp.QuotedRamp; +import com.chargebee.v4.models.quotedRamp.QuotedRamp; -import com.chargebee.v4.core.models.quotedSubscription.QuotedSubscription; +import com.chargebee.v4.models.quotedSubscription.QuotedSubscription; -import com.chargebee.v4.core.models.quotedCharge.QuotedCharge; +import com.chargebee.v4.models.quotedCharge.QuotedCharge; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/quote/responses/QuoteLineGroupsForQuoteResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteLineGroupsForQuoteResponse.java new file mode 100644 index 00000000..3c3706fb --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteLineGroupsForQuoteResponse.java @@ -0,0 +1,176 @@ +package com.chargebee.v4.models.quote.responses; + +import java.util.List; + +import com.chargebee.v4.models.quoteLineGroup.QuoteLineGroup; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.QuoteService; +import com.chargebee.v4.models.quote.params.QuoteLineGroupsForQuoteParams; + +/** + * Immutable response object for QuoteLineGroupsForQuote operation. Contains paginated list data. + */ +public final class QuoteLineGroupsForQuoteResponse { + + private final List list; + + private final String nextOffset; + + private final String quoteId; + + private final QuoteService service; + private final QuoteLineGroupsForQuoteParams originalParams; + private final Response httpResponse; + + private QuoteLineGroupsForQuoteResponse( + List list, + String nextOffset, + String quoteId, + QuoteService service, + QuoteLineGroupsForQuoteParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.quoteId = quoteId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into QuoteLineGroupsForQuoteResponse object (no service context). Use this + * when you only need to read a single page (no nextPage()). + */ + public static QuoteLineGroupsForQuoteResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(QuoteQuoteLineGroupsForQuoteItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new QuoteLineGroupsForQuoteResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse QuoteLineGroupsForQuoteResponse from JSON", e); + } + } + + /** + * Parse JSON response into QuoteLineGroupsForQuoteResponse object with service context for + * pagination (enables nextPage()). + */ + public static QuoteLineGroupsForQuoteResponse fromJson( + String json, + QuoteService service, + QuoteLineGroupsForQuoteParams originalParams, + String quoteId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(QuoteQuoteLineGroupsForQuoteItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new QuoteLineGroupsForQuoteResponse( + list, nextOffset, quoteId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse QuoteLineGroupsForQuoteResponse 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 QuoteLineGroupsForQuoteResponse 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)."); + } + + QuoteLineGroupsForQuoteParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : QuoteLineGroupsForQuoteParams.builder()) + .offset(nextOffset) + .build(); + + return service.quoteLineGroupsForQuote(quoteId, 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 QuoteQuoteLineGroupsForQuoteItem { + + private QuoteLineGroup quoteLineGroup; + + public QuoteLineGroup getQuoteLineGroup() { + return quoteLineGroup; + } + + public static QuoteQuoteLineGroupsForQuoteItem fromJson(String json) { + QuoteQuoteLineGroupsForQuoteItem item = new QuoteQuoteLineGroupsForQuoteItem(); + + String __quoteLineGroupJson = JsonUtil.getObject(json, "quote_line_group"); + if (__quoteLineGroupJson != null) { + item.quoteLineGroup = QuoteLineGroup.fromJson(__quoteLineGroupJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteListResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/quote/QuoteListResponse.java rename to src/main/java/com/chargebee/v4/models/quote/responses/QuoteListResponse.java index a9f32560..4a6b645e 100644 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteListResponse.java +++ b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteListResponse.java @@ -1,17 +1,18 @@ -package com.chargebee.v4.core.responses.quote; +package com.chargebee.v4.models.quote.responses; import java.util.List; -import com.chargebee.v4.core.models.quote.Quote; +import com.chargebee.v4.models.quote.Quote; -import com.chargebee.v4.core.models.quotedSubscription.QuotedSubscription; +import com.chargebee.v4.models.quotedSubscription.QuotedSubscription; -import com.chargebee.v4.core.models.quotedRamp.QuotedRamp; +import com.chargebee.v4.models.quotedRamp.QuotedRamp; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.QuoteService; -import com.chargebee.v4.core.models.quote.params.QuoteListParams; +import com.chargebee.v4.services.QuoteService; +import com.chargebee.v4.models.quote.params.QuoteListParams; /** Immutable response object for QuoteList operation. Contains paginated list data. */ public final class QuoteListResponse { @@ -99,9 +100,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 QuoteListResponse nextPage() throws Exception { + public QuoteListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuotePdfResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/QuotePdfResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/quote/QuotePdfResponse.java rename to src/main/java/com/chargebee/v4/models/quote/responses/QuotePdfResponse.java index de6f7da3..14b81125 100644 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuotePdfResponse.java +++ b/src/main/java/com/chargebee/v4/models/quote/responses/QuotePdfResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.quote; +package com.chargebee.v4.models.quote.responses; -import com.chargebee.v4.core.models.download.Download; +import com.chargebee.v4.models.download.Download; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/quote/responses/QuoteRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteRetrieveResponse.java new file mode 100644 index 00000000..dc64583b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteRetrieveResponse.java @@ -0,0 +1,146 @@ +package com.chargebee.v4.models.quote.responses; + +import com.chargebee.v4.models.quote.Quote; + +import com.chargebee.v4.models.quotedSubscription.QuotedSubscription; + +import com.chargebee.v4.models.quotedCharge.QuotedCharge; + +import com.chargebee.v4.models.quotedRamp.QuotedRamp; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for QuoteRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class QuoteRetrieveResponse extends BaseResponse { + private final Quote quote; + + private final QuotedSubscription quotedSubscription; + + private final QuotedCharge quotedCharge; + + private final QuotedRamp quotedRamp; + + private QuoteRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.quote = builder.quote; + + this.quotedSubscription = builder.quotedSubscription; + + this.quotedCharge = builder.quotedCharge; + + this.quotedRamp = builder.quotedRamp; + } + + /** Parse JSON response into QuoteRetrieveResponse object. */ + public static QuoteRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into QuoteRetrieveResponse object with HTTP response. */ + public static QuoteRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __quoteJson = JsonUtil.getObject(json, "quote"); + if (__quoteJson != null) { + builder.quote(Quote.fromJson(__quoteJson)); + } + + String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); + if (__quotedSubscriptionJson != null) { + builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); + } + + String __quotedChargeJson = JsonUtil.getObject(json, "quoted_charge"); + if (__quotedChargeJson != null) { + builder.quotedCharge(QuotedCharge.fromJson(__quotedChargeJson)); + } + + String __quotedRampJson = JsonUtil.getObject(json, "quoted_ramp"); + if (__quotedRampJson != null) { + builder.quotedRamp(QuotedRamp.fromJson(__quotedRampJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse QuoteRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for QuoteRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for QuoteRetrieveResponse. */ + public static class Builder { + + private Quote quote; + + private QuotedSubscription quotedSubscription; + + private QuotedCharge quotedCharge; + + private QuotedRamp quotedRamp; + + private Response httpResponse; + + private Builder() {} + + public Builder quote(Quote quote) { + this.quote = quote; + return this; + } + + public Builder quotedSubscription(QuotedSubscription quotedSubscription) { + this.quotedSubscription = quotedSubscription; + return this; + } + + public Builder quotedCharge(QuotedCharge quotedCharge) { + this.quotedCharge = quotedCharge; + return this; + } + + public Builder quotedRamp(QuotedRamp quotedRamp) { + this.quotedRamp = quotedRamp; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public QuoteRetrieveResponse build() { + return new QuoteRetrieveResponse(this); + } + } + + /** Get the quote from the response. */ + public Quote getQuote() { + return quote; + } + + /** Get the quotedSubscription from the response. */ + public QuotedSubscription getQuotedSubscription() { + return quotedSubscription; + } + + /** Get the quotedCharge from the response. */ + public QuotedCharge getQuotedCharge() { + return quotedCharge; + } + + /** Get the quotedRamp from the response. */ + public QuotedRamp getQuotedRamp() { + return quotedRamp; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteUpdateStatusResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteUpdateStatusResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/quote/QuoteUpdateStatusResponse.java rename to src/main/java/com/chargebee/v4/models/quote/responses/QuoteUpdateStatusResponse.java index bb6b7ea5..ad79eece 100644 --- a/src/main/java/com/chargebee/v4/core/responses/quote/QuoteUpdateStatusResponse.java +++ b/src/main/java/com/chargebee/v4/models/quote/responses/QuoteUpdateStatusResponse.java @@ -1,14 +1,14 @@ -package com.chargebee.v4.core.responses.quote; +package com.chargebee.v4.models.quote.responses; -import com.chargebee.v4.core.models.quote.Quote; +import com.chargebee.v4.models.quote.Quote; -import com.chargebee.v4.core.models.quotedRamp.QuotedRamp; +import com.chargebee.v4.models.quotedRamp.QuotedRamp; -import com.chargebee.v4.core.models.quotedSubscription.QuotedSubscription; +import com.chargebee.v4.models.quotedSubscription.QuotedSubscription; -import com.chargebee.v4.core.models.quotedCharge.QuotedCharge; +import com.chargebee.v4.models.quotedCharge.QuotedCharge; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/quote/responses/UpdateSubscriptionQuoteForItemsResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/UpdateSubscriptionQuoteForItemsResponse.java new file mode 100644 index 00000000..e73d3a72 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/responses/UpdateSubscriptionQuoteForItemsResponse.java @@ -0,0 +1,125 @@ +package com.chargebee.v4.models.quote.responses; + +import com.chargebee.v4.models.quote.Quote; + +import com.chargebee.v4.models.quotedRamp.QuotedRamp; + +import com.chargebee.v4.models.quotedSubscription.QuotedSubscription; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for UpdateSubscriptionQuoteForItems operation. Contains the response + * data from the API. + */ +public final class UpdateSubscriptionQuoteForItemsResponse extends BaseResponse { + private final Quote quote; + + private final QuotedSubscription quotedSubscription; + + private final QuotedRamp quotedRamp; + + private UpdateSubscriptionQuoteForItemsResponse(Builder builder) { + super(builder.httpResponse); + + this.quote = builder.quote; + + this.quotedSubscription = builder.quotedSubscription; + + this.quotedRamp = builder.quotedRamp; + } + + /** Parse JSON response into UpdateSubscriptionQuoteForItemsResponse object. */ + public static UpdateSubscriptionQuoteForItemsResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into UpdateSubscriptionQuoteForItemsResponse object with HTTP response. */ + public static UpdateSubscriptionQuoteForItemsResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __quoteJson = JsonUtil.getObject(json, "quote"); + if (__quoteJson != null) { + builder.quote(Quote.fromJson(__quoteJson)); + } + + String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); + if (__quotedSubscriptionJson != null) { + builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); + } + + String __quotedRampJson = JsonUtil.getObject(json, "quoted_ramp"); + if (__quotedRampJson != null) { + builder.quotedRamp(QuotedRamp.fromJson(__quotedRampJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse UpdateSubscriptionQuoteForItemsResponse from JSON", e); + } + } + + /** Create a new builder for UpdateSubscriptionQuoteForItemsResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UpdateSubscriptionQuoteForItemsResponse. */ + public static class Builder { + + private Quote quote; + + private QuotedSubscription quotedSubscription; + + private QuotedRamp quotedRamp; + + private Response httpResponse; + + private Builder() {} + + public Builder quote(Quote quote) { + this.quote = quote; + return this; + } + + public Builder quotedSubscription(QuotedSubscription quotedSubscription) { + this.quotedSubscription = quotedSubscription; + return this; + } + + public Builder quotedRamp(QuotedRamp quotedRamp) { + this.quotedRamp = quotedRamp; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public UpdateSubscriptionQuoteForItemsResponse build() { + return new UpdateSubscriptionQuoteForItemsResponse(this); + } + } + + /** Get the quote from the response. */ + public Quote getQuote() { + return quote; + } + + /** Get the quotedSubscription from the response. */ + public QuotedSubscription getQuotedSubscription() { + return quotedSubscription; + } + + /** Get the quotedRamp from the response. */ + public QuotedRamp getQuotedRamp() { + return quotedRamp; + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/responses/UpdateSubscriptionQuoteResponse.java b/src/main/java/com/chargebee/v4/models/quote/responses/UpdateSubscriptionQuoteResponse.java new file mode 100644 index 00000000..f162f573 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quote/responses/UpdateSubscriptionQuoteResponse.java @@ -0,0 +1,100 @@ +package com.chargebee.v4.models.quote.responses; + +import com.chargebee.v4.models.quote.Quote; + +import com.chargebee.v4.models.quotedSubscription.QuotedSubscription; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for UpdateSubscriptionQuote operation. Contains the response data from + * the API. + */ +public final class UpdateSubscriptionQuoteResponse extends BaseResponse { + private final Quote quote; + + private final QuotedSubscription quotedSubscription; + + private UpdateSubscriptionQuoteResponse(Builder builder) { + super(builder.httpResponse); + + this.quote = builder.quote; + + this.quotedSubscription = builder.quotedSubscription; + } + + /** Parse JSON response into UpdateSubscriptionQuoteResponse object. */ + public static UpdateSubscriptionQuoteResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into UpdateSubscriptionQuoteResponse object with HTTP response. */ + public static UpdateSubscriptionQuoteResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __quoteJson = JsonUtil.getObject(json, "quote"); + if (__quoteJson != null) { + builder.quote(Quote.fromJson(__quoteJson)); + } + + String __quotedSubscriptionJson = JsonUtil.getObject(json, "quoted_subscription"); + if (__quotedSubscriptionJson != null) { + builder.quotedSubscription(QuotedSubscription.fromJson(__quotedSubscriptionJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse UpdateSubscriptionQuoteResponse from JSON", e); + } + } + + /** Create a new builder for UpdateSubscriptionQuoteResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UpdateSubscriptionQuoteResponse. */ + public static class Builder { + + private Quote quote; + + private QuotedSubscription quotedSubscription; + + private Response httpResponse; + + private Builder() {} + + public Builder quote(Quote quote) { + this.quote = quote; + return this; + } + + public Builder quotedSubscription(QuotedSubscription quotedSubscription) { + this.quotedSubscription = quotedSubscription; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public UpdateSubscriptionQuoteResponse build() { + return new UpdateSubscriptionQuoteResponse(this); + } + } + + /** Get the quote from the response. */ + public Quote getQuote() { + return quote; + } + + /** Get the quotedSubscription from the response. */ + public QuotedSubscription getQuotedSubscription() { + return quotedSubscription; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/quoteLineGroup/QuoteLineGroup.java b/src/main/java/com/chargebee/v4/models/quoteLineGroup/QuoteLineGroup.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/quoteLineGroup/QuoteLineGroup.java rename to src/main/java/com/chargebee/v4/models/quoteLineGroup/QuoteLineGroup.java index a21ef95c..3848fde2 100644 --- a/src/main/java/com/chargebee/v4/core/models/quoteLineGroup/QuoteLineGroup.java +++ b/src/main/java/com/chargebee/v4/models/quoteLineGroup/QuoteLineGroup.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.quoteLineGroup; +package com.chargebee.v4.models.quoteLineGroup; import com.chargebee.v4.internal.JsonUtil; import java.math.BigDecimal; @@ -712,6 +712,7 @@ public static class Discounts { private Long amount; private String description; + private String lineItemId; private EntityType entityType; private DiscountType discountType; private String entityId; @@ -725,6 +726,10 @@ public String getDescription() { return description; } + public String getLineItemId() { + return lineItemId; + } + public EntityType getEntityType() { return entityType; } @@ -812,6 +817,8 @@ public static Discounts fromJson(String json) { obj.description = JsonUtil.getString(json, "description"); + obj.lineItemId = JsonUtil.getString(json, "line_item_id"); + obj.entityType = EntityType.fromString(JsonUtil.getString(json, "entity_type")); obj.discountType = DiscountType.fromString(JsonUtil.getString(json, "discount_type")); diff --git a/src/main/java/com/chargebee/v4/core/models/quotedCharge/QuotedCharge.java b/src/main/java/com/chargebee/v4/models/quotedCharge/QuotedCharge.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/quotedCharge/QuotedCharge.java rename to src/main/java/com/chargebee/v4/models/quotedCharge/QuotedCharge.java index bb53059b..c54254f8 100644 --- a/src/main/java/com/chargebee/v4/core/models/quotedCharge/QuotedCharge.java +++ b/src/main/java/com/chargebee/v4/models/quotedCharge/QuotedCharge.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.quotedCharge; +package com.chargebee.v4.models.quotedCharge; import com.chargebee.v4.internal.JsonUtil; import java.util.List; diff --git a/src/main/java/com/chargebee/v4/models/quotedDeltaRamp/QuotedDeltaRamp.java b/src/main/java/com/chargebee/v4/models/quotedDeltaRamp/QuotedDeltaRamp.java new file mode 100644 index 00000000..532d7c92 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quotedDeltaRamp/QuotedDeltaRamp.java @@ -0,0 +1,49 @@ +/* + * 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.quotedDeltaRamp; + +import com.chargebee.v4.internal.JsonUtil; +import java.util.List; + +public class QuotedDeltaRamp { + + private List lineItems; + + public List getLineItems() { + return lineItems; + } + + public static QuotedDeltaRamp fromJson(String json) { + QuotedDeltaRamp obj = new QuotedDeltaRamp(); + + obj.lineItems = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "line_items")).stream() + .map(LineItems::fromJson) + .collect(java.util.stream.Collectors.toList()); + + return obj; + } + + public static class LineItems { + + private String itemLevelDiscountPerBillingCycleInDecimal; + + public String getItemLevelDiscountPerBillingCycleInDecimal() { + return itemLevelDiscountPerBillingCycleInDecimal; + } + + public static LineItems fromJson(String json) { + LineItems obj = new LineItems(); + + obj.itemLevelDiscountPerBillingCycleInDecimal = + JsonUtil.getString(json, "item_level_discount_per_billing_cycle_in_decimal"); + + return obj; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/quotedRamp/QuotedRamp.java b/src/main/java/com/chargebee/v4/models/quotedRamp/QuotedRamp.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/quotedRamp/QuotedRamp.java rename to src/main/java/com/chargebee/v4/models/quotedRamp/QuotedRamp.java index d630897c..5ea244f0 100644 --- a/src/main/java/com/chargebee/v4/core/models/quotedRamp/QuotedRamp.java +++ b/src/main/java/com/chargebee/v4/models/quotedRamp/QuotedRamp.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.quotedRamp; +package com.chargebee.v4.models.quotedRamp; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/quotedSubscription/QuotedSubscription.java b/src/main/java/com/chargebee/v4/models/quotedSubscription/QuotedSubscription.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/quotedSubscription/QuotedSubscription.java rename to src/main/java/com/chargebee/v4/models/quotedSubscription/QuotedSubscription.java index c267f347..0e2bdbb9 100644 --- a/src/main/java/com/chargebee/v4/core/models/quotedSubscription/QuotedSubscription.java +++ b/src/main/java/com/chargebee/v4/models/quotedSubscription/QuotedSubscription.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.quotedSubscription; +package com.chargebee.v4.models.quotedSubscription; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/ramp/Ramp.java b/src/main/java/com/chargebee/v4/models/ramp/Ramp.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/ramp/Ramp.java rename to src/main/java/com/chargebee/v4/models/ramp/Ramp.java index 5c66ab7f..9b292827 100644 --- a/src/main/java/com/chargebee/v4/core/models/ramp/Ramp.java +++ b/src/main/java/com/chargebee/v4/models/ramp/Ramp.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.ramp; +package com.chargebee.v4.models.ramp; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/ramp/params/RampCreateForSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/ramp/params/RampCreateForSubscriptionParams.java new file mode 100644 index 00000000..ef40290a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/ramp/params/RampCreateForSubscriptionParams.java @@ -0,0 +1,1597 @@ +/* + * 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.ramp.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class RampCreateForSubscriptionParams { + + private final Timestamp effectiveFrom; + + private final String description; + + private final List couponsToRemove; + + private final List discountsToRemove; + + private final List itemsToRemove; + + private final ContractTermParams contractTerm; + + private final List itemsToAdd; + + private final List itemsToUpdate; + + private final List itemTiers; + + private final List couponsToAdd; + + private final List discountsToAdd; + + private RampCreateForSubscriptionParams(RampCreateForSubscriptionBuilder builder) { + + this.effectiveFrom = builder.effectiveFrom; + + this.description = builder.description; + + this.couponsToRemove = builder.couponsToRemove; + + this.discountsToRemove = builder.discountsToRemove; + + this.itemsToRemove = builder.itemsToRemove; + + this.contractTerm = builder.contractTerm; + + this.itemsToAdd = builder.itemsToAdd; + + this.itemsToUpdate = builder.itemsToUpdate; + + this.itemTiers = builder.itemTiers; + + this.couponsToAdd = builder.couponsToAdd; + + this.discountsToAdd = builder.discountsToAdd; + } + + public Timestamp getEffectiveFrom() { + return effectiveFrom; + } + + public String getDescription() { + return description; + } + + public List getCouponsToRemove() { + return couponsToRemove; + } + + public List getDiscountsToRemove() { + return discountsToRemove; + } + + public List getItemsToRemove() { + return itemsToRemove; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getItemsToAdd() { + return itemsToAdd; + } + + public List getItemsToUpdate() { + return itemsToUpdate; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getCouponsToAdd() { + return couponsToAdd; + } + + public List getDiscountsToAdd() { + return discountsToAdd; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.effectiveFrom != null) { + + formData.put("effective_from", this.effectiveFrom); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.couponsToRemove != null) { + + formData.put("coupons_to_remove", this.couponsToRemove); + } + + if (this.discountsToRemove != null) { + + formData.put("discounts_to_remove", this.discountsToRemove); + } + + if (this.itemsToRemove != null) { + + formData.put("items_to_remove", this.itemsToRemove); + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemsToAdd != null) { + + // List of objects + for (int i = 0; i < this.itemsToAdd.size(); i++) { + ItemsToAddParams item = this.itemsToAdd.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "items_to_add[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemsToUpdate != null) { + + // List of objects + for (int i = 0; i < this.itemsToUpdate.size(); i++) { + ItemsToUpdateParams item = this.itemsToUpdate.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "items_to_update[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.couponsToAdd != null) { + + // List of objects + for (int i = 0; i < this.couponsToAdd.size(); i++) { + CouponsToAddParams item = this.couponsToAdd.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "coupons_to_add[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discountsToAdd != null) { + + // List of objects + for (int i = 0; i < this.discountsToAdd.size(); i++) { + DiscountsToAddParams item = this.discountsToAdd.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts_to_add[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for RampCreateForSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RampCreateForSubscriptionBuilder builder() { + return new RampCreateForSubscriptionBuilder(); + } + + public static final class RampCreateForSubscriptionBuilder { + + private Timestamp effectiveFrom; + + private String description; + + private List couponsToRemove; + + private List discountsToRemove; + + private List itemsToRemove; + + private ContractTermParams contractTerm; + + private List itemsToAdd; + + private List itemsToUpdate; + + private List itemTiers; + + private List couponsToAdd; + + private List discountsToAdd; + + private RampCreateForSubscriptionBuilder() {} + + public RampCreateForSubscriptionBuilder effectiveFrom(Timestamp value) { + this.effectiveFrom = value; + return this; + } + + public RampCreateForSubscriptionBuilder description(String value) { + this.description = value; + return this; + } + + public RampCreateForSubscriptionBuilder couponsToRemove(List value) { + this.couponsToRemove = value; + return this; + } + + public RampCreateForSubscriptionBuilder discountsToRemove(List value) { + this.discountsToRemove = value; + return this; + } + + public RampCreateForSubscriptionBuilder itemsToRemove(List value) { + this.itemsToRemove = value; + return this; + } + + public RampCreateForSubscriptionBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public RampCreateForSubscriptionBuilder itemsToAdd(List value) { + this.itemsToAdd = value; + return this; + } + + public RampCreateForSubscriptionBuilder itemsToUpdate(List value) { + this.itemsToUpdate = value; + return this; + } + + public RampCreateForSubscriptionBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public RampCreateForSubscriptionBuilder couponsToAdd(List value) { + this.couponsToAdd = value; + return this; + } + + public RampCreateForSubscriptionBuilder discountsToAdd(List value) { + this.discountsToAdd = value; + return this; + } + + public RampCreateForSubscriptionParams build() { + return new RampCreateForSubscriptionParams(this); + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private final Integer renewalBillingCycles; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + + this.renewalBillingCycles = builder.renewalBillingCycles; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + public Integer getRenewalBillingCycles() { + return renewalBillingCycles; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + if (this.renewalBillingCycles != null) { + + formData.put("renewal_billing_cycles", this.renewalBillingCycles); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private Integer renewalBillingCycles; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermBuilder renewalBillingCycles(Integer value) { + this.renewalBillingCycles = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + RENEW_ONCE("renew_once"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemsToAddParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ChargeOnOption chargeOnOption; + + private ItemsToAddParams(ItemsToAddBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.chargeOnOption = builder.chargeOnOption; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ChargeOnOption getChargeOnOption() { + return chargeOnOption; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.chargeOnOption != null) { + + formData.put("charge_on_option", this.chargeOnOption); + } + + return formData; + } + + /** Create a new builder for ItemsToAddParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemsToAddBuilder builder() { + return new ItemsToAddBuilder(); + } + + public static final class ItemsToAddBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ChargeOnOption chargeOnOption; + + private ItemsToAddBuilder() {} + + public ItemsToAddBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemsToAddBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public ItemsToAddBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public ItemsToAddBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public ItemsToAddBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public ItemsToAddBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public ItemsToAddBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public ItemsToAddBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public ItemsToAddBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public ItemsToAddBuilder chargeOnOption(ChargeOnOption value) { + this.chargeOnOption = value; + return this; + } + + public ItemsToAddParams build() { + return new ItemsToAddParams(this); + } + } + + public enum ChargeOnEvent { + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** 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; + } + } + + public enum ChargeOnOption { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnOption enumValue : ChargeOnOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemsToUpdateParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ChargeOnOption chargeOnOption; + + private ItemsToUpdateParams(ItemsToUpdateBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.chargeOnOption = builder.chargeOnOption; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ChargeOnOption getChargeOnOption() { + return chargeOnOption; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.chargeOnOption != null) { + + formData.put("charge_on_option", this.chargeOnOption); + } + + return formData; + } + + /** Create a new builder for ItemsToUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemsToUpdateBuilder builder() { + return new ItemsToUpdateBuilder(); + } + + public static final class ItemsToUpdateBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ChargeOnOption chargeOnOption; + + private ItemsToUpdateBuilder() {} + + public ItemsToUpdateBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemsToUpdateBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public ItemsToUpdateBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public ItemsToUpdateBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public ItemsToUpdateBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public ItemsToUpdateBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public ItemsToUpdateBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public ItemsToUpdateBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public ItemsToUpdateBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public ItemsToUpdateBuilder chargeOnOption(ChargeOnOption value) { + this.chargeOnOption = value; + return this; + } + + public ItemsToUpdateParams build() { + return new ItemsToUpdateParams(this); + } + } + + public enum ChargeOnEvent { + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** 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; + } + } + + public enum ChargeOnOption { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnOption enumValue : ChargeOnOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CouponsToAddParams { + + private final String couponId; + + private final Timestamp applyTill; + + private CouponsToAddParams(CouponsToAddBuilder builder) { + + this.couponId = builder.couponId; + + this.applyTill = builder.applyTill; + } + + public String getCouponId() { + return couponId; + } + + public Timestamp getApplyTill() { + return applyTill; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.couponId != null) { + + formData.put("coupon_id", this.couponId); + } + + if (this.applyTill != null) { + + formData.put("apply_till", this.applyTill); + } + + return formData; + } + + /** Create a new builder for CouponsToAddParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponsToAddBuilder builder() { + return new CouponsToAddBuilder(); + } + + public static final class CouponsToAddBuilder { + + private String couponId; + + private Timestamp applyTill; + + private CouponsToAddBuilder() {} + + public CouponsToAddBuilder couponId(String value) { + this.couponId = value; + return this; + } + + public CouponsToAddBuilder applyTill(Timestamp value) { + this.applyTill = value; + return this; + } + + public CouponsToAddParams build() { + return new CouponsToAddParams(this); + } + } + } + + public static final class DiscountsToAddParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private DiscountsToAddParams(DiscountsToAddBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + return formData; + } + + /** Create a new builder for DiscountsToAddParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsToAddBuilder builder() { + return new DiscountsToAddBuilder(); + } + + public static final class DiscountsToAddBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private DiscountsToAddBuilder() {} + + public DiscountsToAddBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsToAddBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsToAddBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsToAddBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsToAddBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsToAddBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsToAddBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsToAddBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsToAddParams build() { + return new DiscountsToAddParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/ramp/params/RampDeleteParams.java b/src/main/java/com/chargebee/v4/models/ramp/params/RampDeleteParams.java new file mode 100644 index 00000000..eafdeab5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/ramp/params/RampDeleteParams.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.ramp.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class RampDeleteParams { + + private RampDeleteParams(RampDeleteBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for RampDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RampDeleteBuilder builder() { + return new RampDeleteBuilder(); + } + + public static final class RampDeleteBuilder { + + private RampDeleteBuilder() {} + + public RampDeleteParams build() { + return new RampDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/ramp/params/RampListParams.java b/src/main/java/com/chargebee/v4/models/ramp/params/RampListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/ramp/params/RampListParams.java rename to src/main/java/com/chargebee/v4/models/ramp/params/RampListParams.java index fe0df56d..f7b13c9d 100644 --- a/src/main/java/com/chargebee/v4/core/models/ramp/params/RampListParams.java +++ b/src/main/java/com/chargebee/v4/models/ramp/params/RampListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.ramp.params; +package com.chargebee.v4.models.ramp.params; import com.chargebee.v4.internal.Recommended; @@ -92,13 +92,13 @@ public static final class StatusFilter { this.builder = builder; } - public RampListBuilder in(String... values) { - builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + public RampListBuilder is(String value) { + builder.queryParams.put(fieldName + "[is]", value); return builder; } - public RampListBuilder is(String value) { - builder.queryParams.put(fieldName + "[is]", value); + public RampListBuilder in(String... values) { + builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); return builder; } } @@ -112,13 +112,13 @@ public static final class SubscriptionIdFilter { this.builder = builder; } - public RampListBuilder in(String... values) { - builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + public RampListBuilder is(String value) { + builder.queryParams.put(fieldName + "[is]", value); return builder; } - public RampListBuilder is(String value) { - builder.queryParams.put(fieldName + "[is]", value); + public RampListBuilder in(String... values) { + builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); return builder; } } diff --git a/src/main/java/com/chargebee/v4/core/models/ramp/params/RampRetrieveParams.java b/src/main/java/com/chargebee/v4/models/ramp/params/RampRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/ramp/params/RampRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/ramp/params/RampRetrieveParams.java index 0d47efc6..8db0235d 100644 --- a/src/main/java/com/chargebee/v4/core/models/ramp/params/RampRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/ramp/params/RampRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.ramp.params; +package com.chargebee.v4.models.ramp.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/ramp/params/RampUpdateParams.java b/src/main/java/com/chargebee/v4/models/ramp/params/RampUpdateParams.java new file mode 100644 index 00000000..66a70bbd --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/ramp/params/RampUpdateParams.java @@ -0,0 +1,1597 @@ +/* + * 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.ramp.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class RampUpdateParams { + + private final Timestamp effectiveFrom; + + private final String description; + + private final List couponsToRemove; + + private final List discountsToRemove; + + private final List itemsToRemove; + + private final ContractTermParams contractTerm; + + private final List itemsToAdd; + + private final List itemsToUpdate; + + private final List itemTiers; + + private final List couponsToAdd; + + private final List discountsToAdd; + + private RampUpdateParams(RampUpdateBuilder builder) { + + this.effectiveFrom = builder.effectiveFrom; + + this.description = builder.description; + + this.couponsToRemove = builder.couponsToRemove; + + this.discountsToRemove = builder.discountsToRemove; + + this.itemsToRemove = builder.itemsToRemove; + + this.contractTerm = builder.contractTerm; + + this.itemsToAdd = builder.itemsToAdd; + + this.itemsToUpdate = builder.itemsToUpdate; + + this.itemTiers = builder.itemTiers; + + this.couponsToAdd = builder.couponsToAdd; + + this.discountsToAdd = builder.discountsToAdd; + } + + public Timestamp getEffectiveFrom() { + return effectiveFrom; + } + + public String getDescription() { + return description; + } + + public List getCouponsToRemove() { + return couponsToRemove; + } + + public List getDiscountsToRemove() { + return discountsToRemove; + } + + public List getItemsToRemove() { + return itemsToRemove; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getItemsToAdd() { + return itemsToAdd; + } + + public List getItemsToUpdate() { + return itemsToUpdate; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getCouponsToAdd() { + return couponsToAdd; + } + + public List getDiscountsToAdd() { + return discountsToAdd; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.effectiveFrom != null) { + + formData.put("effective_from", this.effectiveFrom); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.couponsToRemove != null) { + + formData.put("coupons_to_remove", this.couponsToRemove); + } + + if (this.discountsToRemove != null) { + + formData.put("discounts_to_remove", this.discountsToRemove); + } + + if (this.itemsToRemove != null) { + + formData.put("items_to_remove", this.itemsToRemove); + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.itemsToAdd != null) { + + // List of objects + for (int i = 0; i < this.itemsToAdd.size(); i++) { + ItemsToAddParams item = this.itemsToAdd.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "items_to_add[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemsToUpdate != null) { + + // List of objects + for (int i = 0; i < this.itemsToUpdate.size(); i++) { + ItemsToUpdateParams item = this.itemsToUpdate.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "items_to_update[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.couponsToAdd != null) { + + // List of objects + for (int i = 0; i < this.couponsToAdd.size(); i++) { + CouponsToAddParams item = this.couponsToAdd.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "coupons_to_add[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discountsToAdd != null) { + + // List of objects + for (int i = 0; i < this.discountsToAdd.size(); i++) { + DiscountsToAddParams item = this.discountsToAdd.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts_to_add[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for RampUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RampUpdateBuilder builder() { + return new RampUpdateBuilder(); + } + + public static final class RampUpdateBuilder { + + private Timestamp effectiveFrom; + + private String description; + + private List couponsToRemove; + + private List discountsToRemove; + + private List itemsToRemove; + + private ContractTermParams contractTerm; + + private List itemsToAdd; + + private List itemsToUpdate; + + private List itemTiers; + + private List couponsToAdd; + + private List discountsToAdd; + + private RampUpdateBuilder() {} + + public RampUpdateBuilder effectiveFrom(Timestamp value) { + this.effectiveFrom = value; + return this; + } + + public RampUpdateBuilder description(String value) { + this.description = value; + return this; + } + + public RampUpdateBuilder couponsToRemove(List value) { + this.couponsToRemove = value; + return this; + } + + public RampUpdateBuilder discountsToRemove(List value) { + this.discountsToRemove = value; + return this; + } + + public RampUpdateBuilder itemsToRemove(List value) { + this.itemsToRemove = value; + return this; + } + + public RampUpdateBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public RampUpdateBuilder itemsToAdd(List value) { + this.itemsToAdd = value; + return this; + } + + public RampUpdateBuilder itemsToUpdate(List value) { + this.itemsToUpdate = value; + return this; + } + + public RampUpdateBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public RampUpdateBuilder couponsToAdd(List value) { + this.couponsToAdd = value; + return this; + } + + public RampUpdateBuilder discountsToAdd(List value) { + this.discountsToAdd = value; + return this; + } + + public RampUpdateParams build() { + return new RampUpdateParams(this); + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private final Integer renewalBillingCycles; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + + this.renewalBillingCycles = builder.renewalBillingCycles; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + public Integer getRenewalBillingCycles() { + return renewalBillingCycles; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + if (this.renewalBillingCycles != null) { + + formData.put("renewal_billing_cycles", this.renewalBillingCycles); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private Integer renewalBillingCycles; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermBuilder renewalBillingCycles(Integer value) { + this.renewalBillingCycles = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + RENEW_ONCE("renew_once"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemsToAddParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ChargeOnOption chargeOnOption; + + private ItemsToAddParams(ItemsToAddBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.chargeOnOption = builder.chargeOnOption; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ChargeOnOption getChargeOnOption() { + return chargeOnOption; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.chargeOnOption != null) { + + formData.put("charge_on_option", this.chargeOnOption); + } + + return formData; + } + + /** Create a new builder for ItemsToAddParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemsToAddBuilder builder() { + return new ItemsToAddBuilder(); + } + + public static final class ItemsToAddBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ChargeOnOption chargeOnOption; + + private ItemsToAddBuilder() {} + + public ItemsToAddBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemsToAddBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public ItemsToAddBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public ItemsToAddBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public ItemsToAddBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public ItemsToAddBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public ItemsToAddBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public ItemsToAddBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public ItemsToAddBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public ItemsToAddBuilder chargeOnOption(ChargeOnOption value) { + this.chargeOnOption = value; + return this; + } + + public ItemsToAddParams build() { + return new ItemsToAddParams(this); + } + } + + public enum ChargeOnEvent { + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** 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; + } + } + + public enum ChargeOnOption { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnOption enumValue : ChargeOnOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemsToUpdateParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ChargeOnOption chargeOnOption; + + private ItemsToUpdateParams(ItemsToUpdateBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.chargeOnOption = builder.chargeOnOption; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ChargeOnOption getChargeOnOption() { + return chargeOnOption; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.chargeOnOption != null) { + + formData.put("charge_on_option", this.chargeOnOption); + } + + return formData; + } + + /** Create a new builder for ItemsToUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemsToUpdateBuilder builder() { + return new ItemsToUpdateBuilder(); + } + + public static final class ItemsToUpdateBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ChargeOnOption chargeOnOption; + + private ItemsToUpdateBuilder() {} + + public ItemsToUpdateBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemsToUpdateBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public ItemsToUpdateBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public ItemsToUpdateBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public ItemsToUpdateBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public ItemsToUpdateBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public ItemsToUpdateBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public ItemsToUpdateBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public ItemsToUpdateBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public ItemsToUpdateBuilder chargeOnOption(ChargeOnOption value) { + this.chargeOnOption = value; + return this; + } + + public ItemsToUpdateParams build() { + return new ItemsToUpdateParams(this); + } + } + + public enum ChargeOnEvent { + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** 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; + } + } + + public enum ChargeOnOption { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnOption enumValue : ChargeOnOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CouponsToAddParams { + + private final String couponId; + + private final Timestamp applyTill; + + private CouponsToAddParams(CouponsToAddBuilder builder) { + + this.couponId = builder.couponId; + + this.applyTill = builder.applyTill; + } + + public String getCouponId() { + return couponId; + } + + public Timestamp getApplyTill() { + return applyTill; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.couponId != null) { + + formData.put("coupon_id", this.couponId); + } + + if (this.applyTill != null) { + + formData.put("apply_till", this.applyTill); + } + + return formData; + } + + /** Create a new builder for CouponsToAddParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponsToAddBuilder builder() { + return new CouponsToAddBuilder(); + } + + public static final class CouponsToAddBuilder { + + private String couponId; + + private Timestamp applyTill; + + private CouponsToAddBuilder() {} + + public CouponsToAddBuilder couponId(String value) { + this.couponId = value; + return this; + } + + public CouponsToAddBuilder applyTill(Timestamp value) { + this.applyTill = value; + return this; + } + + public CouponsToAddParams build() { + return new CouponsToAddParams(this); + } + } + } + + public static final class DiscountsToAddParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private DiscountsToAddParams(DiscountsToAddBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + return formData; + } + + /** Create a new builder for DiscountsToAddParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsToAddBuilder builder() { + return new DiscountsToAddBuilder(); + } + + public static final class DiscountsToAddBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private DiscountsToAddBuilder() {} + + public DiscountsToAddBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsToAddBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsToAddBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsToAddBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsToAddBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsToAddBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsToAddBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsToAddBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsToAddParams build() { + return new DiscountsToAddParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/ramp/RampCreateForSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/ramp/responses/RampCreateForSubscriptionResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/ramp/RampCreateForSubscriptionResponse.java rename to src/main/java/com/chargebee/v4/models/ramp/responses/RampCreateForSubscriptionResponse.java index f1f6d785..19449e7a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/ramp/RampCreateForSubscriptionResponse.java +++ b/src/main/java/com/chargebee/v4/models/ramp/responses/RampCreateForSubscriptionResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.ramp; +package com.chargebee.v4.models.ramp.responses; -import com.chargebee.v4.core.models.ramp.Ramp; +import com.chargebee.v4.models.ramp.Ramp; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/ramp/RampDeleteResponse.java b/src/main/java/com/chargebee/v4/models/ramp/responses/RampDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/ramp/RampDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/ramp/responses/RampDeleteResponse.java index a02ed0b6..c12d8a61 100644 --- a/src/main/java/com/chargebee/v4/core/responses/ramp/RampDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/ramp/responses/RampDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.ramp; +package com.chargebee.v4.models.ramp.responses; -import com.chargebee.v4.core.models.ramp.Ramp; +import com.chargebee.v4.models.ramp.Ramp; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/ramp/RampListResponse.java b/src/main/java/com/chargebee/v4/models/ramp/responses/RampListResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/ramp/RampListResponse.java rename to src/main/java/com/chargebee/v4/models/ramp/responses/RampListResponse.java index a88e3cf3..aab359cb 100644 --- a/src/main/java/com/chargebee/v4/core/responses/ramp/RampListResponse.java +++ b/src/main/java/com/chargebee/v4/models/ramp/responses/RampListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.ramp; +package com.chargebee.v4.models.ramp.responses; import java.util.List; -import com.chargebee.v4.core.models.ramp.Ramp; +import com.chargebee.v4.models.ramp.Ramp; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.RampService; -import com.chargebee.v4.core.models.ramp.params.RampListParams; +import com.chargebee.v4.services.RampService; +import com.chargebee.v4.models.ramp.params.RampListParams; /** Immutable response object for RampList operation. Contains paginated list data. */ public final class RampListResponse { @@ -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 RampListResponse nextPage() throws Exception { + public RampListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/ramp/responses/RampRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/ramp/responses/RampRetrieveResponse.java new file mode 100644 index 00000000..8c5294ae --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/ramp/responses/RampRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.ramp.responses; + +import com.chargebee.v4.models.ramp.Ramp; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for RampRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class RampRetrieveResponse extends BaseResponse { + private final Ramp ramp; + + private RampRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.ramp = builder.ramp; + } + + /** Parse JSON response into RampRetrieveResponse object. */ + public static RampRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into RampRetrieveResponse object with HTTP response. */ + public static RampRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __rampJson = JsonUtil.getObject(json, "ramp"); + if (__rampJson != null) { + builder.ramp(Ramp.fromJson(__rampJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse RampRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for RampRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for RampRetrieveResponse. */ + public static class Builder { + + private Ramp ramp; + + private Response httpResponse; + + private Builder() {} + + public Builder ramp(Ramp ramp) { + this.ramp = ramp; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public RampRetrieveResponse build() { + return new RampRetrieveResponse(this); + } + } + + /** Get the ramp from the response. */ + public Ramp getRamp() { + return ramp; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/ramp/RampUpdateResponse.java b/src/main/java/com/chargebee/v4/models/ramp/responses/RampUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/ramp/RampUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/ramp/responses/RampUpdateResponse.java index e8766c76..f7cbef23 100644 --- a/src/main/java/com/chargebee/v4/core/responses/ramp/RampUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/ramp/responses/RampUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.ramp; +package com.chargebee.v4.models.ramp.responses; -import com.chargebee.v4.core.models.ramp.Ramp; +import com.chargebee.v4.models.ramp.Ramp; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/recordedPurchase/RecordedPurchase.java b/src/main/java/com/chargebee/v4/models/recordedPurchase/RecordedPurchase.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/recordedPurchase/RecordedPurchase.java rename to src/main/java/com/chargebee/v4/models/recordedPurchase/RecordedPurchase.java index 044f95d9..2ee63421 100644 --- a/src/main/java/com/chargebee/v4/core/models/recordedPurchase/RecordedPurchase.java +++ b/src/main/java/com/chargebee/v4/models/recordedPurchase/RecordedPurchase.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.recordedPurchase; +package com.chargebee.v4.models.recordedPurchase; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/recordedPurchase/params/RecordedPurchaseCreateParams.java b/src/main/java/com/chargebee/v4/models/recordedPurchase/params/RecordedPurchaseCreateParams.java new file mode 100644 index 00000000..ead1eb3c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/recordedPurchase/params/RecordedPurchaseCreateParams.java @@ -0,0 +1,433 @@ +/* + * 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.recordedPurchase.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class RecordedPurchaseCreateParams { + + private final String appId; + + private final CustomerParams customer; + + private final AppleAppStoreParams appleAppStore; + + private final GooglePlayStoreParams googlePlayStore; + + private final OmnichannelSubscriptionParams omnichannelSubscription; + + private RecordedPurchaseCreateParams(RecordedPurchaseCreateBuilder builder) { + + this.appId = builder.appId; + + this.customer = builder.customer; + + this.appleAppStore = builder.appleAppStore; + + this.googlePlayStore = builder.googlePlayStore; + + this.omnichannelSubscription = builder.omnichannelSubscription; + } + + public String getAppId() { + return appId; + } + + public CustomerParams getCustomer() { + return customer; + } + + public AppleAppStoreParams getAppleAppStore() { + return appleAppStore; + } + + public GooglePlayStoreParams getGooglePlayStore() { + return googlePlayStore; + } + + public OmnichannelSubscriptionParams getOmnichannelSubscription() { + return omnichannelSubscription; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.appId != null) { + + formData.put("app_id", this.appId); + } + + 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()); + } + } + + if (this.appleAppStore != null) { + + // Single object + Map nestedData = this.appleAppStore.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "apple_app_store[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.googlePlayStore != null) { + + // Single object + Map nestedData = this.googlePlayStore.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "google_play_store[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.omnichannelSubscription != null) { + + // Single object + Map nestedData = this.omnichannelSubscription.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "omnichannel_subscription[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for RecordedPurchaseCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RecordedPurchaseCreateBuilder builder() { + return new RecordedPurchaseCreateBuilder(); + } + + public static final class RecordedPurchaseCreateBuilder { + + private String appId; + + private CustomerParams customer; + + private AppleAppStoreParams appleAppStore; + + private GooglePlayStoreParams googlePlayStore; + + private OmnichannelSubscriptionParams omnichannelSubscription; + + private RecordedPurchaseCreateBuilder() {} + + public RecordedPurchaseCreateBuilder appId(String value) { + this.appId = value; + return this; + } + + public RecordedPurchaseCreateBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public RecordedPurchaseCreateBuilder appleAppStore(AppleAppStoreParams value) { + this.appleAppStore = value; + return this; + } + + public RecordedPurchaseCreateBuilder googlePlayStore(GooglePlayStoreParams value) { + this.googlePlayStore = value; + return this; + } + + public RecordedPurchaseCreateBuilder omnichannelSubscription( + OmnichannelSubscriptionParams value) { + this.omnichannelSubscription = value; + return this; + } + + public RecordedPurchaseCreateParams build() { + return new RecordedPurchaseCreateParams(this); + } + } + + public static final class CustomerParams { + + private final String id; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + 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 id; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + } + + public static final class AppleAppStoreParams { + + private final String transactionId; + + private final String receipt; + + private final String productId; + + private AppleAppStoreParams(AppleAppStoreBuilder builder) { + + this.transactionId = builder.transactionId; + + this.receipt = builder.receipt; + + this.productId = builder.productId; + } + + public String getTransactionId() { + return transactionId; + } + + public String getReceipt() { + return receipt; + } + + public String getProductId() { + return productId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.transactionId != null) { + + formData.put("transaction_id", this.transactionId); + } + + if (this.receipt != null) { + + formData.put("receipt", this.receipt); + } + + if (this.productId != null) { + + formData.put("product_id", this.productId); + } + + return formData; + } + + /** Create a new builder for AppleAppStoreParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AppleAppStoreBuilder builder() { + return new AppleAppStoreBuilder(); + } + + public static final class AppleAppStoreBuilder { + + private String transactionId; + + private String receipt; + + private String productId; + + private AppleAppStoreBuilder() {} + + public AppleAppStoreBuilder transactionId(String value) { + this.transactionId = value; + return this; + } + + public AppleAppStoreBuilder receipt(String value) { + this.receipt = value; + return this; + } + + public AppleAppStoreBuilder productId(String value) { + this.productId = value; + return this; + } + + public AppleAppStoreParams build() { + return new AppleAppStoreParams(this); + } + } + } + + public static final class GooglePlayStoreParams { + + private final String purchaseToken; + + private final String productId; + + private final String orderId; + + private GooglePlayStoreParams(GooglePlayStoreBuilder builder) { + + this.purchaseToken = builder.purchaseToken; + + this.productId = builder.productId; + + this.orderId = builder.orderId; + } + + public String getPurchaseToken() { + return purchaseToken; + } + + public String getProductId() { + return productId; + } + + public String getOrderId() { + return orderId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.purchaseToken != null) { + + formData.put("purchase_token", this.purchaseToken); + } + + if (this.productId != null) { + + formData.put("product_id", this.productId); + } + + if (this.orderId != null) { + + formData.put("order_id", this.orderId); + } + + return formData; + } + + /** Create a new builder for GooglePlayStoreParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GooglePlayStoreBuilder builder() { + return new GooglePlayStoreBuilder(); + } + + public static final class GooglePlayStoreBuilder { + + private String purchaseToken; + + private String productId; + + private String orderId; + + private GooglePlayStoreBuilder() {} + + public GooglePlayStoreBuilder purchaseToken(String value) { + this.purchaseToken = value; + return this; + } + + public GooglePlayStoreBuilder productId(String value) { + this.productId = value; + return this; + } + + public GooglePlayStoreBuilder orderId(String value) { + this.orderId = value; + return this; + } + + public GooglePlayStoreParams build() { + return new GooglePlayStoreParams(this); + } + } + } + + public static final class OmnichannelSubscriptionParams { + + private final String id; + + private OmnichannelSubscriptionParams(OmnichannelSubscriptionBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for OmnichannelSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OmnichannelSubscriptionBuilder builder() { + return new OmnichannelSubscriptionBuilder(); + } + + public static final class OmnichannelSubscriptionBuilder { + + private String id; + + private OmnichannelSubscriptionBuilder() {} + + public OmnichannelSubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public OmnichannelSubscriptionParams build() { + return new OmnichannelSubscriptionParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/recordedPurchase/params/RecordedPurchaseRetrieveParams.java b/src/main/java/com/chargebee/v4/models/recordedPurchase/params/RecordedPurchaseRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/recordedPurchase/params/RecordedPurchaseRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/recordedPurchase/params/RecordedPurchaseRetrieveParams.java index 718b7ba6..a73e00aa 100644 --- a/src/main/java/com/chargebee/v4/core/models/recordedPurchase/params/RecordedPurchaseRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/recordedPurchase/params/RecordedPurchaseRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.recordedPurchase.params; +package com.chargebee.v4.models.recordedPurchase.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/responses/recordedPurchase/RecordedPurchaseCreateResponse.java b/src/main/java/com/chargebee/v4/models/recordedPurchase/responses/RecordedPurchaseCreateResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/recordedPurchase/RecordedPurchaseCreateResponse.java rename to src/main/java/com/chargebee/v4/models/recordedPurchase/responses/RecordedPurchaseCreateResponse.java index bd2ed972..26712894 100644 --- a/src/main/java/com/chargebee/v4/core/responses/recordedPurchase/RecordedPurchaseCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/recordedPurchase/responses/RecordedPurchaseCreateResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.recordedPurchase; +package com.chargebee.v4.models.recordedPurchase.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.recordedPurchase.RecordedPurchase; +import com.chargebee.v4.models.recordedPurchase.RecordedPurchase; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/recordedPurchase/responses/RecordedPurchaseRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/recordedPurchase/responses/RecordedPurchaseRetrieveResponse.java new file mode 100644 index 00000000..121fc2a8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/recordedPurchase/responses/RecordedPurchaseRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.recordedPurchase.responses; + +import com.chargebee.v4.models.recordedPurchase.RecordedPurchase; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for RecordedPurchaseRetrieve operation. Contains the response data from + * a single resource get operation. + */ +public final class RecordedPurchaseRetrieveResponse extends BaseResponse { + private final RecordedPurchase recordedPurchase; + + private RecordedPurchaseRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.recordedPurchase = builder.recordedPurchase; + } + + /** Parse JSON response into RecordedPurchaseRetrieveResponse object. */ + public static RecordedPurchaseRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into RecordedPurchaseRetrieveResponse object with HTTP response. */ + public static RecordedPurchaseRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __recordedPurchaseJson = JsonUtil.getObject(json, "recorded_purchase"); + if (__recordedPurchaseJson != null) { + builder.recordedPurchase(RecordedPurchase.fromJson(__recordedPurchaseJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse RecordedPurchaseRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for RecordedPurchaseRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for RecordedPurchaseRetrieveResponse. */ + public static class Builder { + + private RecordedPurchase recordedPurchase; + + private Response httpResponse; + + private Builder() {} + + public Builder recordedPurchase(RecordedPurchase recordedPurchase) { + this.recordedPurchase = recordedPurchase; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public RecordedPurchaseRetrieveResponse build() { + return new RecordedPurchaseRetrieveResponse(this); + } + } + + /** Get the recordedPurchase from the response. */ + public RecordedPurchase getRecordedPurchase() { + return recordedPurchase; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/resourceMigration/ResourceMigration.java b/src/main/java/com/chargebee/v4/models/resourceMigration/ResourceMigration.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/resourceMigration/ResourceMigration.java rename to src/main/java/com/chargebee/v4/models/resourceMigration/ResourceMigration.java index 128b7321..86fc71c1 100644 --- a/src/main/java/com/chargebee/v4/core/models/resourceMigration/ResourceMigration.java +++ b/src/main/java/com/chargebee/v4/models/resourceMigration/ResourceMigration.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.resourceMigration; +package com.chargebee.v4.models.resourceMigration; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/resourceMigration/params/ResourceMigrationRetrieveLatestParams.java b/src/main/java/com/chargebee/v4/models/resourceMigration/params/ResourceMigrationRetrieveLatestParams.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/resourceMigration/params/ResourceMigrationRetrieveLatestParams.java rename to src/main/java/com/chargebee/v4/models/resourceMigration/params/ResourceMigrationRetrieveLatestParams.java index e1e9fefe..4b3d0b50 100644 --- a/src/main/java/com/chargebee/v4/core/models/resourceMigration/params/ResourceMigrationRetrieveLatestParams.java +++ b/src/main/java/com/chargebee/v4/models/resourceMigration/params/ResourceMigrationRetrieveLatestParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.resourceMigration.params; +package com.chargebee.v4.models.resourceMigration.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/resourceMigration/responses/ResourceMigrationRetrieveLatestResponse.java b/src/main/java/com/chargebee/v4/models/resourceMigration/responses/ResourceMigrationRetrieveLatestResponse.java new file mode 100644 index 00000000..72af2bc9 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/resourceMigration/responses/ResourceMigrationRetrieveLatestResponse.java @@ -0,0 +1,79 @@ +package com.chargebee.v4.models.resourceMigration.responses; + +import com.chargebee.v4.models.resourceMigration.ResourceMigration; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ResourceMigrationRetrieveLatest operation. Contains the response + * data from a single resource get operation. + */ +public final class ResourceMigrationRetrieveLatestResponse extends BaseResponse { + private final ResourceMigration resourceMigration; + + private ResourceMigrationRetrieveLatestResponse(Builder builder) { + super(builder.httpResponse); + + this.resourceMigration = builder.resourceMigration; + } + + /** Parse JSON response into ResourceMigrationRetrieveLatestResponse object. */ + public static ResourceMigrationRetrieveLatestResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ResourceMigrationRetrieveLatestResponse object with HTTP response. */ + public static ResourceMigrationRetrieveLatestResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __resourceMigrationJson = JsonUtil.getObject(json, "resource_migration"); + if (__resourceMigrationJson != null) { + builder.resourceMigration(ResourceMigration.fromJson(__resourceMigrationJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ResourceMigrationRetrieveLatestResponse from JSON", e); + } + } + + /** Create a new builder for ResourceMigrationRetrieveLatestResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ResourceMigrationRetrieveLatestResponse. */ + public static class Builder { + + private ResourceMigration resourceMigration; + + private Response httpResponse; + + private Builder() {} + + public Builder resourceMigration(ResourceMigration resourceMigration) { + this.resourceMigration = resourceMigration; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ResourceMigrationRetrieveLatestResponse build() { + return new ResourceMigrationRetrieveLatestResponse(this); + } + } + + /** Get the resourceMigration from the response. */ + public ResourceMigration getResourceMigration() { + return resourceMigration; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/rule/Rule.java b/src/main/java/com/chargebee/v4/models/rule/Rule.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/rule/Rule.java rename to src/main/java/com/chargebee/v4/models/rule/Rule.java index a2965fae..a9478e78 100644 --- a/src/main/java/com/chargebee/v4/core/models/rule/Rule.java +++ b/src/main/java/com/chargebee/v4/models/rule/Rule.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.rule; +package com.chargebee.v4.models.rule; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/rule/params/RuleRetrieveParams.java b/src/main/java/com/chargebee/v4/models/rule/params/RuleRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/rule/params/RuleRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/rule/params/RuleRetrieveParams.java index 34f2f10c..00ac79ce 100644 --- a/src/main/java/com/chargebee/v4/core/models/rule/params/RuleRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/rule/params/RuleRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.rule.params; +package com.chargebee.v4.models.rule.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/rule/responses/RuleRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/rule/responses/RuleRetrieveResponse.java new file mode 100644 index 00000000..bb05dd79 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/rule/responses/RuleRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.rule.responses; + +import com.chargebee.v4.models.rule.Rule; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for RuleRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class RuleRetrieveResponse extends BaseResponse { + private final Rule rule; + + private RuleRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.rule = builder.rule; + } + + /** Parse JSON response into RuleRetrieveResponse object. */ + public static RuleRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into RuleRetrieveResponse object with HTTP response. */ + public static RuleRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __ruleJson = JsonUtil.getObject(json, "rule"); + if (__ruleJson != null) { + builder.rule(Rule.fromJson(__ruleJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse RuleRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for RuleRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for RuleRetrieveResponse. */ + public static class Builder { + + private Rule rule; + + private Response httpResponse; + + private Builder() {} + + public Builder rule(Rule rule) { + this.rule = rule; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public RuleRetrieveResponse build() { + return new RuleRetrieveResponse(this); + } + } + + /** Get the rule from the response. */ + public Rule getRule() { + return rule; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/salesOrder/SalesOrder.java b/src/main/java/com/chargebee/v4/models/salesOrder/SalesOrder.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/models/salesOrder/SalesOrder.java rename to src/main/java/com/chargebee/v4/models/salesOrder/SalesOrder.java index 7d60bc3f..3fe79973 100644 --- a/src/main/java/com/chargebee/v4/core/models/salesOrder/SalesOrder.java +++ b/src/main/java/com/chargebee/v4/models/salesOrder/SalesOrder.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.salesOrder; +package com.chargebee.v4.models.salesOrder; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; @@ -29,6 +29,10 @@ public class SalesOrder { private String currencyCode; private List subscriptionIds; private Status status; + @Deprecated private List invoiceIds; + @Deprecated private List creditNoteIds; + @Deprecated private List unbilledChargeIds; + private Boolean deleted; private List lineItems; private List billingAddresses; private List discounts; @@ -37,6 +41,7 @@ public class SalesOrder { private PaymentConfiguration paymentConfiguration; private BillingConfiguration billingConfiguration; private RenewalTerm renewalTerm; + private List creditLines; public String getId() { return id; @@ -102,6 +107,25 @@ public Status getStatus() { return status; } + @Deprecated + public List getInvoiceIds() { + return invoiceIds; + } + + @Deprecated + public List getCreditNoteIds() { + return creditNoteIds; + } + + @Deprecated + public List getUnbilledChargeIds() { + return unbilledChargeIds; + } + + public Boolean getDeleted() { + return deleted; + } + public List getLineItems() { return lineItems; } @@ -134,6 +158,10 @@ public RenewalTerm getRenewalTerm() { return renewalTerm; } + public List getCreditLines() { + return creditLines; + } + public enum Status { ACTIVE("active"), @@ -197,6 +225,15 @@ public static SalesOrder fromJson(String json) { obj.status = Status.fromString(JsonUtil.getString(json, "status")); + obj.invoiceIds = JsonUtil.parseArrayOfString(JsonUtil.getArray(json, "invoice_ids")); + + obj.creditNoteIds = JsonUtil.parseArrayOfString(JsonUtil.getArray(json, "credit_note_ids")); + + obj.unbilledChargeIds = + JsonUtil.parseArrayOfString(JsonUtil.getArray(json, "unbilled_charge_ids")); + + obj.deleted = JsonUtil.getBoolean(json, "deleted"); + obj.lineItems = JsonUtil.parseObjectArray(JsonUtil.getArray(json, "line_items")).stream() .map(LineItems::fromJson) @@ -237,6 +274,11 @@ public static SalesOrder fromJson(String json) { obj.renewalTerm = RenewalTerm.fromJson(__renewalTermJson); } + obj.creditLines = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "credit_lines")).stream() + .map(CreditLines::fromJson) + .collect(java.util.stream.Collectors.toList()); + return obj; } @@ -248,6 +290,9 @@ public static class LineItems { private String name; private String quantity; private String unitPrice; + private String billableUnitPrice; + private String billableQuantity; + private String billableAmount; private Integer billingPeriod; private BillingPeriodUnit billingPeriodUnit; private Integer servicePeriodDays; @@ -283,6 +328,18 @@ public String getUnitPrice() { return unitPrice; } + public String getBillableUnitPrice() { + return billableUnitPrice; + } + + public String getBillableQuantity() { + return billableQuantity; + } + + public String getBillableAmount() { + return billableAmount; + } + public Integer getBillingPeriod() { return billingPeriod; } @@ -436,6 +493,12 @@ public static LineItems fromJson(String json) { obj.unitPrice = JsonUtil.getString(json, "unit_price"); + obj.billableUnitPrice = JsonUtil.getString(json, "billable_unit_price"); + + obj.billableQuantity = JsonUtil.getString(json, "billable_quantity"); + + obj.billableAmount = JsonUtil.getString(json, "billable_amount"); + obj.billingPeriod = JsonUtil.getInteger(json, "billing_period"); obj.billingPeriodUnit = @@ -1323,4 +1386,35 @@ public static RenewalTerm fromJson(String json) { return obj; } } + + public static class CreditLines { + + private String amount; + private String unitPrice; + private String lineItemAssociationId; + + public String getAmount() { + return amount; + } + + public String getUnitPrice() { + return unitPrice; + } + + public String getLineItemAssociationId() { + return lineItemAssociationId; + } + + public static CreditLines fromJson(String json) { + CreditLines obj = new CreditLines(); + + obj.amount = JsonUtil.getString(json, "amount"); + + obj.unitPrice = JsonUtil.getString(json, "unit_price"); + + obj.lineItemAssociationId = JsonUtil.getString(json, "line_item_association_id"); + + return obj; + } + } } diff --git a/src/main/java/com/chargebee/v4/core/models/siteMigrationDetail/SiteMigrationDetail.java b/src/main/java/com/chargebee/v4/models/siteMigrationDetail/SiteMigrationDetail.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/siteMigrationDetail/SiteMigrationDetail.java rename to src/main/java/com/chargebee/v4/models/siteMigrationDetail/SiteMigrationDetail.java index 077c7229..7477191f 100644 --- a/src/main/java/com/chargebee/v4/core/models/siteMigrationDetail/SiteMigrationDetail.java +++ b/src/main/java/com/chargebee/v4/models/siteMigrationDetail/SiteMigrationDetail.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.siteMigrationDetail; +package com.chargebee.v4.models.siteMigrationDetail; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/siteMigrationDetail/params/SiteMigrationDetailListParams.java b/src/main/java/com/chargebee/v4/models/siteMigrationDetail/params/SiteMigrationDetailListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/siteMigrationDetail/params/SiteMigrationDetailListParams.java rename to src/main/java/com/chargebee/v4/models/siteMigrationDetail/params/SiteMigrationDetailListParams.java index c89b827f..47fdfc9a 100644 --- a/src/main/java/com/chargebee/v4/core/models/siteMigrationDetail/params/SiteMigrationDetailListParams.java +++ b/src/main/java/com/chargebee/v4/models/siteMigrationDetail/params/SiteMigrationDetailListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.siteMigrationDetail.params; +package com.chargebee.v4.models.siteMigrationDetail.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/responses/siteMigrationDetail/SiteMigrationDetailListResponse.java b/src/main/java/com/chargebee/v4/models/siteMigrationDetail/responses/SiteMigrationDetailListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/siteMigrationDetail/SiteMigrationDetailListResponse.java rename to src/main/java/com/chargebee/v4/models/siteMigrationDetail/responses/SiteMigrationDetailListResponse.java index dfd5f825..6c91e188 100644 --- a/src/main/java/com/chargebee/v4/core/responses/siteMigrationDetail/SiteMigrationDetailListResponse.java +++ b/src/main/java/com/chargebee/v4/models/siteMigrationDetail/responses/SiteMigrationDetailListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.siteMigrationDetail; +package com.chargebee.v4.models.siteMigrationDetail.responses; import java.util.List; -import com.chargebee.v4.core.models.siteMigrationDetail.SiteMigrationDetail; +import com.chargebee.v4.models.siteMigrationDetail.SiteMigrationDetail; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.SiteMigrationDetailService; -import com.chargebee.v4.core.models.siteMigrationDetail.params.SiteMigrationDetailListParams; +import com.chargebee.v4.services.SiteMigrationDetailService; +import com.chargebee.v4.models.siteMigrationDetail.params.SiteMigrationDetailListParams; /** * Immutable response object for SiteMigrationDetailList operation. Contains paginated list data. @@ -101,9 +102,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 SiteMigrationDetailListResponse nextPage() throws Exception { + public SiteMigrationDetailListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/Subscription.java b/src/main/java/com/chargebee/v4/models/subscription/Subscription.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/subscription/Subscription.java rename to src/main/java/com/chargebee/v4/models/subscription/Subscription.java index 2e7e3722..cf34ce75 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscription/Subscription.java +++ b/src/main/java/com/chargebee/v4/models/subscription/Subscription.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscription; +package com.chargebee.v4.models.subscription; import com.chargebee.v4.internal.JsonUtil; import java.math.BigDecimal; @@ -93,7 +93,7 @@ public class Subscription { private List eventBasedAddons; private String planId; - private java.util.Map customFields = new java.util.HashMap<>(); + private java.util.Map customFields = new java.util.HashMap<>(); public String getId() { return id; @@ -415,7 +415,7 @@ public String getPlanId() { * * @return map containing all custom fields */ - public java.util.Map getCustomFields() { + public java.util.Map getCustomFields() { return customFields; } @@ -425,7 +425,7 @@ public java.util.Map getCustomFields() { * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") * @return the value of the custom field, or null if not present */ - public Object getCustomField(String fieldName) { + public String getCustomField(String fieldName) { return customFields.get(fieldName); } @@ -714,7 +714,7 @@ public static AutoCollection fromString(String value) { public static Subscription fromJson(String json) { Subscription obj = new Subscription(); - // Parse JSON to extract all keys + // Parse JSON to extract all keys for custom field extraction java.util.Set knownFields = new java.util.HashSet<>(); knownFields.add("id"); @@ -1086,9 +1086,9 @@ public static Subscription fromJson(String json) { * @param knownFields set of known field names * @return map of custom fields */ - private static java.util.Map extractCustomFields( + private static java.util.Map extractCustomFields( String json, java.util.Set knownFields) { - java.util.Map customFields = new java.util.HashMap<>(); + java.util.Map customFields = new java.util.HashMap<>(); try { // Parse the entire JSON as a map java.util.Map allFields = JsonUtil.parseJsonObjectToMap(json); @@ -1097,7 +1097,8 @@ private static java.util.Map extractCustomFields( String key = entry.getKey(); // Include fields that start with "cf_" and are not in knownFields if (key != null && key.startsWith("cf_") && !knownFields.contains(key)) { - customFields.put(key, entry.getValue()); + customFields.put( + key, entry.getValue() != null ? String.valueOf(entry.getValue()) : null); } } } diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/ContractTermsForSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/ContractTermsForSubscriptionParams.java new file mode 100644 index 00000000..c6f6b854 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/ContractTermsForSubscriptionParams.java @@ -0,0 +1,153 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ContractTermsForSubscriptionParams { + + private final Map queryParams; + + private ContractTermsForSubscriptionParams(ContractTermsForSubscriptionBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public ContractTermsForSubscriptionBuilder toBuilder() { + ContractTermsForSubscriptionBuilder builder = new ContractTermsForSubscriptionBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for ContractTermsForSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermsForSubscriptionBuilder builder() { + return new ContractTermsForSubscriptionBuilder(); + } + + public static final class ContractTermsForSubscriptionBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private ContractTermsForSubscriptionBuilder() {} + + public ContractTermsForSubscriptionBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public ContractTermsForSubscriptionBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public SortBySortBuilder sortBy() { + return new SortBySortBuilder("sort_by", this); + } + + public ContractTermsForSubscriptionParams build() { + return new ContractTermsForSubscriptionParams(this); + } + + public static final class SortBySortBuilder { + private final String fieldName; + private final ContractTermsForSubscriptionBuilder builder; + + SortBySortBuilder(String fieldName, ContractTermsForSubscriptionBuilder 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 ContractTermsForSubscriptionBuilder builder; + + SortDirection( + String fieldName, String selectedField, ContractTermsForSubscriptionBuilder builder) { + this.fieldName = fieldName; + this.selectedField = selectedField; + this.builder = builder; + } + + public ContractTermsForSubscriptionBuilder asc() { + builder.queryParams.put(fieldName + "[asc]", selectedField); + return builder; + } + + public ContractTermsForSubscriptionBuilder 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/subscription/params/ImportSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/ImportSubscriptionParams.java new file mode 100644 index 00000000..d55fc074 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/ImportSubscriptionParams.java @@ -0,0 +1,4043 @@ +/* + * 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.subscription.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 ImportSubscriptionParams { + + private final String id; + + private final String clientProfileId; + + private final String planId; + + private final Integer planQuantity; + + private final String planQuantityInDecimal; + + private final Long planUnitPrice; + + private final String planUnitPriceInDecimal; + + private final Long setupFee; + + private final Timestamp trialEnd; + + private final Integer billingCycles; + + private final Timestamp startDate; + + private final AutoCollection autoCollection; + + private final String poNumber; + + private final List couponIds; + + private final Integer contractTermBillingCycleOnRenewal; + + private final Status status; + + private final Timestamp currentTermEnd; + + private final Timestamp currentTermStart; + + private final Timestamp trialStart; + + private final Timestamp cancelledAt; + + private final Timestamp startedAt; + + private final Timestamp activatedAt; + + private final Timestamp pauseDate; + + private final Timestamp resumeDate; + + private final Boolean createCurrentTermInvoice; + + private final String affiliateToken; + + private final String invoiceNotes; + + private final java.util.Map metaData; + + private final CustomerParams customer; + + private final ContractTermParams contractTerm; + + private final CardParams card; + + private final PaymentMethodParams paymentMethod; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final TransactionParams transaction; + + private final List addons; + + private final List eventBasedAddons; + + private final List chargedEventBasedAddons; + + private final List coupons; + + private final Map customFields; + + private ImportSubscriptionParams(ImportSubscriptionBuilder builder) { + + this.id = builder.id; + + this.clientProfileId = builder.clientProfileId; + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + + this.planUnitPrice = builder.planUnitPrice; + + this.planUnitPriceInDecimal = builder.planUnitPriceInDecimal; + + this.setupFee = builder.setupFee; + + this.trialEnd = builder.trialEnd; + + this.billingCycles = builder.billingCycles; + + this.startDate = builder.startDate; + + this.autoCollection = builder.autoCollection; + + this.poNumber = builder.poNumber; + + this.couponIds = builder.couponIds; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + + this.status = builder.status; + + this.currentTermEnd = builder.currentTermEnd; + + this.currentTermStart = builder.currentTermStart; + + this.trialStart = builder.trialStart; + + this.cancelledAt = builder.cancelledAt; + + this.startedAt = builder.startedAt; + + this.activatedAt = builder.activatedAt; + + this.pauseDate = builder.pauseDate; + + this.resumeDate = builder.resumeDate; + + this.createCurrentTermInvoice = builder.createCurrentTermInvoice; + + this.affiliateToken = builder.affiliateToken; + + this.invoiceNotes = builder.invoiceNotes; + + this.metaData = builder.metaData; + + this.customer = builder.customer; + + this.contractTerm = builder.contractTerm; + + this.card = builder.card; + + this.paymentMethod = builder.paymentMethod; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.transaction = builder.transaction; + + this.addons = builder.addons; + + this.eventBasedAddons = builder.eventBasedAddons; + + this.chargedEventBasedAddons = builder.chargedEventBasedAddons; + + this.coupons = builder.coupons; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getId() { + return id; + } + + public String getClientProfileId() { + return clientProfileId; + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + public Long getPlanUnitPrice() { + return planUnitPrice; + } + + public String getPlanUnitPriceInDecimal() { + return planUnitPriceInDecimal; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getStartDate() { + return startDate; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public String getPoNumber() { + return poNumber; + } + + public List getCouponIds() { + return couponIds; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + public Status getStatus() { + return status; + } + + public Timestamp getCurrentTermEnd() { + return currentTermEnd; + } + + public Timestamp getCurrentTermStart() { + return currentTermStart; + } + + public Timestamp getTrialStart() { + return trialStart; + } + + public Timestamp getCancelledAt() { + return cancelledAt; + } + + public Timestamp getStartedAt() { + return startedAt; + } + + public Timestamp getActivatedAt() { + return activatedAt; + } + + public Timestamp getPauseDate() { + return pauseDate; + } + + public Timestamp getResumeDate() { + return resumeDate; + } + + public Boolean getCreateCurrentTermInvoice() { + return createCurrentTermInvoice; + } + + public String getAffiliateToken() { + return affiliateToken; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public java.util.Map getMetaData() { + return metaData; + } + + public CustomerParams getCustomer() { + return customer; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public CardParams getCard() { + return card; + } + + public PaymentMethodParams getPaymentMethod() { + return paymentMethod; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public TransactionParams getTransaction() { + return transaction; + } + + public List getAddons() { + return addons; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + public List getChargedEventBasedAddons() { + return chargedEventBasedAddons; + } + + public List getCoupons() { + return coupons; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.clientProfileId != null) { + + formData.put("client_profile_id", this.clientProfileId); + } + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + if (this.planUnitPrice != null) { + + formData.put("plan_unit_price", this.planUnitPrice); + } + + if (this.planUnitPriceInDecimal != null) { + + formData.put("plan_unit_price_in_decimal", this.planUnitPriceInDecimal); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.currentTermEnd != null) { + + formData.put("current_term_end", this.currentTermEnd); + } + + if (this.currentTermStart != null) { + + formData.put("current_term_start", this.currentTermStart); + } + + if (this.trialStart != null) { + + formData.put("trial_start", this.trialStart); + } + + if (this.cancelledAt != null) { + + formData.put("cancelled_at", this.cancelledAt); + } + + if (this.startedAt != null) { + + formData.put("started_at", this.startedAt); + } + + if (this.activatedAt != null) { + + formData.put("activated_at", this.activatedAt); + } + + if (this.pauseDate != null) { + + formData.put("pause_date", this.pauseDate); + } + + if (this.resumeDate != null) { + + formData.put("resume_date", this.resumeDate); + } + + if (this.createCurrentTermInvoice != null) { + + formData.put("create_current_term_invoice", this.createCurrentTermInvoice); + } + + if (this.affiliateToken != null) { + + formData.put("affiliate_token", this.affiliateToken); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + 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()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentMethod != null) { + + // Single object + Map nestedData = this.paymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.transaction != null) { + + // Single object + Map nestedData = this.transaction.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "transaction[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.chargedEventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.chargedEventBasedAddons.size(); i++) { + ChargedEventBasedAddonsParams item = this.chargedEventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "charged_event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.coupons != null) { + + // List of objects + for (int i = 0; i < this.coupons.size(); i++) { + CouponsParams item = this.coupons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for ImportSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ImportSubscriptionBuilder builder() { + return new ImportSubscriptionBuilder(); + } + + public static final class ImportSubscriptionBuilder { + + private String id; + + private String clientProfileId; + + private String planId; + + private Integer planQuantity; + + private String planQuantityInDecimal; + + private Long planUnitPrice; + + private String planUnitPriceInDecimal; + + private Long setupFee; + + private Timestamp trialEnd; + + private Integer billingCycles; + + private Timestamp startDate; + + private AutoCollection autoCollection; + + private String poNumber; + + private List couponIds; + + private Integer contractTermBillingCycleOnRenewal; + + private Status status; + + private Timestamp currentTermEnd; + + private Timestamp currentTermStart; + + private Timestamp trialStart; + + private Timestamp cancelledAt; + + private Timestamp startedAt; + + private Timestamp activatedAt; + + private Timestamp pauseDate; + + private Timestamp resumeDate; + + private Boolean createCurrentTermInvoice; + + private String affiliateToken; + + private String invoiceNotes; + + private java.util.Map metaData; + + private CustomerParams customer; + + private ContractTermParams contractTerm; + + private CardParams card; + + private PaymentMethodParams paymentMethod; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private TransactionParams transaction; + + private List addons; + + private List eventBasedAddons; + + private List chargedEventBasedAddons; + + private List coupons; + + private Map customFields = new LinkedHashMap<>(); + + private ImportSubscriptionBuilder() {} + + public ImportSubscriptionBuilder id(String value) { + this.id = value; + return this; + } + + public ImportSubscriptionBuilder clientProfileId(String value) { + this.clientProfileId = value; + return this; + } + + public ImportSubscriptionBuilder planId(String value) { + this.planId = value; + return this; + } + + public ImportSubscriptionBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public ImportSubscriptionBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + public ImportSubscriptionBuilder planUnitPrice(Long value) { + this.planUnitPrice = value; + return this; + } + + public ImportSubscriptionBuilder planUnitPriceInDecimal(String value) { + this.planUnitPriceInDecimal = value; + return this; + } + + public ImportSubscriptionBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public ImportSubscriptionBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public ImportSubscriptionBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public ImportSubscriptionBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public ImportSubscriptionBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public ImportSubscriptionBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public ImportSubscriptionBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public ImportSubscriptionBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public ImportSubscriptionBuilder status(Status value) { + this.status = value; + return this; + } + + public ImportSubscriptionBuilder currentTermEnd(Timestamp value) { + this.currentTermEnd = value; + return this; + } + + public ImportSubscriptionBuilder currentTermStart(Timestamp value) { + this.currentTermStart = value; + return this; + } + + public ImportSubscriptionBuilder trialStart(Timestamp value) { + this.trialStart = value; + return this; + } + + public ImportSubscriptionBuilder cancelledAt(Timestamp value) { + this.cancelledAt = value; + return this; + } + + public ImportSubscriptionBuilder startedAt(Timestamp value) { + this.startedAt = value; + return this; + } + + public ImportSubscriptionBuilder activatedAt(Timestamp value) { + this.activatedAt = value; + return this; + } + + public ImportSubscriptionBuilder pauseDate(Timestamp value) { + this.pauseDate = value; + return this; + } + + public ImportSubscriptionBuilder resumeDate(Timestamp value) { + this.resumeDate = value; + return this; + } + + public ImportSubscriptionBuilder createCurrentTermInvoice(Boolean value) { + this.createCurrentTermInvoice = value; + return this; + } + + public ImportSubscriptionBuilder affiliateToken(String value) { + this.affiliateToken = value; + return this; + } + + public ImportSubscriptionBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public ImportSubscriptionBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public ImportSubscriptionBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public ImportSubscriptionBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public ImportSubscriptionBuilder card(CardParams value) { + this.card = value; + return this; + } + + public ImportSubscriptionBuilder paymentMethod(PaymentMethodParams value) { + this.paymentMethod = value; + return this; + } + + public ImportSubscriptionBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public ImportSubscriptionBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public ImportSubscriptionBuilder transaction(TransactionParams value) { + this.transaction = value; + return this; + } + + public ImportSubscriptionBuilder addons(List value) { + this.addons = value; + return this; + } + + public ImportSubscriptionBuilder eventBasedAddons(List value) { + this.eventBasedAddons = value; + return this; + } + + public ImportSubscriptionBuilder chargedEventBasedAddons( + List value) { + this.chargedEventBasedAddons = value; + return this; + } + + @Deprecated + public ImportSubscriptionBuilder coupons(List value) { + this.coupons = 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 ImportSubscriptionBuilder 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 ImportSubscriptionBuilder 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 ImportSubscriptionParams build() { + return new ImportSubscriptionParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + FUTURE("future"), + + IN_TRIAL("in_trial"), + + ACTIVE("active"), + + NON_RENEWING("non_renewing"), + + PAUSED("paused"), + + CANCELLED("cancelled"), + + TRANSFERRED("transferred"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class CustomerParams { + + private final String id; + + private final String email; + + private final String firstName; + + private final String lastName; + + private final String company; + + private final String phone; + + private final String locale; + + private final Taxability taxability; + + private final EntityCode entityCode; + + private final String exemptNumber; + + private final Integer netTermDays; + + private final TaxjarExemptionCategory taxjarExemptionCategory; + + private final CustomerType customerType; + + private final AutoCollection autoCollection; + + private final Boolean allowDirectDebit; + + private final String vatNumber; + + private final String vatNumberPrefix; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.email = builder.email; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.company = builder.company; + + this.phone = builder.phone; + + this.locale = builder.locale; + + this.taxability = builder.taxability; + + this.entityCode = builder.entityCode; + + this.exemptNumber = builder.exemptNumber; + + this.netTermDays = builder.netTermDays; + + this.taxjarExemptionCategory = builder.taxjarExemptionCategory; + + this.customerType = builder.customerType; + + this.autoCollection = builder.autoCollection; + + this.allowDirectDebit = builder.allowDirectDebit; + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + } + + public String getId() { + return id; + } + + public String getEmail() { + return email; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getCompany() { + return company; + } + + public String getPhone() { + return phone; + } + + public String getLocale() { + return locale; + } + + public Taxability getTaxability() { + return taxability; + } + + public EntityCode getEntityCode() { + return entityCode; + } + + public String getExemptNumber() { + return exemptNumber; + } + + public Integer getNetTermDays() { + return netTermDays; + } + + public TaxjarExemptionCategory getTaxjarExemptionCategory() { + return taxjarExemptionCategory; + } + + public CustomerType getCustomerType() { + return customerType; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public Boolean getAllowDirectDebit() { + return allowDirectDebit; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + + if (this.company != null) { + + formData.put("company", this.company); + } + + if (this.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.locale != null) { + + formData.put("locale", this.locale); + } + + if (this.taxability != null) { + + formData.put("taxability", this.taxability); + } + + if (this.entityCode != null) { + + formData.put("entity_code", this.entityCode); + } + + if (this.exemptNumber != null) { + + formData.put("exempt_number", this.exemptNumber); + } + + if (this.netTermDays != null) { + + formData.put("net_term_days", this.netTermDays); + } + + if (this.taxjarExemptionCategory != null) { + + formData.put("taxjar_exemption_category", this.taxjarExemptionCategory); + } + + if (this.customerType != null) { + + formData.put("customer_type", this.customerType); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.allowDirectDebit != null) { + + formData.put("allow_direct_debit", this.allowDirectDebit); + } + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + 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 id; + + private String email; + + private String firstName; + + private String lastName; + + private String company; + + private String phone; + + private String locale; + + private Taxability taxability; + + private EntityCode entityCode; + + private String exemptNumber; + + private Integer netTermDays; + + private TaxjarExemptionCategory taxjarExemptionCategory; + + private CustomerType customerType; + + private AutoCollection autoCollection; + + private Boolean allowDirectDebit; + + private String vatNumber; + + private String vatNumberPrefix; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerBuilder email(String value) { + this.email = value; + return this; + } + + public CustomerBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CustomerBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CustomerBuilder company(String value) { + this.company = value; + return this; + } + + public CustomerBuilder phone(String value) { + this.phone = value; + return this; + } + + public CustomerBuilder locale(String value) { + this.locale = value; + return this; + } + + public CustomerBuilder taxability(Taxability value) { + this.taxability = value; + return this; + } + + public CustomerBuilder entityCode(EntityCode value) { + this.entityCode = value; + return this; + } + + public CustomerBuilder exemptNumber(String value) { + this.exemptNumber = value; + return this; + } + + public CustomerBuilder netTermDays(Integer value) { + this.netTermDays = value; + return this; + } + + public CustomerBuilder taxjarExemptionCategory(TaxjarExemptionCategory value) { + this.taxjarExemptionCategory = value; + return this; + } + + public CustomerBuilder customerType(CustomerType value) { + this.customerType = value; + return this; + } + + public CustomerBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public CustomerBuilder allowDirectDebit(Boolean value) { + this.allowDirectDebit = value; + return this; + } + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + + public enum Taxability { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Taxability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Taxability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Taxability fromString(String value) { + if (value == null) return _UNKNOWN; + for (Taxability enumValue : Taxability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EntityCode { + A("a"), + + B("b"), + + C("c"), + + D("d"), + + E("e"), + + F("f"), + + G("g"), + + H("h"), + + I("i"), + + J("j"), + + K("k"), + + L("l"), + + M("m"), + + N("n"), + + P("p"), + + Q("q"), + + R("r"), + + MED_1("med1"), + + MED_2("med2"), + + /** An enum member indicating that EntityCode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EntityCode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EntityCode fromString(String value) { + if (value == null) return _UNKNOWN; + for (EntityCode enumValue : EntityCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TaxjarExemptionCategory { + WHOLESALE("wholesale"), + + GOVERNMENT("government"), + + OTHER("other"), + + /** + * An enum member indicating that TaxjarExemptionCategory was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + TaxjarExemptionCategory(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TaxjarExemptionCategory fromString(String value) { + if (value == null) return _UNKNOWN; + for (TaxjarExemptionCategory enumValue : TaxjarExemptionCategory.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum CustomerType { + RESIDENTIAL("residential"), + + BUSINESS("business"), + + SENIOR_CITIZEN("senior_citizen"), + + INDUSTRIAL("industrial"), + + /** An enum member indicating that CustomerType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CustomerType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CustomerType fromString(String value) { + if (value == null) return _UNKNOWN; + for (CustomerType enumValue : CustomerType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ContractTermParams { + + private final String id; + + private final Timestamp createdAt; + + private final Timestamp contractStart; + + private final Integer billingCycle; + + private final Long totalAmountRaised; + + private final Long totalAmountRaisedBeforeTax; + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.id = builder.id; + + this.createdAt = builder.createdAt; + + this.contractStart = builder.contractStart; + + this.billingCycle = builder.billingCycle; + + this.totalAmountRaised = builder.totalAmountRaised; + + this.totalAmountRaisedBeforeTax = builder.totalAmountRaisedBeforeTax; + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public String getId() { + return id; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Timestamp getContractStart() { + return contractStart; + } + + public Integer getBillingCycle() { + return billingCycle; + } + + public Long getTotalAmountRaised() { + return totalAmountRaised; + } + + public Long getTotalAmountRaisedBeforeTax() { + return totalAmountRaisedBeforeTax; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.createdAt != null) { + + formData.put("created_at", this.createdAt); + } + + if (this.contractStart != null) { + + formData.put("contract_start", this.contractStart); + } + + if (this.billingCycle != null) { + + formData.put("billing_cycle", this.billingCycle); + } + + if (this.totalAmountRaised != null) { + + formData.put("total_amount_raised", this.totalAmountRaised); + } + + if (this.totalAmountRaisedBeforeTax != null) { + + formData.put("total_amount_raised_before_tax", this.totalAmountRaisedBeforeTax); + } + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private String id; + + private Timestamp createdAt; + + private Timestamp contractStart; + + private Integer billingCycle; + + private Long totalAmountRaised; + + private Long totalAmountRaisedBeforeTax; + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder id(String value) { + this.id = value; + return this; + } + + public ContractTermBuilder createdAt(Timestamp value) { + this.createdAt = value; + return this; + } + + public ContractTermBuilder contractStart(Timestamp value) { + this.contractStart = value; + return this; + } + + public ContractTermBuilder billingCycle(Integer value) { + this.billingCycle = value; + return this; + } + + public ContractTermBuilder totalAmountRaised(Long value) { + this.totalAmountRaised = value; + return this; + } + + public ContractTermBuilder totalAmountRaisedBeforeTax(Long value) { + this.totalAmountRaisedBeforeTax = value; + return this; + } + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + RENEW_ONCE("renew_once"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CardParams { + + 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 java.util.Map additionalInformation; + + private CardParams(CardBuilder 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.additionalInformation = builder.additionalInformation; + } + + 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 java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** 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.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + 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 java.util.Map additionalInformation; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + @Deprecated + public CardBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public CardBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CardBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CardBuilder number(String value) { + this.number = value; + return this; + } + + public CardBuilder expiryMonth(Integer value) { + this.expiryMonth = value; + return this; + } + + public CardBuilder expiryYear(Integer value) { + this.expiryYear = value; + return this; + } + + public CardBuilder cvv(String value) { + this.cvv = value; + return this; + } + + public CardBuilder preferredScheme(PreferredScheme value) { + this.preferredScheme = value; + return this; + } + + public CardBuilder billingAddr1(String value) { + this.billingAddr1 = value; + return this; + } + + public CardBuilder billingAddr2(String value) { + this.billingAddr2 = value; + return this; + } + + public CardBuilder billingCity(String value) { + this.billingCity = value; + return this; + } + + public CardBuilder billingStateCode(String value) { + this.billingStateCode = value; + return this; + } + + public CardBuilder billingState(String value) { + this.billingState = value; + return this; + } + + public CardBuilder billingZip(String value) { + this.billingZip = value; + return this; + } + + public CardBuilder billingCountry(String value) { + this.billingCountry = value; + return this; + } + + public CardBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public CardParams build() { + return new CardParams(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 PaymentMethodParams { + + private final Type type; + + private final Gateway gateway; + + private final String gatewayAccountId; + + private final String referenceId; + + private final String issuingCountry; + + private final java.util.Map additionalInformation; + + private PaymentMethodParams(PaymentMethodBuilder builder) { + + this.type = builder.type; + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.referenceId = builder.referenceId; + + this.issuingCountry = builder.issuingCountry; + + this.additionalInformation = builder.additionalInformation; + } + + public Type getType() { + return type; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getReferenceId() { + return referenceId; + } + + public String getIssuingCountry() { + return issuingCountry; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.gateway != null) { + + formData.put("gateway", this.gateway); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.issuingCountry != null) { + + formData.put("issuing_country", this.issuingCountry); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentMethodBuilder builder() { + return new PaymentMethodBuilder(); + } + + public static final class PaymentMethodBuilder { + + private Type type; + + private Gateway gateway; + + private String gatewayAccountId; + + private String referenceId; + + private String issuingCountry; + + private java.util.Map additionalInformation; + + private PaymentMethodBuilder() {} + + public PaymentMethodBuilder type(Type value) { + this.type = value; + return this; + } + + @Deprecated + public PaymentMethodBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public PaymentMethodBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentMethodBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public PaymentMethodBuilder issuingCountry(String value) { + this.issuingCountry = value; + return this; + } + + public PaymentMethodBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentMethodParams build() { + return new PaymentMethodParams(this); + } + } + + public enum Type { + CARD("card"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + AMAZON_PAYMENTS("amazon_payments"), + + DIRECT_DEBIT("direct_debit"), + + GENERIC("generic"), + + ALIPAY("alipay"), + + UNIONPAY("unionpay"), + + APPLE_PAY("apple_pay"), + + WECHAT_PAY("wechat_pay"), + + IDEAL("ideal"), + + GOOGLE_PAY("google_pay"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GIROPAY("giropay"), + + DOTPAY("dotpay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + VENMO("venmo"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** 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 Gateway { + 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"), + + GOCARDLESS("gocardless"), + + 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 static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class TransactionParams { + + private final Long amount; + + private final PaymentMethod paymentMethod; + + private final String referenceNumber; + + private final Timestamp date; + + private TransactionParams(TransactionBuilder builder) { + + this.amount = builder.amount; + + this.paymentMethod = builder.paymentMethod; + + this.referenceNumber = builder.referenceNumber; + + this.date = builder.date; + } + + public Long getAmount() { + return amount; + } + + public PaymentMethod getPaymentMethod() { + return paymentMethod; + } + + public String getReferenceNumber() { + return referenceNumber; + } + + public Timestamp getDate() { + return date; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.paymentMethod != null) { + + formData.put("payment_method", this.paymentMethod); + } + + if (this.referenceNumber != null) { + + formData.put("reference_number", this.referenceNumber); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + return formData; + } + + /** Create a new builder for TransactionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionBuilder builder() { + return new TransactionBuilder(); + } + + public static final class TransactionBuilder { + + private Long amount; + + private PaymentMethod paymentMethod; + + private String referenceNumber; + + private Timestamp date; + + private TransactionBuilder() {} + + public TransactionBuilder amount(Long value) { + this.amount = value; + return this; + } + + public TransactionBuilder paymentMethod(PaymentMethod value) { + this.paymentMethod = value; + return this; + } + + public TransactionBuilder referenceNumber(String value) { + this.referenceNumber = value; + return this; + } + + public TransactionBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public TransactionParams build() { + return new TransactionParams(this); + } + } + + public enum PaymentMethod { + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + OTHER("other"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + CUSTOM("custom"), + + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethod enumValue : PaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private final Integer servicePeriodInDays; + + private final OnEvent onEvent; + + private final Boolean chargeOnce; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.servicePeriodInDays = builder.servicePeriodInDays; + + this.onEvent = builder.onEvent; + + this.chargeOnce = builder.chargeOnce; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getServicePeriodInDays() { + return servicePeriodInDays; + } + + public OnEvent getOnEvent() { + return onEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.servicePeriodInDays != null) { + + formData.put("service_period_in_days", this.servicePeriodInDays); + } + + if (this.onEvent != null) { + + formData.put("on_event", this.onEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private Integer servicePeriodInDays; + + private OnEvent onEvent; + + private Boolean chargeOnce; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { + this.servicePeriodInDays = value; + return this; + } + + public EventBasedAddonsBuilder onEvent(OnEvent value) { + this.onEvent = value; + return this; + } + + public EventBasedAddonsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + + public enum OnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** An enum member indicating that OnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (OnEvent enumValue : OnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ChargedEventBasedAddonsParams { + + private final String id; + + private final Timestamp lastChargedAt; + + private ChargedEventBasedAddonsParams(ChargedEventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.lastChargedAt = builder.lastChargedAt; + } + + public String getId() { + return id; + } + + public Timestamp getLastChargedAt() { + return lastChargedAt; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.lastChargedAt != null) { + + formData.put("last_charged_at", this.lastChargedAt); + } + + return formData; + } + + /** Create a new builder for ChargedEventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargedEventBasedAddonsBuilder builder() { + return new ChargedEventBasedAddonsBuilder(); + } + + public static final class ChargedEventBasedAddonsBuilder { + + private String id; + + private Timestamp lastChargedAt; + + private ChargedEventBasedAddonsBuilder() {} + + public ChargedEventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public ChargedEventBasedAddonsBuilder lastChargedAt(Timestamp value) { + this.lastChargedAt = value; + return this; + } + + public ChargedEventBasedAddonsParams build() { + return new ChargedEventBasedAddonsParams(this); + } + } + } + + public static final class CouponsParams { + + private final String couponId; + + private final Timestamp applyTill; + + private CouponsParams(CouponsBuilder builder) { + + this.couponId = builder.couponId; + + this.applyTill = builder.applyTill; + } + + public String getCouponId() { + return couponId; + } + + public Timestamp getApplyTill() { + return applyTill; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.couponId != null) { + + formData.put("coupon_id", this.couponId); + } + + if (this.applyTill != null) { + + formData.put("apply_till", this.applyTill); + } + + return formData; + } + + /** Create a new builder for CouponsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponsBuilder builder() { + return new CouponsBuilder(); + } + + public static final class CouponsBuilder { + + private String couponId; + + private Timestamp applyTill; + + private CouponsBuilder() {} + + public CouponsBuilder couponId(String value) { + this.couponId = value; + return this; + } + + public CouponsBuilder applyTill(Timestamp value) { + this.applyTill = value; + return this; + } + + public CouponsParams build() { + return new CouponsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionAddChargeAtTermEndParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionAddChargeAtTermEndParams.java new file mode 100644 index 00000000..c4a8e0e4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionAddChargeAtTermEndParams.java @@ -0,0 +1,233 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class SubscriptionAddChargeAtTermEndParams { + + private final Long amount; + + private final String description; + + private final String amountInDecimal; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private SubscriptionAddChargeAtTermEndParams(SubscriptionAddChargeAtTermEndBuilder builder) { + + this.amount = builder.amount; + + this.description = builder.description; + + this.amountInDecimal = builder.amountInDecimal; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public Long getAmount() { + return amount; + } + + public String getDescription() { + return description; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for SubscriptionAddChargeAtTermEndParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionAddChargeAtTermEndBuilder builder() { + return new SubscriptionAddChargeAtTermEndBuilder(); + } + + public static final class SubscriptionAddChargeAtTermEndBuilder { + + private Long amount; + + private String description; + + private String amountInDecimal; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private SubscriptionAddChargeAtTermEndBuilder() {} + + public SubscriptionAddChargeAtTermEndBuilder amount(Long value) { + this.amount = value; + return this; + } + + public SubscriptionAddChargeAtTermEndBuilder description(String value) { + this.description = value; + return this; + } + + public SubscriptionAddChargeAtTermEndBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public SubscriptionAddChargeAtTermEndBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public SubscriptionAddChargeAtTermEndBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public SubscriptionAddChargeAtTermEndBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public SubscriptionAddChargeAtTermEndBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public SubscriptionAddChargeAtTermEndBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public SubscriptionAddChargeAtTermEndParams build() { + return new SubscriptionAddChargeAtTermEndParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCancelForItemsParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCancelForItemsParams.java new file mode 100644 index 00000000..ab0c442a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCancelForItemsParams.java @@ -0,0 +1,621 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class SubscriptionCancelForItemsParams { + + private final CancelOption cancelOption; + + private final Boolean endOfTerm; + + private final Timestamp cancelAt; + + private final CreditOptionForCurrentTermCharges creditOptionForCurrentTermCharges; + + private final UnbilledChargesOption unbilledChargesOption; + + private final AccountReceivablesHandling accountReceivablesHandling; + + private final RefundableCreditsHandling refundableCreditsHandling; + + private final ContractTermCancelOption contractTermCancelOption; + + private final Timestamp invoiceDate; + + private final String cancelReasonCode; + + private final List subscriptionItems; + + private SubscriptionCancelForItemsParams(SubscriptionCancelForItemsBuilder builder) { + + this.cancelOption = builder.cancelOption; + + this.endOfTerm = builder.endOfTerm; + + this.cancelAt = builder.cancelAt; + + this.creditOptionForCurrentTermCharges = builder.creditOptionForCurrentTermCharges; + + this.unbilledChargesOption = builder.unbilledChargesOption; + + this.accountReceivablesHandling = builder.accountReceivablesHandling; + + this.refundableCreditsHandling = builder.refundableCreditsHandling; + + this.contractTermCancelOption = builder.contractTermCancelOption; + + this.invoiceDate = builder.invoiceDate; + + this.cancelReasonCode = builder.cancelReasonCode; + + this.subscriptionItems = builder.subscriptionItems; + } + + public CancelOption getCancelOption() { + return cancelOption; + } + + public Boolean getEndOfTerm() { + return endOfTerm; + } + + public Timestamp getCancelAt() { + return cancelAt; + } + + public CreditOptionForCurrentTermCharges getCreditOptionForCurrentTermCharges() { + return creditOptionForCurrentTermCharges; + } + + public UnbilledChargesOption getUnbilledChargesOption() { + return unbilledChargesOption; + } + + public AccountReceivablesHandling getAccountReceivablesHandling() { + return accountReceivablesHandling; + } + + public RefundableCreditsHandling getRefundableCreditsHandling() { + return refundableCreditsHandling; + } + + public ContractTermCancelOption getContractTermCancelOption() { + return contractTermCancelOption; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public String getCancelReasonCode() { + return cancelReasonCode; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.cancelOption != null) { + + formData.put("cancel_option", this.cancelOption); + } + + if (this.endOfTerm != null) { + + formData.put("end_of_term", this.endOfTerm); + } + + if (this.cancelAt != null) { + + formData.put("cancel_at", this.cancelAt); + } + + if (this.creditOptionForCurrentTermCharges != null) { + + formData.put( + "credit_option_for_current_term_charges", this.creditOptionForCurrentTermCharges); + } + + if (this.unbilledChargesOption != null) { + + formData.put("unbilled_charges_option", this.unbilledChargesOption); + } + + if (this.accountReceivablesHandling != null) { + + formData.put("account_receivables_handling", this.accountReceivablesHandling); + } + + if (this.refundableCreditsHandling != null) { + + formData.put("refundable_credits_handling", this.refundableCreditsHandling); + } + + if (this.contractTermCancelOption != null) { + + formData.put("contract_term_cancel_option", this.contractTermCancelOption); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.cancelReasonCode != null) { + + formData.put("cancel_reason_code", this.cancelReasonCode); + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for SubscriptionCancelForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionCancelForItemsBuilder builder() { + return new SubscriptionCancelForItemsBuilder(); + } + + public static final class SubscriptionCancelForItemsBuilder { + + private CancelOption cancelOption; + + private Boolean endOfTerm; + + private Timestamp cancelAt; + + private CreditOptionForCurrentTermCharges creditOptionForCurrentTermCharges; + + private UnbilledChargesOption unbilledChargesOption; + + private AccountReceivablesHandling accountReceivablesHandling; + + private RefundableCreditsHandling refundableCreditsHandling; + + private ContractTermCancelOption contractTermCancelOption; + + private Timestamp invoiceDate; + + private String cancelReasonCode; + + private List subscriptionItems; + + private SubscriptionCancelForItemsBuilder() {} + + public SubscriptionCancelForItemsBuilder cancelOption(CancelOption value) { + this.cancelOption = value; + return this; + } + + public SubscriptionCancelForItemsBuilder endOfTerm(Boolean value) { + this.endOfTerm = value; + return this; + } + + public SubscriptionCancelForItemsBuilder cancelAt(Timestamp value) { + this.cancelAt = value; + return this; + } + + public SubscriptionCancelForItemsBuilder creditOptionForCurrentTermCharges( + CreditOptionForCurrentTermCharges value) { + this.creditOptionForCurrentTermCharges = value; + return this; + } + + public SubscriptionCancelForItemsBuilder unbilledChargesOption(UnbilledChargesOption value) { + this.unbilledChargesOption = value; + return this; + } + + public SubscriptionCancelForItemsBuilder accountReceivablesHandling( + AccountReceivablesHandling value) { + this.accountReceivablesHandling = value; + return this; + } + + public SubscriptionCancelForItemsBuilder refundableCreditsHandling( + RefundableCreditsHandling value) { + this.refundableCreditsHandling = value; + return this; + } + + public SubscriptionCancelForItemsBuilder contractTermCancelOption( + ContractTermCancelOption value) { + this.contractTermCancelOption = value; + return this; + } + + public SubscriptionCancelForItemsBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public SubscriptionCancelForItemsBuilder cancelReasonCode(String value) { + this.cancelReasonCode = value; + return this; + } + + public SubscriptionCancelForItemsBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public SubscriptionCancelForItemsParams build() { + return new SubscriptionCancelForItemsParams(this); + } + } + + public enum CancelOption { + IMMEDIATELY("immediately"), + + END_OF_TERM("end_of_term"), + + SPECIFIC_DATE("specific_date"), + + END_OF_BILLING_TERM("end_of_billing_term"), + + /** An enum member indicating that CancelOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CancelOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CancelOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (CancelOption enumValue : CancelOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum CreditOptionForCurrentTermCharges { + NONE("none"), + + PRORATE("prorate"), + + FULL("full"), + + /** + * An enum member indicating that CreditOptionForCurrentTermCharges was instantiated with an + * unknown value. + */ + _UNKNOWN(null); + private final String value; + + CreditOptionForCurrentTermCharges(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CreditOptionForCurrentTermCharges fromString(String value) { + if (value == null) return _UNKNOWN; + for (CreditOptionForCurrentTermCharges enumValue : + CreditOptionForCurrentTermCharges.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum UnbilledChargesOption { + INVOICE("invoice"), + + DELETE("delete"), + + /** + * An enum member indicating that UnbilledChargesOption was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + UnbilledChargesOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static UnbilledChargesOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (UnbilledChargesOption enumValue : UnbilledChargesOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AccountReceivablesHandling { + NO_ACTION("no_action"), + + SCHEDULE_PAYMENT_COLLECTION("schedule_payment_collection"), + + WRITE_OFF("write_off"), + + /** + * An enum member indicating that AccountReceivablesHandling was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + AccountReceivablesHandling(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AccountReceivablesHandling fromString(String value) { + if (value == null) return _UNKNOWN; + for (AccountReceivablesHandling enumValue : AccountReceivablesHandling.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum RefundableCreditsHandling { + NO_ACTION("no_action"), + + SCHEDULE_REFUND("schedule_refund"), + + /** + * An enum member indicating that RefundableCreditsHandling was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + RefundableCreditsHandling(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static RefundableCreditsHandling fromString(String value) { + if (value == null) return _UNKNOWN; + for (RefundableCreditsHandling enumValue : RefundableCreditsHandling.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ContractTermCancelOption { + TERMINATE_IMMEDIATELY("terminate_immediately"), + + END_OF_CONTRACT_TERM("end_of_contract_term"), + + SPECIFIC_DATE("specific_date"), + + END_OF_SUBSCRIPTION_BILLING_TERM("end_of_subscription_billing_term"), + + /** + * An enum member indicating that ContractTermCancelOption was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + ContractTermCancelOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ContractTermCancelOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ContractTermCancelOption enumValue : ContractTermCancelOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer servicePeriodDays; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.servicePeriodDays = builder.servicePeriodDays; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer servicePeriodDays; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCancelParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCancelParams.java new file mode 100644 index 00000000..90e69519 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCancelParams.java @@ -0,0 +1,577 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class SubscriptionCancelParams { + + private final CancelOption cancelOption; + + private final Boolean endOfTerm; + + private final Timestamp cancelAt; + + private final CreditOptionForCurrentTermCharges creditOptionForCurrentTermCharges; + + private final UnbilledChargesOption unbilledChargesOption; + + private final AccountReceivablesHandling accountReceivablesHandling; + + private final RefundableCreditsHandling refundableCreditsHandling; + + private final ContractTermCancelOption contractTermCancelOption; + + private final Timestamp invoiceDate; + + private final String cancelReasonCode; + + private final List eventBasedAddons; + + private SubscriptionCancelParams(SubscriptionCancelBuilder builder) { + + this.cancelOption = builder.cancelOption; + + this.endOfTerm = builder.endOfTerm; + + this.cancelAt = builder.cancelAt; + + this.creditOptionForCurrentTermCharges = builder.creditOptionForCurrentTermCharges; + + this.unbilledChargesOption = builder.unbilledChargesOption; + + this.accountReceivablesHandling = builder.accountReceivablesHandling; + + this.refundableCreditsHandling = builder.refundableCreditsHandling; + + this.contractTermCancelOption = builder.contractTermCancelOption; + + this.invoiceDate = builder.invoiceDate; + + this.cancelReasonCode = builder.cancelReasonCode; + + this.eventBasedAddons = builder.eventBasedAddons; + } + + public CancelOption getCancelOption() { + return cancelOption; + } + + public Boolean getEndOfTerm() { + return endOfTerm; + } + + public Timestamp getCancelAt() { + return cancelAt; + } + + public CreditOptionForCurrentTermCharges getCreditOptionForCurrentTermCharges() { + return creditOptionForCurrentTermCharges; + } + + public UnbilledChargesOption getUnbilledChargesOption() { + return unbilledChargesOption; + } + + public AccountReceivablesHandling getAccountReceivablesHandling() { + return accountReceivablesHandling; + } + + public RefundableCreditsHandling getRefundableCreditsHandling() { + return refundableCreditsHandling; + } + + public ContractTermCancelOption getContractTermCancelOption() { + return contractTermCancelOption; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public String getCancelReasonCode() { + return cancelReasonCode; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.cancelOption != null) { + + formData.put("cancel_option", this.cancelOption); + } + + if (this.endOfTerm != null) { + + formData.put("end_of_term", this.endOfTerm); + } + + if (this.cancelAt != null) { + + formData.put("cancel_at", this.cancelAt); + } + + if (this.creditOptionForCurrentTermCharges != null) { + + formData.put( + "credit_option_for_current_term_charges", this.creditOptionForCurrentTermCharges); + } + + if (this.unbilledChargesOption != null) { + + formData.put("unbilled_charges_option", this.unbilledChargesOption); + } + + if (this.accountReceivablesHandling != null) { + + formData.put("account_receivables_handling", this.accountReceivablesHandling); + } + + if (this.refundableCreditsHandling != null) { + + formData.put("refundable_credits_handling", this.refundableCreditsHandling); + } + + if (this.contractTermCancelOption != null) { + + formData.put("contract_term_cancel_option", this.contractTermCancelOption); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.cancelReasonCode != null) { + + formData.put("cancel_reason_code", this.cancelReasonCode); + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for SubscriptionCancelParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionCancelBuilder builder() { + return new SubscriptionCancelBuilder(); + } + + public static final class SubscriptionCancelBuilder { + + private CancelOption cancelOption; + + private Boolean endOfTerm; + + private Timestamp cancelAt; + + private CreditOptionForCurrentTermCharges creditOptionForCurrentTermCharges; + + private UnbilledChargesOption unbilledChargesOption; + + private AccountReceivablesHandling accountReceivablesHandling; + + private RefundableCreditsHandling refundableCreditsHandling; + + private ContractTermCancelOption contractTermCancelOption; + + private Timestamp invoiceDate; + + private String cancelReasonCode; + + private List eventBasedAddons; + + private SubscriptionCancelBuilder() {} + + public SubscriptionCancelBuilder cancelOption(CancelOption value) { + this.cancelOption = value; + return this; + } + + public SubscriptionCancelBuilder endOfTerm(Boolean value) { + this.endOfTerm = value; + return this; + } + + public SubscriptionCancelBuilder cancelAt(Timestamp value) { + this.cancelAt = value; + return this; + } + + public SubscriptionCancelBuilder creditOptionForCurrentTermCharges( + CreditOptionForCurrentTermCharges value) { + this.creditOptionForCurrentTermCharges = value; + return this; + } + + public SubscriptionCancelBuilder unbilledChargesOption(UnbilledChargesOption value) { + this.unbilledChargesOption = value; + return this; + } + + public SubscriptionCancelBuilder accountReceivablesHandling(AccountReceivablesHandling value) { + this.accountReceivablesHandling = value; + return this; + } + + public SubscriptionCancelBuilder refundableCreditsHandling(RefundableCreditsHandling value) { + this.refundableCreditsHandling = value; + return this; + } + + public SubscriptionCancelBuilder contractTermCancelOption(ContractTermCancelOption value) { + this.contractTermCancelOption = value; + return this; + } + + public SubscriptionCancelBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public SubscriptionCancelBuilder cancelReasonCode(String value) { + this.cancelReasonCode = value; + return this; + } + + public SubscriptionCancelBuilder eventBasedAddons(List value) { + this.eventBasedAddons = value; + return this; + } + + public SubscriptionCancelParams build() { + return new SubscriptionCancelParams(this); + } + } + + public enum CancelOption { + IMMEDIATELY("immediately"), + + END_OF_TERM("end_of_term"), + + SPECIFIC_DATE("specific_date"), + + END_OF_BILLING_TERM("end_of_billing_term"), + + /** An enum member indicating that CancelOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CancelOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CancelOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (CancelOption enumValue : CancelOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum CreditOptionForCurrentTermCharges { + NONE("none"), + + PRORATE("prorate"), + + FULL("full"), + + /** + * An enum member indicating that CreditOptionForCurrentTermCharges was instantiated with an + * unknown value. + */ + _UNKNOWN(null); + private final String value; + + CreditOptionForCurrentTermCharges(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CreditOptionForCurrentTermCharges fromString(String value) { + if (value == null) return _UNKNOWN; + for (CreditOptionForCurrentTermCharges enumValue : + CreditOptionForCurrentTermCharges.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum UnbilledChargesOption { + INVOICE("invoice"), + + DELETE("delete"), + + /** + * An enum member indicating that UnbilledChargesOption was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + UnbilledChargesOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static UnbilledChargesOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (UnbilledChargesOption enumValue : UnbilledChargesOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AccountReceivablesHandling { + NO_ACTION("no_action"), + + SCHEDULE_PAYMENT_COLLECTION("schedule_payment_collection"), + + WRITE_OFF("write_off"), + + /** + * An enum member indicating that AccountReceivablesHandling was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + AccountReceivablesHandling(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AccountReceivablesHandling fromString(String value) { + if (value == null) return _UNKNOWN; + for (AccountReceivablesHandling enumValue : AccountReceivablesHandling.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum RefundableCreditsHandling { + NO_ACTION("no_action"), + + SCHEDULE_REFUND("schedule_refund"), + + /** + * An enum member indicating that RefundableCreditsHandling was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + RefundableCreditsHandling(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static RefundableCreditsHandling fromString(String value) { + if (value == null) return _UNKNOWN; + for (RefundableCreditsHandling enumValue : RefundableCreditsHandling.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ContractTermCancelOption { + TERMINATE_IMMEDIATELY("terminate_immediately"), + + END_OF_CONTRACT_TERM("end_of_contract_term"), + + SPECIFIC_DATE("specific_date"), + + END_OF_SUBSCRIPTION_BILLING_TERM("end_of_subscription_billing_term"), + + /** + * An enum member indicating that ContractTermCancelOption was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + ContractTermCancelOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ContractTermCancelOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ContractTermCancelOption enumValue : ContractTermCancelOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final Integer servicePeriodInDays; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.servicePeriodInDays = builder.servicePeriodInDays; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public Integer getServicePeriodInDays() { + return servicePeriodInDays; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.servicePeriodInDays != null) { + + formData.put("service_period_in_days", this.servicePeriodInDays); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private Integer servicePeriodInDays; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { + this.servicePeriodInDays = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionChangeTermEndParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionChangeTermEndParams.java new file mode 100644 index 00000000..f3ef252a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionChangeTermEndParams.java @@ -0,0 +1,101 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class SubscriptionChangeTermEndParams { + + private final Timestamp termEndsAt; + + private final Boolean prorate; + + private final Boolean invoiceImmediately; + + private SubscriptionChangeTermEndParams(SubscriptionChangeTermEndBuilder builder) { + + this.termEndsAt = builder.termEndsAt; + + this.prorate = builder.prorate; + + this.invoiceImmediately = builder.invoiceImmediately; + } + + public Timestamp getTermEndsAt() { + return termEndsAt; + } + + public Boolean getProrate() { + return prorate; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.termEndsAt != null) { + + formData.put("term_ends_at", this.termEndsAt); + } + + if (this.prorate != null) { + + formData.put("prorate", this.prorate); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + return formData; + } + + /** Create a new builder for SubscriptionChangeTermEndParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionChangeTermEndBuilder builder() { + return new SubscriptionChangeTermEndBuilder(); + } + + public static final class SubscriptionChangeTermEndBuilder { + + private Timestamp termEndsAt; + + private Boolean prorate; + + private Boolean invoiceImmediately; + + private SubscriptionChangeTermEndBuilder() {} + + public SubscriptionChangeTermEndBuilder termEndsAt(Timestamp value) { + this.termEndsAt = value; + return this; + } + + public SubscriptionChangeTermEndBuilder prorate(Boolean value) { + this.prorate = value; + return this; + } + + public SubscriptionChangeTermEndBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public SubscriptionChangeTermEndParams build() { + return new SubscriptionChangeTermEndParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionChargeAddonAtTermEndParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionChargeAddonAtTermEndParams.java new file mode 100644 index 00000000..de9dd9d4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionChargeAddonAtTermEndParams.java @@ -0,0 +1,181 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class SubscriptionChargeAddonAtTermEndParams { + + private final String addonId; + + private final Integer addonQuantity; + + private final Long addonUnitPrice; + + private final String addonQuantityInDecimal; + + private final String addonUnitPriceInDecimal; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private SubscriptionChargeAddonAtTermEndParams(SubscriptionChargeAddonAtTermEndBuilder builder) { + + this.addonId = builder.addonId; + + this.addonQuantity = builder.addonQuantity; + + this.addonUnitPrice = builder.addonUnitPrice; + + this.addonQuantityInDecimal = builder.addonQuantityInDecimal; + + this.addonUnitPriceInDecimal = builder.addonUnitPriceInDecimal; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public String getAddonId() { + return addonId; + } + + public Integer getAddonQuantity() { + return addonQuantity; + } + + public Long getAddonUnitPrice() { + return addonUnitPrice; + } + + public String getAddonQuantityInDecimal() { + return addonQuantityInDecimal; + } + + public String getAddonUnitPriceInDecimal() { + return addonUnitPriceInDecimal; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.addonId != null) { + + formData.put("addon_id", this.addonId); + } + + if (this.addonQuantity != null) { + + formData.put("addon_quantity", this.addonQuantity); + } + + if (this.addonUnitPrice != null) { + + formData.put("addon_unit_price", this.addonUnitPrice); + } + + if (this.addonQuantityInDecimal != null) { + + formData.put("addon_quantity_in_decimal", this.addonQuantityInDecimal); + } + + if (this.addonUnitPriceInDecimal != null) { + + formData.put("addon_unit_price_in_decimal", this.addonUnitPriceInDecimal); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for SubscriptionChargeAddonAtTermEndParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionChargeAddonAtTermEndBuilder builder() { + return new SubscriptionChargeAddonAtTermEndBuilder(); + } + + public static final class SubscriptionChargeAddonAtTermEndBuilder { + + private String addonId; + + private Integer addonQuantity; + + private Long addonUnitPrice; + + private String addonQuantityInDecimal; + + private String addonUnitPriceInDecimal; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private SubscriptionChargeAddonAtTermEndBuilder() {} + + public SubscriptionChargeAddonAtTermEndBuilder addonId(String value) { + this.addonId = value; + return this; + } + + public SubscriptionChargeAddonAtTermEndBuilder addonQuantity(Integer value) { + this.addonQuantity = value; + return this; + } + + public SubscriptionChargeAddonAtTermEndBuilder addonUnitPrice(Long value) { + this.addonUnitPrice = value; + return this; + } + + public SubscriptionChargeAddonAtTermEndBuilder addonQuantityInDecimal(String value) { + this.addonQuantityInDecimal = value; + return this; + } + + public SubscriptionChargeAddonAtTermEndBuilder addonUnitPriceInDecimal(String value) { + this.addonUnitPriceInDecimal = value; + return this; + } + + public SubscriptionChargeAddonAtTermEndBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public SubscriptionChargeAddonAtTermEndBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public SubscriptionChargeAddonAtTermEndParams build() { + return new SubscriptionChargeAddonAtTermEndParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionChargeFutureRenewalsParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionChargeFutureRenewalsParams.java new file mode 100644 index 00000000..19b281c1 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionChargeFutureRenewalsParams.java @@ -0,0 +1,395 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class SubscriptionChargeFutureRenewalsParams { + + private final Integer termsToCharge; + + private final Boolean invoiceImmediately; + + private final ScheduleType scheduleType; + + private final FixedIntervalScheduleParams fixedIntervalSchedule; + + private final List specificDatesSchedule; + + private SubscriptionChargeFutureRenewalsParams(SubscriptionChargeFutureRenewalsBuilder builder) { + + this.termsToCharge = builder.termsToCharge; + + this.invoiceImmediately = builder.invoiceImmediately; + + this.scheduleType = builder.scheduleType; + + this.fixedIntervalSchedule = builder.fixedIntervalSchedule; + + this.specificDatesSchedule = builder.specificDatesSchedule; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + public ScheduleType getScheduleType() { + return scheduleType; + } + + public FixedIntervalScheduleParams getFixedIntervalSchedule() { + return fixedIntervalSchedule; + } + + public List getSpecificDatesSchedule() { + return specificDatesSchedule; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + if (this.scheduleType != null) { + + formData.put("schedule_type", this.scheduleType); + } + + if (this.fixedIntervalSchedule != null) { + + // Single object + Map nestedData = this.fixedIntervalSchedule.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "fixed_interval_schedule[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.specificDatesSchedule != null) { + + // List of objects + for (int i = 0; i < this.specificDatesSchedule.size(); i++) { + SpecificDatesScheduleParams item = this.specificDatesSchedule.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "specific_dates_schedule[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for SubscriptionChargeFutureRenewalsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionChargeFutureRenewalsBuilder builder() { + return new SubscriptionChargeFutureRenewalsBuilder(); + } + + public static final class SubscriptionChargeFutureRenewalsBuilder { + + private Integer termsToCharge; + + private Boolean invoiceImmediately; + + private ScheduleType scheduleType; + + private FixedIntervalScheduleParams fixedIntervalSchedule; + + private List specificDatesSchedule; + + private SubscriptionChargeFutureRenewalsBuilder() {} + + public SubscriptionChargeFutureRenewalsBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public SubscriptionChargeFutureRenewalsBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public SubscriptionChargeFutureRenewalsBuilder scheduleType(ScheduleType value) { + this.scheduleType = value; + return this; + } + + public SubscriptionChargeFutureRenewalsBuilder fixedIntervalSchedule( + FixedIntervalScheduleParams value) { + this.fixedIntervalSchedule = value; + return this; + } + + public SubscriptionChargeFutureRenewalsBuilder specificDatesSchedule( + List value) { + this.specificDatesSchedule = value; + return this; + } + + public SubscriptionChargeFutureRenewalsParams build() { + return new SubscriptionChargeFutureRenewalsParams(this); + } + } + + public enum ScheduleType { + IMMEDIATE("immediate"), + + SPECIFIC_DATES("specific_dates"), + + FIXED_INTERVALS("fixed_intervals"), + + /** An enum member indicating that ScheduleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ScheduleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ScheduleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ScheduleType enumValue : ScheduleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class FixedIntervalScheduleParams { + + private final Integer numberOfOccurrences; + + private final Integer daysBeforeRenewal; + + private final EndScheduleOn endScheduleOn; + + private final Timestamp endDate; + + private FixedIntervalScheduleParams(FixedIntervalScheduleBuilder builder) { + + this.numberOfOccurrences = builder.numberOfOccurrences; + + this.daysBeforeRenewal = builder.daysBeforeRenewal; + + this.endScheduleOn = builder.endScheduleOn; + + this.endDate = builder.endDate; + } + + public Integer getNumberOfOccurrences() { + return numberOfOccurrences; + } + + public Integer getDaysBeforeRenewal() { + return daysBeforeRenewal; + } + + public EndScheduleOn getEndScheduleOn() { + return endScheduleOn; + } + + public Timestamp getEndDate() { + return endDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.numberOfOccurrences != null) { + + formData.put("number_of_occurrences", this.numberOfOccurrences); + } + + if (this.daysBeforeRenewal != null) { + + formData.put("days_before_renewal", this.daysBeforeRenewal); + } + + if (this.endScheduleOn != null) { + + formData.put("end_schedule_on", this.endScheduleOn); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + return formData; + } + + /** Create a new builder for FixedIntervalScheduleParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static FixedIntervalScheduleBuilder builder() { + return new FixedIntervalScheduleBuilder(); + } + + public static final class FixedIntervalScheduleBuilder { + + private Integer numberOfOccurrences; + + private Integer daysBeforeRenewal; + + private EndScheduleOn endScheduleOn; + + private Timestamp endDate; + + private FixedIntervalScheduleBuilder() {} + + public FixedIntervalScheduleBuilder numberOfOccurrences(Integer value) { + this.numberOfOccurrences = value; + return this; + } + + public FixedIntervalScheduleBuilder daysBeforeRenewal(Integer value) { + this.daysBeforeRenewal = value; + return this; + } + + public FixedIntervalScheduleBuilder endScheduleOn(EndScheduleOn value) { + this.endScheduleOn = value; + return this; + } + + public FixedIntervalScheduleBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public FixedIntervalScheduleParams build() { + return new FixedIntervalScheduleParams(this); + } + } + + public enum EndScheduleOn { + AFTER_NUMBER_OF_INTERVALS("after_number_of_intervals"), + + SPECIFIC_DATE("specific_date"), + + SUBSCRIPTION_END("subscription_end"), + + /** An enum member indicating that EndScheduleOn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EndScheduleOn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EndScheduleOn fromString(String value) { + if (value == null) return _UNKNOWN; + for (EndScheduleOn enumValue : EndScheduleOn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class SpecificDatesScheduleParams { + + private final Integer termsToCharge; + + private final Timestamp date; + + private SpecificDatesScheduleParams(SpecificDatesScheduleBuilder builder) { + + this.termsToCharge = builder.termsToCharge; + + this.date = builder.date; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Timestamp getDate() { + return date; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + return formData; + } + + /** Create a new builder for SpecificDatesScheduleParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SpecificDatesScheduleBuilder builder() { + return new SpecificDatesScheduleBuilder(); + } + + public static final class SpecificDatesScheduleBuilder { + + private Integer termsToCharge; + + private Timestamp date; + + private SpecificDatesScheduleBuilder() {} + + public SpecificDatesScheduleBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public SpecificDatesScheduleBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public SpecificDatesScheduleParams build() { + return new SpecificDatesScheduleParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateForCustomerParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateForCustomerParams.java new file mode 100644 index 00000000..a6afa4ab --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateForCustomerParams.java @@ -0,0 +1,2331 @@ +/* + * 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.subscription.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 SubscriptionCreateForCustomerParams { + + private final String id; + + private final String planId; + + private final Integer planQuantity; + + private final String planQuantityInDecimal; + + private final Long planUnitPrice; + + private final String planUnitPriceInDecimal; + + private final Long setupFee; + + private final Timestamp trialEnd; + + private final Integer billingCycles; + + private final List mandatoryAddonsToRemove; + + private final Timestamp startDate; + + private final String coupon; + + private final AutoCollection autoCollection; + + private final Integer termsToCharge; + + private final BillingAlignmentMode billingAlignmentMode; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final String poNumber; + + private final List couponIds; + + private final String paymentSourceId; + + private final Boolean overrideRelationship; + + private final String invoiceNotes; + + private final Timestamp invoiceDate; + + private final java.util.Map metaData; + + private final Boolean invoiceImmediately; + + private final Boolean replacePrimaryPaymentSource; + + private final Integer freePeriod; + + private final FreePeriodUnit freePeriodUnit; + + private final Integer contractTermBillingCycleOnRenewal; + + private final TrialEndAction trialEndAction; + + private final PaymentInitiator paymentInitiator; + + private final ShippingAddressParams shippingAddress; + + private final StatementDescriptorParams statementDescriptor; + + private final PaymentIntentParams paymentIntent; + + private final ContractTermParams contractTerm; + + private final List addons; + + private final List eventBasedAddons; + + private final List coupons; + + private final Map customFields; + + private SubscriptionCreateForCustomerParams(SubscriptionCreateForCustomerBuilder builder) { + + this.id = builder.id; + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + + this.planUnitPrice = builder.planUnitPrice; + + this.planUnitPriceInDecimal = builder.planUnitPriceInDecimal; + + this.setupFee = builder.setupFee; + + this.trialEnd = builder.trialEnd; + + this.billingCycles = builder.billingCycles; + + this.mandatoryAddonsToRemove = builder.mandatoryAddonsToRemove; + + this.startDate = builder.startDate; + + this.coupon = builder.coupon; + + this.autoCollection = builder.autoCollection; + + this.termsToCharge = builder.termsToCharge; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.poNumber = builder.poNumber; + + this.couponIds = builder.couponIds; + + this.paymentSourceId = builder.paymentSourceId; + + this.overrideRelationship = builder.overrideRelationship; + + this.invoiceNotes = builder.invoiceNotes; + + this.invoiceDate = builder.invoiceDate; + + this.metaData = builder.metaData; + + this.invoiceImmediately = builder.invoiceImmediately; + + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; + + this.freePeriod = builder.freePeriod; + + this.freePeriodUnit = builder.freePeriodUnit; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + + this.trialEndAction = builder.trialEndAction; + + this.paymentInitiator = builder.paymentInitiator; + + this.shippingAddress = builder.shippingAddress; + + this.statementDescriptor = builder.statementDescriptor; + + this.paymentIntent = builder.paymentIntent; + + this.contractTerm = builder.contractTerm; + + this.addons = builder.addons; + + this.eventBasedAddons = builder.eventBasedAddons; + + this.coupons = builder.coupons; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getId() { + return id; + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + public Long getPlanUnitPrice() { + return planUnitPrice; + } + + public String getPlanUnitPriceInDecimal() { + return planUnitPriceInDecimal; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public List getMandatoryAddonsToRemove() { + return mandatoryAddonsToRemove; + } + + public Timestamp getStartDate() { + return startDate; + } + + public String getCoupon() { + return coupon; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public String getPoNumber() { + return poNumber; + } + + public List getCouponIds() { + return couponIds; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public Boolean getOverrideRelationship() { + return overrideRelationship; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public java.util.Map getMetaData() { + return metaData; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + public Boolean getReplacePrimaryPaymentSource() { + return replacePrimaryPaymentSource; + } + + public Integer getFreePeriod() { + return freePeriod; + } + + public FreePeriodUnit getFreePeriodUnit() { + return freePeriodUnit; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + public TrialEndAction getTrialEndAction() { + return trialEndAction; + } + + public PaymentInitiator getPaymentInitiator() { + return paymentInitiator; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public StatementDescriptorParams getStatementDescriptor() { + return statementDescriptor; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getAddons() { + return addons; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + public List getCoupons() { + return coupons; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + if (this.planUnitPrice != null) { + + formData.put("plan_unit_price", this.planUnitPrice); + } + + if (this.planUnitPriceInDecimal != null) { + + formData.put("plan_unit_price_in_decimal", this.planUnitPriceInDecimal); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.mandatoryAddonsToRemove != null) { + + formData.put("mandatory_addons_to_remove", this.mandatoryAddonsToRemove); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.overrideRelationship != null) { + + formData.put("override_relationship", this.overrideRelationship); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + if (this.replacePrimaryPaymentSource != null) { + + formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); + } + + if (this.freePeriod != null) { + + formData.put("free_period", this.freePeriod); + } + + if (this.freePeriodUnit != null) { + + formData.put("free_period_unit", this.freePeriodUnit); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + if (this.trialEndAction != null) { + + formData.put("trial_end_action", this.trialEndAction); + } + + if (this.paymentInitiator != null) { + + formData.put("payment_initiator", this.paymentInitiator); + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.statementDescriptor != null) { + + // Single object + Map nestedData = this.statementDescriptor.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.coupons != null) { + + // List of objects + for (int i = 0; i < this.coupons.size(); i++) { + CouponsParams item = this.coupons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for SubscriptionCreateForCustomerParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionCreateForCustomerBuilder builder() { + return new SubscriptionCreateForCustomerBuilder(); + } + + public static final class SubscriptionCreateForCustomerBuilder { + + private String id; + + private String planId; + + private Integer planQuantity; + + private String planQuantityInDecimal; + + private Long planUnitPrice; + + private String planUnitPriceInDecimal; + + private Long setupFee; + + private Timestamp trialEnd; + + private Integer billingCycles; + + private List mandatoryAddonsToRemove; + + private Timestamp startDate; + + private String coupon; + + private AutoCollection autoCollection; + + private Integer termsToCharge; + + private BillingAlignmentMode billingAlignmentMode; + + private OfflinePaymentMethod offlinePaymentMethod; + + private String poNumber; + + private List couponIds; + + private String paymentSourceId; + + private Boolean overrideRelationship; + + private String invoiceNotes; + + private Timestamp invoiceDate; + + private java.util.Map metaData; + + private Boolean invoiceImmediately; + + private Boolean replacePrimaryPaymentSource; + + private Integer freePeriod; + + private FreePeriodUnit freePeriodUnit; + + private Integer contractTermBillingCycleOnRenewal; + + private TrialEndAction trialEndAction; + + private PaymentInitiator paymentInitiator; + + private ShippingAddressParams shippingAddress; + + private StatementDescriptorParams statementDescriptor; + + private PaymentIntentParams paymentIntent; + + private ContractTermParams contractTerm; + + private List addons; + + private List eventBasedAddons; + + private List coupons; + + private Map customFields = new LinkedHashMap<>(); + + private SubscriptionCreateForCustomerBuilder() {} + + public SubscriptionCreateForCustomerBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder planId(String value) { + this.planId = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder planUnitPrice(Long value) { + this.planUnitPrice = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder planUnitPriceInDecimal(String value) { + this.planUnitPriceInDecimal = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder mandatoryAddonsToRemove(List value) { + this.mandatoryAddonsToRemove = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + @Deprecated + public SubscriptionCreateForCustomerBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder billingAlignmentMode(BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder overrideRelationship(Boolean value) { + this.overrideRelationship = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder replacePrimaryPaymentSource(Boolean value) { + this.replacePrimaryPaymentSource = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder freePeriod(Integer value) { + this.freePeriod = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder freePeriodUnit(FreePeriodUnit value) { + this.freePeriodUnit = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder trialEndAction(TrialEndAction value) { + this.trialEndAction = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder paymentInitiator(PaymentInitiator value) { + this.paymentInitiator = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder statementDescriptor( + StatementDescriptorParams value) { + this.statementDescriptor = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder addons(List value) { + this.addons = value; + return this; + } + + public SubscriptionCreateForCustomerBuilder eventBasedAddons( + List value) { + this.eventBasedAddons = value; + return this; + } + + @Deprecated + public SubscriptionCreateForCustomerBuilder coupons(List value) { + this.coupons = 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 SubscriptionCreateForCustomerBuilder 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 SubscriptionCreateForCustomerBuilder 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 SubscriptionCreateForCustomerParams build() { + return new SubscriptionCreateForCustomerParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum FreePeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + FreePeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static FreePeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialEndAction { + SITE_DEFAULT("site_default"), + + PLAN_DEFAULT("plan_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialEndAction enumValue : TrialEndAction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PaymentInitiator { + CUSTOMER("customer"), + + MERCHANT("merchant"), + + /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentInitiator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentInitiator fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentInitiator enumValue : PaymentInitiator.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class StatementDescriptorParams { + + private final String descriptor; + + private StatementDescriptorParams(StatementDescriptorBuilder builder) { + + this.descriptor = builder.descriptor; + } + + public String getDescriptor() { + return descriptor; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.descriptor != null) { + + formData.put("descriptor", this.descriptor); + } + + return formData; + } + + /** Create a new builder for StatementDescriptorParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatementDescriptorBuilder builder() { + return new StatementDescriptorBuilder(); + } + + public static final class StatementDescriptorBuilder { + + private String descriptor; + + private StatementDescriptorBuilder() {} + + public StatementDescriptorBuilder descriptor(String value) { + this.descriptor = value; + return this; + } + + public StatementDescriptorParams build() { + return new StatementDescriptorParams(this); + } + } + } + + public static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AddonsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private final Integer servicePeriodInDays; + + private final OnEvent onEvent; + + private final Boolean chargeOnce; + + private final ChargeOn chargeOn; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.servicePeriodInDays = builder.servicePeriodInDays; + + this.onEvent = builder.onEvent; + + this.chargeOnce = builder.chargeOnce; + + this.chargeOn = builder.chargeOn; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getServicePeriodInDays() { + return servicePeriodInDays; + } + + public OnEvent getOnEvent() { + return onEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ChargeOn getChargeOn() { + return chargeOn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.servicePeriodInDays != null) { + + formData.put("service_period_in_days", this.servicePeriodInDays); + } + + if (this.onEvent != null) { + + formData.put("on_event", this.onEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.chargeOn != null) { + + formData.put("charge_on", this.chargeOn); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private Integer servicePeriodInDays; + + private OnEvent onEvent; + + private Boolean chargeOnce; + + private ChargeOn chargeOn; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { + this.servicePeriodInDays = value; + return this; + } + + public EventBasedAddonsBuilder onEvent(OnEvent value) { + this.onEvent = value; + return this; + } + + public EventBasedAddonsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public EventBasedAddonsBuilder chargeOn(ChargeOn value) { + this.chargeOn = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + + public enum OnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** An enum member indicating that OnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (OnEvent enumValue : OnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChargeOn { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOn fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOn enumValue : ChargeOn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CouponsParams { + + private final String couponId; + + private final Timestamp applyTill; + + private CouponsParams(CouponsBuilder builder) { + + this.couponId = builder.couponId; + + this.applyTill = builder.applyTill; + } + + public String getCouponId() { + return couponId; + } + + public Timestamp getApplyTill() { + return applyTill; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.couponId != null) { + + formData.put("coupon_id", this.couponId); + } + + if (this.applyTill != null) { + + formData.put("apply_till", this.applyTill); + } + + return formData; + } + + /** Create a new builder for CouponsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponsBuilder builder() { + return new CouponsBuilder(); + } + + public static final class CouponsBuilder { + + private String couponId; + + private Timestamp applyTill; + + private CouponsBuilder() {} + + public CouponsBuilder couponId(String value) { + this.couponId = value; + return this; + } + + public CouponsBuilder applyTill(Timestamp value) { + this.applyTill = value; + return this; + } + + public CouponsParams build() { + return new CouponsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateParams.java new file mode 100644 index 00000000..1caaf068 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateParams.java @@ -0,0 +1,5306 @@ +/* + * 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.subscription.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 SubscriptionCreateParams { + + private final String id; + + private final String planId; + + private final Integer planQuantity; + + private final String planQuantityInDecimal; + + private final Long planUnitPrice; + + private final String planUnitPriceInDecimal; + + private final Long setupFee; + + private final Timestamp trialEnd; + + private final Integer billingCycles; + + private final List mandatoryAddonsToRemove; + + private final Timestamp startDate; + + private final String coupon; + + private final AutoCollection autoCollection; + + private final Integer termsToCharge; + + private final BillingAlignmentMode billingAlignmentMode; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final String poNumber; + + private final List couponIds; + + private final String tokenId; + + private final String affiliateToken; + + private final String createdFromIp; + + private final String invoiceNotes; + + private final Timestamp invoiceDate; + + private final java.util.Map metaData; + + private final Boolean invoiceImmediately; + + private final Integer freePeriod; + + private final FreePeriodUnit freePeriodUnit; + + private final Integer contractTermBillingCycleOnRenewal; + + private final TrialEndAction trialEndAction; + + private final String clientProfileId; + + private final PaymentInitiator paymentInitiator; + + private final CustomerParams customer; + + private final CardParams card; + + private final BankAccountParams bankAccount; + + private final PaymentMethodParams paymentMethod; + + private final PaymentIntentParams paymentIntent; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final StatementDescriptorParams statementDescriptor; + + private final ContractTermParams contractTerm; + + private final List entityIdentifiers; + + private final List taxProvidersFields; + + private final List addons; + + private final List eventBasedAddons; + + private final List coupons; + + private final Map customFields; + + private SubscriptionCreateParams(SubscriptionCreateBuilder builder) { + + this.id = builder.id; + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + + this.planUnitPrice = builder.planUnitPrice; + + this.planUnitPriceInDecimal = builder.planUnitPriceInDecimal; + + this.setupFee = builder.setupFee; + + this.trialEnd = builder.trialEnd; + + this.billingCycles = builder.billingCycles; + + this.mandatoryAddonsToRemove = builder.mandatoryAddonsToRemove; + + this.startDate = builder.startDate; + + this.coupon = builder.coupon; + + this.autoCollection = builder.autoCollection; + + this.termsToCharge = builder.termsToCharge; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.poNumber = builder.poNumber; + + this.couponIds = builder.couponIds; + + this.tokenId = builder.tokenId; + + this.affiliateToken = builder.affiliateToken; + + this.createdFromIp = builder.createdFromIp; + + this.invoiceNotes = builder.invoiceNotes; + + this.invoiceDate = builder.invoiceDate; + + this.metaData = builder.metaData; + + this.invoiceImmediately = builder.invoiceImmediately; + + this.freePeriod = builder.freePeriod; + + this.freePeriodUnit = builder.freePeriodUnit; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + + this.trialEndAction = builder.trialEndAction; + + this.clientProfileId = builder.clientProfileId; + + this.paymentInitiator = builder.paymentInitiator; + + this.customer = builder.customer; + + this.card = builder.card; + + this.bankAccount = builder.bankAccount; + + this.paymentMethod = builder.paymentMethod; + + this.paymentIntent = builder.paymentIntent; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.statementDescriptor = builder.statementDescriptor; + + this.contractTerm = builder.contractTerm; + + this.entityIdentifiers = builder.entityIdentifiers; + + this.taxProvidersFields = builder.taxProvidersFields; + + this.addons = builder.addons; + + this.eventBasedAddons = builder.eventBasedAddons; + + this.coupons = builder.coupons; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getId() { + return id; + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + public Long getPlanUnitPrice() { + return planUnitPrice; + } + + public String getPlanUnitPriceInDecimal() { + return planUnitPriceInDecimal; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public List getMandatoryAddonsToRemove() { + return mandatoryAddonsToRemove; + } + + public Timestamp getStartDate() { + return startDate; + } + + public String getCoupon() { + return coupon; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public String getPoNumber() { + return poNumber; + } + + public List getCouponIds() { + return couponIds; + } + + public String getTokenId() { + return tokenId; + } + + public String getAffiliateToken() { + return affiliateToken; + } + + public String getCreatedFromIp() { + return createdFromIp; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public java.util.Map getMetaData() { + return metaData; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + public Integer getFreePeriod() { + return freePeriod; + } + + public FreePeriodUnit getFreePeriodUnit() { + return freePeriodUnit; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + public TrialEndAction getTrialEndAction() { + return trialEndAction; + } + + public String getClientProfileId() { + return clientProfileId; + } + + public PaymentInitiator getPaymentInitiator() { + return paymentInitiator; + } + + public CustomerParams getCustomer() { + return customer; + } + + public CardParams getCard() { + return card; + } + + public BankAccountParams getBankAccount() { + return bankAccount; + } + + public PaymentMethodParams getPaymentMethod() { + return paymentMethod; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public StatementDescriptorParams getStatementDescriptor() { + return statementDescriptor; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getEntityIdentifiers() { + return entityIdentifiers; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + public List getAddons() { + return addons; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + public List getCoupons() { + return coupons; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + if (this.planUnitPrice != null) { + + formData.put("plan_unit_price", this.planUnitPrice); + } + + if (this.planUnitPriceInDecimal != null) { + + formData.put("plan_unit_price_in_decimal", this.planUnitPriceInDecimal); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.mandatoryAddonsToRemove != null) { + + formData.put("mandatory_addons_to_remove", this.mandatoryAddonsToRemove); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.tokenId != null) { + + formData.put("token_id", this.tokenId); + } + + if (this.affiliateToken != null) { + + formData.put("affiliate_token", this.affiliateToken); + } + + if (this.createdFromIp != null) { + + formData.put("created_from_ip", this.createdFromIp); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + if (this.freePeriod != null) { + + formData.put("free_period", this.freePeriod); + } + + if (this.freePeriodUnit != null) { + + formData.put("free_period_unit", this.freePeriodUnit); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + if (this.trialEndAction != null) { + + formData.put("trial_end_action", this.trialEndAction); + } + + if (this.clientProfileId != null) { + + formData.put("client_profile_id", this.clientProfileId); + } + + if (this.paymentInitiator != null) { + + formData.put("payment_initiator", this.paymentInitiator); + } + + 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()); + } + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.bankAccount != null) { + + // Single object + Map nestedData = this.bankAccount.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "bank_account[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentMethod != null) { + + // Single object + Map nestedData = this.paymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.statementDescriptor != null) { + + // Single object + Map nestedData = this.statementDescriptor.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.entityIdentifiers != null) { + + // List of objects + for (int i = 0; i < this.entityIdentifiers.size(); i++) { + EntityIdentifiersParams item = this.entityIdentifiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "entity_identifiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.coupons != null) { + + // List of objects + for (int i = 0; i < this.coupons.size(); i++) { + CouponsParams item = this.coupons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for SubscriptionCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionCreateBuilder builder() { + return new SubscriptionCreateBuilder(); + } + + public static final class SubscriptionCreateBuilder { + + private String id; + + private String planId; + + private Integer planQuantity; + + private String planQuantityInDecimal; + + private Long planUnitPrice; + + private String planUnitPriceInDecimal; + + private Long setupFee; + + private Timestamp trialEnd; + + private Integer billingCycles; + + private List mandatoryAddonsToRemove; + + private Timestamp startDate; + + private String coupon; + + private AutoCollection autoCollection; + + private Integer termsToCharge; + + private BillingAlignmentMode billingAlignmentMode; + + private OfflinePaymentMethod offlinePaymentMethod; + + private String poNumber; + + private List couponIds; + + private String tokenId; + + private String affiliateToken; + + private String createdFromIp; + + private String invoiceNotes; + + private Timestamp invoiceDate; + + private java.util.Map metaData; + + private Boolean invoiceImmediately; + + private Integer freePeriod; + + private FreePeriodUnit freePeriodUnit; + + private Integer contractTermBillingCycleOnRenewal; + + private TrialEndAction trialEndAction; + + private String clientProfileId; + + private PaymentInitiator paymentInitiator; + + private CustomerParams customer; + + private CardParams card; + + private BankAccountParams bankAccount; + + private PaymentMethodParams paymentMethod; + + private PaymentIntentParams paymentIntent; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private StatementDescriptorParams statementDescriptor; + + private ContractTermParams contractTerm; + + private List entityIdentifiers; + + private List taxProvidersFields; + + private List addons; + + private List eventBasedAddons; + + private List coupons; + + private Map customFields = new LinkedHashMap<>(); + + private SubscriptionCreateBuilder() {} + + public SubscriptionCreateBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionCreateBuilder planId(String value) { + this.planId = value; + return this; + } + + public SubscriptionCreateBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public SubscriptionCreateBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + public SubscriptionCreateBuilder planUnitPrice(Long value) { + this.planUnitPrice = value; + return this; + } + + public SubscriptionCreateBuilder planUnitPriceInDecimal(String value) { + this.planUnitPriceInDecimal = value; + return this; + } + + public SubscriptionCreateBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionCreateBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionCreateBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionCreateBuilder mandatoryAddonsToRemove(List value) { + this.mandatoryAddonsToRemove = value; + return this; + } + + public SubscriptionCreateBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + @Deprecated + public SubscriptionCreateBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionCreateBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionCreateBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public SubscriptionCreateBuilder billingAlignmentMode(BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public SubscriptionCreateBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionCreateBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public SubscriptionCreateBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public SubscriptionCreateBuilder tokenId(String value) { + this.tokenId = value; + return this; + } + + public SubscriptionCreateBuilder affiliateToken(String value) { + this.affiliateToken = value; + return this; + } + + @Deprecated + public SubscriptionCreateBuilder createdFromIp(String value) { + this.createdFromIp = value; + return this; + } + + public SubscriptionCreateBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public SubscriptionCreateBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public SubscriptionCreateBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public SubscriptionCreateBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public SubscriptionCreateBuilder freePeriod(Integer value) { + this.freePeriod = value; + return this; + } + + public SubscriptionCreateBuilder freePeriodUnit(FreePeriodUnit value) { + this.freePeriodUnit = value; + return this; + } + + public SubscriptionCreateBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionCreateBuilder trialEndAction(TrialEndAction value) { + this.trialEndAction = value; + return this; + } + + public SubscriptionCreateBuilder clientProfileId(String value) { + this.clientProfileId = value; + return this; + } + + public SubscriptionCreateBuilder paymentInitiator(PaymentInitiator value) { + this.paymentInitiator = value; + return this; + } + + public SubscriptionCreateBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public SubscriptionCreateBuilder card(CardParams value) { + this.card = value; + return this; + } + + public SubscriptionCreateBuilder bankAccount(BankAccountParams value) { + this.bankAccount = value; + return this; + } + + public SubscriptionCreateBuilder paymentMethod(PaymentMethodParams value) { + this.paymentMethod = value; + return this; + } + + public SubscriptionCreateBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public SubscriptionCreateBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public SubscriptionCreateBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public SubscriptionCreateBuilder statementDescriptor(StatementDescriptorParams value) { + this.statementDescriptor = value; + return this; + } + + public SubscriptionCreateBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public SubscriptionCreateBuilder entityIdentifiers(List value) { + this.entityIdentifiers = value; + return this; + } + + public SubscriptionCreateBuilder taxProvidersFields(List value) { + this.taxProvidersFields = value; + return this; + } + + public SubscriptionCreateBuilder addons(List value) { + this.addons = value; + return this; + } + + public SubscriptionCreateBuilder eventBasedAddons(List value) { + this.eventBasedAddons = value; + return this; + } + + @Deprecated + public SubscriptionCreateBuilder coupons(List value) { + this.coupons = 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 SubscriptionCreateBuilder 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 SubscriptionCreateBuilder 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 SubscriptionCreateParams build() { + return new SubscriptionCreateParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum FreePeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + FreePeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static FreePeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialEndAction { + SITE_DEFAULT("site_default"), + + PLAN_DEFAULT("plan_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialEndAction enumValue : TrialEndAction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PaymentInitiator { + CUSTOMER("customer"), + + MERCHANT("merchant"), + + /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentInitiator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentInitiator fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentInitiator enumValue : PaymentInitiator.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class CustomerParams { + + private final String id; + + private final String email; + + private final String firstName; + + private final String lastName; + + private final String company; + + private final String phone; + + private final String locale; + + private final Taxability taxability; + + private final EntityCode entityCode; + + private final String exemptNumber; + + private final Integer netTermDays; + + private final TaxjarExemptionCategory taxjarExemptionCategory; + + private final AutoCollection autoCollection; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final Boolean allowDirectDebit; + + private final Boolean consolidatedInvoicing; + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final String entityIdentifierScheme; + + private final String entityIdentifierStandard; + + private final Boolean isEinvoiceEnabled; + + private final EinvoicingMethod einvoicingMethod; + + private final Boolean registeredForGst; + + private final Boolean businessCustomerWithoutVatNumber; + + private final List exemptionDetails; + + private final CustomerType customerType; + + private CustomerParams(CustomerBuilder builder) { + + this.id = builder.id; + + this.email = builder.email; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.company = builder.company; + + this.phone = builder.phone; + + this.locale = builder.locale; + + this.taxability = builder.taxability; + + this.entityCode = builder.entityCode; + + this.exemptNumber = builder.exemptNumber; + + this.netTermDays = builder.netTermDays; + + this.taxjarExemptionCategory = builder.taxjarExemptionCategory; + + this.autoCollection = builder.autoCollection; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.allowDirectDebit = builder.allowDirectDebit; + + this.consolidatedInvoicing = builder.consolidatedInvoicing; + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.entityIdentifierScheme = builder.entityIdentifierScheme; + + this.entityIdentifierStandard = builder.entityIdentifierStandard; + + this.isEinvoiceEnabled = builder.isEinvoiceEnabled; + + this.einvoicingMethod = builder.einvoicingMethod; + + this.registeredForGst = builder.registeredForGst; + + this.businessCustomerWithoutVatNumber = builder.businessCustomerWithoutVatNumber; + + this.exemptionDetails = builder.exemptionDetails; + + this.customerType = builder.customerType; + } + + public String getId() { + return id; + } + + public String getEmail() { + return email; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getCompany() { + return company; + } + + public String getPhone() { + return phone; + } + + public String getLocale() { + return locale; + } + + public Taxability getTaxability() { + return taxability; + } + + public EntityCode getEntityCode() { + return entityCode; + } + + public String getExemptNumber() { + return exemptNumber; + } + + public Integer getNetTermDays() { + return netTermDays; + } + + public TaxjarExemptionCategory getTaxjarExemptionCategory() { + return taxjarExemptionCategory; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public Boolean getAllowDirectDebit() { + return allowDirectDebit; + } + + public Boolean getConsolidatedInvoicing() { + return consolidatedInvoicing; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public String getEntityIdentifierScheme() { + return entityIdentifierScheme; + } + + public String getEntityIdentifierStandard() { + return entityIdentifierStandard; + } + + public Boolean getIsEinvoiceEnabled() { + return isEinvoiceEnabled; + } + + public EinvoicingMethod getEinvoicingMethod() { + return einvoicingMethod; + } + + public Boolean getRegisteredForGst() { + return registeredForGst; + } + + public Boolean getBusinessCustomerWithoutVatNumber() { + return businessCustomerWithoutVatNumber; + } + + public List getExemptionDetails() { + return exemptionDetails; + } + + public CustomerType getCustomerType() { + return customerType; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + + if (this.company != null) { + + formData.put("company", this.company); + } + + if (this.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.locale != null) { + + formData.put("locale", this.locale); + } + + if (this.taxability != null) { + + formData.put("taxability", this.taxability); + } + + if (this.entityCode != null) { + + formData.put("entity_code", this.entityCode); + } + + if (this.exemptNumber != null) { + + formData.put("exempt_number", this.exemptNumber); + } + + if (this.netTermDays != null) { + + formData.put("net_term_days", this.netTermDays); + } + + if (this.taxjarExemptionCategory != null) { + + formData.put("taxjar_exemption_category", this.taxjarExemptionCategory); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.allowDirectDebit != null) { + + formData.put("allow_direct_debit", this.allowDirectDebit); + } + + if (this.consolidatedInvoicing != null) { + + formData.put("consolidated_invoicing", this.consolidatedInvoicing); + } + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.entityIdentifierScheme != null) { + + formData.put("entity_identifier_scheme", this.entityIdentifierScheme); + } + + if (this.entityIdentifierStandard != null) { + + formData.put("entity_identifier_standard", this.entityIdentifierStandard); + } + + if (this.isEinvoiceEnabled != null) { + + formData.put("is_einvoice_enabled", this.isEinvoiceEnabled); + } + + if (this.einvoicingMethod != null) { + + formData.put("einvoicing_method", this.einvoicingMethod); + } + + if (this.registeredForGst != null) { + + formData.put("registered_for_gst", this.registeredForGst); + } + + if (this.businessCustomerWithoutVatNumber != null) { + + formData.put("business_customer_without_vat_number", this.businessCustomerWithoutVatNumber); + } + + if (this.exemptionDetails != null) { + + formData.put("exemption_details", JsonUtil.toJson(this.exemptionDetails)); + } + + if (this.customerType != null) { + + formData.put("customer_type", this.customerType); + } + + 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 id; + + private String email; + + private String firstName; + + private String lastName; + + private String company; + + private String phone; + + private String locale; + + private Taxability taxability; + + private EntityCode entityCode; + + private String exemptNumber; + + private Integer netTermDays; + + private TaxjarExemptionCategory taxjarExemptionCategory; + + private AutoCollection autoCollection; + + private OfflinePaymentMethod offlinePaymentMethod; + + private Boolean allowDirectDebit; + + private Boolean consolidatedInvoicing; + + private String vatNumber; + + private String vatNumberPrefix; + + private String entityIdentifierScheme; + + private String entityIdentifierStandard; + + private Boolean isEinvoiceEnabled; + + private EinvoicingMethod einvoicingMethod; + + private Boolean registeredForGst; + + private Boolean businessCustomerWithoutVatNumber; + + private List exemptionDetails; + + private CustomerType customerType; + + private CustomerBuilder() {} + + public CustomerBuilder id(String value) { + this.id = value; + return this; + } + + public CustomerBuilder email(String value) { + this.email = value; + return this; + } + + public CustomerBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CustomerBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CustomerBuilder company(String value) { + this.company = value; + return this; + } + + public CustomerBuilder phone(String value) { + this.phone = value; + return this; + } + + public CustomerBuilder locale(String value) { + this.locale = value; + return this; + } + + public CustomerBuilder taxability(Taxability value) { + this.taxability = value; + return this; + } + + public CustomerBuilder entityCode(EntityCode value) { + this.entityCode = value; + return this; + } + + public CustomerBuilder exemptNumber(String value) { + this.exemptNumber = value; + return this; + } + + public CustomerBuilder netTermDays(Integer value) { + this.netTermDays = value; + return this; + } + + public CustomerBuilder taxjarExemptionCategory(TaxjarExemptionCategory value) { + this.taxjarExemptionCategory = value; + return this; + } + + public CustomerBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public CustomerBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public CustomerBuilder allowDirectDebit(Boolean value) { + this.allowDirectDebit = value; + return this; + } + + public CustomerBuilder consolidatedInvoicing(Boolean value) { + this.consolidatedInvoicing = value; + return this; + } + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder entityIdentifierScheme(String value) { + this.entityIdentifierScheme = value; + return this; + } + + public CustomerBuilder entityIdentifierStandard(String value) { + this.entityIdentifierStandard = value; + return this; + } + + public CustomerBuilder isEinvoiceEnabled(Boolean value) { + this.isEinvoiceEnabled = value; + return this; + } + + public CustomerBuilder einvoicingMethod(EinvoicingMethod value) { + this.einvoicingMethod = value; + return this; + } + + public CustomerBuilder registeredForGst(Boolean value) { + this.registeredForGst = value; + return this; + } + + public CustomerBuilder businessCustomerWithoutVatNumber(Boolean value) { + this.businessCustomerWithoutVatNumber = value; + return this; + } + + public CustomerBuilder exemptionDetails(List value) { + this.exemptionDetails = value; + return this; + } + + public CustomerBuilder customerType(CustomerType value) { + this.customerType = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + + public enum Taxability { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Taxability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Taxability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Taxability fromString(String value) { + if (value == null) return _UNKNOWN; + for (Taxability enumValue : Taxability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EntityCode { + A("a"), + + B("b"), + + C("c"), + + D("d"), + + E("e"), + + F("f"), + + G("g"), + + H("h"), + + I("i"), + + J("j"), + + K("k"), + + L("l"), + + M("m"), + + N("n"), + + P("p"), + + Q("q"), + + R("r"), + + MED_1("med1"), + + MED_2("med2"), + + /** An enum member indicating that EntityCode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EntityCode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EntityCode fromString(String value) { + if (value == null) return _UNKNOWN; + for (EntityCode enumValue : EntityCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TaxjarExemptionCategory { + WHOLESALE("wholesale"), + + GOVERNMENT("government"), + + OTHER("other"), + + /** + * An enum member indicating that TaxjarExemptionCategory was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + TaxjarExemptionCategory(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TaxjarExemptionCategory fromString(String value) { + if (value == null) return _UNKNOWN; + for (TaxjarExemptionCategory enumValue : TaxjarExemptionCategory.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EinvoicingMethod { + AUTOMATIC("automatic"), + + MANUAL("manual"), + + SITE_DEFAULT("site_default"), + + /** An enum member indicating that EinvoicingMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EinvoicingMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EinvoicingMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (EinvoicingMethod enumValue : EinvoicingMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum CustomerType { + RESIDENTIAL("residential"), + + BUSINESS("business"), + + SENIOR_CITIZEN("senior_citizen"), + + INDUSTRIAL("industrial"), + + /** An enum member indicating that CustomerType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CustomerType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CustomerType fromString(String value) { + if (value == null) return _UNKNOWN; + for (CustomerType enumValue : CustomerType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CardParams { + + 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 java.util.Map additionalInformation; + + private CardParams(CardBuilder 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.additionalInformation = builder.additionalInformation; + } + + 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 java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** 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.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + 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 java.util.Map additionalInformation; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + @Deprecated + public CardBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public CardBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CardBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CardBuilder number(String value) { + this.number = value; + return this; + } + + public CardBuilder expiryMonth(Integer value) { + this.expiryMonth = value; + return this; + } + + public CardBuilder expiryYear(Integer value) { + this.expiryYear = value; + return this; + } + + public CardBuilder cvv(String value) { + this.cvv = value; + return this; + } + + public CardBuilder preferredScheme(PreferredScheme value) { + this.preferredScheme = value; + return this; + } + + public CardBuilder billingAddr1(String value) { + this.billingAddr1 = value; + return this; + } + + public CardBuilder billingAddr2(String value) { + this.billingAddr2 = value; + return this; + } + + public CardBuilder billingCity(String value) { + this.billingCity = value; + return this; + } + + public CardBuilder billingStateCode(String value) { + this.billingStateCode = value; + return this; + } + + public CardBuilder billingState(String value) { + this.billingState = value; + return this; + } + + public CardBuilder billingZip(String value) { + this.billingZip = value; + return this; + } + + public CardBuilder billingCountry(String value) { + this.billingCountry = value; + return this; + } + + @Deprecated + public CardBuilder ipAddress(String value) { + this.ipAddress = value; + return this; + } + + public CardBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public CardParams build() { + return new CardParams(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 BankAccountParams { + + private final String gatewayAccountId; + + private final String iban; + + private final String firstName; + + private final String lastName; + + private final String company; + + private final String email; + + private final String phone; + + private final String bankName; + + private final String accountNumber; + + private final String routingNumber; + + private final String bankCode; + + private final AccountType accountType; + + private final AccountHolderType accountHolderType; + + private final EcheckType echeckType; + + private final String issuingCountry; + + private final String swedishIdentityNumber; + + private final java.util.Map billingAddress; + + private BankAccountParams(BankAccountBuilder builder) { + + this.gatewayAccountId = builder.gatewayAccountId; + + this.iban = builder.iban; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.company = builder.company; + + this.email = builder.email; + + this.phone = builder.phone; + + this.bankName = builder.bankName; + + this.accountNumber = builder.accountNumber; + + this.routingNumber = builder.routingNumber; + + this.bankCode = builder.bankCode; + + this.accountType = builder.accountType; + + this.accountHolderType = builder.accountHolderType; + + this.echeckType = builder.echeckType; + + this.issuingCountry = builder.issuingCountry; + + this.swedishIdentityNumber = builder.swedishIdentityNumber; + + this.billingAddress = builder.billingAddress; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getIban() { + return iban; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getCompany() { + return company; + } + + public String getEmail() { + return email; + } + + public String getPhone() { + return phone; + } + + public String getBankName() { + return bankName; + } + + public String getAccountNumber() { + return accountNumber; + } + + public String getRoutingNumber() { + return routingNumber; + } + + public String getBankCode() { + return bankCode; + } + + public AccountType getAccountType() { + return accountType; + } + + public AccountHolderType getAccountHolderType() { + return accountHolderType; + } + + public EcheckType getEcheckType() { + return echeckType; + } + + public String getIssuingCountry() { + return issuingCountry; + } + + public String getSwedishIdentityNumber() { + return swedishIdentityNumber; + } + + public java.util.Map getBillingAddress() { + return billingAddress; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.iban != null) { + + formData.put("iban", this.iban); + } + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + + if (this.company != null) { + + formData.put("company", this.company); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.phone != null) { + + formData.put("phone", this.phone); + } + + if (this.bankName != null) { + + formData.put("bank_name", this.bankName); + } + + if (this.accountNumber != null) { + + formData.put("account_number", this.accountNumber); + } + + if (this.routingNumber != null) { + + formData.put("routing_number", this.routingNumber); + } + + if (this.bankCode != null) { + + formData.put("bank_code", this.bankCode); + } + + if (this.accountType != null) { + + formData.put("account_type", this.accountType); + } + + if (this.accountHolderType != null) { + + formData.put("account_holder_type", this.accountHolderType); + } + + if (this.echeckType != null) { + + formData.put("echeck_type", this.echeckType); + } + + if (this.issuingCountry != null) { + + formData.put("issuing_country", this.issuingCountry); + } + + if (this.swedishIdentityNumber != null) { + + formData.put("swedish_identity_number", this.swedishIdentityNumber); + } + + if (this.billingAddress != null) { + + formData.put("billing_address", JsonUtil.toJson(this.billingAddress)); + } + + return formData; + } + + /** Create a new builder for BankAccountParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BankAccountBuilder builder() { + return new BankAccountBuilder(); + } + + public static final class BankAccountBuilder { + + private String gatewayAccountId; + + private String iban; + + private String firstName; + + private String lastName; + + private String company; + + private String email; + + private String phone; + + private String bankName; + + private String accountNumber; + + private String routingNumber; + + private String bankCode; + + private AccountType accountType; + + private AccountHolderType accountHolderType; + + private EcheckType echeckType; + + private String issuingCountry; + + private String swedishIdentityNumber; + + private java.util.Map billingAddress; + + private BankAccountBuilder() {} + + public BankAccountBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public BankAccountBuilder iban(String value) { + this.iban = value; + return this; + } + + public BankAccountBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BankAccountBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BankAccountBuilder company(String value) { + this.company = value; + return this; + } + + public BankAccountBuilder email(String value) { + this.email = value; + return this; + } + + public BankAccountBuilder phone(String value) { + this.phone = value; + return this; + } + + public BankAccountBuilder bankName(String value) { + this.bankName = value; + return this; + } + + public BankAccountBuilder accountNumber(String value) { + this.accountNumber = value; + return this; + } + + public BankAccountBuilder routingNumber(String value) { + this.routingNumber = value; + return this; + } + + public BankAccountBuilder bankCode(String value) { + this.bankCode = value; + return this; + } + + public BankAccountBuilder accountType(AccountType value) { + this.accountType = value; + return this; + } + + public BankAccountBuilder accountHolderType(AccountHolderType value) { + this.accountHolderType = value; + return this; + } + + public BankAccountBuilder echeckType(EcheckType value) { + this.echeckType = value; + return this; + } + + public BankAccountBuilder issuingCountry(String value) { + this.issuingCountry = value; + return this; + } + + public BankAccountBuilder swedishIdentityNumber(String value) { + this.swedishIdentityNumber = value; + return this; + } + + public BankAccountBuilder billingAddress(java.util.Map value) { + this.billingAddress = value; + return this; + } + + public BankAccountParams build() { + return new BankAccountParams(this); + } + } + + public enum AccountType { + CHECKING("checking"), + + SAVINGS("savings"), + + BUSINESS_CHECKING("business_checking"), + + CURRENT("current"), + + /** An enum member indicating that AccountType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AccountType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AccountType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AccountType enumValue : AccountType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AccountHolderType { + INDIVIDUAL("individual"), + + COMPANY("company"), + + /** + * An enum member indicating that AccountHolderType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + AccountHolderType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AccountHolderType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AccountHolderType enumValue : AccountHolderType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EcheckType { + WEB("web"), + + PPD("ppd"), + + CCD("ccd"), + + /** An enum member indicating that EcheckType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EcheckType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EcheckType fromString(String value) { + if (value == null) return _UNKNOWN; + for (EcheckType enumValue : EcheckType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class PaymentMethodParams { + + private final Type type; + + private final Gateway gateway; + + private final String gatewayAccountId; + + private final String referenceId; + + private final String tmpToken; + + private final String issuingCountry; + + private final java.util.Map additionalInformation; + + private PaymentMethodParams(PaymentMethodBuilder builder) { + + this.type = builder.type; + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.referenceId = builder.referenceId; + + this.tmpToken = builder.tmpToken; + + this.issuingCountry = builder.issuingCountry; + + this.additionalInformation = builder.additionalInformation; + } + + public Type getType() { + return type; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getReferenceId() { + return referenceId; + } + + public String getTmpToken() { + return tmpToken; + } + + public String getIssuingCountry() { + return issuingCountry; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.gateway != null) { + + formData.put("gateway", this.gateway); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.tmpToken != null) { + + formData.put("tmp_token", this.tmpToken); + } + + if (this.issuingCountry != null) { + + formData.put("issuing_country", this.issuingCountry); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentMethodBuilder builder() { + return new PaymentMethodBuilder(); + } + + public static final class PaymentMethodBuilder { + + private Type type; + + private Gateway gateway; + + private String gatewayAccountId; + + private String referenceId; + + private String tmpToken; + + private String issuingCountry; + + private java.util.Map additionalInformation; + + private PaymentMethodBuilder() {} + + public PaymentMethodBuilder type(Type value) { + this.type = value; + return this; + } + + @Deprecated + public PaymentMethodBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public PaymentMethodBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentMethodBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public PaymentMethodBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public PaymentMethodBuilder issuingCountry(String value) { + this.issuingCountry = value; + return this; + } + + public PaymentMethodBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentMethodParams build() { + return new PaymentMethodParams(this); + } + } + + public enum Type { + CARD("card"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + AMAZON_PAYMENTS("amazon_payments"), + + DIRECT_DEBIT("direct_debit"), + + GENERIC("generic"), + + ALIPAY("alipay"), + + UNIONPAY("unionpay"), + + APPLE_PAY("apple_pay"), + + WECHAT_PAY("wechat_pay"), + + IDEAL("ideal"), + + GOOGLE_PAY("google_pay"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GIROPAY("giropay"), + + DOTPAY("dotpay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + VENMO("venmo"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** 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 Gateway { + 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"), + + GOCARDLESS("gocardless"), + + 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 static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class StatementDescriptorParams { + + private final String descriptor; + + private StatementDescriptorParams(StatementDescriptorBuilder builder) { + + this.descriptor = builder.descriptor; + } + + public String getDescriptor() { + return descriptor; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.descriptor != null) { + + formData.put("descriptor", this.descriptor); + } + + return formData; + } + + /** Create a new builder for StatementDescriptorParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatementDescriptorBuilder builder() { + return new StatementDescriptorBuilder(); + } + + public static final class StatementDescriptorBuilder { + + private String descriptor; + + private StatementDescriptorBuilder() {} + + public StatementDescriptorBuilder descriptor(String value) { + this.descriptor = value; + return this; + } + + public StatementDescriptorParams build() { + return new StatementDescriptorParams(this); + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class EntityIdentifiersParams { + + private final String id; + + private final String scheme; + + private final String value; + + private final String standard; + + private EntityIdentifiersParams(EntityIdentifiersBuilder builder) { + + this.id = builder.id; + + this.scheme = builder.scheme; + + this.value = builder.value; + + this.standard = builder.standard; + } + + public String getId() { + return id; + } + + public String getScheme() { + return scheme; + } + + public String getValue() { + return value; + } + + public String getStandard() { + return standard; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.scheme != null) { + + formData.put("scheme", this.scheme); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + if (this.standard != null) { + + formData.put("standard", this.standard); + } + + return formData; + } + + /** Create a new builder for EntityIdentifiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EntityIdentifiersBuilder builder() { + return new EntityIdentifiersBuilder(); + } + + public static final class EntityIdentifiersBuilder { + + private String id; + + private String scheme; + + private String value; + + private String standard; + + private EntityIdentifiersBuilder() {} + + public EntityIdentifiersBuilder id(String value) { + this.id = value; + return this; + } + + public EntityIdentifiersBuilder scheme(String value) { + this.scheme = value; + return this; + } + + public EntityIdentifiersBuilder value(String value) { + this.value = value; + return this; + } + + public EntityIdentifiersBuilder standard(String value) { + this.standard = value; + return this; + } + + public EntityIdentifiersParams build() { + return new EntityIdentifiersParams(this); + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AddonsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private final Integer servicePeriodInDays; + + private final OnEvent onEvent; + + private final Boolean chargeOnce; + + private final ChargeOn chargeOn; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.servicePeriodInDays = builder.servicePeriodInDays; + + this.onEvent = builder.onEvent; + + this.chargeOnce = builder.chargeOnce; + + this.chargeOn = builder.chargeOn; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getServicePeriodInDays() { + return servicePeriodInDays; + } + + public OnEvent getOnEvent() { + return onEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ChargeOn getChargeOn() { + return chargeOn; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.servicePeriodInDays != null) { + + formData.put("service_period_in_days", this.servicePeriodInDays); + } + + if (this.onEvent != null) { + + formData.put("on_event", this.onEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.chargeOn != null) { + + formData.put("charge_on", this.chargeOn); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private Integer servicePeriodInDays; + + private OnEvent onEvent; + + private Boolean chargeOnce; + + private ChargeOn chargeOn; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { + this.servicePeriodInDays = value; + return this; + } + + public EventBasedAddonsBuilder onEvent(OnEvent value) { + this.onEvent = value; + return this; + } + + public EventBasedAddonsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public EventBasedAddonsBuilder chargeOn(ChargeOn value) { + this.chargeOn = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + + public enum OnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** An enum member indicating that OnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (OnEvent enumValue : OnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChargeOn { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOn fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOn enumValue : ChargeOn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CouponsParams { + + private final String couponId; + + private final Timestamp applyTill; + + private CouponsParams(CouponsBuilder builder) { + + this.couponId = builder.couponId; + + this.applyTill = builder.applyTill; + } + + public String getCouponId() { + return couponId; + } + + public Timestamp getApplyTill() { + return applyTill; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.couponId != null) { + + formData.put("coupon_id", this.couponId); + } + + if (this.applyTill != null) { + + formData.put("apply_till", this.applyTill); + } + + return formData; + } + + /** Create a new builder for CouponsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponsBuilder builder() { + return new CouponsBuilder(); + } + + public static final class CouponsBuilder { + + private String couponId; + + private Timestamp applyTill; + + private CouponsBuilder() {} + + public CouponsBuilder couponId(String value) { + this.couponId = value; + return this; + } + + public CouponsBuilder applyTill(Timestamp value) { + this.applyTill = value; + return this; + } + + public CouponsParams build() { + return new CouponsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateWithItemsParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateWithItemsParams.java new file mode 100644 index 00000000..3ade7a23 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateWithItemsParams.java @@ -0,0 +1,2985 @@ +/* + * 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.subscription.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 SubscriptionCreateWithItemsParams { + + private final String id; + + private final String businessEntityId; + + private final Timestamp trialEnd; + + private final Integer billingCycles; + + private final Long setupFee; + + private final List mandatoryItemsToRemove; + + private final Integer netTermDays; + + private final Timestamp startDate; + + private final String coupon; + + private final AutoCollection autoCollection; + + private final Integer termsToCharge; + + private final BillingAlignmentMode billingAlignmentMode; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final String poNumber; + + private final List couponIds; + + private final String paymentSourceId; + + private final Boolean overrideRelationship; + + private final String invoiceNotes; + + private final Timestamp invoiceDate; + + private final java.util.Map metaData; + + private final Boolean invoiceImmediately; + + private final Boolean replacePrimaryPaymentSource; + + private final Integer freePeriod; + + private final FreePeriodUnit freePeriodUnit; + + private final Integer contractTermBillingCycleOnRenewal; + + private final Boolean createPendingInvoices; + + private final Boolean autoCloseInvoices; + + private final Boolean firstInvoicePending; + + private final TrialEndAction trialEndAction; + + private final PaymentInitiator paymentInitiator; + + private final ShippingAddressParams shippingAddress; + + private final StatementDescriptorParams statementDescriptor; + + private final PaymentIntentParams paymentIntent; + + private final ContractTermParams contractTerm; + + private final BillingOverrideParams billingOverride; + + private final List subscriptionItems; + + private final List discounts; + + private final List itemTiers; + + private final List coupons; + + private final Map customFields; + + private SubscriptionCreateWithItemsParams(SubscriptionCreateWithItemsBuilder builder) { + + this.id = builder.id; + + this.businessEntityId = builder.businessEntityId; + + this.trialEnd = builder.trialEnd; + + this.billingCycles = builder.billingCycles; + + this.setupFee = builder.setupFee; + + this.mandatoryItemsToRemove = builder.mandatoryItemsToRemove; + + this.netTermDays = builder.netTermDays; + + this.startDate = builder.startDate; + + this.coupon = builder.coupon; + + this.autoCollection = builder.autoCollection; + + this.termsToCharge = builder.termsToCharge; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.poNumber = builder.poNumber; + + this.couponIds = builder.couponIds; + + this.paymentSourceId = builder.paymentSourceId; + + this.overrideRelationship = builder.overrideRelationship; + + this.invoiceNotes = builder.invoiceNotes; + + this.invoiceDate = builder.invoiceDate; + + this.metaData = builder.metaData; + + this.invoiceImmediately = builder.invoiceImmediately; + + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; + + this.freePeriod = builder.freePeriod; + + this.freePeriodUnit = builder.freePeriodUnit; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + + this.createPendingInvoices = builder.createPendingInvoices; + + this.autoCloseInvoices = builder.autoCloseInvoices; + + this.firstInvoicePending = builder.firstInvoicePending; + + this.trialEndAction = builder.trialEndAction; + + this.paymentInitiator = builder.paymentInitiator; + + this.shippingAddress = builder.shippingAddress; + + this.statementDescriptor = builder.statementDescriptor; + + this.paymentIntent = builder.paymentIntent; + + this.contractTerm = builder.contractTerm; + + this.billingOverride = builder.billingOverride; + + this.subscriptionItems = builder.subscriptionItems; + + this.discounts = builder.discounts; + + this.itemTiers = builder.itemTiers; + + this.coupons = builder.coupons; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getId() { + return id; + } + + public String getBusinessEntityId() { + return businessEntityId; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Long getSetupFee() { + return setupFee; + } + + public List getMandatoryItemsToRemove() { + return mandatoryItemsToRemove; + } + + public Integer getNetTermDays() { + return netTermDays; + } + + public Timestamp getStartDate() { + return startDate; + } + + public String getCoupon() { + return coupon; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public String getPoNumber() { + return poNumber; + } + + public List getCouponIds() { + return couponIds; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public Boolean getOverrideRelationship() { + return overrideRelationship; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public java.util.Map getMetaData() { + return metaData; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + public Boolean getReplacePrimaryPaymentSource() { + return replacePrimaryPaymentSource; + } + + public Integer getFreePeriod() { + return freePeriod; + } + + public FreePeriodUnit getFreePeriodUnit() { + return freePeriodUnit; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + public Boolean getCreatePendingInvoices() { + return createPendingInvoices; + } + + public Boolean getAutoCloseInvoices() { + return autoCloseInvoices; + } + + public Boolean getFirstInvoicePending() { + return firstInvoicePending; + } + + public TrialEndAction getTrialEndAction() { + return trialEndAction; + } + + public PaymentInitiator getPaymentInitiator() { + return paymentInitiator; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public StatementDescriptorParams getStatementDescriptor() { + return statementDescriptor; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public BillingOverrideParams getBillingOverride() { + return billingOverride; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + public List getDiscounts() { + return discounts; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getCoupons() { + return coupons; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.businessEntityId != null) { + + formData.put("business_entity_id", this.businessEntityId); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.mandatoryItemsToRemove != null) { + + formData.put("mandatory_items_to_remove", this.mandatoryItemsToRemove); + } + + if (this.netTermDays != null) { + + formData.put("net_term_days", this.netTermDays); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.overrideRelationship != null) { + + formData.put("override_relationship", this.overrideRelationship); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + if (this.replacePrimaryPaymentSource != null) { + + formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); + } + + if (this.freePeriod != null) { + + formData.put("free_period", this.freePeriod); + } + + if (this.freePeriodUnit != null) { + + formData.put("free_period_unit", this.freePeriodUnit); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + if (this.createPendingInvoices != null) { + + formData.put("create_pending_invoices", this.createPendingInvoices); + } + + if (this.autoCloseInvoices != null) { + + formData.put("auto_close_invoices", this.autoCloseInvoices); + } + + if (this.firstInvoicePending != null) { + + formData.put("first_invoice_pending", this.firstInvoicePending); + } + + if (this.trialEndAction != null) { + + formData.put("trial_end_action", this.trialEndAction); + } + + if (this.paymentInitiator != null) { + + formData.put("payment_initiator", this.paymentInitiator); + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.statementDescriptor != null) { + + // Single object + Map nestedData = this.statementDescriptor.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingOverride != null) { + + // Single object + Map nestedData = this.billingOverride.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_override[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.coupons != null) { + + // List of objects + for (int i = 0; i < this.coupons.size(); i++) { + CouponsParams item = this.coupons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for SubscriptionCreateWithItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionCreateWithItemsBuilder builder() { + return new SubscriptionCreateWithItemsBuilder(); + } + + public static final class SubscriptionCreateWithItemsBuilder { + + private String id; + + private String businessEntityId; + + private Timestamp trialEnd; + + private Integer billingCycles; + + private Long setupFee; + + private List mandatoryItemsToRemove; + + private Integer netTermDays; + + private Timestamp startDate; + + private String coupon; + + private AutoCollection autoCollection; + + private Integer termsToCharge; + + private BillingAlignmentMode billingAlignmentMode; + + private OfflinePaymentMethod offlinePaymentMethod; + + private String poNumber; + + private List couponIds; + + private String paymentSourceId; + + private Boolean overrideRelationship; + + private String invoiceNotes; + + private Timestamp invoiceDate; + + private java.util.Map metaData; + + private Boolean invoiceImmediately; + + private Boolean replacePrimaryPaymentSource; + + private Integer freePeriod; + + private FreePeriodUnit freePeriodUnit; + + private Integer contractTermBillingCycleOnRenewal; + + private Boolean createPendingInvoices; + + private Boolean autoCloseInvoices; + + private Boolean firstInvoicePending; + + private TrialEndAction trialEndAction; + + private PaymentInitiator paymentInitiator; + + private ShippingAddressParams shippingAddress; + + private StatementDescriptorParams statementDescriptor; + + private PaymentIntentParams paymentIntent; + + private ContractTermParams contractTerm; + + private BillingOverrideParams billingOverride; + + private List subscriptionItems; + + private List discounts; + + private List itemTiers; + + private List coupons; + + private Map customFields = new LinkedHashMap<>(); + + private SubscriptionCreateWithItemsBuilder() {} + + public SubscriptionCreateWithItemsBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder businessEntityId(String value) { + this.businessEntityId = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + @Deprecated + public SubscriptionCreateWithItemsBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder mandatoryItemsToRemove(List value) { + this.mandatoryItemsToRemove = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder netTermDays(Integer value) { + this.netTermDays = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + @Deprecated + public SubscriptionCreateWithItemsBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder billingAlignmentMode(BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder overrideRelationship(Boolean value) { + this.overrideRelationship = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder replacePrimaryPaymentSource(Boolean value) { + this.replacePrimaryPaymentSource = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder freePeriod(Integer value) { + this.freePeriod = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder freePeriodUnit(FreePeriodUnit value) { + this.freePeriodUnit = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder createPendingInvoices(Boolean value) { + this.createPendingInvoices = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder autoCloseInvoices(Boolean value) { + this.autoCloseInvoices = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder firstInvoicePending(Boolean value) { + this.firstInvoicePending = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder trialEndAction(TrialEndAction value) { + this.trialEndAction = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder paymentInitiator(PaymentInitiator value) { + this.paymentInitiator = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder statementDescriptor(StatementDescriptorParams value) { + this.statementDescriptor = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder billingOverride(BillingOverrideParams value) { + this.billingOverride = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public SubscriptionCreateWithItemsBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + @Deprecated + public SubscriptionCreateWithItemsBuilder coupons(List value) { + this.coupons = 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 SubscriptionCreateWithItemsBuilder 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 SubscriptionCreateWithItemsBuilder 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 SubscriptionCreateWithItemsParams build() { + return new SubscriptionCreateWithItemsParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum FreePeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + FreePeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static FreePeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialEndAction { + SITE_DEFAULT("site_default"), + + PLAN_DEFAULT("plan_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialEndAction enumValue : TrialEndAction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PaymentInitiator { + CUSTOMER("customer"), + + MERCHANT("merchant"), + + /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentInitiator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentInitiator fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentInitiator enumValue : PaymentInitiator.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class StatementDescriptorParams { + + private final String descriptor; + + private StatementDescriptorParams(StatementDescriptorBuilder builder) { + + this.descriptor = builder.descriptor; + } + + public String getDescriptor() { + return descriptor; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.descriptor != null) { + + formData.put("descriptor", this.descriptor); + } + + return formData; + } + + /** Create a new builder for StatementDescriptorParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatementDescriptorBuilder builder() { + return new StatementDescriptorBuilder(); + } + + public static final class StatementDescriptorBuilder { + + private String descriptor; + + private StatementDescriptorBuilder() {} + + public StatementDescriptorBuilder descriptor(String value) { + this.descriptor = value; + return this; + } + + public StatementDescriptorParams build() { + return new StatementDescriptorParams(this); + } + } + } + + public static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Timestamp contractStart; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.contractStart = builder.contractStart; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Timestamp getContractStart() { + return contractStart; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.contractStart != null) { + + formData.put("contract_start", this.contractStart); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Timestamp contractStart; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + @Deprecated + public ContractTermBuilder contractStart(Timestamp value) { + this.contractStart = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingOverrideParams { + + private final Long maxExcessPaymentUsage; + + private final Long maxRefundableCreditsUsage; + + private BillingOverrideParams(BillingOverrideBuilder builder) { + + this.maxExcessPaymentUsage = builder.maxExcessPaymentUsage; + + this.maxRefundableCreditsUsage = builder.maxRefundableCreditsUsage; + } + + public Long getMaxExcessPaymentUsage() { + return maxExcessPaymentUsage; + } + + public Long getMaxRefundableCreditsUsage() { + return maxRefundableCreditsUsage; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.maxExcessPaymentUsage != null) { + + formData.put("max_excess_payment_usage", this.maxExcessPaymentUsage); + } + + if (this.maxRefundableCreditsUsage != null) { + + formData.put("max_refundable_credits_usage", this.maxRefundableCreditsUsage); + } + + return formData; + } + + /** Create a new builder for BillingOverrideParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingOverrideBuilder builder() { + return new BillingOverrideBuilder(); + } + + public static final class BillingOverrideBuilder { + + private Long maxExcessPaymentUsage; + + private Long maxRefundableCreditsUsage; + + private BillingOverrideBuilder() {} + + public BillingOverrideBuilder maxExcessPaymentUsage(Long value) { + this.maxExcessPaymentUsage = value; + return this; + } + + public BillingOverrideBuilder maxRefundableCreditsUsage(Long value) { + this.maxRefundableCreditsUsage = value; + return this; + } + + public BillingOverrideParams build() { + return new BillingOverrideParams(this); + } + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ItemType itemType; + + private final ChargeOnOption chargeOnOption; + + private final UsageAccumulationResetFrequency usageAccumulationResetFrequency; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.itemType = builder.itemType; + + this.chargeOnOption = builder.chargeOnOption; + + this.usageAccumulationResetFrequency = builder.usageAccumulationResetFrequency; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ItemType getItemType() { + return itemType; + } + + public ChargeOnOption getChargeOnOption() { + return chargeOnOption; + } + + public UsageAccumulationResetFrequency getUsageAccumulationResetFrequency() { + return usageAccumulationResetFrequency; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.itemType != null) { + + formData.put("item_type", this.itemType); + } + + if (this.chargeOnOption != null) { + + formData.put("charge_on_option", this.chargeOnOption); + } + + if (this.usageAccumulationResetFrequency != null) { + + formData.put("usage_accumulation_reset_frequency", this.usageAccumulationResetFrequency); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ItemType itemType; + + private ChargeOnOption chargeOnOption; + + private UsageAccumulationResetFrequency usageAccumulationResetFrequency; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionItemsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionItemsBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public SubscriptionItemsBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { + this.chargeOnOption = value; + return this; + } + + public SubscriptionItemsBuilder usageAccumulationResetFrequency( + UsageAccumulationResetFrequency value) { + this.usageAccumulationResetFrequency = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + + 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"), + + /** 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; + } + } + + 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 enum ChargeOnOption { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnOption enumValue : ChargeOnOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum UsageAccumulationResetFrequency { + NEVER("never"), + + SUBSCRIPTION_BILLING_FREQUENCY("subscription_billing_frequency"), + + /** + * An enum member indicating that UsageAccumulationResetFrequency was instantiated with an + * unknown value. + */ + _UNKNOWN(null); + private final String value; + + UsageAccumulationResetFrequency(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static UsageAccumulationResetFrequency fromString(String value) { + if (value == null) return _UNKNOWN; + for (UsageAccumulationResetFrequency enumValue : UsageAccumulationResetFrequency.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DiscountsParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private final Integer quantity; + + private DiscountsParams(DiscountsBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private Integer quantity; + + private DiscountsBuilder() {} + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CouponsParams { + + private final String couponId; + + private final Timestamp applyTill; + + private CouponsParams(CouponsBuilder builder) { + + this.couponId = builder.couponId; + + this.applyTill = builder.applyTill; + } + + public String getCouponId() { + return couponId; + } + + public Timestamp getApplyTill() { + return applyTill; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.couponId != null) { + + formData.put("coupon_id", this.couponId); + } + + if (this.applyTill != null) { + + formData.put("apply_till", this.applyTill); + } + + return formData; + } + + /** Create a new builder for CouponsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponsBuilder builder() { + return new CouponsBuilder(); + } + + public static final class CouponsBuilder { + + private String couponId; + + private Timestamp applyTill; + + private CouponsBuilder() {} + + public CouponsBuilder couponId(String value) { + this.couponId = value; + return this; + } + + public CouponsBuilder applyTill(Timestamp value) { + this.applyTill = value; + return this; + } + + public CouponsParams build() { + return new CouponsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionDeleteParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionDeleteParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionDeleteParams.java rename to src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionDeleteParams.java index 3c6a56e5..3ce0c342 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionDeleteParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionDeleteParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscription.params; +package com.chargebee.v4.models.subscription.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class SubscriptionDeleteParams { - private final Map formData; - - private SubscriptionDeleteParams(SubscriptionDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private SubscriptionDeleteParams(SubscriptionDeleteBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static SubscriptionDeleteBuilder builder() { } public static final class SubscriptionDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); private SubscriptionDeleteBuilder() {} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionEditAdvanceInvoiceScheduleParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionEditAdvanceInvoiceScheduleParams.java new file mode 100644 index 00000000..e75530cf --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionEditAdvanceInvoiceScheduleParams.java @@ -0,0 +1,394 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class SubscriptionEditAdvanceInvoiceScheduleParams { + + private final Integer termsToCharge; + + private final ScheduleType scheduleType; + + private final FixedIntervalScheduleParams fixedIntervalSchedule; + + private final List specificDatesSchedule; + + private SubscriptionEditAdvanceInvoiceScheduleParams( + SubscriptionEditAdvanceInvoiceScheduleBuilder builder) { + + this.termsToCharge = builder.termsToCharge; + + this.scheduleType = builder.scheduleType; + + this.fixedIntervalSchedule = builder.fixedIntervalSchedule; + + this.specificDatesSchedule = builder.specificDatesSchedule; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public ScheduleType getScheduleType() { + return scheduleType; + } + + public FixedIntervalScheduleParams getFixedIntervalSchedule() { + return fixedIntervalSchedule; + } + + public List getSpecificDatesSchedule() { + return specificDatesSchedule; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.scheduleType != null) { + + formData.put("schedule_type", this.scheduleType); + } + + if (this.fixedIntervalSchedule != null) { + + // Single object + Map nestedData = this.fixedIntervalSchedule.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "fixed_interval_schedule[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.specificDatesSchedule != null) { + + // List of objects + for (int i = 0; i < this.specificDatesSchedule.size(); i++) { + SpecificDatesScheduleParams item = this.specificDatesSchedule.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "specific_dates_schedule[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for SubscriptionEditAdvanceInvoiceScheduleParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionEditAdvanceInvoiceScheduleBuilder builder() { + return new SubscriptionEditAdvanceInvoiceScheduleBuilder(); + } + + public static final class SubscriptionEditAdvanceInvoiceScheduleBuilder { + + private Integer termsToCharge; + + private ScheduleType scheduleType; + + private FixedIntervalScheduleParams fixedIntervalSchedule; + + private List specificDatesSchedule; + + private SubscriptionEditAdvanceInvoiceScheduleBuilder() {} + + public SubscriptionEditAdvanceInvoiceScheduleBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public SubscriptionEditAdvanceInvoiceScheduleBuilder scheduleType(ScheduleType value) { + this.scheduleType = value; + return this; + } + + public SubscriptionEditAdvanceInvoiceScheduleBuilder fixedIntervalSchedule( + FixedIntervalScheduleParams value) { + this.fixedIntervalSchedule = value; + return this; + } + + public SubscriptionEditAdvanceInvoiceScheduleBuilder specificDatesSchedule( + List value) { + this.specificDatesSchedule = value; + return this; + } + + public SubscriptionEditAdvanceInvoiceScheduleParams build() { + return new SubscriptionEditAdvanceInvoiceScheduleParams(this); + } + } + + public enum ScheduleType { + SPECIFIC_DATES("specific_dates"), + + FIXED_INTERVALS("fixed_intervals"), + + /** An enum member indicating that ScheduleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ScheduleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ScheduleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ScheduleType enumValue : ScheduleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class FixedIntervalScheduleParams { + + private final Integer numberOfOccurrences; + + private final Integer daysBeforeRenewal; + + private final EndScheduleOn endScheduleOn; + + private final Timestamp endDate; + + private FixedIntervalScheduleParams(FixedIntervalScheduleBuilder builder) { + + this.numberOfOccurrences = builder.numberOfOccurrences; + + this.daysBeforeRenewal = builder.daysBeforeRenewal; + + this.endScheduleOn = builder.endScheduleOn; + + this.endDate = builder.endDate; + } + + public Integer getNumberOfOccurrences() { + return numberOfOccurrences; + } + + public Integer getDaysBeforeRenewal() { + return daysBeforeRenewal; + } + + public EndScheduleOn getEndScheduleOn() { + return endScheduleOn; + } + + public Timestamp getEndDate() { + return endDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.numberOfOccurrences != null) { + + formData.put("number_of_occurrences", this.numberOfOccurrences); + } + + if (this.daysBeforeRenewal != null) { + + formData.put("days_before_renewal", this.daysBeforeRenewal); + } + + if (this.endScheduleOn != null) { + + formData.put("end_schedule_on", this.endScheduleOn); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + return formData; + } + + /** Create a new builder for FixedIntervalScheduleParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static FixedIntervalScheduleBuilder builder() { + return new FixedIntervalScheduleBuilder(); + } + + public static final class FixedIntervalScheduleBuilder { + + private Integer numberOfOccurrences; + + private Integer daysBeforeRenewal; + + private EndScheduleOn endScheduleOn; + + private Timestamp endDate; + + private FixedIntervalScheduleBuilder() {} + + public FixedIntervalScheduleBuilder numberOfOccurrences(Integer value) { + this.numberOfOccurrences = value; + return this; + } + + public FixedIntervalScheduleBuilder daysBeforeRenewal(Integer value) { + this.daysBeforeRenewal = value; + return this; + } + + public FixedIntervalScheduleBuilder endScheduleOn(EndScheduleOn value) { + this.endScheduleOn = value; + return this; + } + + public FixedIntervalScheduleBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public FixedIntervalScheduleParams build() { + return new FixedIntervalScheduleParams(this); + } + } + + public enum EndScheduleOn { + AFTER_NUMBER_OF_INTERVALS("after_number_of_intervals"), + + SPECIFIC_DATE("specific_date"), + + SUBSCRIPTION_END("subscription_end"), + + /** An enum member indicating that EndScheduleOn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EndScheduleOn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EndScheduleOn fromString(String value) { + if (value == null) return _UNKNOWN; + for (EndScheduleOn enumValue : EndScheduleOn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class SpecificDatesScheduleParams { + + private final String id; + + private final Integer termsToCharge; + + private final Timestamp date; + + private SpecificDatesScheduleParams(SpecificDatesScheduleBuilder builder) { + + this.id = builder.id; + + this.termsToCharge = builder.termsToCharge; + + this.date = builder.date; + } + + public String getId() { + return id; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Timestamp getDate() { + return date; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + return formData; + } + + /** Create a new builder for SpecificDatesScheduleParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SpecificDatesScheduleBuilder builder() { + return new SpecificDatesScheduleBuilder(); + } + + public static final class SpecificDatesScheduleBuilder { + + private String id; + + private Integer termsToCharge; + + private Timestamp date; + + private SpecificDatesScheduleBuilder() {} + + public SpecificDatesScheduleBuilder id(String value) { + this.id = value; + return this; + } + + public SpecificDatesScheduleBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public SpecificDatesScheduleBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public SpecificDatesScheduleParams build() { + return new SpecificDatesScheduleParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportContractTermParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportContractTermParams.java new file mode 100644 index 00000000..49008c13 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportContractTermParams.java @@ -0,0 +1,419 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class SubscriptionImportContractTermParams { + + private final Integer contractTermBillingCycleOnRenewal; + + private final ContractTermParams contractTerm; + + private SubscriptionImportContractTermParams(SubscriptionImportContractTermBuilder builder) { + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + + this.contractTerm = builder.contractTerm; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for SubscriptionImportContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionImportContractTermBuilder builder() { + return new SubscriptionImportContractTermBuilder(); + } + + public static final class SubscriptionImportContractTermBuilder { + + private Integer contractTermBillingCycleOnRenewal; + + private ContractTermParams contractTerm; + + private SubscriptionImportContractTermBuilder() {} + + public SubscriptionImportContractTermBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionImportContractTermBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public SubscriptionImportContractTermParams build() { + return new SubscriptionImportContractTermParams(this); + } + } + + public static final class ContractTermParams { + + private final String id; + + private final Timestamp createdAt; + + private final Timestamp contractStart; + + private final Timestamp contractEnd; + + private final Status status; + + private final Long totalAmountRaised; + + private final Long totalAmountRaisedBeforeTax; + + private final Long totalContractValue; + + private final Long totalContractValueBeforeTax; + + private final Integer billingCycle; + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.id = builder.id; + + this.createdAt = builder.createdAt; + + this.contractStart = builder.contractStart; + + this.contractEnd = builder.contractEnd; + + this.status = builder.status; + + this.totalAmountRaised = builder.totalAmountRaised; + + this.totalAmountRaisedBeforeTax = builder.totalAmountRaisedBeforeTax; + + this.totalContractValue = builder.totalContractValue; + + this.totalContractValueBeforeTax = builder.totalContractValueBeforeTax; + + this.billingCycle = builder.billingCycle; + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public String getId() { + return id; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Timestamp getContractStart() { + return contractStart; + } + + public Timestamp getContractEnd() { + return contractEnd; + } + + public Status getStatus() { + return status; + } + + public Long getTotalAmountRaised() { + return totalAmountRaised; + } + + public Long getTotalAmountRaisedBeforeTax() { + return totalAmountRaisedBeforeTax; + } + + public Long getTotalContractValue() { + return totalContractValue; + } + + public Long getTotalContractValueBeforeTax() { + return totalContractValueBeforeTax; + } + + public Integer getBillingCycle() { + return billingCycle; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.createdAt != null) { + + formData.put("created_at", this.createdAt); + } + + if (this.contractStart != null) { + + formData.put("contract_start", this.contractStart); + } + + if (this.contractEnd != null) { + + formData.put("contract_end", this.contractEnd); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.totalAmountRaised != null) { + + formData.put("total_amount_raised", this.totalAmountRaised); + } + + if (this.totalAmountRaisedBeforeTax != null) { + + formData.put("total_amount_raised_before_tax", this.totalAmountRaisedBeforeTax); + } + + if (this.totalContractValue != null) { + + formData.put("total_contract_value", this.totalContractValue); + } + + if (this.totalContractValueBeforeTax != null) { + + formData.put("total_contract_value_before_tax", this.totalContractValueBeforeTax); + } + + if (this.billingCycle != null) { + + formData.put("billing_cycle", this.billingCycle); + } + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private String id; + + private Timestamp createdAt; + + private Timestamp contractStart; + + private Timestamp contractEnd; + + private Status status; + + private Long totalAmountRaised; + + private Long totalAmountRaisedBeforeTax; + + private Long totalContractValue; + + private Long totalContractValueBeforeTax; + + private Integer billingCycle; + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder id(String value) { + this.id = value; + return this; + } + + public ContractTermBuilder createdAt(Timestamp value) { + this.createdAt = value; + return this; + } + + public ContractTermBuilder contractStart(Timestamp value) { + this.contractStart = value; + return this; + } + + public ContractTermBuilder contractEnd(Timestamp value) { + this.contractEnd = value; + return this; + } + + public ContractTermBuilder status(Status value) { + this.status = value; + return this; + } + + public ContractTermBuilder totalAmountRaised(Long value) { + this.totalAmountRaised = value; + return this; + } + + public ContractTermBuilder totalAmountRaisedBeforeTax(Long value) { + this.totalAmountRaisedBeforeTax = value; + return this; + } + + public ContractTermBuilder totalContractValue(Long value) { + this.totalContractValue = value; + return this; + } + + public ContractTermBuilder totalContractValueBeforeTax(Long value) { + this.totalContractValueBeforeTax = value; + return this; + } + + public ContractTermBuilder billingCycle(Integer value) { + this.billingCycle = value; + return this; + } + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum Status { + ACTIVE("active"), + + COMPLETED("completed"), + + CANCELLED("cancelled"), + + TERMINATED("terminated"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + RENEW_ONCE("renew_once"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportForCustomerParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportForCustomerParams.java new file mode 100644 index 00000000..7030eff9 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportForCustomerParams.java @@ -0,0 +1,2112 @@ +/* + * 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.subscription.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 SubscriptionImportForCustomerParams { + + private final String id; + + private final String planId; + + private final Integer planQuantity; + + private final String planQuantityInDecimal; + + private final Long planUnitPrice; + + private final String planUnitPriceInDecimal; + + private final Long setupFee; + + private final Timestamp trialEnd; + + private final Integer billingCycles; + + private final Timestamp startDate; + + private final AutoCollection autoCollection; + + private final String poNumber; + + private final List couponIds; + + private final String paymentSourceId; + + private final Status status; + + private final Timestamp currentTermEnd; + + private final Timestamp currentTermStart; + + private final Timestamp trialStart; + + private final Timestamp cancelledAt; + + private final Timestamp startedAt; + + private final Timestamp activatedAt; + + private final Timestamp pauseDate; + + private final Timestamp resumeDate; + + private final Integer contractTermBillingCycleOnRenewal; + + private final Boolean createCurrentTermInvoice; + + private final String invoiceNotes; + + private final java.util.Map metaData; + + private final ContractTermParams contractTerm; + + private final TransactionParams transaction; + + private final ShippingAddressParams shippingAddress; + + private final List addons; + + private final List eventBasedAddons; + + private final List chargedEventBasedAddons; + + private final List coupons; + + private final Map customFields; + + private SubscriptionImportForCustomerParams(SubscriptionImportForCustomerBuilder builder) { + + this.id = builder.id; + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + + this.planUnitPrice = builder.planUnitPrice; + + this.planUnitPriceInDecimal = builder.planUnitPriceInDecimal; + + this.setupFee = builder.setupFee; + + this.trialEnd = builder.trialEnd; + + this.billingCycles = builder.billingCycles; + + this.startDate = builder.startDate; + + this.autoCollection = builder.autoCollection; + + this.poNumber = builder.poNumber; + + this.couponIds = builder.couponIds; + + this.paymentSourceId = builder.paymentSourceId; + + this.status = builder.status; + + this.currentTermEnd = builder.currentTermEnd; + + this.currentTermStart = builder.currentTermStart; + + this.trialStart = builder.trialStart; + + this.cancelledAt = builder.cancelledAt; + + this.startedAt = builder.startedAt; + + this.activatedAt = builder.activatedAt; + + this.pauseDate = builder.pauseDate; + + this.resumeDate = builder.resumeDate; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + + this.createCurrentTermInvoice = builder.createCurrentTermInvoice; + + this.invoiceNotes = builder.invoiceNotes; + + this.metaData = builder.metaData; + + this.contractTerm = builder.contractTerm; + + this.transaction = builder.transaction; + + this.shippingAddress = builder.shippingAddress; + + this.addons = builder.addons; + + this.eventBasedAddons = builder.eventBasedAddons; + + this.chargedEventBasedAddons = builder.chargedEventBasedAddons; + + this.coupons = builder.coupons; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getId() { + return id; + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + public Long getPlanUnitPrice() { + return planUnitPrice; + } + + public String getPlanUnitPriceInDecimal() { + return planUnitPriceInDecimal; + } + + public Long getSetupFee() { + return setupFee; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getStartDate() { + return startDate; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public String getPoNumber() { + return poNumber; + } + + public List getCouponIds() { + return couponIds; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public Status getStatus() { + return status; + } + + public Timestamp getCurrentTermEnd() { + return currentTermEnd; + } + + public Timestamp getCurrentTermStart() { + return currentTermStart; + } + + public Timestamp getTrialStart() { + return trialStart; + } + + public Timestamp getCancelledAt() { + return cancelledAt; + } + + public Timestamp getStartedAt() { + return startedAt; + } + + public Timestamp getActivatedAt() { + return activatedAt; + } + + public Timestamp getPauseDate() { + return pauseDate; + } + + public Timestamp getResumeDate() { + return resumeDate; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + public Boolean getCreateCurrentTermInvoice() { + return createCurrentTermInvoice; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public java.util.Map getMetaData() { + return metaData; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public TransactionParams getTransaction() { + return transaction; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public List getAddons() { + return addons; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + public List getChargedEventBasedAddons() { + return chargedEventBasedAddons; + } + + public List getCoupons() { + return coupons; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + if (this.planUnitPrice != null) { + + formData.put("plan_unit_price", this.planUnitPrice); + } + + if (this.planUnitPriceInDecimal != null) { + + formData.put("plan_unit_price_in_decimal", this.planUnitPriceInDecimal); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.currentTermEnd != null) { + + formData.put("current_term_end", this.currentTermEnd); + } + + if (this.currentTermStart != null) { + + formData.put("current_term_start", this.currentTermStart); + } + + if (this.trialStart != null) { + + formData.put("trial_start", this.trialStart); + } + + if (this.cancelledAt != null) { + + formData.put("cancelled_at", this.cancelledAt); + } + + if (this.startedAt != null) { + + formData.put("started_at", this.startedAt); + } + + if (this.activatedAt != null) { + + formData.put("activated_at", this.activatedAt); + } + + if (this.pauseDate != null) { + + formData.put("pause_date", this.pauseDate); + } + + if (this.resumeDate != null) { + + formData.put("resume_date", this.resumeDate); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + if (this.createCurrentTermInvoice != null) { + + formData.put("create_current_term_invoice", this.createCurrentTermInvoice); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.transaction != null) { + + // Single object + Map nestedData = this.transaction.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "transaction[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.chargedEventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.chargedEventBasedAddons.size(); i++) { + ChargedEventBasedAddonsParams item = this.chargedEventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "charged_event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.coupons != null) { + + // List of objects + for (int i = 0; i < this.coupons.size(); i++) { + CouponsParams item = this.coupons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for SubscriptionImportForCustomerParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionImportForCustomerBuilder builder() { + return new SubscriptionImportForCustomerBuilder(); + } + + public static final class SubscriptionImportForCustomerBuilder { + + private String id; + + private String planId; + + private Integer planQuantity; + + private String planQuantityInDecimal; + + private Long planUnitPrice; + + private String planUnitPriceInDecimal; + + private Long setupFee; + + private Timestamp trialEnd; + + private Integer billingCycles; + + private Timestamp startDate; + + private AutoCollection autoCollection; + + private String poNumber; + + private List couponIds; + + private String paymentSourceId; + + private Status status; + + private Timestamp currentTermEnd; + + private Timestamp currentTermStart; + + private Timestamp trialStart; + + private Timestamp cancelledAt; + + private Timestamp startedAt; + + private Timestamp activatedAt; + + private Timestamp pauseDate; + + private Timestamp resumeDate; + + private Integer contractTermBillingCycleOnRenewal; + + private Boolean createCurrentTermInvoice; + + private String invoiceNotes; + + private java.util.Map metaData; + + private ContractTermParams contractTerm; + + private TransactionParams transaction; + + private ShippingAddressParams shippingAddress; + + private List addons; + + private List eventBasedAddons; + + private List chargedEventBasedAddons; + + private List coupons; + + private Map customFields = new LinkedHashMap<>(); + + private SubscriptionImportForCustomerBuilder() {} + + public SubscriptionImportForCustomerBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionImportForCustomerBuilder planId(String value) { + this.planId = value; + return this; + } + + public SubscriptionImportForCustomerBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public SubscriptionImportForCustomerBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + public SubscriptionImportForCustomerBuilder planUnitPrice(Long value) { + this.planUnitPrice = value; + return this; + } + + public SubscriptionImportForCustomerBuilder planUnitPriceInDecimal(String value) { + this.planUnitPriceInDecimal = value; + return this; + } + + public SubscriptionImportForCustomerBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionImportForCustomerBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionImportForCustomerBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionImportForCustomerBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionImportForCustomerBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionImportForCustomerBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public SubscriptionImportForCustomerBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public SubscriptionImportForCustomerBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public SubscriptionImportForCustomerBuilder status(Status value) { + this.status = value; + return this; + } + + public SubscriptionImportForCustomerBuilder currentTermEnd(Timestamp value) { + this.currentTermEnd = value; + return this; + } + + public SubscriptionImportForCustomerBuilder currentTermStart(Timestamp value) { + this.currentTermStart = value; + return this; + } + + public SubscriptionImportForCustomerBuilder trialStart(Timestamp value) { + this.trialStart = value; + return this; + } + + public SubscriptionImportForCustomerBuilder cancelledAt(Timestamp value) { + this.cancelledAt = value; + return this; + } + + public SubscriptionImportForCustomerBuilder startedAt(Timestamp value) { + this.startedAt = value; + return this; + } + + public SubscriptionImportForCustomerBuilder activatedAt(Timestamp value) { + this.activatedAt = value; + return this; + } + + public SubscriptionImportForCustomerBuilder pauseDate(Timestamp value) { + this.pauseDate = value; + return this; + } + + public SubscriptionImportForCustomerBuilder resumeDate(Timestamp value) { + this.resumeDate = value; + return this; + } + + public SubscriptionImportForCustomerBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionImportForCustomerBuilder createCurrentTermInvoice(Boolean value) { + this.createCurrentTermInvoice = value; + return this; + } + + public SubscriptionImportForCustomerBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public SubscriptionImportForCustomerBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public SubscriptionImportForCustomerBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public SubscriptionImportForCustomerBuilder transaction(TransactionParams value) { + this.transaction = value; + return this; + } + + public SubscriptionImportForCustomerBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public SubscriptionImportForCustomerBuilder addons(List value) { + this.addons = value; + return this; + } + + public SubscriptionImportForCustomerBuilder eventBasedAddons( + List value) { + this.eventBasedAddons = value; + return this; + } + + public SubscriptionImportForCustomerBuilder chargedEventBasedAddons( + List value) { + this.chargedEventBasedAddons = value; + return this; + } + + @Deprecated + public SubscriptionImportForCustomerBuilder coupons(List value) { + this.coupons = 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 SubscriptionImportForCustomerBuilder 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 SubscriptionImportForCustomerBuilder 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 SubscriptionImportForCustomerParams build() { + return new SubscriptionImportForCustomerParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + FUTURE("future"), + + IN_TRIAL("in_trial"), + + ACTIVE("active"), + + NON_RENEWING("non_renewing"), + + PAUSED("paused"), + + CANCELLED("cancelled"), + + TRANSFERRED("transferred"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class ContractTermParams { + + private final String id; + + private final Timestamp createdAt; + + private final Timestamp contractStart; + + private final Integer billingCycle; + + private final Long totalAmountRaised; + + private final Long totalAmountRaisedBeforeTax; + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.id = builder.id; + + this.createdAt = builder.createdAt; + + this.contractStart = builder.contractStart; + + this.billingCycle = builder.billingCycle; + + this.totalAmountRaised = builder.totalAmountRaised; + + this.totalAmountRaisedBeforeTax = builder.totalAmountRaisedBeforeTax; + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public String getId() { + return id; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Timestamp getContractStart() { + return contractStart; + } + + public Integer getBillingCycle() { + return billingCycle; + } + + public Long getTotalAmountRaised() { + return totalAmountRaised; + } + + public Long getTotalAmountRaisedBeforeTax() { + return totalAmountRaisedBeforeTax; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.createdAt != null) { + + formData.put("created_at", this.createdAt); + } + + if (this.contractStart != null) { + + formData.put("contract_start", this.contractStart); + } + + if (this.billingCycle != null) { + + formData.put("billing_cycle", this.billingCycle); + } + + if (this.totalAmountRaised != null) { + + formData.put("total_amount_raised", this.totalAmountRaised); + } + + if (this.totalAmountRaisedBeforeTax != null) { + + formData.put("total_amount_raised_before_tax", this.totalAmountRaisedBeforeTax); + } + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private String id; + + private Timestamp createdAt; + + private Timestamp contractStart; + + private Integer billingCycle; + + private Long totalAmountRaised; + + private Long totalAmountRaisedBeforeTax; + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder id(String value) { + this.id = value; + return this; + } + + public ContractTermBuilder createdAt(Timestamp value) { + this.createdAt = value; + return this; + } + + public ContractTermBuilder contractStart(Timestamp value) { + this.contractStart = value; + return this; + } + + public ContractTermBuilder billingCycle(Integer value) { + this.billingCycle = value; + return this; + } + + public ContractTermBuilder totalAmountRaised(Long value) { + this.totalAmountRaised = value; + return this; + } + + public ContractTermBuilder totalAmountRaisedBeforeTax(Long value) { + this.totalAmountRaisedBeforeTax = value; + return this; + } + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + RENEW_ONCE("renew_once"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TransactionParams { + + private final Long amount; + + private final PaymentMethod paymentMethod; + + private final String referenceNumber; + + private final Timestamp date; + + private TransactionParams(TransactionBuilder builder) { + + this.amount = builder.amount; + + this.paymentMethod = builder.paymentMethod; + + this.referenceNumber = builder.referenceNumber; + + this.date = builder.date; + } + + public Long getAmount() { + return amount; + } + + public PaymentMethod getPaymentMethod() { + return paymentMethod; + } + + public String getReferenceNumber() { + return referenceNumber; + } + + public Timestamp getDate() { + return date; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.paymentMethod != null) { + + formData.put("payment_method", this.paymentMethod); + } + + if (this.referenceNumber != null) { + + formData.put("reference_number", this.referenceNumber); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + return formData; + } + + /** Create a new builder for TransactionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionBuilder builder() { + return new TransactionBuilder(); + } + + public static final class TransactionBuilder { + + private Long amount; + + private PaymentMethod paymentMethod; + + private String referenceNumber; + + private Timestamp date; + + private TransactionBuilder() {} + + public TransactionBuilder amount(Long value) { + this.amount = value; + return this; + } + + public TransactionBuilder paymentMethod(PaymentMethod value) { + this.paymentMethod = value; + return this; + } + + public TransactionBuilder referenceNumber(String value) { + this.referenceNumber = value; + return this; + } + + public TransactionBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public TransactionParams build() { + return new TransactionParams(this); + } + } + + public enum PaymentMethod { + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + OTHER("other"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + CUSTOM("custom"), + + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethod enumValue : PaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private final Integer servicePeriodInDays; + + private final OnEvent onEvent; + + private final Boolean chargeOnce; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.servicePeriodInDays = builder.servicePeriodInDays; + + this.onEvent = builder.onEvent; + + this.chargeOnce = builder.chargeOnce; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getServicePeriodInDays() { + return servicePeriodInDays; + } + + public OnEvent getOnEvent() { + return onEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.servicePeriodInDays != null) { + + formData.put("service_period_in_days", this.servicePeriodInDays); + } + + if (this.onEvent != null) { + + formData.put("on_event", this.onEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private Integer servicePeriodInDays; + + private OnEvent onEvent; + + private Boolean chargeOnce; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { + this.servicePeriodInDays = value; + return this; + } + + public EventBasedAddonsBuilder onEvent(OnEvent value) { + this.onEvent = value; + return this; + } + + public EventBasedAddonsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + + public enum OnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** An enum member indicating that OnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (OnEvent enumValue : OnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ChargedEventBasedAddonsParams { + + private final String id; + + private final Timestamp lastChargedAt; + + private ChargedEventBasedAddonsParams(ChargedEventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.lastChargedAt = builder.lastChargedAt; + } + + public String getId() { + return id; + } + + public Timestamp getLastChargedAt() { + return lastChargedAt; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.lastChargedAt != null) { + + formData.put("last_charged_at", this.lastChargedAt); + } + + return formData; + } + + /** Create a new builder for ChargedEventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargedEventBasedAddonsBuilder builder() { + return new ChargedEventBasedAddonsBuilder(); + } + + public static final class ChargedEventBasedAddonsBuilder { + + private String id; + + private Timestamp lastChargedAt; + + private ChargedEventBasedAddonsBuilder() {} + + public ChargedEventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public ChargedEventBasedAddonsBuilder lastChargedAt(Timestamp value) { + this.lastChargedAt = value; + return this; + } + + public ChargedEventBasedAddonsParams build() { + return new ChargedEventBasedAddonsParams(this); + } + } + } + + public static final class CouponsParams { + + private final String couponId; + + private final Timestamp applyTill; + + private CouponsParams(CouponsBuilder builder) { + + this.couponId = builder.couponId; + + this.applyTill = builder.applyTill; + } + + public String getCouponId() { + return couponId; + } + + public Timestamp getApplyTill() { + return applyTill; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.couponId != null) { + + formData.put("coupon_id", this.couponId); + } + + if (this.applyTill != null) { + + formData.put("apply_till", this.applyTill); + } + + return formData; + } + + /** Create a new builder for CouponsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponsBuilder builder() { + return new CouponsBuilder(); + } + + public static final class CouponsBuilder { + + private String couponId; + + private Timestamp applyTill; + + private CouponsBuilder() {} + + public CouponsBuilder couponId(String value) { + this.couponId = value; + return this; + } + + public CouponsBuilder applyTill(Timestamp value) { + this.applyTill = value; + return this; + } + + public CouponsParams build() { + return new CouponsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportForItemsParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportForItemsParams.java new file mode 100644 index 00000000..71c5ac6f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportForItemsParams.java @@ -0,0 +1,2620 @@ +/* + * 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.subscription.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 SubscriptionImportForItemsParams { + + private final List exhaustedCouponIds; + + private final String id; + + private final Timestamp trialEnd; + + private final Integer billingCycles; + + private final Long setupFee; + + private final Integer netTermDays; + + private final Timestamp startDate; + + private final AutoCollection autoCollection; + + private final String poNumber; + + private final List couponIds; + + private final String paymentSourceId; + + private final Status status; + + private final Timestamp currentTermEnd; + + private final Timestamp currentTermStart; + + private final Timestamp trialStart; + + private final Timestamp cancelledAt; + + private final Timestamp startedAt; + + private final Timestamp activatedAt; + + private final Timestamp pauseDate; + + private final Timestamp resumeDate; + + private final Integer contractTermBillingCycleOnRenewal; + + private final Boolean createCurrentTermInvoice; + + private final String invoiceNotes; + + private final java.util.Map metaData; + + private final String cancelReasonCode; + + private final Boolean createPendingInvoices; + + private final Boolean autoCloseInvoices; + + private final ContractTermParams contractTerm; + + private final TransactionParams transaction; + + private final ShippingAddressParams shippingAddress; + + private final List subscriptionItems; + + private final List discounts; + + private final List chargedItems; + + private final List itemTiers; + + private final List coupons; + + private final Map customFields; + + private SubscriptionImportForItemsParams(SubscriptionImportForItemsBuilder builder) { + + this.exhaustedCouponIds = builder.exhaustedCouponIds; + + this.id = builder.id; + + this.trialEnd = builder.trialEnd; + + this.billingCycles = builder.billingCycles; + + this.setupFee = builder.setupFee; + + this.netTermDays = builder.netTermDays; + + this.startDate = builder.startDate; + + this.autoCollection = builder.autoCollection; + + this.poNumber = builder.poNumber; + + this.couponIds = builder.couponIds; + + this.paymentSourceId = builder.paymentSourceId; + + this.status = builder.status; + + this.currentTermEnd = builder.currentTermEnd; + + this.currentTermStart = builder.currentTermStart; + + this.trialStart = builder.trialStart; + + this.cancelledAt = builder.cancelledAt; + + this.startedAt = builder.startedAt; + + this.activatedAt = builder.activatedAt; + + this.pauseDate = builder.pauseDate; + + this.resumeDate = builder.resumeDate; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + + this.createCurrentTermInvoice = builder.createCurrentTermInvoice; + + this.invoiceNotes = builder.invoiceNotes; + + this.metaData = builder.metaData; + + this.cancelReasonCode = builder.cancelReasonCode; + + this.createPendingInvoices = builder.createPendingInvoices; + + this.autoCloseInvoices = builder.autoCloseInvoices; + + this.contractTerm = builder.contractTerm; + + this.transaction = builder.transaction; + + this.shippingAddress = builder.shippingAddress; + + this.subscriptionItems = builder.subscriptionItems; + + this.discounts = builder.discounts; + + this.chargedItems = builder.chargedItems; + + this.itemTiers = builder.itemTiers; + + this.coupons = builder.coupons; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public List getExhaustedCouponIds() { + return exhaustedCouponIds; + } + + public String getId() { + return id; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Long getSetupFee() { + return setupFee; + } + + public Integer getNetTermDays() { + return netTermDays; + } + + public Timestamp getStartDate() { + return startDate; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public String getPoNumber() { + return poNumber; + } + + public List getCouponIds() { + return couponIds; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public Status getStatus() { + return status; + } + + public Timestamp getCurrentTermEnd() { + return currentTermEnd; + } + + public Timestamp getCurrentTermStart() { + return currentTermStart; + } + + public Timestamp getTrialStart() { + return trialStart; + } + + public Timestamp getCancelledAt() { + return cancelledAt; + } + + public Timestamp getStartedAt() { + return startedAt; + } + + public Timestamp getActivatedAt() { + return activatedAt; + } + + public Timestamp getPauseDate() { + return pauseDate; + } + + public Timestamp getResumeDate() { + return resumeDate; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + public Boolean getCreateCurrentTermInvoice() { + return createCurrentTermInvoice; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public java.util.Map getMetaData() { + return metaData; + } + + public String getCancelReasonCode() { + return cancelReasonCode; + } + + public Boolean getCreatePendingInvoices() { + return createPendingInvoices; + } + + public Boolean getAutoCloseInvoices() { + return autoCloseInvoices; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public TransactionParams getTransaction() { + return transaction; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + public List getDiscounts() { + return discounts; + } + + public List getChargedItems() { + return chargedItems; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getCoupons() { + return coupons; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.exhaustedCouponIds != null) { + + formData.put("exhausted_coupon_ids", this.exhaustedCouponIds); + } + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.netTermDays != null) { + + formData.put("net_term_days", this.netTermDays); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.currentTermEnd != null) { + + formData.put("current_term_end", this.currentTermEnd); + } + + if (this.currentTermStart != null) { + + formData.put("current_term_start", this.currentTermStart); + } + + if (this.trialStart != null) { + + formData.put("trial_start", this.trialStart); + } + + if (this.cancelledAt != null) { + + formData.put("cancelled_at", this.cancelledAt); + } + + if (this.startedAt != null) { + + formData.put("started_at", this.startedAt); + } + + if (this.activatedAt != null) { + + formData.put("activated_at", this.activatedAt); + } + + if (this.pauseDate != null) { + + formData.put("pause_date", this.pauseDate); + } + + if (this.resumeDate != null) { + + formData.put("resume_date", this.resumeDate); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + if (this.createCurrentTermInvoice != null) { + + formData.put("create_current_term_invoice", this.createCurrentTermInvoice); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + if (this.cancelReasonCode != null) { + + formData.put("cancel_reason_code", this.cancelReasonCode); + } + + if (this.createPendingInvoices != null) { + + formData.put("create_pending_invoices", this.createPendingInvoices); + } + + if (this.autoCloseInvoices != null) { + + formData.put("auto_close_invoices", this.autoCloseInvoices); + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.transaction != null) { + + // Single object + Map nestedData = this.transaction.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "transaction[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.chargedItems != null) { + + // List of objects + for (int i = 0; i < this.chargedItems.size(); i++) { + ChargedItemsParams item = this.chargedItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "charged_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.coupons != null) { + + // List of objects + for (int i = 0; i < this.coupons.size(); i++) { + CouponsParams item = this.coupons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for SubscriptionImportForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionImportForItemsBuilder builder() { + return new SubscriptionImportForItemsBuilder(); + } + + public static final class SubscriptionImportForItemsBuilder { + + private List exhaustedCouponIds; + + private String id; + + private Timestamp trialEnd; + + private Integer billingCycles; + + private Long setupFee; + + private Integer netTermDays; + + private Timestamp startDate; + + private AutoCollection autoCollection; + + private String poNumber; + + private List couponIds; + + private String paymentSourceId; + + private Status status; + + private Timestamp currentTermEnd; + + private Timestamp currentTermStart; + + private Timestamp trialStart; + + private Timestamp cancelledAt; + + private Timestamp startedAt; + + private Timestamp activatedAt; + + private Timestamp pauseDate; + + private Timestamp resumeDate; + + private Integer contractTermBillingCycleOnRenewal; + + private Boolean createCurrentTermInvoice; + + private String invoiceNotes; + + private java.util.Map metaData; + + private String cancelReasonCode; + + private Boolean createPendingInvoices; + + private Boolean autoCloseInvoices; + + private ContractTermParams contractTerm; + + private TransactionParams transaction; + + private ShippingAddressParams shippingAddress; + + private List subscriptionItems; + + private List discounts; + + private List chargedItems; + + private List itemTiers; + + private List coupons; + + private Map customFields = new LinkedHashMap<>(); + + private SubscriptionImportForItemsBuilder() {} + + public SubscriptionImportForItemsBuilder exhaustedCouponIds(List value) { + this.exhaustedCouponIds = value; + return this; + } + + public SubscriptionImportForItemsBuilder id(String value) { + this.id = value; + return this; + } + + public SubscriptionImportForItemsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionImportForItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + @Deprecated + public SubscriptionImportForItemsBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionImportForItemsBuilder netTermDays(Integer value) { + this.netTermDays = value; + return this; + } + + public SubscriptionImportForItemsBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionImportForItemsBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionImportForItemsBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public SubscriptionImportForItemsBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public SubscriptionImportForItemsBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public SubscriptionImportForItemsBuilder status(Status value) { + this.status = value; + return this; + } + + public SubscriptionImportForItemsBuilder currentTermEnd(Timestamp value) { + this.currentTermEnd = value; + return this; + } + + public SubscriptionImportForItemsBuilder currentTermStart(Timestamp value) { + this.currentTermStart = value; + return this; + } + + public SubscriptionImportForItemsBuilder trialStart(Timestamp value) { + this.trialStart = value; + return this; + } + + public SubscriptionImportForItemsBuilder cancelledAt(Timestamp value) { + this.cancelledAt = value; + return this; + } + + public SubscriptionImportForItemsBuilder startedAt(Timestamp value) { + this.startedAt = value; + return this; + } + + public SubscriptionImportForItemsBuilder activatedAt(Timestamp value) { + this.activatedAt = value; + return this; + } + + public SubscriptionImportForItemsBuilder pauseDate(Timestamp value) { + this.pauseDate = value; + return this; + } + + public SubscriptionImportForItemsBuilder resumeDate(Timestamp value) { + this.resumeDate = value; + return this; + } + + public SubscriptionImportForItemsBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionImportForItemsBuilder createCurrentTermInvoice(Boolean value) { + this.createCurrentTermInvoice = value; + return this; + } + + public SubscriptionImportForItemsBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public SubscriptionImportForItemsBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public SubscriptionImportForItemsBuilder cancelReasonCode(String value) { + this.cancelReasonCode = value; + return this; + } + + public SubscriptionImportForItemsBuilder createPendingInvoices(Boolean value) { + this.createPendingInvoices = value; + return this; + } + + public SubscriptionImportForItemsBuilder autoCloseInvoices(Boolean value) { + this.autoCloseInvoices = value; + return this; + } + + public SubscriptionImportForItemsBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public SubscriptionImportForItemsBuilder transaction(TransactionParams value) { + this.transaction = value; + return this; + } + + public SubscriptionImportForItemsBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public SubscriptionImportForItemsBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public SubscriptionImportForItemsBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public SubscriptionImportForItemsBuilder chargedItems(List value) { + this.chargedItems = value; + return this; + } + + public SubscriptionImportForItemsBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + @Deprecated + public SubscriptionImportForItemsBuilder coupons(List value) { + this.coupons = 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 SubscriptionImportForItemsBuilder 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 SubscriptionImportForItemsBuilder 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 SubscriptionImportForItemsParams build() { + return new SubscriptionImportForItemsParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + FUTURE("future"), + + IN_TRIAL("in_trial"), + + ACTIVE("active"), + + NON_RENEWING("non_renewing"), + + PAUSED("paused"), + + CANCELLED("cancelled"), + + TRANSFERRED("transferred"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class ContractTermParams { + + private final String id; + + private final Timestamp createdAt; + + private final Timestamp contractStart; + + private final Integer billingCycle; + + private final Long totalAmountRaised; + + private final Long totalAmountRaisedBeforeTax; + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.id = builder.id; + + this.createdAt = builder.createdAt; + + this.contractStart = builder.contractStart; + + this.billingCycle = builder.billingCycle; + + this.totalAmountRaised = builder.totalAmountRaised; + + this.totalAmountRaisedBeforeTax = builder.totalAmountRaisedBeforeTax; + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public String getId() { + return id; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Timestamp getContractStart() { + return contractStart; + } + + public Integer getBillingCycle() { + return billingCycle; + } + + public Long getTotalAmountRaised() { + return totalAmountRaised; + } + + public Long getTotalAmountRaisedBeforeTax() { + return totalAmountRaisedBeforeTax; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.createdAt != null) { + + formData.put("created_at", this.createdAt); + } + + if (this.contractStart != null) { + + formData.put("contract_start", this.contractStart); + } + + if (this.billingCycle != null) { + + formData.put("billing_cycle", this.billingCycle); + } + + if (this.totalAmountRaised != null) { + + formData.put("total_amount_raised", this.totalAmountRaised); + } + + if (this.totalAmountRaisedBeforeTax != null) { + + formData.put("total_amount_raised_before_tax", this.totalAmountRaisedBeforeTax); + } + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private String id; + + private Timestamp createdAt; + + private Timestamp contractStart; + + private Integer billingCycle; + + private Long totalAmountRaised; + + private Long totalAmountRaisedBeforeTax; + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder id(String value) { + this.id = value; + return this; + } + + public ContractTermBuilder createdAt(Timestamp value) { + this.createdAt = value; + return this; + } + + public ContractTermBuilder contractStart(Timestamp value) { + this.contractStart = value; + return this; + } + + public ContractTermBuilder billingCycle(Integer value) { + this.billingCycle = value; + return this; + } + + public ContractTermBuilder totalAmountRaised(Long value) { + this.totalAmountRaised = value; + return this; + } + + public ContractTermBuilder totalAmountRaisedBeforeTax(Long value) { + this.totalAmountRaisedBeforeTax = value; + return this; + } + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + RENEW_ONCE("renew_once"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TransactionParams { + + private final Long amount; + + private final PaymentMethod paymentMethod; + + private final String referenceNumber; + + private final Timestamp date; + + private TransactionParams(TransactionBuilder builder) { + + this.amount = builder.amount; + + this.paymentMethod = builder.paymentMethod; + + this.referenceNumber = builder.referenceNumber; + + this.date = builder.date; + } + + public Long getAmount() { + return amount; + } + + public PaymentMethod getPaymentMethod() { + return paymentMethod; + } + + public String getReferenceNumber() { + return referenceNumber; + } + + public Timestamp getDate() { + return date; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.paymentMethod != null) { + + formData.put("payment_method", this.paymentMethod); + } + + if (this.referenceNumber != null) { + + formData.put("reference_number", this.referenceNumber); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + return formData; + } + + /** Create a new builder for TransactionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionBuilder builder() { + return new TransactionBuilder(); + } + + public static final class TransactionBuilder { + + private Long amount; + + private PaymentMethod paymentMethod; + + private String referenceNumber; + + private Timestamp date; + + private TransactionBuilder() {} + + public TransactionBuilder amount(Long value) { + this.amount = value; + return this; + } + + public TransactionBuilder paymentMethod(PaymentMethod value) { + this.paymentMethod = value; + return this; + } + + public TransactionBuilder referenceNumber(String value) { + this.referenceNumber = value; + return this; + } + + public TransactionBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public TransactionParams build() { + return new TransactionParams(this); + } + } + + public enum PaymentMethod { + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + OTHER("other"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + CUSTOM("custom"), + + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethod enumValue : PaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ItemType itemType; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.itemType = builder.itemType; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ItemType getItemType() { + return itemType; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.itemType != null) { + + formData.put("item_type", this.itemType); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ItemType itemType; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionItemsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionItemsBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public SubscriptionItemsBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + + 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"), + + /** 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; + } + } + + 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 DiscountsParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private final Integer quantity; + + private DiscountsParams(DiscountsBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private Integer quantity; + + private DiscountsBuilder() {} + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 ChargedItemsParams { + + private final String itemPriceId; + + private final Timestamp lastChargedAt; + + private ChargedItemsParams(ChargedItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.lastChargedAt = builder.lastChargedAt; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Timestamp getLastChargedAt() { + return lastChargedAt; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.lastChargedAt != null) { + + formData.put("last_charged_at", this.lastChargedAt); + } + + return formData; + } + + /** Create a new builder for ChargedItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargedItemsBuilder builder() { + return new ChargedItemsBuilder(); + } + + public static final class ChargedItemsBuilder { + + private String itemPriceId; + + private Timestamp lastChargedAt; + + private ChargedItemsBuilder() {} + + public ChargedItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ChargedItemsBuilder lastChargedAt(Timestamp value) { + this.lastChargedAt = value; + return this; + } + + public ChargedItemsParams build() { + return new ChargedItemsParams(this); + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CouponsParams { + + private final String couponId; + + private final Timestamp applyTill; + + private CouponsParams(CouponsBuilder builder) { + + this.couponId = builder.couponId; + + this.applyTill = builder.applyTill; + } + + public String getCouponId() { + return couponId; + } + + public Timestamp getApplyTill() { + return applyTill; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.couponId != null) { + + formData.put("coupon_id", this.couponId); + } + + if (this.applyTill != null) { + + formData.put("apply_till", this.applyTill); + } + + return formData; + } + + /** Create a new builder for CouponsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponsBuilder builder() { + return new CouponsBuilder(); + } + + public static final class CouponsBuilder { + + private String couponId; + + private Timestamp applyTill; + + private CouponsBuilder() {} + + public CouponsBuilder couponId(String value) { + this.couponId = value; + return this; + } + + public CouponsBuilder applyTill(Timestamp value) { + this.applyTill = value; + return this; + } + + public CouponsParams build() { + return new CouponsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportUnbilledChargesParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportUnbilledChargesParams.java new file mode 100644 index 00000000..79572b13 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportUnbilledChargesParams.java @@ -0,0 +1,868 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class SubscriptionImportUnbilledChargesParams { + + private final List unbilledCharges; + + private final List discounts; + + private final List tiers; + + private SubscriptionImportUnbilledChargesParams( + SubscriptionImportUnbilledChargesBuilder builder) { + + this.unbilledCharges = builder.unbilledCharges; + + this.discounts = builder.discounts; + + this.tiers = builder.tiers; + } + + public List getUnbilledCharges() { + return unbilledCharges; + } + + public List getDiscounts() { + return discounts; + } + + public List getTiers() { + return tiers; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.unbilledCharges != null) { + + // List of objects + for (int i = 0; i < this.unbilledCharges.size(); i++) { + UnbilledChargesParams item = this.unbilledCharges.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "unbilled_charges[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.tiers != null) { + + // List of objects + for (int i = 0; i < this.tiers.size(); i++) { + TiersParams item = this.tiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for SubscriptionImportUnbilledChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionImportUnbilledChargesBuilder builder() { + return new SubscriptionImportUnbilledChargesBuilder(); + } + + public static final class SubscriptionImportUnbilledChargesBuilder { + + private List unbilledCharges; + + private List discounts; + + private List tiers; + + private SubscriptionImportUnbilledChargesBuilder() {} + + public SubscriptionImportUnbilledChargesBuilder unbilledCharges( + List value) { + this.unbilledCharges = value; + return this; + } + + public SubscriptionImportUnbilledChargesBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public SubscriptionImportUnbilledChargesBuilder tiers(List value) { + this.tiers = value; + return this; + } + + public SubscriptionImportUnbilledChargesParams build() { + return new SubscriptionImportUnbilledChargesParams(this); + } + } + + public static final class UnbilledChargesParams { + + private final String id; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private final EntityType entityType; + + private final String entityId; + + private final String description; + + private final Long unitAmount; + + private final Integer quantity; + + private final Long amount; + + private final String unitAmountInDecimal; + + private final String quantityInDecimal; + + private final String amountInDecimal; + + private final Long discountAmount; + + private final Boolean useForProration; + + private final Boolean isAdvanceCharge; + + private UnbilledChargesParams(UnbilledChargesBuilder builder) { + + this.id = builder.id; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + + this.entityType = builder.entityType; + + this.entityId = builder.entityId; + + this.description = builder.description; + + this.unitAmount = builder.unitAmount; + + this.quantity = builder.quantity; + + this.amount = builder.amount; + + this.unitAmountInDecimal = builder.unitAmountInDecimal; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.amountInDecimal = builder.amountInDecimal; + + this.discountAmount = builder.discountAmount; + + this.useForProration = builder.useForProration; + + this.isAdvanceCharge = builder.isAdvanceCharge; + } + + public String getId() { + return id; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + + public String getDescription() { + return description; + } + + public Long getUnitAmount() { + return unitAmount; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getAmount() { + return amount; + } + + public String getUnitAmountInDecimal() { + return unitAmountInDecimal; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public Long getDiscountAmount() { + return discountAmount; + } + + public Boolean getUseForProration() { + return useForProration; + } + + public Boolean getIsAdvanceCharge() { + return isAdvanceCharge; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + if (this.entityType != null) { + + formData.put("entity_type", this.entityType); + } + + if (this.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.unitAmount != null) { + + formData.put("unit_amount", this.unitAmount); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.unitAmountInDecimal != null) { + + formData.put("unit_amount_in_decimal", this.unitAmountInDecimal); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.discountAmount != null) { + + formData.put("discount_amount", this.discountAmount); + } + + if (this.useForProration != null) { + + formData.put("use_for_proration", this.useForProration); + } + + if (this.isAdvanceCharge != null) { + + formData.put("is_advance_charge", this.isAdvanceCharge); + } + + return formData; + } + + /** Create a new builder for UnbilledChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UnbilledChargesBuilder builder() { + return new UnbilledChargesBuilder(); + } + + public static final class UnbilledChargesBuilder { + + private String id; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private EntityType entityType; + + private String entityId; + + private String description; + + private Long unitAmount; + + private Integer quantity; + + private Long amount; + + private String unitAmountInDecimal; + + private String quantityInDecimal; + + private String amountInDecimal; + + private Long discountAmount; + + private Boolean useForProration; + + private Boolean isAdvanceCharge; + + private UnbilledChargesBuilder() {} + + public UnbilledChargesBuilder id(String value) { + this.id = value; + return this; + } + + public UnbilledChargesBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public UnbilledChargesBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public UnbilledChargesBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public UnbilledChargesBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public UnbilledChargesBuilder description(String value) { + this.description = value; + return this; + } + + public UnbilledChargesBuilder unitAmount(Long value) { + this.unitAmount = value; + return this; + } + + public UnbilledChargesBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public UnbilledChargesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public UnbilledChargesBuilder unitAmountInDecimal(String value) { + this.unitAmountInDecimal = value; + return this; + } + + public UnbilledChargesBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public UnbilledChargesBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public UnbilledChargesBuilder discountAmount(Long value) { + this.discountAmount = value; + return this; + } + + public UnbilledChargesBuilder useForProration(Boolean value) { + this.useForProration = value; + return this; + } + + public UnbilledChargesBuilder isAdvanceCharge(Boolean value) { + this.isAdvanceCharge = value; + return this; + } + + public UnbilledChargesParams build() { + return new UnbilledChargesParams(this); + } + } + + public enum EntityType { + ADHOC("adhoc"), + + PLAN_ITEM_PRICE("plan_item_price"), + + ADDON_ITEM_PRICE("addon_item_price"), + + CHARGE_ITEM_PRICE("charge_item_price"), + + PLAN_SETUP("plan_setup"), + + PLAN("plan"), + + ADDON("addon"), + + /** 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 static final class DiscountsParams { + + private final String unbilledChargeId; + + private final EntityType entityType; + + private final String entityId; + + private final String description; + + private final Long amount; + + private DiscountsParams(DiscountsBuilder builder) { + + this.unbilledChargeId = builder.unbilledChargeId; + + this.entityType = builder.entityType; + + this.entityId = builder.entityId; + + this.description = builder.description; + + this.amount = builder.amount; + } + + public String getUnbilledChargeId() { + return unbilledChargeId; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + + public String getDescription() { + return description; + } + + public Long getAmount() { + return amount; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.unbilledChargeId != null) { + + formData.put("unbilled_charge_id", this.unbilledChargeId); + } + + if (this.entityType != null) { + + formData.put("entity_type", this.entityType); + } + + if (this.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private String unbilledChargeId; + + private EntityType entityType; + + private String entityId; + + private String description; + + private Long amount; + + private DiscountsBuilder() {} + + public DiscountsBuilder unbilledChargeId(String value) { + this.unbilledChargeId = value; + return this; + } + + public DiscountsBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public DiscountsBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public DiscountsBuilder description(String value) { + this.description = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum EntityType { + ITEM_LEVEL_COUPON("item_level_coupon"), + + DOCUMENT_LEVEL_COUPON("document_level_coupon"), + + ITEM_LEVEL_DISCOUNT("item_level_discount"), + + DOCUMENT_LEVEL_DISCOUNT("document_level_discount"), + + /** 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 static final class TiersParams { + + private final String unbilledChargeId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Integer quantityUsed; + + private final Long unitAmount; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String quantityUsedInDecimal; + + private final String unitAmountInDecimal; + + private TiersParams(TiersBuilder builder) { + + this.unbilledChargeId = builder.unbilledChargeId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.quantityUsed = builder.quantityUsed; + + this.unitAmount = builder.unitAmount; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.quantityUsedInDecimal = builder.quantityUsedInDecimal; + + this.unitAmountInDecimal = builder.unitAmountInDecimal; + } + + public String getUnbilledChargeId() { + return unbilledChargeId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Integer getQuantityUsed() { + return quantityUsed; + } + + public Long getUnitAmount() { + return unitAmount; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getQuantityUsedInDecimal() { + return quantityUsedInDecimal; + } + + public String getUnitAmountInDecimal() { + return unitAmountInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.unbilledChargeId != null) { + + formData.put("unbilled_charge_id", this.unbilledChargeId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.quantityUsed != null) { + + formData.put("quantity_used", this.quantityUsed); + } + + if (this.unitAmount != null) { + + formData.put("unit_amount", this.unitAmount); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.quantityUsedInDecimal != null) { + + formData.put("quantity_used_in_decimal", this.quantityUsedInDecimal); + } + + if (this.unitAmountInDecimal != null) { + + formData.put("unit_amount_in_decimal", this.unitAmountInDecimal); + } + + return formData; + } + + /** Create a new builder for TiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TiersBuilder builder() { + return new TiersBuilder(); + } + + public static final class TiersBuilder { + + private String unbilledChargeId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Integer quantityUsed; + + private Long unitAmount; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String quantityUsedInDecimal; + + private String unitAmountInDecimal; + + private TiersBuilder() {} + + public TiersBuilder unbilledChargeId(String value) { + this.unbilledChargeId = value; + return this; + } + + public TiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public TiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public TiersBuilder quantityUsed(Integer value) { + this.quantityUsed = value; + return this; + } + + public TiersBuilder unitAmount(Long value) { + this.unitAmount = value; + return this; + } + + public TiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public TiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public TiersBuilder quantityUsedInDecimal(String value) { + this.quantityUsedInDecimal = value; + return this; + } + + public TiersBuilder unitAmountInDecimal(String value) { + this.unitAmountInDecimal = value; + return this; + } + + public TiersParams build() { + return new TiersParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionListDiscountsParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionListDiscountsParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionListDiscountsParams.java rename to src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionListDiscountsParams.java index dbdbbcef..977e5c1c 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionListDiscountsParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionListDiscountsParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscription.params; +package com.chargebee.v4.models.subscription.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionListParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionListParams.java rename to src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionListParams.java index afd89cdb..7e5565c8 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionListParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscription.params; +package com.chargebee.v4.models.subscription.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionMoveParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionMoveParams.java new file mode 100644 index 00000000..1a882b6f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionMoveParams.java @@ -0,0 +1,80 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class SubscriptionMoveParams { + + private final String toCustomerId; + + private final Boolean copyPaymentSource; + + private SubscriptionMoveParams(SubscriptionMoveBuilder builder) { + + this.toCustomerId = builder.toCustomerId; + + this.copyPaymentSource = builder.copyPaymentSource; + } + + public String getToCustomerId() { + return toCustomerId; + } + + public Boolean getCopyPaymentSource() { + return copyPaymentSource; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.toCustomerId != null) { + + formData.put("to_customer_id", this.toCustomerId); + } + + if (this.copyPaymentSource != null) { + + formData.put("copy_payment_source", this.copyPaymentSource); + } + + return formData; + } + + /** Create a new builder for SubscriptionMoveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionMoveBuilder builder() { + return new SubscriptionMoveBuilder(); + } + + public static final class SubscriptionMoveBuilder { + + private String toCustomerId; + + private Boolean copyPaymentSource; + + private SubscriptionMoveBuilder() {} + + public SubscriptionMoveBuilder toCustomerId(String value) { + this.toCustomerId = value; + return this; + } + + public SubscriptionMoveBuilder copyPaymentSource(Boolean value) { + this.copyPaymentSource = value; + return this; + } + + public SubscriptionMoveParams build() { + return new SubscriptionMoveParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionOverrideBillingProfileParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionOverrideBillingProfileParams.java new file mode 100644 index 00000000..d6b75935 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionOverrideBillingProfileParams.java @@ -0,0 +1,109 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class SubscriptionOverrideBillingProfileParams { + + private final String paymentSourceId; + + private final AutoCollection autoCollection; + + private SubscriptionOverrideBillingProfileParams( + SubscriptionOverrideBillingProfileBuilder builder) { + + this.paymentSourceId = builder.paymentSourceId; + + this.autoCollection = builder.autoCollection; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + return formData; + } + + /** Create a new builder for SubscriptionOverrideBillingProfileParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionOverrideBillingProfileBuilder builder() { + return new SubscriptionOverrideBillingProfileBuilder(); + } + + public static final class SubscriptionOverrideBillingProfileBuilder { + + private String paymentSourceId; + + private AutoCollection autoCollection; + + private SubscriptionOverrideBillingProfileBuilder() {} + + public SubscriptionOverrideBillingProfileBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public SubscriptionOverrideBillingProfileBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionOverrideBillingProfileParams build() { + return new SubscriptionOverrideBillingProfileParams(this); + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionPauseParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionPauseParams.java new file mode 100644 index 00000000..9233c07d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionPauseParams.java @@ -0,0 +1,254 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class SubscriptionPauseParams { + + private final PauseOption pauseOption; + + private final Timestamp pauseDate; + + private final UnbilledChargesHandling unbilledChargesHandling; + + private final InvoiceDunningHandling invoiceDunningHandling; + + private final Integer skipBillingCycles; + + private final Timestamp resumeDate; + + private SubscriptionPauseParams(SubscriptionPauseBuilder builder) { + + this.pauseOption = builder.pauseOption; + + this.pauseDate = builder.pauseDate; + + this.unbilledChargesHandling = builder.unbilledChargesHandling; + + this.invoiceDunningHandling = builder.invoiceDunningHandling; + + this.skipBillingCycles = builder.skipBillingCycles; + + this.resumeDate = builder.resumeDate; + } + + public PauseOption getPauseOption() { + return pauseOption; + } + + public Timestamp getPauseDate() { + return pauseDate; + } + + public UnbilledChargesHandling getUnbilledChargesHandling() { + return unbilledChargesHandling; + } + + public InvoiceDunningHandling getInvoiceDunningHandling() { + return invoiceDunningHandling; + } + + public Integer getSkipBillingCycles() { + return skipBillingCycles; + } + + public Timestamp getResumeDate() { + return resumeDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.pauseOption != null) { + + formData.put("pause_option", this.pauseOption); + } + + if (this.pauseDate != null) { + + formData.put("pause_date", this.pauseDate); + } + + if (this.unbilledChargesHandling != null) { + + formData.put("unbilled_charges_handling", this.unbilledChargesHandling); + } + + if (this.invoiceDunningHandling != null) { + + formData.put("invoice_dunning_handling", this.invoiceDunningHandling); + } + + if (this.skipBillingCycles != null) { + + formData.put("skip_billing_cycles", this.skipBillingCycles); + } + + if (this.resumeDate != null) { + + formData.put("resume_date", this.resumeDate); + } + + return formData; + } + + /** Create a new builder for SubscriptionPauseParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionPauseBuilder builder() { + return new SubscriptionPauseBuilder(); + } + + public static final class SubscriptionPauseBuilder { + + private PauseOption pauseOption; + + private Timestamp pauseDate; + + private UnbilledChargesHandling unbilledChargesHandling; + + private InvoiceDunningHandling invoiceDunningHandling; + + private Integer skipBillingCycles; + + private Timestamp resumeDate; + + private SubscriptionPauseBuilder() {} + + public SubscriptionPauseBuilder pauseOption(PauseOption value) { + this.pauseOption = value; + return this; + } + + public SubscriptionPauseBuilder pauseDate(Timestamp value) { + this.pauseDate = value; + return this; + } + + public SubscriptionPauseBuilder unbilledChargesHandling(UnbilledChargesHandling value) { + this.unbilledChargesHandling = value; + return this; + } + + public SubscriptionPauseBuilder invoiceDunningHandling(InvoiceDunningHandling value) { + this.invoiceDunningHandling = value; + return this; + } + + public SubscriptionPauseBuilder skipBillingCycles(Integer value) { + this.skipBillingCycles = value; + return this; + } + + public SubscriptionPauseBuilder resumeDate(Timestamp value) { + this.resumeDate = value; + return this; + } + + public SubscriptionPauseParams build() { + return new SubscriptionPauseParams(this); + } + } + + public enum PauseOption { + IMMEDIATELY("immediately"), + + END_OF_TERM("end_of_term"), + + SPECIFIC_DATE("specific_date"), + + BILLING_CYCLES("billing_cycles"), + + /** An enum member indicating that PauseOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PauseOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PauseOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (PauseOption enumValue : PauseOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum UnbilledChargesHandling { + NO_ACTION("no_action"), + + INVOICE("invoice"), + + /** + * An enum member indicating that UnbilledChargesHandling was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + UnbilledChargesHandling(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static UnbilledChargesHandling fromString(String value) { + if (value == null) return _UNKNOWN; + for (UnbilledChargesHandling enumValue : UnbilledChargesHandling.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum InvoiceDunningHandling { + CONTINUE("continue"), + + STOP("stop"), + + /** + * An enum member indicating that InvoiceDunningHandling was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + InvoiceDunningHandling(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static InvoiceDunningHandling fromString(String value) { + if (value == null) return _UNKNOWN; + for (InvoiceDunningHandling enumValue : InvoiceDunningHandling.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionReactivateParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionReactivateParams.java new file mode 100644 index 00000000..a2021f68 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionReactivateParams.java @@ -0,0 +1,770 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class SubscriptionReactivateParams { + + private final Timestamp trialEnd; + + private final Integer billingCycles; + + private final Integer trialPeriodDays; + + private final Timestamp reactivateFrom; + + private final Boolean invoiceImmediately; + + private final BillingAlignmentMode billingAlignmentMode; + + private final Integer termsToCharge; + + private final Timestamp invoiceDate; + + private final Integer contractTermBillingCycleOnRenewal; + + private final PaymentInitiator paymentInitiator; + + private final ContractTermParams contractTerm; + + private final StatementDescriptorParams statementDescriptor; + + private final PaymentIntentParams paymentIntent; + + private SubscriptionReactivateParams(SubscriptionReactivateBuilder builder) { + + this.trialEnd = builder.trialEnd; + + this.billingCycles = builder.billingCycles; + + this.trialPeriodDays = builder.trialPeriodDays; + + this.reactivateFrom = builder.reactivateFrom; + + this.invoiceImmediately = builder.invoiceImmediately; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.termsToCharge = builder.termsToCharge; + + this.invoiceDate = builder.invoiceDate; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + + this.paymentInitiator = builder.paymentInitiator; + + this.contractTerm = builder.contractTerm; + + this.statementDescriptor = builder.statementDescriptor; + + this.paymentIntent = builder.paymentIntent; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getTrialPeriodDays() { + return trialPeriodDays; + } + + public Timestamp getReactivateFrom() { + return reactivateFrom; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + public PaymentInitiator getPaymentInitiator() { + return paymentInitiator; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public StatementDescriptorParams getStatementDescriptor() { + return statementDescriptor; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialPeriodDays != null) { + + formData.put("trial_period_days", this.trialPeriodDays); + } + + if (this.reactivateFrom != null) { + + formData.put("reactivate_from", this.reactivateFrom); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + if (this.paymentInitiator != null) { + + formData.put("payment_initiator", this.paymentInitiator); + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.statementDescriptor != null) { + + // Single object + Map nestedData = this.statementDescriptor.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for SubscriptionReactivateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionReactivateBuilder builder() { + return new SubscriptionReactivateBuilder(); + } + + public static final class SubscriptionReactivateBuilder { + + private Timestamp trialEnd; + + private Integer billingCycles; + + private Integer trialPeriodDays; + + private Timestamp reactivateFrom; + + private Boolean invoiceImmediately; + + private BillingAlignmentMode billingAlignmentMode; + + private Integer termsToCharge; + + private Timestamp invoiceDate; + + private Integer contractTermBillingCycleOnRenewal; + + private PaymentInitiator paymentInitiator; + + private ContractTermParams contractTerm; + + private StatementDescriptorParams statementDescriptor; + + private PaymentIntentParams paymentIntent; + + private SubscriptionReactivateBuilder() {} + + public SubscriptionReactivateBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionReactivateBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + @Deprecated + public SubscriptionReactivateBuilder trialPeriodDays(Integer value) { + this.trialPeriodDays = value; + return this; + } + + public SubscriptionReactivateBuilder reactivateFrom(Timestamp value) { + this.reactivateFrom = value; + return this; + } + + public SubscriptionReactivateBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public SubscriptionReactivateBuilder billingAlignmentMode(BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public SubscriptionReactivateBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public SubscriptionReactivateBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public SubscriptionReactivateBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionReactivateBuilder paymentInitiator(PaymentInitiator value) { + this.paymentInitiator = value; + return this; + } + + public SubscriptionReactivateBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public SubscriptionReactivateBuilder statementDescriptor(StatementDescriptorParams value) { + this.statementDescriptor = value; + return this; + } + + public SubscriptionReactivateBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public SubscriptionReactivateParams build() { + return new SubscriptionReactivateParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PaymentInitiator { + CUSTOMER("customer"), + + MERCHANT("merchant"), + + /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentInitiator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentInitiator fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentInitiator enumValue : PaymentInitiator.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class StatementDescriptorParams { + + private final String descriptor; + + private StatementDescriptorParams(StatementDescriptorBuilder builder) { + + this.descriptor = builder.descriptor; + } + + public String getDescriptor() { + return descriptor; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.descriptor != null) { + + formData.put("descriptor", this.descriptor); + } + + return formData; + } + + /** Create a new builder for StatementDescriptorParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatementDescriptorBuilder builder() { + return new StatementDescriptorBuilder(); + } + + public static final class StatementDescriptorBuilder { + + private String descriptor; + + private StatementDescriptorBuilder() {} + + public StatementDescriptorBuilder descriptor(String value) { + this.descriptor = value; + return this; + } + + public StatementDescriptorParams build() { + return new StatementDescriptorParams(this); + } + } + } + + public static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRegenerateInvoiceParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRegenerateInvoiceParams.java new file mode 100644 index 00000000..0653e327 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRegenerateInvoiceParams.java @@ -0,0 +1,121 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class SubscriptionRegenerateInvoiceParams { + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private final Boolean prorate; + + private final Boolean invoiceImmediately; + + private SubscriptionRegenerateInvoiceParams(SubscriptionRegenerateInvoiceBuilder builder) { + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + + this.prorate = builder.prorate; + + this.invoiceImmediately = builder.invoiceImmediately; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + public Boolean getProrate() { + return prorate; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + if (this.prorate != null) { + + formData.put("prorate", this.prorate); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + return formData; + } + + /** Create a new builder for SubscriptionRegenerateInvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionRegenerateInvoiceBuilder builder() { + return new SubscriptionRegenerateInvoiceBuilder(); + } + + public static final class SubscriptionRegenerateInvoiceBuilder { + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private Boolean prorate; + + private Boolean invoiceImmediately; + + private SubscriptionRegenerateInvoiceBuilder() {} + + public SubscriptionRegenerateInvoiceBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public SubscriptionRegenerateInvoiceBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public SubscriptionRegenerateInvoiceBuilder prorate(Boolean value) { + this.prorate = value; + return this; + } + + public SubscriptionRegenerateInvoiceBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public SubscriptionRegenerateInvoiceParams build() { + return new SubscriptionRegenerateInvoiceParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveAdvanceInvoiceScheduleParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveAdvanceInvoiceScheduleParams.java new file mode 100644 index 00000000..58f2b221 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveAdvanceInvoiceScheduleParams.java @@ -0,0 +1,121 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class SubscriptionRemoveAdvanceInvoiceScheduleParams { + + private final List specificDatesSchedule; + + private SubscriptionRemoveAdvanceInvoiceScheduleParams( + SubscriptionRemoveAdvanceInvoiceScheduleBuilder builder) { + + this.specificDatesSchedule = builder.specificDatesSchedule; + } + + public List getSpecificDatesSchedule() { + return specificDatesSchedule; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.specificDatesSchedule != null) { + + // List of objects + for (int i = 0; i < this.specificDatesSchedule.size(); i++) { + SpecificDatesScheduleParams item = this.specificDatesSchedule.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "specific_dates_schedule[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for SubscriptionRemoveAdvanceInvoiceScheduleParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionRemoveAdvanceInvoiceScheduleBuilder builder() { + return new SubscriptionRemoveAdvanceInvoiceScheduleBuilder(); + } + + public static final class SubscriptionRemoveAdvanceInvoiceScheduleBuilder { + + private List specificDatesSchedule; + + private SubscriptionRemoveAdvanceInvoiceScheduleBuilder() {} + + public SubscriptionRemoveAdvanceInvoiceScheduleBuilder specificDatesSchedule( + List value) { + this.specificDatesSchedule = value; + return this; + } + + public SubscriptionRemoveAdvanceInvoiceScheduleParams build() { + return new SubscriptionRemoveAdvanceInvoiceScheduleParams(this); + } + } + + public static final class SpecificDatesScheduleParams { + + private final String id; + + private SpecificDatesScheduleParams(SpecificDatesScheduleBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for SpecificDatesScheduleParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SpecificDatesScheduleBuilder builder() { + return new SpecificDatesScheduleBuilder(); + } + + public static final class SpecificDatesScheduleBuilder { + + private String id; + + private SpecificDatesScheduleBuilder() {} + + public SpecificDatesScheduleBuilder id(String value) { + this.id = value; + return this; + } + + public SpecificDatesScheduleParams build() { + return new SpecificDatesScheduleParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveCouponsParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveCouponsParams.java new file mode 100644 index 00000000..065933a8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveCouponsParams.java @@ -0,0 +1,61 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class SubscriptionRemoveCouponsParams { + + private final List couponIds; + + private SubscriptionRemoveCouponsParams(SubscriptionRemoveCouponsBuilder builder) { + + this.couponIds = builder.couponIds; + } + + public List getCouponIds() { + return couponIds; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + return formData; + } + + /** Create a new builder for SubscriptionRemoveCouponsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionRemoveCouponsBuilder builder() { + return new SubscriptionRemoveCouponsBuilder(); + } + + public static final class SubscriptionRemoveCouponsBuilder { + + private List couponIds; + + private SubscriptionRemoveCouponsBuilder() {} + + public SubscriptionRemoveCouponsBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public SubscriptionRemoveCouponsParams build() { + return new SubscriptionRemoveCouponsParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveScheduledCancellationParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveScheduledCancellationParams.java new file mode 100644 index 00000000..c3a3fe86 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveScheduledCancellationParams.java @@ -0,0 +1,206 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class SubscriptionRemoveScheduledCancellationParams { + + private final Integer billingCycles; + + private final Integer contractTermBillingCycleOnRenewal; + + private final ContractTermParams contractTerm; + + private SubscriptionRemoveScheduledCancellationParams( + SubscriptionRemoveScheduledCancellationBuilder builder) { + + this.billingCycles = builder.billingCycles; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + + this.contractTerm = builder.contractTerm; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for SubscriptionRemoveScheduledCancellationParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionRemoveScheduledCancellationBuilder builder() { + return new SubscriptionRemoveScheduledCancellationBuilder(); + } + + public static final class SubscriptionRemoveScheduledCancellationBuilder { + + private Integer billingCycles; + + private Integer contractTermBillingCycleOnRenewal; + + private ContractTermParams contractTerm; + + private SubscriptionRemoveScheduledCancellationBuilder() {} + + public SubscriptionRemoveScheduledCancellationBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionRemoveScheduledCancellationBuilder contractTermBillingCycleOnRenewal( + Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionRemoveScheduledCancellationBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public SubscriptionRemoveScheduledCancellationParams build() { + return new SubscriptionRemoveScheduledCancellationParams(this); + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveScheduledChangesParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveScheduledChangesParams.java similarity index 75% rename from src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveScheduledChangesParams.java rename to src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveScheduledChangesParams.java index 504eee42..e84c0441 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveScheduledChangesParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveScheduledChangesParams.java @@ -4,25 +4,22 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscription.params; +package com.chargebee.v4.models.subscription.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class SubscriptionRemoveScheduledChangesParams { - private final Map formData; - private SubscriptionRemoveScheduledChangesParams( - SubscriptionRemoveScheduledChangesBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + SubscriptionRemoveScheduledChangesBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -33,7 +30,6 @@ public static SubscriptionRemoveScheduledChangesBuilder builder() { } public static final class SubscriptionRemoveScheduledChangesBuilder { - private final Map formData = new LinkedHashMap<>(); private SubscriptionRemoveScheduledChangesBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveScheduledPauseParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveScheduledPauseParams.java similarity index 77% rename from src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveScheduledPauseParams.java rename to src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveScheduledPauseParams.java index c424cb8f..32335017 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveScheduledPauseParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveScheduledPauseParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscription.params; +package com.chargebee.v4.models.subscription.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class SubscriptionRemoveScheduledPauseParams { - private final Map formData; - - private SubscriptionRemoveScheduledPauseParams(SubscriptionRemoveScheduledPauseBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private SubscriptionRemoveScheduledPauseParams(SubscriptionRemoveScheduledPauseBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static SubscriptionRemoveScheduledPauseBuilder builder() { } public static final class SubscriptionRemoveScheduledPauseBuilder { - private final Map formData = new LinkedHashMap<>(); private SubscriptionRemoveScheduledPauseBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveScheduledResumptionParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveScheduledResumptionParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveScheduledResumptionParams.java rename to src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveScheduledResumptionParams.java index 77e4ba51..730b3022 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRemoveScheduledResumptionParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRemoveScheduledResumptionParams.java @@ -4,25 +4,22 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscription.params; +package com.chargebee.v4.models.subscription.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class SubscriptionRemoveScheduledResumptionParams { - private final Map formData; - private SubscriptionRemoveScheduledResumptionParams( - SubscriptionRemoveScheduledResumptionBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + SubscriptionRemoveScheduledResumptionBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -33,7 +30,6 @@ public static SubscriptionRemoveScheduledResumptionBuilder builder() { } public static final class SubscriptionRemoveScheduledResumptionBuilder { - private final Map formData = new LinkedHashMap<>(); private SubscriptionRemoveScheduledResumptionBuilder() {} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionResumeParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionResumeParams.java new file mode 100644 index 00000000..9a62b3af --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionResumeParams.java @@ -0,0 +1,528 @@ +/* + * 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.subscription.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class SubscriptionResumeParams { + + private final ResumeOption resumeOption; + + private final Timestamp resumeDate; + + private final ChargesHandling chargesHandling; + + private final UnpaidInvoicesHandling unpaidInvoicesHandling; + + private final PaymentInitiator paymentInitiator; + + private final PaymentIntentParams paymentIntent; + + private SubscriptionResumeParams(SubscriptionResumeBuilder builder) { + + this.resumeOption = builder.resumeOption; + + this.resumeDate = builder.resumeDate; + + this.chargesHandling = builder.chargesHandling; + + this.unpaidInvoicesHandling = builder.unpaidInvoicesHandling; + + this.paymentInitiator = builder.paymentInitiator; + + this.paymentIntent = builder.paymentIntent; + } + + public ResumeOption getResumeOption() { + return resumeOption; + } + + public Timestamp getResumeDate() { + return resumeDate; + } + + public ChargesHandling getChargesHandling() { + return chargesHandling; + } + + public UnpaidInvoicesHandling getUnpaidInvoicesHandling() { + return unpaidInvoicesHandling; + } + + public PaymentInitiator getPaymentInitiator() { + return paymentInitiator; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.resumeOption != null) { + + formData.put("resume_option", this.resumeOption); + } + + if (this.resumeDate != null) { + + formData.put("resume_date", this.resumeDate); + } + + if (this.chargesHandling != null) { + + formData.put("charges_handling", this.chargesHandling); + } + + if (this.unpaidInvoicesHandling != null) { + + formData.put("unpaid_invoices_handling", this.unpaidInvoicesHandling); + } + + if (this.paymentInitiator != null) { + + formData.put("payment_initiator", this.paymentInitiator); + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for SubscriptionResumeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionResumeBuilder builder() { + return new SubscriptionResumeBuilder(); + } + + public static final class SubscriptionResumeBuilder { + + private ResumeOption resumeOption; + + private Timestamp resumeDate; + + private ChargesHandling chargesHandling; + + private UnpaidInvoicesHandling unpaidInvoicesHandling; + + private PaymentInitiator paymentInitiator; + + private PaymentIntentParams paymentIntent; + + private SubscriptionResumeBuilder() {} + + public SubscriptionResumeBuilder resumeOption(ResumeOption value) { + this.resumeOption = value; + return this; + } + + public SubscriptionResumeBuilder resumeDate(Timestamp value) { + this.resumeDate = value; + return this; + } + + public SubscriptionResumeBuilder chargesHandling(ChargesHandling value) { + this.chargesHandling = value; + return this; + } + + public SubscriptionResumeBuilder unpaidInvoicesHandling(UnpaidInvoicesHandling value) { + this.unpaidInvoicesHandling = value; + return this; + } + + public SubscriptionResumeBuilder paymentInitiator(PaymentInitiator value) { + this.paymentInitiator = value; + return this; + } + + public SubscriptionResumeBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public SubscriptionResumeParams build() { + return new SubscriptionResumeParams(this); + } + } + + public enum ResumeOption { + IMMEDIATELY("immediately"), + + SPECIFIC_DATE("specific_date"), + + /** An enum member indicating that ResumeOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ResumeOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ResumeOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ResumeOption enumValue : ResumeOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChargesHandling { + INVOICE_IMMEDIATELY("invoice_immediately"), + + ADD_TO_UNBILLED_CHARGES("add_to_unbilled_charges"), + + /** An enum member indicating that ChargesHandling was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargesHandling(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargesHandling fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargesHandling enumValue : ChargesHandling.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum UnpaidInvoicesHandling { + NO_ACTION("no_action"), + + SCHEDULE_PAYMENT_COLLECTION("schedule_payment_collection"), + + /** + * An enum member indicating that UnpaidInvoicesHandling was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + UnpaidInvoicesHandling(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static UnpaidInvoicesHandling fromString(String value) { + if (value == null) return _UNKNOWN; + for (UnpaidInvoicesHandling enumValue : UnpaidInvoicesHandling.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PaymentInitiator { + CUSTOMER("customer"), + + MERCHANT("merchant"), + + /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentInitiator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentInitiator fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentInitiator enumValue : PaymentInitiator.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRetrieveAdvanceInvoiceScheduleParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRetrieveAdvanceInvoiceScheduleParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRetrieveAdvanceInvoiceScheduleParams.java rename to src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRetrieveAdvanceInvoiceScheduleParams.java index 4a882d96..2a01a9b9 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRetrieveAdvanceInvoiceScheduleParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRetrieveAdvanceInvoiceScheduleParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscription.params; +package com.chargebee.v4.models.subscription.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRetrieveParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRetrieveParams.java index 1843bf12..f10728f7 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscription.params; +package com.chargebee.v4.models.subscription.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRetrieveWithScheduledChangesParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRetrieveWithScheduledChangesParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRetrieveWithScheduledChangesParams.java rename to src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRetrieveWithScheduledChangesParams.java index 5fe83ffd..b1cf0c8d 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscription/params/SubscriptionRetrieveWithScheduledChangesParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionRetrieveWithScheduledChangesParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscription.params; +package com.chargebee.v4.models.subscription.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateForItemsParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateForItemsParams.java new file mode 100644 index 00000000..b8d4f5b5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateForItemsParams.java @@ -0,0 +1,4875 @@ +/* + * 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.subscription.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 SubscriptionUpdateForItemsParams { + + private final List mandatoryItemsToRemove; + + private final Boolean replaceItemsList; + + private final Long setupFee; + + private final Integer netTermDays; + + private final Timestamp invoiceDate; + + private final Timestamp startDate; + + private final Timestamp trialEnd; + + private final Integer billingCycles; + + private final String coupon; + + private final Integer termsToCharge; + + private final Timestamp reactivateFrom; + + private final BillingAlignmentMode billingAlignmentMode; + + private final AutoCollection autoCollection; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final String poNumber; + + private final List couponIds; + + private final Boolean replaceCouponList; + + private final Boolean prorate; + + private final Boolean endOfTerm; + + private final Boolean forceTermReset; + + private final Boolean reactivate; + + private final String tokenId; + + private final String invoiceNotes; + + private final java.util.Map metaData; + + private final Boolean invoiceImmediately; + + private final Boolean overrideRelationship; + + private final Timestamp changesScheduledAt; + + private final ChangeOption changeOption; + + private final Integer contractTermBillingCycleOnRenewal; + + private final Integer freePeriod; + + private final FreePeriodUnit freePeriodUnit; + + private final Boolean createPendingInvoices; + + private final Boolean autoCloseInvoices; + + private final TrialEndAction trialEndAction; + + private final PaymentInitiator paymentInitiator; + + private final Boolean invoiceUsages; + + private final CardParams card; + + private final PaymentMethodParams paymentMethod; + + private final PaymentIntentParams paymentIntent; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final StatementDescriptorParams statementDescriptor; + + private final CustomerParams customer; + + private final ContractTermParams contractTerm; + + private final BillingOverrideParams billingOverride; + + private final List subscriptionItems; + + private final List discounts; + + private final List itemTiers; + + private final List coupons; + + private final Map customFields; + + private SubscriptionUpdateForItemsParams(SubscriptionUpdateForItemsBuilder builder) { + + this.mandatoryItemsToRemove = builder.mandatoryItemsToRemove; + + this.replaceItemsList = builder.replaceItemsList; + + this.setupFee = builder.setupFee; + + this.netTermDays = builder.netTermDays; + + this.invoiceDate = builder.invoiceDate; + + this.startDate = builder.startDate; + + this.trialEnd = builder.trialEnd; + + this.billingCycles = builder.billingCycles; + + this.coupon = builder.coupon; + + this.termsToCharge = builder.termsToCharge; + + this.reactivateFrom = builder.reactivateFrom; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.autoCollection = builder.autoCollection; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.poNumber = builder.poNumber; + + this.couponIds = builder.couponIds; + + this.replaceCouponList = builder.replaceCouponList; + + this.prorate = builder.prorate; + + this.endOfTerm = builder.endOfTerm; + + this.forceTermReset = builder.forceTermReset; + + this.reactivate = builder.reactivate; + + this.tokenId = builder.tokenId; + + this.invoiceNotes = builder.invoiceNotes; + + this.metaData = builder.metaData; + + this.invoiceImmediately = builder.invoiceImmediately; + + this.overrideRelationship = builder.overrideRelationship; + + this.changesScheduledAt = builder.changesScheduledAt; + + this.changeOption = builder.changeOption; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + + this.freePeriod = builder.freePeriod; + + this.freePeriodUnit = builder.freePeriodUnit; + + this.createPendingInvoices = builder.createPendingInvoices; + + this.autoCloseInvoices = builder.autoCloseInvoices; + + this.trialEndAction = builder.trialEndAction; + + this.paymentInitiator = builder.paymentInitiator; + + this.invoiceUsages = builder.invoiceUsages; + + this.card = builder.card; + + this.paymentMethod = builder.paymentMethod; + + this.paymentIntent = builder.paymentIntent; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.statementDescriptor = builder.statementDescriptor; + + this.customer = builder.customer; + + this.contractTerm = builder.contractTerm; + + this.billingOverride = builder.billingOverride; + + this.subscriptionItems = builder.subscriptionItems; + + this.discounts = builder.discounts; + + this.itemTiers = builder.itemTiers; + + this.coupons = builder.coupons; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public List getMandatoryItemsToRemove() { + return mandatoryItemsToRemove; + } + + public Boolean getReplaceItemsList() { + return replaceItemsList; + } + + public Long getSetupFee() { + return setupFee; + } + + public Integer getNetTermDays() { + return netTermDays; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public String getCoupon() { + return coupon; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Timestamp getReactivateFrom() { + return reactivateFrom; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public String getPoNumber() { + return poNumber; + } + + public List getCouponIds() { + return couponIds; + } + + public Boolean getReplaceCouponList() { + return replaceCouponList; + } + + public Boolean getProrate() { + return prorate; + } + + public Boolean getEndOfTerm() { + return endOfTerm; + } + + public Boolean getForceTermReset() { + return forceTermReset; + } + + public Boolean getReactivate() { + return reactivate; + } + + public String getTokenId() { + return tokenId; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public java.util.Map getMetaData() { + return metaData; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + public Boolean getOverrideRelationship() { + return overrideRelationship; + } + + public Timestamp getChangesScheduledAt() { + return changesScheduledAt; + } + + public ChangeOption getChangeOption() { + return changeOption; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + public Integer getFreePeriod() { + return freePeriod; + } + + public FreePeriodUnit getFreePeriodUnit() { + return freePeriodUnit; + } + + public Boolean getCreatePendingInvoices() { + return createPendingInvoices; + } + + public Boolean getAutoCloseInvoices() { + return autoCloseInvoices; + } + + public TrialEndAction getTrialEndAction() { + return trialEndAction; + } + + public PaymentInitiator getPaymentInitiator() { + return paymentInitiator; + } + + public Boolean getInvoiceUsages() { + return invoiceUsages; + } + + public CardParams getCard() { + return card; + } + + public PaymentMethodParams getPaymentMethod() { + return paymentMethod; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public StatementDescriptorParams getStatementDescriptor() { + return statementDescriptor; + } + + public CustomerParams getCustomer() { + return customer; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public BillingOverrideParams getBillingOverride() { + return billingOverride; + } + + public List getSubscriptionItems() { + return subscriptionItems; + } + + public List getDiscounts() { + return discounts; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getCoupons() { + return coupons; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.mandatoryItemsToRemove != null) { + + formData.put("mandatory_items_to_remove", this.mandatoryItemsToRemove); + } + + if (this.replaceItemsList != null) { + + formData.put("replace_items_list", this.replaceItemsList); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.netTermDays != null) { + + formData.put("net_term_days", this.netTermDays); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.reactivateFrom != null) { + + formData.put("reactivate_from", this.reactivateFrom); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.replaceCouponList != null) { + + formData.put("replace_coupon_list", this.replaceCouponList); + } + + if (this.prorate != null) { + + formData.put("prorate", this.prorate); + } + + if (this.endOfTerm != null) { + + formData.put("end_of_term", this.endOfTerm); + } + + if (this.forceTermReset != null) { + + formData.put("force_term_reset", this.forceTermReset); + } + + if (this.reactivate != null) { + + formData.put("reactivate", this.reactivate); + } + + if (this.tokenId != null) { + + formData.put("token_id", this.tokenId); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + if (this.overrideRelationship != null) { + + formData.put("override_relationship", this.overrideRelationship); + } + + if (this.changesScheduledAt != null) { + + formData.put("changes_scheduled_at", this.changesScheduledAt); + } + + if (this.changeOption != null) { + + formData.put("change_option", this.changeOption); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + if (this.freePeriod != null) { + + formData.put("free_period", this.freePeriod); + } + + if (this.freePeriodUnit != null) { + + formData.put("free_period_unit", this.freePeriodUnit); + } + + if (this.createPendingInvoices != null) { + + formData.put("create_pending_invoices", this.createPendingInvoices); + } + + if (this.autoCloseInvoices != null) { + + formData.put("auto_close_invoices", this.autoCloseInvoices); + } + + if (this.trialEndAction != null) { + + formData.put("trial_end_action", this.trialEndAction); + } + + if (this.paymentInitiator != null) { + + formData.put("payment_initiator", this.paymentInitiator); + } + + if (this.invoiceUsages != null) { + + formData.put("invoice_usages", this.invoiceUsages); + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentMethod != null) { + + // Single object + Map nestedData = this.paymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.statementDescriptor != null) { + + // Single object + Map nestedData = this.statementDescriptor.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingOverride != null) { + + // Single object + Map nestedData = this.billingOverride.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_override[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.subscriptionItems != null) { + + // List of objects + for (int i = 0; i < this.subscriptionItems.size(); i++) { + SubscriptionItemsParams item = this.subscriptionItems.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_items[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.discounts != null) { + + // List of objects + for (int i = 0; i < this.discounts.size(); i++) { + DiscountsParams item = this.discounts.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "discounts[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.coupons != null) { + + // List of objects + for (int i = 0; i < this.coupons.size(); i++) { + CouponsParams item = this.coupons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for SubscriptionUpdateForItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionUpdateForItemsBuilder builder() { + return new SubscriptionUpdateForItemsBuilder(); + } + + public static final class SubscriptionUpdateForItemsBuilder { + + private List mandatoryItemsToRemove; + + private Boolean replaceItemsList; + + private Long setupFee; + + private Integer netTermDays; + + private Timestamp invoiceDate; + + private Timestamp startDate; + + private Timestamp trialEnd; + + private Integer billingCycles; + + private String coupon; + + private Integer termsToCharge; + + private Timestamp reactivateFrom; + + private BillingAlignmentMode billingAlignmentMode; + + private AutoCollection autoCollection; + + private OfflinePaymentMethod offlinePaymentMethod; + + private String poNumber; + + private List couponIds; + + private Boolean replaceCouponList; + + private Boolean prorate; + + private Boolean endOfTerm; + + private Boolean forceTermReset; + + private Boolean reactivate; + + private String tokenId; + + private String invoiceNotes; + + private java.util.Map metaData; + + private Boolean invoiceImmediately; + + private Boolean overrideRelationship; + + private Timestamp changesScheduledAt; + + private ChangeOption changeOption; + + private Integer contractTermBillingCycleOnRenewal; + + private Integer freePeriod; + + private FreePeriodUnit freePeriodUnit; + + private Boolean createPendingInvoices; + + private Boolean autoCloseInvoices; + + private TrialEndAction trialEndAction; + + private PaymentInitiator paymentInitiator; + + private Boolean invoiceUsages; + + private CardParams card; + + private PaymentMethodParams paymentMethod; + + private PaymentIntentParams paymentIntent; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private StatementDescriptorParams statementDescriptor; + + private CustomerParams customer; + + private ContractTermParams contractTerm; + + private BillingOverrideParams billingOverride; + + private List subscriptionItems; + + private List discounts; + + private List itemTiers; + + private List coupons; + + private Map customFields = new LinkedHashMap<>(); + + private SubscriptionUpdateForItemsBuilder() {} + + public SubscriptionUpdateForItemsBuilder mandatoryItemsToRemove(List value) { + this.mandatoryItemsToRemove = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder replaceItemsList(Boolean value) { + this.replaceItemsList = value; + return this; + } + + @Deprecated + public SubscriptionUpdateForItemsBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder netTermDays(Integer value) { + this.netTermDays = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + @Deprecated + public SubscriptionUpdateForItemsBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder reactivateFrom(Timestamp value) { + this.reactivateFrom = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder billingAlignmentMode(BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder replaceCouponList(Boolean value) { + this.replaceCouponList = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder prorate(Boolean value) { + this.prorate = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder endOfTerm(Boolean value) { + this.endOfTerm = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder forceTermReset(Boolean value) { + this.forceTermReset = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder reactivate(Boolean value) { + this.reactivate = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder tokenId(String value) { + this.tokenId = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder overrideRelationship(Boolean value) { + this.overrideRelationship = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder changesScheduledAt(Timestamp value) { + this.changesScheduledAt = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder changeOption(ChangeOption value) { + this.changeOption = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder freePeriod(Integer value) { + this.freePeriod = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder freePeriodUnit(FreePeriodUnit value) { + this.freePeriodUnit = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder createPendingInvoices(Boolean value) { + this.createPendingInvoices = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder autoCloseInvoices(Boolean value) { + this.autoCloseInvoices = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder trialEndAction(TrialEndAction value) { + this.trialEndAction = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder paymentInitiator(PaymentInitiator value) { + this.paymentInitiator = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder invoiceUsages(Boolean value) { + this.invoiceUsages = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder card(CardParams value) { + this.card = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder paymentMethod(PaymentMethodParams value) { + this.paymentMethod = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder statementDescriptor(StatementDescriptorParams value) { + this.statementDescriptor = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder billingOverride(BillingOverrideParams value) { + this.billingOverride = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder subscriptionItems( + List value) { + this.subscriptionItems = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder discounts(List value) { + this.discounts = value; + return this; + } + + public SubscriptionUpdateForItemsBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + @Deprecated + public SubscriptionUpdateForItemsBuilder coupons(List value) { + this.coupons = 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 SubscriptionUpdateForItemsBuilder 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 SubscriptionUpdateForItemsBuilder 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 SubscriptionUpdateForItemsParams build() { + return new SubscriptionUpdateForItemsParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChangeOption { + IMMEDIATELY("immediately"), + + END_OF_TERM("end_of_term"), + + SPECIFIC_DATE("specific_date"), + + /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChangeOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChangeOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChangeOption enumValue : ChangeOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum FreePeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + FreePeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static FreePeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialEndAction { + SITE_DEFAULT("site_default"), + + PLAN_DEFAULT("plan_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialEndAction enumValue : TrialEndAction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PaymentInitiator { + CUSTOMER("customer"), + + MERCHANT("merchant"), + + /** An enum member indicating that PaymentInitiator was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentInitiator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentInitiator fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentInitiator enumValue : PaymentInitiator.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class CardParams { + + 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 java.util.Map additionalInformation; + + private CardParams(CardBuilder 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.additionalInformation = builder.additionalInformation; + } + + 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 java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** 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.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + 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 java.util.Map additionalInformation; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + @Deprecated + public CardBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public CardBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CardBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CardBuilder number(String value) { + this.number = value; + return this; + } + + public CardBuilder expiryMonth(Integer value) { + this.expiryMonth = value; + return this; + } + + public CardBuilder expiryYear(Integer value) { + this.expiryYear = value; + return this; + } + + public CardBuilder cvv(String value) { + this.cvv = value; + return this; + } + + public CardBuilder preferredScheme(PreferredScheme value) { + this.preferredScheme = value; + return this; + } + + public CardBuilder billingAddr1(String value) { + this.billingAddr1 = value; + return this; + } + + public CardBuilder billingAddr2(String value) { + this.billingAddr2 = value; + return this; + } + + public CardBuilder billingCity(String value) { + this.billingCity = value; + return this; + } + + public CardBuilder billingStateCode(String value) { + this.billingStateCode = value; + return this; + } + + public CardBuilder billingState(String value) { + this.billingState = value; + return this; + } + + public CardBuilder billingZip(String value) { + this.billingZip = value; + return this; + } + + public CardBuilder billingCountry(String value) { + this.billingCountry = value; + return this; + } + + @Deprecated + public CardBuilder ipAddress(String value) { + this.ipAddress = value; + return this; + } + + public CardBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public CardParams build() { + return new CardParams(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 PaymentMethodParams { + + private final Type type; + + private final Gateway gateway; + + private final String gatewayAccountId; + + private final String referenceId; + + private final String tmpToken; + + private final String issuingCountry; + + private final java.util.Map additionalInformation; + + private PaymentMethodParams(PaymentMethodBuilder builder) { + + this.type = builder.type; + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.referenceId = builder.referenceId; + + this.tmpToken = builder.tmpToken; + + this.issuingCountry = builder.issuingCountry; + + this.additionalInformation = builder.additionalInformation; + } + + public Type getType() { + return type; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getReferenceId() { + return referenceId; + } + + public String getTmpToken() { + return tmpToken; + } + + public String getIssuingCountry() { + return issuingCountry; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.gateway != null) { + + formData.put("gateway", this.gateway); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.tmpToken != null) { + + formData.put("tmp_token", this.tmpToken); + } + + if (this.issuingCountry != null) { + + formData.put("issuing_country", this.issuingCountry); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentMethodBuilder builder() { + return new PaymentMethodBuilder(); + } + + public static final class PaymentMethodBuilder { + + private Type type; + + private Gateway gateway; + + private String gatewayAccountId; + + private String referenceId; + + private String tmpToken; + + private String issuingCountry; + + private java.util.Map additionalInformation; + + private PaymentMethodBuilder() {} + + public PaymentMethodBuilder type(Type value) { + this.type = value; + return this; + } + + @Deprecated + public PaymentMethodBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public PaymentMethodBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentMethodBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public PaymentMethodBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public PaymentMethodBuilder issuingCountry(String value) { + this.issuingCountry = value; + return this; + } + + public PaymentMethodBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentMethodParams build() { + return new PaymentMethodParams(this); + } + } + + public enum Type { + CARD("card"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + AMAZON_PAYMENTS("amazon_payments"), + + DIRECT_DEBIT("direct_debit"), + + GENERIC("generic"), + + ALIPAY("alipay"), + + UNIONPAY("unionpay"), + + APPLE_PAY("apple_pay"), + + WECHAT_PAY("wechat_pay"), + + IDEAL("ideal"), + + GOOGLE_PAY("google_pay"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GIROPAY("giropay"), + + DOTPAY("dotpay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + VENMO("venmo"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** 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 Gateway { + 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"), + + GOCARDLESS("gocardless"), + + 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 static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class StatementDescriptorParams { + + private final String descriptor; + + private StatementDescriptorParams(StatementDescriptorBuilder builder) { + + this.descriptor = builder.descriptor; + } + + public String getDescriptor() { + return descriptor; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.descriptor != null) { + + formData.put("descriptor", this.descriptor); + } + + return formData; + } + + /** Create a new builder for StatementDescriptorParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatementDescriptorBuilder builder() { + return new StatementDescriptorBuilder(); + } + + public static final class StatementDescriptorBuilder { + + private String descriptor; + + private StatementDescriptorBuilder() {} + + public StatementDescriptorBuilder descriptor(String value) { + this.descriptor = value; + return this; + } + + public StatementDescriptorParams build() { + return new StatementDescriptorParams(this); + } + } + } + + public static final class CustomerParams { + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final String entityIdentifierScheme; + + private final Boolean isEinvoiceEnabled; + + private final EinvoicingMethod einvoicingMethod; + + private final String entityIdentifierStandard; + + private final Boolean businessCustomerWithoutVatNumber; + + private final Boolean registeredForGst; + + private CustomerParams(CustomerBuilder builder) { + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.entityIdentifierScheme = builder.entityIdentifierScheme; + + this.isEinvoiceEnabled = builder.isEinvoiceEnabled; + + this.einvoicingMethod = builder.einvoicingMethod; + + this.entityIdentifierStandard = builder.entityIdentifierStandard; + + this.businessCustomerWithoutVatNumber = builder.businessCustomerWithoutVatNumber; + + this.registeredForGst = builder.registeredForGst; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public String getEntityIdentifierScheme() { + return entityIdentifierScheme; + } + + public Boolean getIsEinvoiceEnabled() { + return isEinvoiceEnabled; + } + + public EinvoicingMethod getEinvoicingMethod() { + return einvoicingMethod; + } + + public String getEntityIdentifierStandard() { + return entityIdentifierStandard; + } + + public Boolean getBusinessCustomerWithoutVatNumber() { + return businessCustomerWithoutVatNumber; + } + + public Boolean getRegisteredForGst() { + return registeredForGst; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.entityIdentifierScheme != null) { + + formData.put("entity_identifier_scheme", this.entityIdentifierScheme); + } + + if (this.isEinvoiceEnabled != null) { + + formData.put("is_einvoice_enabled", this.isEinvoiceEnabled); + } + + if (this.einvoicingMethod != null) { + + formData.put("einvoicing_method", this.einvoicingMethod); + } + + if (this.entityIdentifierStandard != null) { + + formData.put("entity_identifier_standard", this.entityIdentifierStandard); + } + + if (this.businessCustomerWithoutVatNumber != null) { + + formData.put("business_customer_without_vat_number", this.businessCustomerWithoutVatNumber); + } + + if (this.registeredForGst != null) { + + formData.put("registered_for_gst", this.registeredForGst); + } + + 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 String vatNumberPrefix; + + private String entityIdentifierScheme; + + private Boolean isEinvoiceEnabled; + + private EinvoicingMethod einvoicingMethod; + + private String entityIdentifierStandard; + + private Boolean businessCustomerWithoutVatNumber; + + private Boolean registeredForGst; + + private CustomerBuilder() {} + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder entityIdentifierScheme(String value) { + this.entityIdentifierScheme = value; + return this; + } + + public CustomerBuilder isEinvoiceEnabled(Boolean value) { + this.isEinvoiceEnabled = value; + return this; + } + + public CustomerBuilder einvoicingMethod(EinvoicingMethod value) { + this.einvoicingMethod = value; + return this; + } + + public CustomerBuilder entityIdentifierStandard(String value) { + this.entityIdentifierStandard = value; + return this; + } + + public CustomerBuilder businessCustomerWithoutVatNumber(Boolean value) { + this.businessCustomerWithoutVatNumber = value; + return this; + } + + public CustomerBuilder registeredForGst(Boolean value) { + this.registeredForGst = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + + public enum EinvoicingMethod { + AUTOMATIC("automatic"), + + MANUAL("manual"), + + SITE_DEFAULT("site_default"), + + /** An enum member indicating that EinvoicingMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EinvoicingMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EinvoicingMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (EinvoicingMethod enumValue : EinvoicingMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private final Timestamp contractStart; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + + this.contractStart = builder.contractStart; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + public Timestamp getContractStart() { + return contractStart; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + if (this.contractStart != null) { + + formData.put("contract_start", this.contractStart); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private Timestamp contractStart; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + @Deprecated + public ContractTermBuilder contractStart(Timestamp value) { + this.contractStart = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + RENEW_ONCE("renew_once"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingOverrideParams { + + private final Long maxExcessPaymentUsage; + + private final Long maxRefundableCreditsUsage; + + private BillingOverrideParams(BillingOverrideBuilder builder) { + + this.maxExcessPaymentUsage = builder.maxExcessPaymentUsage; + + this.maxRefundableCreditsUsage = builder.maxRefundableCreditsUsage; + } + + public Long getMaxExcessPaymentUsage() { + return maxExcessPaymentUsage; + } + + public Long getMaxRefundableCreditsUsage() { + return maxRefundableCreditsUsage; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.maxExcessPaymentUsage != null) { + + formData.put("max_excess_payment_usage", this.maxExcessPaymentUsage); + } + + if (this.maxRefundableCreditsUsage != null) { + + formData.put("max_refundable_credits_usage", this.maxRefundableCreditsUsage); + } + + return formData; + } + + /** Create a new builder for BillingOverrideParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingOverrideBuilder builder() { + return new BillingOverrideBuilder(); + } + + public static final class BillingOverrideBuilder { + + private Long maxExcessPaymentUsage; + + private Long maxRefundableCreditsUsage; + + private BillingOverrideBuilder() {} + + public BillingOverrideBuilder maxExcessPaymentUsage(Long value) { + this.maxExcessPaymentUsage = value; + return this; + } + + public BillingOverrideBuilder maxRefundableCreditsUsage(Long value) { + this.maxRefundableCreditsUsage = value; + return this; + } + + public BillingOverrideParams build() { + return new BillingOverrideParams(this); + } + } + } + + public static final class SubscriptionItemsParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Integer billingCycles; + + private final Timestamp trialEnd; + + private final Integer servicePeriodDays; + + private final ChargeOnEvent chargeOnEvent; + + private final Boolean chargeOnce; + + private final ChargeOnOption chargeOnOption; + + private final ItemType itemType; + + private final ProrationType prorationType; + + private final UsageAccumulationResetFrequency usageAccumulationResetFrequency; + + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.billingCycles = builder.billingCycles; + + this.trialEnd = builder.trialEnd; + + this.servicePeriodDays = builder.servicePeriodDays; + + this.chargeOnEvent = builder.chargeOnEvent; + + this.chargeOnce = builder.chargeOnce; + + this.chargeOnOption = builder.chargeOnOption; + + this.itemType = builder.itemType; + + this.prorationType = builder.prorationType; + + this.usageAccumulationResetFrequency = builder.usageAccumulationResetFrequency; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getServicePeriodDays() { + return servicePeriodDays; + } + + public ChargeOnEvent getChargeOnEvent() { + return chargeOnEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public ChargeOnOption getChargeOnOption() { + return chargeOnOption; + } + + public ItemType getItemType() { + return itemType; + } + + public ProrationType getProrationType() { + return prorationType; + } + + public UsageAccumulationResetFrequency getUsageAccumulationResetFrequency() { + return usageAccumulationResetFrequency; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.servicePeriodDays != null) { + + formData.put("service_period_days", this.servicePeriodDays); + } + + if (this.chargeOnEvent != null) { + + formData.put("charge_on_event", this.chargeOnEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.chargeOnOption != null) { + + formData.put("charge_on_option", this.chargeOnOption); + } + + if (this.itemType != null) { + + formData.put("item_type", this.itemType); + } + + if (this.prorationType != null) { + + formData.put("proration_type", this.prorationType); + } + + if (this.usageAccumulationResetFrequency != null) { + + formData.put("usage_accumulation_reset_frequency", this.usageAccumulationResetFrequency); + } + + return formData; + } + + /** Create a new builder for SubscriptionItemsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionItemsBuilder builder() { + return new SubscriptionItemsBuilder(); + } + + public static final class SubscriptionItemsBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Integer billingCycles; + + private Timestamp trialEnd; + + private Integer servicePeriodDays; + + private ChargeOnEvent chargeOnEvent; + + private Boolean chargeOnce; + + private ChargeOnOption chargeOnOption; + + private ItemType itemType; + + private ProrationType prorationType; + + private UsageAccumulationResetFrequency usageAccumulationResetFrequency; + + private SubscriptionItemsBuilder() {} + + public SubscriptionItemsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public SubscriptionItemsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public SubscriptionItemsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public SubscriptionItemsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public SubscriptionItemsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public SubscriptionItemsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionItemsBuilder servicePeriodDays(Integer value) { + this.servicePeriodDays = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnEvent(ChargeOnEvent value) { + this.chargeOnEvent = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { + this.chargeOnOption = value; + return this; + } + + public SubscriptionItemsBuilder itemType(ItemType value) { + this.itemType = value; + return this; + } + + public SubscriptionItemsBuilder prorationType(ProrationType value) { + this.prorationType = value; + return this; + } + + public SubscriptionItemsBuilder usageAccumulationResetFrequency( + UsageAccumulationResetFrequency value) { + this.usageAccumulationResetFrequency = value; + return this; + } + + public SubscriptionItemsParams build() { + return new SubscriptionItemsParams(this); + } + } + + 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"), + + /** 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; + } + } + + public enum ChargeOnOption { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOnOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnOption enumValue : ChargeOnOption.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 enum ProrationType { + FULL_TERM("full_term"), + + PARTIAL_TERM("partial_term"), + + NONE("none"), + + /** An enum member indicating that ProrationType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationType enumValue : ProrationType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum UsageAccumulationResetFrequency { + NEVER("never"), + + SUBSCRIPTION_BILLING_FREQUENCY("subscription_billing_frequency"), + + /** + * An enum member indicating that UsageAccumulationResetFrequency was instantiated with an + * unknown value. + */ + _UNKNOWN(null); + private final String value; + + UsageAccumulationResetFrequency(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static UsageAccumulationResetFrequency fromString(String value) { + if (value == null) return _UNKNOWN; + for (UsageAccumulationResetFrequency enumValue : UsageAccumulationResetFrequency.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class DiscountsParams { + + private final ApplyOn applyOn; + + private final DurationType durationType; + + private final Number percentage; + + private final Long amount; + + private final Integer period; + + private final PeriodUnit periodUnit; + + private final Boolean includedInMrr; + + private final String itemPriceId; + + private final Integer quantity; + + private final OperationType operationType; + + private final String id; + + private DiscountsParams(DiscountsBuilder builder) { + + this.applyOn = builder.applyOn; + + this.durationType = builder.durationType; + + this.percentage = builder.percentage; + + this.amount = builder.amount; + + this.period = builder.period; + + this.periodUnit = builder.periodUnit; + + this.includedInMrr = builder.includedInMrr; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.operationType = builder.operationType; + + this.id = builder.id; + } + + public ApplyOn getApplyOn() { + return applyOn; + } + + public DurationType getDurationType() { + return durationType; + } + + public Number getPercentage() { + return percentage; + } + + public Long getAmount() { + return amount; + } + + public Integer getPeriod() { + return period; + } + + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + public Boolean getIncludedInMrr() { + return includedInMrr; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public OperationType getOperationType() { + return operationType; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.applyOn != null) { + + formData.put("apply_on", this.applyOn); + } + + if (this.durationType != null) { + + formData.put("duration_type", this.durationType); + } + + if (this.percentage != null) { + + formData.put("percentage", this.percentage); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.period != null) { + + formData.put("period", this.period); + } + + if (this.periodUnit != null) { + + formData.put("period_unit", this.periodUnit); + } + + if (this.includedInMrr != null) { + + formData.put("included_in_mrr", this.includedInMrr); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.operationType != null) { + + formData.put("operation_type", this.operationType); + } + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for DiscountsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DiscountsBuilder builder() { + return new DiscountsBuilder(); + } + + public static final class DiscountsBuilder { + + private ApplyOn applyOn; + + private DurationType durationType; + + private Number percentage; + + private Long amount; + + private Integer period; + + private PeriodUnit periodUnit; + + private Boolean includedInMrr; + + private String itemPriceId; + + private Integer quantity; + + private OperationType operationType; + + private String id; + + private DiscountsBuilder() {} + + public DiscountsBuilder applyOn(ApplyOn value) { + this.applyOn = value; + return this; + } + + public DiscountsBuilder durationType(DurationType value) { + this.durationType = value; + return this; + } + + public DiscountsBuilder percentage(Number value) { + this.percentage = value; + return this; + } + + public DiscountsBuilder amount(Long value) { + this.amount = value; + return this; + } + + public DiscountsBuilder period(Integer value) { + this.period = value; + return this; + } + + public DiscountsBuilder periodUnit(PeriodUnit value) { + this.periodUnit = value; + return this; + } + + public DiscountsBuilder includedInMrr(Boolean value) { + this.includedInMrr = value; + return this; + } + + public DiscountsBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public DiscountsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public DiscountsBuilder operationType(OperationType value) { + this.operationType = value; + return this; + } + + public DiscountsBuilder id(String value) { + this.id = value; + return this; + } + + public DiscountsParams build() { + return new DiscountsParams(this); + } + } + + public enum ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIC_ITEM_PRICE("specific_item_price"), + + /** 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 enum OperationType { + ADD("add"), + + REMOVE("remove"), + + /** An enum member indicating that OperationType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OperationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OperationType fromString(String value) { + if (value == null) return _UNKNOWN; + for (OperationType enumValue : OperationType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CouponsParams { + + private final String couponId; + + private final Timestamp applyTill; + + private CouponsParams(CouponsBuilder builder) { + + this.couponId = builder.couponId; + + this.applyTill = builder.applyTill; + } + + public String getCouponId() { + return couponId; + } + + public Timestamp getApplyTill() { + return applyTill; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.couponId != null) { + + formData.put("coupon_id", this.couponId); + } + + if (this.applyTill != null) { + + formData.put("apply_till", this.applyTill); + } + + return formData; + } + + /** Create a new builder for CouponsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponsBuilder builder() { + return new CouponsBuilder(); + } + + public static final class CouponsBuilder { + + private String couponId; + + private Timestamp applyTill; + + private CouponsBuilder() {} + + public CouponsBuilder couponId(String value) { + this.couponId = value; + return this; + } + + public CouponsBuilder applyTill(Timestamp value) { + this.applyTill = value; + return this; + } + + public CouponsParams build() { + return new CouponsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateParams.java new file mode 100644 index 00000000..a90548e4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateParams.java @@ -0,0 +1,4123 @@ +/* + * 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.subscription.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 SubscriptionUpdateParams { + + private final String planId; + + private final Integer planQuantity; + + private final Long planUnitPrice; + + private final Long setupFee; + + private final Boolean replaceAddonList; + + private final List mandatoryAddonsToRemove; + + private final String planQuantityInDecimal; + + private final String planUnitPriceInDecimal; + + private final Timestamp invoiceDate; + + private final Timestamp startDate; + + private final Timestamp trialEnd; + + private final Integer billingCycles; + + private final String coupon; + + private final Integer termsToCharge; + + private final Timestamp reactivateFrom; + + private final BillingAlignmentMode billingAlignmentMode; + + private final AutoCollection autoCollection; + + private final OfflinePaymentMethod offlinePaymentMethod; + + private final String poNumber; + + private final List couponIds; + + private final Boolean replaceCouponList; + + private final Boolean prorate; + + private final Boolean endOfTerm; + + private final Boolean forceTermReset; + + private final Boolean reactivate; + + private final String tokenId; + + private final String invoiceNotes; + + private final java.util.Map metaData; + + private final Boolean invoiceImmediately; + + private final Boolean overrideRelationship; + + private final Timestamp changesScheduledAt; + + private final ChangeOption changeOption; + + private final Integer contractTermBillingCycleOnRenewal; + + private final Integer freePeriod; + + private final FreePeriodUnit freePeriodUnit; + + private final TrialEndAction trialEndAction; + + private final CardParams card; + + private final PaymentMethodParams paymentMethod; + + private final PaymentIntentParams paymentIntent; + + private final BillingAddressParams billingAddress; + + private final ShippingAddressParams shippingAddress; + + private final StatementDescriptorParams statementDescriptor; + + private final CustomerParams customer; + + private final ContractTermParams contractTerm; + + private final List addons; + + private final List eventBasedAddons; + + private final List coupons; + + private final Map customFields; + + private SubscriptionUpdateParams(SubscriptionUpdateBuilder builder) { + + this.planId = builder.planId; + + this.planQuantity = builder.planQuantity; + + this.planUnitPrice = builder.planUnitPrice; + + this.setupFee = builder.setupFee; + + this.replaceAddonList = builder.replaceAddonList; + + this.mandatoryAddonsToRemove = builder.mandatoryAddonsToRemove; + + this.planQuantityInDecimal = builder.planQuantityInDecimal; + + this.planUnitPriceInDecimal = builder.planUnitPriceInDecimal; + + this.invoiceDate = builder.invoiceDate; + + this.startDate = builder.startDate; + + this.trialEnd = builder.trialEnd; + + this.billingCycles = builder.billingCycles; + + this.coupon = builder.coupon; + + this.termsToCharge = builder.termsToCharge; + + this.reactivateFrom = builder.reactivateFrom; + + this.billingAlignmentMode = builder.billingAlignmentMode; + + this.autoCollection = builder.autoCollection; + + this.offlinePaymentMethod = builder.offlinePaymentMethod; + + this.poNumber = builder.poNumber; + + this.couponIds = builder.couponIds; + + this.replaceCouponList = builder.replaceCouponList; + + this.prorate = builder.prorate; + + this.endOfTerm = builder.endOfTerm; + + this.forceTermReset = builder.forceTermReset; + + this.reactivate = builder.reactivate; + + this.tokenId = builder.tokenId; + + this.invoiceNotes = builder.invoiceNotes; + + this.metaData = builder.metaData; + + this.invoiceImmediately = builder.invoiceImmediately; + + this.overrideRelationship = builder.overrideRelationship; + + this.changesScheduledAt = builder.changesScheduledAt; + + this.changeOption = builder.changeOption; + + this.contractTermBillingCycleOnRenewal = builder.contractTermBillingCycleOnRenewal; + + this.freePeriod = builder.freePeriod; + + this.freePeriodUnit = builder.freePeriodUnit; + + this.trialEndAction = builder.trialEndAction; + + this.card = builder.card; + + this.paymentMethod = builder.paymentMethod; + + this.paymentIntent = builder.paymentIntent; + + this.billingAddress = builder.billingAddress; + + this.shippingAddress = builder.shippingAddress; + + this.statementDescriptor = builder.statementDescriptor; + + this.customer = builder.customer; + + this.contractTerm = builder.contractTerm; + + this.addons = builder.addons; + + this.eventBasedAddons = builder.eventBasedAddons; + + this.coupons = builder.coupons; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getPlanId() { + return planId; + } + + public Integer getPlanQuantity() { + return planQuantity; + } + + public Long getPlanUnitPrice() { + return planUnitPrice; + } + + public Long getSetupFee() { + return setupFee; + } + + public Boolean getReplaceAddonList() { + return replaceAddonList; + } + + public List getMandatoryAddonsToRemove() { + return mandatoryAddonsToRemove; + } + + public String getPlanQuantityInDecimal() { + return planQuantityInDecimal; + } + + public String getPlanUnitPriceInDecimal() { + return planUnitPriceInDecimal; + } + + public Timestamp getInvoiceDate() { + return invoiceDate; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public String getCoupon() { + return coupon; + } + + public Integer getTermsToCharge() { + return termsToCharge; + } + + public Timestamp getReactivateFrom() { + return reactivateFrom; + } + + public BillingAlignmentMode getBillingAlignmentMode() { + return billingAlignmentMode; + } + + public AutoCollection getAutoCollection() { + return autoCollection; + } + + public OfflinePaymentMethod getOfflinePaymentMethod() { + return offlinePaymentMethod; + } + + public String getPoNumber() { + return poNumber; + } + + public List getCouponIds() { + return couponIds; + } + + public Boolean getReplaceCouponList() { + return replaceCouponList; + } + + public Boolean getProrate() { + return prorate; + } + + public Boolean getEndOfTerm() { + return endOfTerm; + } + + public Boolean getForceTermReset() { + return forceTermReset; + } + + public Boolean getReactivate() { + return reactivate; + } + + public String getTokenId() { + return tokenId; + } + + public String getInvoiceNotes() { + return invoiceNotes; + } + + public java.util.Map getMetaData() { + return metaData; + } + + public Boolean getInvoiceImmediately() { + return invoiceImmediately; + } + + public Boolean getOverrideRelationship() { + return overrideRelationship; + } + + public Timestamp getChangesScheduledAt() { + return changesScheduledAt; + } + + public ChangeOption getChangeOption() { + return changeOption; + } + + public Integer getContractTermBillingCycleOnRenewal() { + return contractTermBillingCycleOnRenewal; + } + + public Integer getFreePeriod() { + return freePeriod; + } + + public FreePeriodUnit getFreePeriodUnit() { + return freePeriodUnit; + } + + public TrialEndAction getTrialEndAction() { + return trialEndAction; + } + + public CardParams getCard() { + return card; + } + + public PaymentMethodParams getPaymentMethod() { + return paymentMethod; + } + + public PaymentIntentParams getPaymentIntent() { + return paymentIntent; + } + + public BillingAddressParams getBillingAddress() { + return billingAddress; + } + + public ShippingAddressParams getShippingAddress() { + return shippingAddress; + } + + public StatementDescriptorParams getStatementDescriptor() { + return statementDescriptor; + } + + public CustomerParams getCustomer() { + return customer; + } + + public ContractTermParams getContractTerm() { + return contractTerm; + } + + public List getAddons() { + return addons; + } + + public List getEventBasedAddons() { + return eventBasedAddons; + } + + public List getCoupons() { + return coupons; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.planId != null) { + + formData.put("plan_id", this.planId); + } + + if (this.planQuantity != null) { + + formData.put("plan_quantity", this.planQuantity); + } + + if (this.planUnitPrice != null) { + + formData.put("plan_unit_price", this.planUnitPrice); + } + + if (this.setupFee != null) { + + formData.put("setup_fee", this.setupFee); + } + + if (this.replaceAddonList != null) { + + formData.put("replace_addon_list", this.replaceAddonList); + } + + if (this.mandatoryAddonsToRemove != null) { + + formData.put("mandatory_addons_to_remove", this.mandatoryAddonsToRemove); + } + + if (this.planQuantityInDecimal != null) { + + formData.put("plan_quantity_in_decimal", this.planQuantityInDecimal); + } + + if (this.planUnitPriceInDecimal != null) { + + formData.put("plan_unit_price_in_decimal", this.planUnitPriceInDecimal); + } + + if (this.invoiceDate != null) { + + formData.put("invoice_date", this.invoiceDate); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.coupon != null) { + + formData.put("coupon", this.coupon); + } + + if (this.termsToCharge != null) { + + formData.put("terms_to_charge", this.termsToCharge); + } + + if (this.reactivateFrom != null) { + + formData.put("reactivate_from", this.reactivateFrom); + } + + if (this.billingAlignmentMode != null) { + + formData.put("billing_alignment_mode", this.billingAlignmentMode); + } + + if (this.autoCollection != null) { + + formData.put("auto_collection", this.autoCollection); + } + + if (this.offlinePaymentMethod != null) { + + formData.put("offline_payment_method", this.offlinePaymentMethod); + } + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + if (this.couponIds != null) { + + formData.put("coupon_ids", this.couponIds); + } + + if (this.replaceCouponList != null) { + + formData.put("replace_coupon_list", this.replaceCouponList); + } + + if (this.prorate != null) { + + formData.put("prorate", this.prorate); + } + + if (this.endOfTerm != null) { + + formData.put("end_of_term", this.endOfTerm); + } + + if (this.forceTermReset != null) { + + formData.put("force_term_reset", this.forceTermReset); + } + + if (this.reactivate != null) { + + formData.put("reactivate", this.reactivate); + } + + if (this.tokenId != null) { + + formData.put("token_id", this.tokenId); + } + + if (this.invoiceNotes != null) { + + formData.put("invoice_notes", this.invoiceNotes); + } + + if (this.metaData != null) { + + formData.put("meta_data", JsonUtil.toJson(this.metaData)); + } + + if (this.invoiceImmediately != null) { + + formData.put("invoice_immediately", this.invoiceImmediately); + } + + if (this.overrideRelationship != null) { + + formData.put("override_relationship", this.overrideRelationship); + } + + if (this.changesScheduledAt != null) { + + formData.put("changes_scheduled_at", this.changesScheduledAt); + } + + if (this.changeOption != null) { + + formData.put("change_option", this.changeOption); + } + + if (this.contractTermBillingCycleOnRenewal != null) { + + formData.put( + "contract_term_billing_cycle_on_renewal", this.contractTermBillingCycleOnRenewal); + } + + if (this.freePeriod != null) { + + formData.put("free_period", this.freePeriod); + } + + if (this.freePeriodUnit != null) { + + formData.put("free_period_unit", this.freePeriodUnit); + } + + if (this.trialEndAction != null) { + + formData.put("trial_end_action", this.trialEndAction); + } + + if (this.card != null) { + + // Single object + Map nestedData = this.card.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "card[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentMethod != null) { + + // Single object + Map nestedData = this.paymentMethod.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_method[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.paymentIntent != null) { + + // Single object + Map nestedData = this.paymentIntent.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "payment_intent[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.billingAddress != null) { + + // Single object + Map nestedData = this.billingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.shippingAddress != null) { + + // Single object + Map nestedData = this.shippingAddress.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "shipping_address[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.statementDescriptor != null) { + + // Single object + Map nestedData = this.statementDescriptor.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "statement_descriptor[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + 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()); + } + } + + if (this.contractTerm != null) { + + // Single object + Map nestedData = this.contractTerm.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "contract_term[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.eventBasedAddons != null) { + + // List of objects + for (int i = 0; i < this.eventBasedAddons.size(); i++) { + EventBasedAddonsParams item = this.eventBasedAddons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "event_based_addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.coupons != null) { + + // List of objects + for (int i = 0; i < this.coupons.size(); i++) { + CouponsParams item = this.coupons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "coupons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for SubscriptionUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionUpdateBuilder builder() { + return new SubscriptionUpdateBuilder(); + } + + public static final class SubscriptionUpdateBuilder { + + private String planId; + + private Integer planQuantity; + + private Long planUnitPrice; + + private Long setupFee; + + private Boolean replaceAddonList; + + private List mandatoryAddonsToRemove; + + private String planQuantityInDecimal; + + private String planUnitPriceInDecimal; + + private Timestamp invoiceDate; + + private Timestamp startDate; + + private Timestamp trialEnd; + + private Integer billingCycles; + + private String coupon; + + private Integer termsToCharge; + + private Timestamp reactivateFrom; + + private BillingAlignmentMode billingAlignmentMode; + + private AutoCollection autoCollection; + + private OfflinePaymentMethod offlinePaymentMethod; + + private String poNumber; + + private List couponIds; + + private Boolean replaceCouponList; + + private Boolean prorate; + + private Boolean endOfTerm; + + private Boolean forceTermReset; + + private Boolean reactivate; + + private String tokenId; + + private String invoiceNotes; + + private java.util.Map metaData; + + private Boolean invoiceImmediately; + + private Boolean overrideRelationship; + + private Timestamp changesScheduledAt; + + private ChangeOption changeOption; + + private Integer contractTermBillingCycleOnRenewal; + + private Integer freePeriod; + + private FreePeriodUnit freePeriodUnit; + + private TrialEndAction trialEndAction; + + private CardParams card; + + private PaymentMethodParams paymentMethod; + + private PaymentIntentParams paymentIntent; + + private BillingAddressParams billingAddress; + + private ShippingAddressParams shippingAddress; + + private StatementDescriptorParams statementDescriptor; + + private CustomerParams customer; + + private ContractTermParams contractTerm; + + private List addons; + + private List eventBasedAddons; + + private List coupons; + + private Map customFields = new LinkedHashMap<>(); + + private SubscriptionUpdateBuilder() {} + + public SubscriptionUpdateBuilder planId(String value) { + this.planId = value; + return this; + } + + public SubscriptionUpdateBuilder planQuantity(Integer value) { + this.planQuantity = value; + return this; + } + + public SubscriptionUpdateBuilder planUnitPrice(Long value) { + this.planUnitPrice = value; + return this; + } + + public SubscriptionUpdateBuilder setupFee(Long value) { + this.setupFee = value; + return this; + } + + public SubscriptionUpdateBuilder replaceAddonList(Boolean value) { + this.replaceAddonList = value; + return this; + } + + public SubscriptionUpdateBuilder mandatoryAddonsToRemove(List value) { + this.mandatoryAddonsToRemove = value; + return this; + } + + public SubscriptionUpdateBuilder planQuantityInDecimal(String value) { + this.planQuantityInDecimal = value; + return this; + } + + public SubscriptionUpdateBuilder planUnitPriceInDecimal(String value) { + this.planUnitPriceInDecimal = value; + return this; + } + + public SubscriptionUpdateBuilder invoiceDate(Timestamp value) { + this.invoiceDate = value; + return this; + } + + public SubscriptionUpdateBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public SubscriptionUpdateBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public SubscriptionUpdateBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + @Deprecated + public SubscriptionUpdateBuilder coupon(String value) { + this.coupon = value; + return this; + } + + public SubscriptionUpdateBuilder termsToCharge(Integer value) { + this.termsToCharge = value; + return this; + } + + public SubscriptionUpdateBuilder reactivateFrom(Timestamp value) { + this.reactivateFrom = value; + return this; + } + + public SubscriptionUpdateBuilder billingAlignmentMode(BillingAlignmentMode value) { + this.billingAlignmentMode = value; + return this; + } + + public SubscriptionUpdateBuilder autoCollection(AutoCollection value) { + this.autoCollection = value; + return this; + } + + public SubscriptionUpdateBuilder offlinePaymentMethod(OfflinePaymentMethod value) { + this.offlinePaymentMethod = value; + return this; + } + + public SubscriptionUpdateBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public SubscriptionUpdateBuilder couponIds(List value) { + this.couponIds = value; + return this; + } + + public SubscriptionUpdateBuilder replaceCouponList(Boolean value) { + this.replaceCouponList = value; + return this; + } + + public SubscriptionUpdateBuilder prorate(Boolean value) { + this.prorate = value; + return this; + } + + public SubscriptionUpdateBuilder endOfTerm(Boolean value) { + this.endOfTerm = value; + return this; + } + + public SubscriptionUpdateBuilder forceTermReset(Boolean value) { + this.forceTermReset = value; + return this; + } + + public SubscriptionUpdateBuilder reactivate(Boolean value) { + this.reactivate = value; + return this; + } + + public SubscriptionUpdateBuilder tokenId(String value) { + this.tokenId = value; + return this; + } + + public SubscriptionUpdateBuilder invoiceNotes(String value) { + this.invoiceNotes = value; + return this; + } + + public SubscriptionUpdateBuilder metaData(java.util.Map value) { + this.metaData = value; + return this; + } + + public SubscriptionUpdateBuilder invoiceImmediately(Boolean value) { + this.invoiceImmediately = value; + return this; + } + + public SubscriptionUpdateBuilder overrideRelationship(Boolean value) { + this.overrideRelationship = value; + return this; + } + + public SubscriptionUpdateBuilder changesScheduledAt(Timestamp value) { + this.changesScheduledAt = value; + return this; + } + + public SubscriptionUpdateBuilder changeOption(ChangeOption value) { + this.changeOption = value; + return this; + } + + public SubscriptionUpdateBuilder contractTermBillingCycleOnRenewal(Integer value) { + this.contractTermBillingCycleOnRenewal = value; + return this; + } + + public SubscriptionUpdateBuilder freePeriod(Integer value) { + this.freePeriod = value; + return this; + } + + public SubscriptionUpdateBuilder freePeriodUnit(FreePeriodUnit value) { + this.freePeriodUnit = value; + return this; + } + + public SubscriptionUpdateBuilder trialEndAction(TrialEndAction value) { + this.trialEndAction = value; + return this; + } + + public SubscriptionUpdateBuilder card(CardParams value) { + this.card = value; + return this; + } + + public SubscriptionUpdateBuilder paymentMethod(PaymentMethodParams value) { + this.paymentMethod = value; + return this; + } + + public SubscriptionUpdateBuilder paymentIntent(PaymentIntentParams value) { + this.paymentIntent = value; + return this; + } + + public SubscriptionUpdateBuilder billingAddress(BillingAddressParams value) { + this.billingAddress = value; + return this; + } + + public SubscriptionUpdateBuilder shippingAddress(ShippingAddressParams value) { + this.shippingAddress = value; + return this; + } + + public SubscriptionUpdateBuilder statementDescriptor(StatementDescriptorParams value) { + this.statementDescriptor = value; + return this; + } + + public SubscriptionUpdateBuilder customer(CustomerParams value) { + this.customer = value; + return this; + } + + public SubscriptionUpdateBuilder contractTerm(ContractTermParams value) { + this.contractTerm = value; + return this; + } + + public SubscriptionUpdateBuilder addons(List value) { + this.addons = value; + return this; + } + + public SubscriptionUpdateBuilder eventBasedAddons(List value) { + this.eventBasedAddons = value; + return this; + } + + @Deprecated + public SubscriptionUpdateBuilder coupons(List value) { + this.coupons = 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 SubscriptionUpdateBuilder 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 SubscriptionUpdateBuilder 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 SubscriptionUpdateParams build() { + return new SubscriptionUpdateParams(this); + } + } + + public enum BillingAlignmentMode { + IMMEDIATE("immediate"), + + DELAYED("delayed"), + + /** + * An enum member indicating that BillingAlignmentMode was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + BillingAlignmentMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static BillingAlignmentMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (BillingAlignmentMode enumValue : BillingAlignmentMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChangeOption { + IMMEDIATELY("immediately"), + + END_OF_TERM("end_of_term"), + + SPECIFIC_DATE("specific_date"), + + /** An enum member indicating that ChangeOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChangeOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChangeOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChangeOption enumValue : ChangeOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum FreePeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that FreePeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + FreePeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static FreePeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (FreePeriodUnit enumValue : FreePeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialEndAction { + SITE_DEFAULT("site_default"), + + PLAN_DEFAULT("plan_default"), + + ACTIVATE_SUBSCRIPTION("activate_subscription"), + + CANCEL_SUBSCRIPTION("cancel_subscription"), + + /** An enum member indicating that TrialEndAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialEndAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialEndAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialEndAction enumValue : TrialEndAction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class CardParams { + + 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 java.util.Map additionalInformation; + + private CardParams(CardBuilder 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.additionalInformation = builder.additionalInformation; + } + + 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 java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** 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.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for CardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CardBuilder builder() { + return new CardBuilder(); + } + + public static final class CardBuilder { + + 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 java.util.Map additionalInformation; + + private CardBuilder() {} + + @Deprecated + public CardBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public CardBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + @Deprecated + public CardBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public CardBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CardBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public CardBuilder number(String value) { + this.number = value; + return this; + } + + public CardBuilder expiryMonth(Integer value) { + this.expiryMonth = value; + return this; + } + + public CardBuilder expiryYear(Integer value) { + this.expiryYear = value; + return this; + } + + public CardBuilder cvv(String value) { + this.cvv = value; + return this; + } + + public CardBuilder preferredScheme(PreferredScheme value) { + this.preferredScheme = value; + return this; + } + + public CardBuilder billingAddr1(String value) { + this.billingAddr1 = value; + return this; + } + + public CardBuilder billingAddr2(String value) { + this.billingAddr2 = value; + return this; + } + + public CardBuilder billingCity(String value) { + this.billingCity = value; + return this; + } + + public CardBuilder billingStateCode(String value) { + this.billingStateCode = value; + return this; + } + + public CardBuilder billingState(String value) { + this.billingState = value; + return this; + } + + public CardBuilder billingZip(String value) { + this.billingZip = value; + return this; + } + + public CardBuilder billingCountry(String value) { + this.billingCountry = value; + return this; + } + + @Deprecated + public CardBuilder ipAddress(String value) { + this.ipAddress = value; + return this; + } + + public CardBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public CardParams build() { + return new CardParams(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 PaymentMethodParams { + + private final Type type; + + private final Gateway gateway; + + private final String gatewayAccountId; + + private final String referenceId; + + private final String tmpToken; + + private final String issuingCountry; + + private final java.util.Map additionalInformation; + + private PaymentMethodParams(PaymentMethodBuilder builder) { + + this.type = builder.type; + + this.gateway = builder.gateway; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.referenceId = builder.referenceId; + + this.tmpToken = builder.tmpToken; + + this.issuingCountry = builder.issuingCountry; + + this.additionalInformation = builder.additionalInformation; + } + + public Type getType() { + return type; + } + + public Gateway getGateway() { + return gateway; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getReferenceId() { + return referenceId; + } + + public String getTmpToken() { + return tmpToken; + } + + public String getIssuingCountry() { + return issuingCountry; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.gateway != null) { + + formData.put("gateway", this.gateway); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.tmpToken != null) { + + formData.put("tmp_token", this.tmpToken); + } + + if (this.issuingCountry != null) { + + formData.put("issuing_country", this.issuingCountry); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentMethodParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentMethodBuilder builder() { + return new PaymentMethodBuilder(); + } + + public static final class PaymentMethodBuilder { + + private Type type; + + private Gateway gateway; + + private String gatewayAccountId; + + private String referenceId; + + private String tmpToken; + + private String issuingCountry; + + private java.util.Map additionalInformation; + + private PaymentMethodBuilder() {} + + public PaymentMethodBuilder type(Type value) { + this.type = value; + return this; + } + + @Deprecated + public PaymentMethodBuilder gateway(Gateway value) { + this.gateway = value; + return this; + } + + public PaymentMethodBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentMethodBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public PaymentMethodBuilder tmpToken(String value) { + this.tmpToken = value; + return this; + } + + public PaymentMethodBuilder issuingCountry(String value) { + this.issuingCountry = value; + return this; + } + + public PaymentMethodBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentMethodParams build() { + return new PaymentMethodParams(this); + } + } + + public enum Type { + CARD("card"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + AMAZON_PAYMENTS("amazon_payments"), + + DIRECT_DEBIT("direct_debit"), + + GENERIC("generic"), + + ALIPAY("alipay"), + + UNIONPAY("unionpay"), + + APPLE_PAY("apple_pay"), + + WECHAT_PAY("wechat_pay"), + + IDEAL("ideal"), + + GOOGLE_PAY("google_pay"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GIROPAY("giropay"), + + DOTPAY("dotpay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + VENMO("venmo"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** 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 Gateway { + 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"), + + GOCARDLESS("gocardless"), + + 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 static final class PaymentIntentParams { + + private final String id; + + private final String gatewayAccountId; + + private final String gwToken; + + private final PaymentMethodType paymentMethodType; + + private final String referenceId; + + private final String gwPaymentMethodId; + + private final java.util.Map additionalInformation; + + private PaymentIntentParams(PaymentIntentBuilder builder) { + + this.id = builder.id; + + this.gatewayAccountId = builder.gatewayAccountId; + + this.gwToken = builder.gwToken; + + this.paymentMethodType = builder.paymentMethodType; + + this.referenceId = builder.referenceId; + + this.gwPaymentMethodId = builder.gwPaymentMethodId; + + this.additionalInformation = builder.additionalInformation; + } + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getGwToken() { + return gwToken; + } + + public PaymentMethodType getPaymentMethodType() { + return paymentMethodType; + } + + public String getReferenceId() { + return referenceId; + } + + public String getGwPaymentMethodId() { + return gwPaymentMethodId; + } + + public java.util.Map getAdditionalInformation() { + return additionalInformation; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + + if (this.gwToken != null) { + + formData.put("gw_token", this.gwToken); + } + + if (this.paymentMethodType != null) { + + formData.put("payment_method_type", this.paymentMethodType); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.gwPaymentMethodId != null) { + + formData.put("gw_payment_method_id", this.gwPaymentMethodId); + } + + if (this.additionalInformation != null) { + + formData.put("additional_information", JsonUtil.toJson(this.additionalInformation)); + } + + return formData; + } + + /** Create a new builder for PaymentIntentParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentIntentBuilder builder() { + return new PaymentIntentBuilder(); + } + + public static final class PaymentIntentBuilder { + + private String id; + + private String gatewayAccountId; + + private String gwToken; + + private PaymentMethodType paymentMethodType; + + private String referenceId; + + private String gwPaymentMethodId; + + private java.util.Map additionalInformation; + + private PaymentIntentBuilder() {} + + public PaymentIntentBuilder id(String value) { + this.id = value; + return this; + } + + public PaymentIntentBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + + public PaymentIntentBuilder gwToken(String value) { + this.gwToken = value; + return this; + } + + public PaymentIntentBuilder paymentMethodType(PaymentMethodType value) { + this.paymentMethodType = value; + return this; + } + + public PaymentIntentBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + @Deprecated + public PaymentIntentBuilder gwPaymentMethodId(String value) { + this.gwPaymentMethodId = value; + return this; + } + + public PaymentIntentBuilder additionalInformation(java.util.Map value) { + this.additionalInformation = value; + return this; + } + + public PaymentIntentParams build() { + return new PaymentIntentParams(this); + } + } + + public enum PaymentMethodType { + CARD("card"), + + IDEAL("ideal"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GOOGLE_PAY("google_pay"), + + DOTPAY("dotpay"), + + GIROPAY("giropay"), + + APPLE_PAY("apple_pay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + BOLETO("boleto"), + + VENMO("venmo"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + /** + * An enum member indicating that PaymentMethodType was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + PaymentMethodType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethodType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethodType enumValue : PaymentMethodType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class BillingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 BillingAddressParams(BillingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 BillingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingAddressBuilder builder() { + return new BillingAddressBuilder(); + } + + public static final class BillingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private BillingAddressBuilder() {} + + public BillingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public BillingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public BillingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public BillingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public BillingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public BillingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public BillingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public BillingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public BillingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public BillingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public BillingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public BillingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public BillingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public BillingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public BillingAddressParams build() { + return new BillingAddressParams(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; + } + } + } + + public static final class ShippingAddressParams { + + private final String firstName; + + private final String lastName; + + private final String email; + + private final String company; + + private final String phone; + + private final String line1; + + private final String line2; + + private final String line3; + + 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 ShippingAddressParams(ShippingAddressBuilder builder) { + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; + + this.email = builder.email; + + this.company = builder.company; + + this.phone = builder.phone; + + this.line1 = builder.line1; + + this.line2 = builder.line2; + + this.line3 = builder.line3; + + 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 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 getLine1() { + return line1; + } + + public String getLine2() { + return line2; + } + + public String getLine3() { + return line3; + } + + 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.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.line1 != null) { + + formData.put("line1", this.line1); + } + + if (this.line2 != null) { + + formData.put("line2", this.line2); + } + + if (this.line3 != null) { + + formData.put("line3", this.line3); + } + + 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 ShippingAddressParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ShippingAddressBuilder builder() { + return new ShippingAddressBuilder(); + } + + public static final class ShippingAddressBuilder { + + private String firstName; + + private String lastName; + + private String email; + + private String company; + + private String phone; + + private String line1; + + private String line2; + + private String line3; + + private String city; + + private String stateCode; + + private String state; + + private String zip; + + private String country; + + private ValidationStatus validationStatus; + + private ShippingAddressBuilder() {} + + public ShippingAddressBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public ShippingAddressBuilder lastName(String value) { + this.lastName = value; + return this; + } + + public ShippingAddressBuilder email(String value) { + this.email = value; + return this; + } + + public ShippingAddressBuilder company(String value) { + this.company = value; + return this; + } + + public ShippingAddressBuilder phone(String value) { + this.phone = value; + return this; + } + + public ShippingAddressBuilder line1(String value) { + this.line1 = value; + return this; + } + + public ShippingAddressBuilder line2(String value) { + this.line2 = value; + return this; + } + + public ShippingAddressBuilder line3(String value) { + this.line3 = value; + return this; + } + + public ShippingAddressBuilder city(String value) { + this.city = value; + return this; + } + + public ShippingAddressBuilder stateCode(String value) { + this.stateCode = value; + return this; + } + + public ShippingAddressBuilder state(String value) { + this.state = value; + return this; + } + + public ShippingAddressBuilder zip(String value) { + this.zip = value; + return this; + } + + public ShippingAddressBuilder country(String value) { + this.country = value; + return this; + } + + public ShippingAddressBuilder validationStatus(ValidationStatus value) { + this.validationStatus = value; + return this; + } + + public ShippingAddressParams build() { + return new ShippingAddressParams(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; + } + } + } + + public static final class StatementDescriptorParams { + + private final String descriptor; + + private StatementDescriptorParams(StatementDescriptorBuilder builder) { + + this.descriptor = builder.descriptor; + } + + public String getDescriptor() { + return descriptor; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.descriptor != null) { + + formData.put("descriptor", this.descriptor); + } + + return formData; + } + + /** Create a new builder for StatementDescriptorParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static StatementDescriptorBuilder builder() { + return new StatementDescriptorBuilder(); + } + + public static final class StatementDescriptorBuilder { + + private String descriptor; + + private StatementDescriptorBuilder() {} + + public StatementDescriptorBuilder descriptor(String value) { + this.descriptor = value; + return this; + } + + public StatementDescriptorParams build() { + return new StatementDescriptorParams(this); + } + } + } + + public static final class CustomerParams { + + private final String vatNumber; + + private final String vatNumberPrefix; + + private final String entityIdentifierScheme; + + private final Boolean isEinvoiceEnabled; + + private final EinvoicingMethod einvoicingMethod; + + private final String entityIdentifierStandard; + + private final Boolean businessCustomerWithoutVatNumber; + + private final Boolean registeredForGst; + + private CustomerParams(CustomerBuilder builder) { + + this.vatNumber = builder.vatNumber; + + this.vatNumberPrefix = builder.vatNumberPrefix; + + this.entityIdentifierScheme = builder.entityIdentifierScheme; + + this.isEinvoiceEnabled = builder.isEinvoiceEnabled; + + this.einvoicingMethod = builder.einvoicingMethod; + + this.entityIdentifierStandard = builder.entityIdentifierStandard; + + this.businessCustomerWithoutVatNumber = builder.businessCustomerWithoutVatNumber; + + this.registeredForGst = builder.registeredForGst; + } + + public String getVatNumber() { + return vatNumber; + } + + public String getVatNumberPrefix() { + return vatNumberPrefix; + } + + public String getEntityIdentifierScheme() { + return entityIdentifierScheme; + } + + public Boolean getIsEinvoiceEnabled() { + return isEinvoiceEnabled; + } + + public EinvoicingMethod getEinvoicingMethod() { + return einvoicingMethod; + } + + public String getEntityIdentifierStandard() { + return entityIdentifierStandard; + } + + public Boolean getBusinessCustomerWithoutVatNumber() { + return businessCustomerWithoutVatNumber; + } + + public Boolean getRegisteredForGst() { + return registeredForGst; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.vatNumber != null) { + + formData.put("vat_number", this.vatNumber); + } + + if (this.vatNumberPrefix != null) { + + formData.put("vat_number_prefix", this.vatNumberPrefix); + } + + if (this.entityIdentifierScheme != null) { + + formData.put("entity_identifier_scheme", this.entityIdentifierScheme); + } + + if (this.isEinvoiceEnabled != null) { + + formData.put("is_einvoice_enabled", this.isEinvoiceEnabled); + } + + if (this.einvoicingMethod != null) { + + formData.put("einvoicing_method", this.einvoicingMethod); + } + + if (this.entityIdentifierStandard != null) { + + formData.put("entity_identifier_standard", this.entityIdentifierStandard); + } + + if (this.businessCustomerWithoutVatNumber != null) { + + formData.put("business_customer_without_vat_number", this.businessCustomerWithoutVatNumber); + } + + if (this.registeredForGst != null) { + + formData.put("registered_for_gst", this.registeredForGst); + } + + 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 String vatNumberPrefix; + + private String entityIdentifierScheme; + + private Boolean isEinvoiceEnabled; + + private EinvoicingMethod einvoicingMethod; + + private String entityIdentifierStandard; + + private Boolean businessCustomerWithoutVatNumber; + + private Boolean registeredForGst; + + private CustomerBuilder() {} + + public CustomerBuilder vatNumber(String value) { + this.vatNumber = value; + return this; + } + + public CustomerBuilder vatNumberPrefix(String value) { + this.vatNumberPrefix = value; + return this; + } + + public CustomerBuilder entityIdentifierScheme(String value) { + this.entityIdentifierScheme = value; + return this; + } + + public CustomerBuilder isEinvoiceEnabled(Boolean value) { + this.isEinvoiceEnabled = value; + return this; + } + + public CustomerBuilder einvoicingMethod(EinvoicingMethod value) { + this.einvoicingMethod = value; + return this; + } + + public CustomerBuilder entityIdentifierStandard(String value) { + this.entityIdentifierStandard = value; + return this; + } + + public CustomerBuilder businessCustomerWithoutVatNumber(Boolean value) { + this.businessCustomerWithoutVatNumber = value; + return this; + } + + public CustomerBuilder registeredForGst(Boolean value) { + this.registeredForGst = value; + return this; + } + + public CustomerParams build() { + return new CustomerParams(this); + } + } + + public enum EinvoicingMethod { + AUTOMATIC("automatic"), + + MANUAL("manual"), + + SITE_DEFAULT("site_default"), + + /** An enum member indicating that EinvoicingMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EinvoicingMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EinvoicingMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (EinvoicingMethod enumValue : EinvoicingMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ContractTermParams { + + private final ActionAtTermEnd actionAtTermEnd; + + private final Integer cancellationCutoffPeriod; + + private ContractTermParams(ContractTermBuilder builder) { + + this.actionAtTermEnd = builder.actionAtTermEnd; + + this.cancellationCutoffPeriod = builder.cancellationCutoffPeriod; + } + + public ActionAtTermEnd getActionAtTermEnd() { + return actionAtTermEnd; + } + + public Integer getCancellationCutoffPeriod() { + return cancellationCutoffPeriod; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.actionAtTermEnd != null) { + + formData.put("action_at_term_end", this.actionAtTermEnd); + } + + if (this.cancellationCutoffPeriod != null) { + + formData.put("cancellation_cutoff_period", this.cancellationCutoffPeriod); + } + + return formData; + } + + /** Create a new builder for ContractTermParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ContractTermBuilder builder() { + return new ContractTermBuilder(); + } + + public static final class ContractTermBuilder { + + private ActionAtTermEnd actionAtTermEnd; + + private Integer cancellationCutoffPeriod; + + private ContractTermBuilder() {} + + public ContractTermBuilder actionAtTermEnd(ActionAtTermEnd value) { + this.actionAtTermEnd = value; + return this; + } + + public ContractTermBuilder cancellationCutoffPeriod(Integer value) { + this.cancellationCutoffPeriod = value; + return this; + } + + public ContractTermParams build() { + return new ContractTermParams(this); + } + } + + public enum ActionAtTermEnd { + RENEW("renew"), + + EVERGREEN("evergreen"), + + CANCEL("cancel"), + + RENEW_ONCE("renew_once"), + + /** An enum member indicating that ActionAtTermEnd was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionAtTermEnd(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionAtTermEnd fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionAtTermEnd enumValue : ActionAtTermEnd.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final Integer billingCycles; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private final Timestamp trialEnd; + + private final ProrationType prorationType; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.billingCycles = builder.billingCycles; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.trialEnd = builder.trialEnd; + + this.prorationType = builder.prorationType; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public Integer getBillingCycles() { + return billingCycles; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Timestamp getTrialEnd() { + return trialEnd; + } + + public ProrationType getProrationType() { + return prorationType; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.billingCycles != null) { + + formData.put("billing_cycles", this.billingCycles); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.trialEnd != null) { + + formData.put("trial_end", this.trialEnd); + } + + if (this.prorationType != null) { + + formData.put("proration_type", this.prorationType); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private Integer billingCycles; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private Timestamp trialEnd; + + private ProrationType prorationType; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder billingCycles(Integer value) { + this.billingCycles = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder trialEnd(Timestamp value) { + this.trialEnd = value; + return this; + } + + public AddonsBuilder prorationType(ProrationType value) { + this.prorationType = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + + public enum ProrationType { + FULL_TERM("full_term"), + + PARTIAL_TERM("partial_term"), + + NONE("none"), + + /** An enum member indicating that ProrationType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationType enumValue : ProrationType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class EventBasedAddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final Integer servicePeriodInDays; + + private final ChargeOn chargeOn; + + private final OnEvent onEvent; + + private final Boolean chargeOnce; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private EventBasedAddonsParams(EventBasedAddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.servicePeriodInDays = builder.servicePeriodInDays; + + this.chargeOn = builder.chargeOn; + + this.onEvent = builder.onEvent; + + this.chargeOnce = builder.chargeOnce; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public Integer getServicePeriodInDays() { + return servicePeriodInDays; + } + + public ChargeOn getChargeOn() { + return chargeOn; + } + + public OnEvent getOnEvent() { + return onEvent; + } + + public Boolean getChargeOnce() { + return chargeOnce; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.servicePeriodInDays != null) { + + formData.put("service_period_in_days", this.servicePeriodInDays); + } + + if (this.chargeOn != null) { + + formData.put("charge_on", this.chargeOn); + } + + if (this.onEvent != null) { + + formData.put("on_event", this.onEvent); + } + + if (this.chargeOnce != null) { + + formData.put("charge_once", this.chargeOnce); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + return formData; + } + + /** Create a new builder for EventBasedAddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventBasedAddonsBuilder builder() { + return new EventBasedAddonsBuilder(); + } + + public static final class EventBasedAddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private Integer servicePeriodInDays; + + private ChargeOn chargeOn; + + private OnEvent onEvent; + + private Boolean chargeOnce; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private EventBasedAddonsBuilder() {} + + public EventBasedAddonsBuilder id(String value) { + this.id = value; + return this; + } + + public EventBasedAddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public EventBasedAddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public EventBasedAddonsBuilder servicePeriodInDays(Integer value) { + this.servicePeriodInDays = value; + return this; + } + + public EventBasedAddonsBuilder chargeOn(ChargeOn value) { + this.chargeOn = value; + return this; + } + + public EventBasedAddonsBuilder onEvent(OnEvent value) { + this.onEvent = value; + return this; + } + + public EventBasedAddonsBuilder chargeOnce(Boolean value) { + this.chargeOnce = value; + return this; + } + + public EventBasedAddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public EventBasedAddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public EventBasedAddonsParams build() { + return new EventBasedAddonsParams(this); + } + } + + public enum ChargeOn { + IMMEDIATELY("immediately"), + + ON_EVENT("on_event"), + + /** An enum member indicating that ChargeOn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOn fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOn enumValue : ChargeOn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + /** An enum member indicating that OnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (OnEvent enumValue : OnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class CouponsParams { + + private final String couponId; + + private final Timestamp applyTill; + + private CouponsParams(CouponsBuilder builder) { + + this.couponId = builder.couponId; + + this.applyTill = builder.applyTill; + } + + public String getCouponId() { + return couponId; + } + + public Timestamp getApplyTill() { + return applyTill; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.couponId != null) { + + formData.put("coupon_id", this.couponId); + } + + if (this.applyTill != null) { + + formData.put("apply_till", this.applyTill); + } + + return formData; + } + + /** Create a new builder for CouponsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CouponsBuilder builder() { + return new CouponsBuilder(); + } + + public static final class CouponsBuilder { + + private String couponId; + + private Timestamp applyTill; + + private CouponsBuilder() {} + + public CouponsBuilder couponId(String value) { + this.couponId = value; + return this; + } + + public CouponsBuilder applyTill(Timestamp value) { + this.applyTill = value; + return this; + } + + public CouponsParams build() { + return new CouponsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionsForCustomerParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionsForCustomerParams.java new file mode 100644 index 00000000..dddb59aa --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionsForCustomerParams.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.subscription.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class SubscriptionsForCustomerParams { + + private final Map queryParams; + + private SubscriptionsForCustomerParams(SubscriptionsForCustomerBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public SubscriptionsForCustomerBuilder toBuilder() { + SubscriptionsForCustomerBuilder builder = new SubscriptionsForCustomerBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for SubscriptionsForCustomerParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionsForCustomerBuilder builder() { + return new SubscriptionsForCustomerBuilder(); + } + + public static final class SubscriptionsForCustomerBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private SubscriptionsForCustomerBuilder() {} + + public SubscriptionsForCustomerBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public SubscriptionsForCustomerBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public SubscriptionsForCustomerParams build() { + return new SubscriptionsForCustomerParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/responses/ContractTermsForSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/ContractTermsForSubscriptionResponse.java new file mode 100644 index 00000000..9c9a5c87 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/ContractTermsForSubscriptionResponse.java @@ -0,0 +1,180 @@ +package com.chargebee.v4.models.subscription.responses; + +import java.util.List; + +import com.chargebee.v4.models.contractTerm.ContractTerm; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.SubscriptionService; +import com.chargebee.v4.models.subscription.params.ContractTermsForSubscriptionParams; + +/** + * Immutable response object for ContractTermsForSubscription operation. Contains paginated list + * data. + */ +public final class ContractTermsForSubscriptionResponse { + + private final List list; + + private final String nextOffset; + + private final String subscriptionId; + + private final SubscriptionService service; + private final ContractTermsForSubscriptionParams originalParams; + private final Response httpResponse; + + private ContractTermsForSubscriptionResponse( + List list, + String nextOffset, + String subscriptionId, + SubscriptionService service, + ContractTermsForSubscriptionParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.subscriptionId = subscriptionId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into ContractTermsForSubscriptionResponse object (no service context). Use + * this when you only need to read a single page (no nextPage()). + */ + public static ContractTermsForSubscriptionResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(SubscriptionContractTermsForSubscriptionItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new ContractTermsForSubscriptionResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ContractTermsForSubscriptionResponse from JSON", e); + } + } + + /** + * Parse JSON response into ContractTermsForSubscriptionResponse object with service context for + * pagination (enables nextPage()). + */ + public static ContractTermsForSubscriptionResponse fromJson( + String json, + SubscriptionService service, + ContractTermsForSubscriptionParams originalParams, + String subscriptionId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(SubscriptionContractTermsForSubscriptionItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new ContractTermsForSubscriptionResponse( + list, nextOffset, subscriptionId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ContractTermsForSubscriptionResponse 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 ContractTermsForSubscriptionResponse 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)."); + } + + ContractTermsForSubscriptionParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : ContractTermsForSubscriptionParams.builder()) + .offset(nextOffset) + .build(); + + return service.contractTermsForSubscription(subscriptionId, 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 SubscriptionContractTermsForSubscriptionItem { + + private ContractTerm contractTerm; + + public ContractTerm getContractTerm() { + return contractTerm; + } + + public static SubscriptionContractTermsForSubscriptionItem fromJson(String json) { + SubscriptionContractTermsForSubscriptionItem item = + new SubscriptionContractTermsForSubscriptionItem(); + + String __contractTermJson = JsonUtil.getObject(json, "contract_term"); + if (__contractTermJson != null) { + item.contractTerm = ContractTerm.fromJson(__contractTermJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/responses/ImportSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/ImportSubscriptionResponse.java new file mode 100644 index 00000000..d26a89dd --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/ImportSubscriptionResponse.java @@ -0,0 +1,146 @@ +package com.chargebee.v4.models.subscription.responses; + +import com.chargebee.v4.models.invoice.Invoice; + +import com.chargebee.v4.models.customer.Customer; + +import com.chargebee.v4.models.subscription.Subscription; + +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 ImportSubscription operation. Contains the response data from the + * API. + */ +public final class ImportSubscriptionResponse extends BaseResponse { + private final Subscription subscription; + + private final Customer customer; + + private final Card card; + + private final Invoice invoice; + + private ImportSubscriptionResponse(Builder builder) { + super(builder.httpResponse); + + this.subscription = builder.subscription; + + this.customer = builder.customer; + + this.card = builder.card; + + this.invoice = builder.invoice; + } + + /** Parse JSON response into ImportSubscriptionResponse object. */ + public static ImportSubscriptionResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ImportSubscriptionResponse object with HTTP response. */ + public static ImportSubscriptionResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __subscriptionJson = JsonUtil.getObject(json, "subscription"); + if (__subscriptionJson != null) { + builder.subscription(Subscription.fromJson(__subscriptionJson)); + } + + 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)); + } + + String __invoiceJson = JsonUtil.getObject(json, "invoice"); + if (__invoiceJson != null) { + builder.invoice(Invoice.fromJson(__invoiceJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ImportSubscriptionResponse from JSON", e); + } + } + + /** Create a new builder for ImportSubscriptionResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ImportSubscriptionResponse. */ + public static class Builder { + + private Subscription subscription; + + private Customer customer; + + private Card card; + + private Invoice invoice; + + private Response httpResponse; + + private Builder() {} + + public Builder subscription(Subscription subscription) { + this.subscription = subscription; + return this; + } + + public Builder customer(Customer customer) { + this.customer = customer; + return this; + } + + public Builder card(Card card) { + this.card = card; + return this; + } + + public Builder invoice(Invoice invoice) { + this.invoice = invoice; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ImportSubscriptionResponse build() { + return new ImportSubscriptionResponse(this); + } + } + + /** Get the subscription from the response. */ + public Subscription getSubscription() { + return subscription; + } + + /** Get the customer from the response. */ + public Customer getCustomer() { + return customer; + } + + /** Get the card from the response. */ + public Card getCard() { + return card; + } + + /** Get the invoice from the response. */ + public Invoice getInvoice() { + return invoice; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionAddChargeAtTermEndResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionAddChargeAtTermEndResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionAddChargeAtTermEndResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionAddChargeAtTermEndResponse.java index 91bd06df..4fc17658 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionAddChargeAtTermEndResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionAddChargeAtTermEndResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionCancelForItemsResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionCancelForItemsResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionCancelForItemsResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionCancelForItemsResponse.java index cf167ae9..3ea020da 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionCancelForItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionCancelForItemsResponse.java @@ -1,20 +1,20 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionCancelResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionCancelResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionCancelResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionCancelResponse.java index 4ac9cf2b..b63fa89a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionCancelResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionCancelResponse.java @@ -1,20 +1,20 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionChangeTermEndResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionChangeTermEndResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionChangeTermEndResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionChangeTermEndResponse.java index acc31c18..8d7efbf6 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionChangeTermEndResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionChangeTermEndResponse.java @@ -1,20 +1,20 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionChargeAddonAtTermEndResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionChargeAddonAtTermEndResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionChargeAddonAtTermEndResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionChargeAddonAtTermEndResponse.java index efe1a257..d690bf35 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionChargeAddonAtTermEndResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionChargeAddonAtTermEndResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionChargeFutureRenewalsResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionChargeFutureRenewalsResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionChargeFutureRenewalsResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionChargeFutureRenewalsResponse.java index 81fe8eca..8859c8e7 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionChargeFutureRenewalsResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionChargeFutureRenewalsResponse.java @@ -1,18 +1,18 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionCreateForCustomerResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionCreateForCustomerResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionCreateForCustomerResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionCreateForCustomerResponse.java index 119d2361..d71ad773 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionCreateForCustomerResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionCreateForCustomerResponse.java @@ -1,18 +1,18 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionCreateResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionCreateResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionCreateResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionCreateResponse.java index 12335280..337b8b9a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionCreateResponse.java @@ -1,18 +1,18 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionCreateWithItemsResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionCreateWithItemsResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionCreateWithItemsResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionCreateWithItemsResponse.java index efff576e..68514e08 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionCreateWithItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionCreateWithItemsResponse.java @@ -1,18 +1,18 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionDeleteResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionDeleteResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionDeleteResponse.java index 7aac9d32..180a2fc3 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionDeleteResponse.java @@ -1,12 +1,12 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionEditAdvanceInvoiceScheduleResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionEditAdvanceInvoiceScheduleResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionEditAdvanceInvoiceScheduleResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionEditAdvanceInvoiceScheduleResponse.java index 6288d6bb..6790cc41 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionEditAdvanceInvoiceScheduleResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionEditAdvanceInvoiceScheduleResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionImportContractTermResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionImportContractTermResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionImportContractTermResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionImportContractTermResponse.java index 7cea2027..aa0a33ff 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionImportContractTermResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionImportContractTermResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; -import com.chargebee.v4.core.models.contractTerm.ContractTerm; +import com.chargebee.v4.models.contractTerm.ContractTerm; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionImportForCustomerResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionImportForCustomerResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionImportForCustomerResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionImportForCustomerResponse.java index ba9165b6..525b2eb8 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionImportForCustomerResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionImportForCustomerResponse.java @@ -1,14 +1,14 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionImportForItemsResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionImportForItemsResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionImportForItemsResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionImportForItemsResponse.java index 91a013c2..88874408 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionImportForItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionImportForItemsResponse.java @@ -1,14 +1,14 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionImportUnbilledChargesResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionImportUnbilledChargesResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionImportUnbilledChargesResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionImportUnbilledChargesResponse.java index a52bf72f..4fb02239 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionImportUnbilledChargesResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionImportUnbilledChargesResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionListDiscountsResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionListDiscountsResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionListDiscountsResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionListDiscountsResponse.java index a9e48f2c..964d691b 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionListDiscountsResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionListDiscountsResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.discount.Discount; +import com.chargebee.v4.models.discount.Discount; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.SubscriptionService; -import com.chargebee.v4.core.models.subscription.params.SubscriptionListDiscountsParams; +import com.chargebee.v4.services.SubscriptionService; +import com.chargebee.v4.models.subscription.params.SubscriptionListDiscountsParams; /** * Immutable response object for SubscriptionListDiscounts operation. Contains paginated list data. @@ -107,9 +108,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 SubscriptionListDiscountsResponse nextPage() throws Exception { + public SubscriptionListDiscountsResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionListResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionListResponse.java similarity index 90% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionListResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionListResponse.java index 8e94111f..acd5e968 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionListResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionListResponse.java @@ -1,17 +1,18 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.SubscriptionService; -import com.chargebee.v4.core.models.subscription.params.SubscriptionListParams; +import com.chargebee.v4.services.SubscriptionService; +import com.chargebee.v4.models.subscription.params.SubscriptionListParams; /** Immutable response object for SubscriptionList operation. Contains paginated list data. */ public final class SubscriptionListResponse { @@ -102,9 +103,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 SubscriptionListResponse nextPage() throws Exception { + public SubscriptionListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionMoveResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionMoveResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionMoveResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionMoveResponse.java index 3550f39e..c9eccee0 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionMoveResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionMoveResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionOverrideBillingProfileResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionOverrideBillingProfileResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionOverrideBillingProfileResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionOverrideBillingProfileResponse.java index 87532191..09b7ed93 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionOverrideBillingProfileResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionOverrideBillingProfileResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; -import com.chargebee.v4.core.models.paymentSource.PaymentSource; +import com.chargebee.v4.models.paymentSource.PaymentSource; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionPauseResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionPauseResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionPauseResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionPauseResponse.java index 3bb5de2e..f60bc792 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionPauseResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionPauseResponse.java @@ -1,20 +1,20 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionReactivateResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionReactivateResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionReactivateResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionReactivateResponse.java index ccc43298..c036573b 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionReactivateResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionReactivateResponse.java @@ -1,18 +1,18 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRegenerateInvoiceResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRegenerateInvoiceResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRegenerateInvoiceResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRegenerateInvoiceResponse.java index 9cce3e0b..0394c59e 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRegenerateInvoiceResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRegenerateInvoiceResponse.java @@ -1,12 +1,12 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveAdvanceInvoiceScheduleResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveAdvanceInvoiceScheduleResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveAdvanceInvoiceScheduleResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveAdvanceInvoiceScheduleResponse.java index c5f9ccff..f13dbdae 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveAdvanceInvoiceScheduleResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveAdvanceInvoiceScheduleResponse.java @@ -1,12 +1,12 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveCouponsResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveCouponsResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveCouponsResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveCouponsResponse.java index d4501c78..bb694d5c 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveCouponsResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveCouponsResponse.java @@ -1,12 +1,12 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveScheduledCancellationResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveScheduledCancellationResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveScheduledCancellationResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveScheduledCancellationResponse.java index 7f390cbd..1d806b52 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveScheduledCancellationResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveScheduledCancellationResponse.java @@ -1,12 +1,12 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveScheduledChangesResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveScheduledChangesResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveScheduledChangesResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveScheduledChangesResponse.java index 4f45e70b..ad5a4b91 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveScheduledChangesResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveScheduledChangesResponse.java @@ -1,16 +1,16 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveScheduledPauseResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveScheduledPauseResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveScheduledPauseResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveScheduledPauseResponse.java index bdd37ae6..5f262bd3 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveScheduledPauseResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveScheduledPauseResponse.java @@ -1,12 +1,12 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveScheduledResumptionResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveScheduledResumptionResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveScheduledResumptionResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveScheduledResumptionResponse.java index 22cea01a..2140194c 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionRemoveScheduledResumptionResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRemoveScheduledResumptionResponse.java @@ -1,12 +1,12 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionResumeResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionResumeResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionResumeResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionResumeResponse.java index aae24d56..510efb76 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionResumeResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionResumeResponse.java @@ -1,18 +1,18 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRetrieveAdvanceInvoiceScheduleResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRetrieveAdvanceInvoiceScheduleResponse.java new file mode 100644 index 00000000..ba3dae96 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRetrieveAdvanceInvoiceScheduleResponse.java @@ -0,0 +1,86 @@ +package com.chargebee.v4.models.subscription.responses; + +import com.chargebee.v4.models.advanceInvoiceSchedule.AdvanceInvoiceSchedule; + +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 SubscriptionRetrieveAdvanceInvoiceSchedule operation. Contains the + * response data from a single resource get operation. + */ +public final class SubscriptionRetrieveAdvanceInvoiceScheduleResponse extends BaseResponse { + private final List advanceInvoiceSchedules; + + private SubscriptionRetrieveAdvanceInvoiceScheduleResponse(Builder builder) { + super(builder.httpResponse); + + this.advanceInvoiceSchedules = builder.advanceInvoiceSchedules; + } + + /** Parse JSON response into SubscriptionRetrieveAdvanceInvoiceScheduleResponse object. */ + public static SubscriptionRetrieveAdvanceInvoiceScheduleResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into SubscriptionRetrieveAdvanceInvoiceScheduleResponse object with HTTP + * response. + */ + public static SubscriptionRetrieveAdvanceInvoiceScheduleResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __advanceInvoiceSchedulesJson = JsonUtil.getArray(json, "advance_invoice_schedules"); + if (__advanceInvoiceSchedulesJson != null) { + builder.advanceInvoiceSchedules( + JsonUtil.parseObjectArray(__advanceInvoiceSchedulesJson).stream() + .map(AdvanceInvoiceSchedule::fromJson) + .collect(java.util.stream.Collectors.toList())); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse SubscriptionRetrieveAdvanceInvoiceScheduleResponse from JSON", e); + } + } + + /** Create a new builder for SubscriptionRetrieveAdvanceInvoiceScheduleResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SubscriptionRetrieveAdvanceInvoiceScheduleResponse. */ + public static class Builder { + + private List advanceInvoiceSchedules; + + private Response httpResponse; + + private Builder() {} + + public Builder advanceInvoiceSchedules(List advanceInvoiceSchedules) { + this.advanceInvoiceSchedules = advanceInvoiceSchedules; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public SubscriptionRetrieveAdvanceInvoiceScheduleResponse build() { + return new SubscriptionRetrieveAdvanceInvoiceScheduleResponse(this); + } + } + + /** Get the advanceInvoiceSchedules from the response. */ + public List getAdvanceInvoiceSchedules() { + return advanceInvoiceSchedules; + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRetrieveResponse.java new file mode 100644 index 00000000..44438e9c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRetrieveResponse.java @@ -0,0 +1,123 @@ +package com.chargebee.v4.models.subscription.responses; + +import com.chargebee.v4.models.subscription.Subscription; + +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 SubscriptionRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class SubscriptionRetrieveResponse extends BaseResponse { + private final Subscription subscription; + + private final Customer customer; + + private final Card card; + + private SubscriptionRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.subscription = builder.subscription; + + this.customer = builder.customer; + + this.card = builder.card; + } + + /** Parse JSON response into SubscriptionRetrieveResponse object. */ + public static SubscriptionRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into SubscriptionRetrieveResponse object with HTTP response. */ + public static SubscriptionRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __subscriptionJson = JsonUtil.getObject(json, "subscription"); + if (__subscriptionJson != null) { + builder.subscription(Subscription.fromJson(__subscriptionJson)); + } + + 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 SubscriptionRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for SubscriptionRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SubscriptionRetrieveResponse. */ + public static class Builder { + + private Subscription subscription; + + private Customer customer; + + private Card card; + + private Response httpResponse; + + private Builder() {} + + public Builder subscription(Subscription subscription) { + this.subscription = subscription; + return this; + } + + 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 SubscriptionRetrieveResponse build() { + return new SubscriptionRetrieveResponse(this); + } + } + + /** Get the subscription from the response. */ + public Subscription getSubscription() { + return subscription; + } + + /** 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/subscription/responses/SubscriptionRetrieveWithScheduledChangesResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRetrieveWithScheduledChangesResponse.java new file mode 100644 index 00000000..cd14db3e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionRetrieveWithScheduledChangesResponse.java @@ -0,0 +1,128 @@ +package com.chargebee.v4.models.subscription.responses; + +import com.chargebee.v4.models.subscription.Subscription; + +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 SubscriptionRetrieveWithScheduledChanges operation. Contains the + * response data from a single resource get operation. + */ +public final class SubscriptionRetrieveWithScheduledChangesResponse extends BaseResponse { + private final Subscription subscription; + + private final Customer customer; + + private final Card card; + + private SubscriptionRetrieveWithScheduledChangesResponse(Builder builder) { + super(builder.httpResponse); + + this.subscription = builder.subscription; + + this.customer = builder.customer; + + this.card = builder.card; + } + + /** Parse JSON response into SubscriptionRetrieveWithScheduledChangesResponse object. */ + public static SubscriptionRetrieveWithScheduledChangesResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into SubscriptionRetrieveWithScheduledChangesResponse object with HTTP + * response. + */ + public static SubscriptionRetrieveWithScheduledChangesResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __subscriptionJson = JsonUtil.getObject(json, "subscription"); + if (__subscriptionJson != null) { + builder.subscription(Subscription.fromJson(__subscriptionJson)); + } + + 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 SubscriptionRetrieveWithScheduledChangesResponse from JSON", e); + } + } + + /** Create a new builder for SubscriptionRetrieveWithScheduledChangesResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SubscriptionRetrieveWithScheduledChangesResponse. */ + public static class Builder { + + private Subscription subscription; + + private Customer customer; + + private Card card; + + private Response httpResponse; + + private Builder() {} + + public Builder subscription(Subscription subscription) { + this.subscription = subscription; + return this; + } + + 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 SubscriptionRetrieveWithScheduledChangesResponse build() { + return new SubscriptionRetrieveWithScheduledChangesResponse(this); + } + } + + /** Get the subscription from the response. */ + public Subscription getSubscription() { + return subscription; + } + + /** 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/core/responses/subscription/SubscriptionUpdateForItemsResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionUpdateForItemsResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionUpdateForItemsResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionUpdateForItemsResponse.java index e2a2c6c4..97a8b849 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionUpdateForItemsResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionUpdateForItemsResponse.java @@ -1,20 +1,20 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionUpdateResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionUpdateResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionUpdateResponse.java index 5ac2191a..94f9a775 100644 --- a/src/main/java/com/chargebee/v4/core/responses/subscription/SubscriptionUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionUpdateResponse.java @@ -1,20 +1,20 @@ -package com.chargebee.v4.core.responses.subscription; +package com.chargebee.v4.models.subscription.responses; import java.util.List; -import com.chargebee.v4.core.models.invoice.Invoice; +import com.chargebee.v4.models.invoice.Invoice; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.creditNote.CreditNote; +import com.chargebee.v4.models.creditNote.CreditNote; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.models.subscription.Subscription; +import com.chargebee.v4.models.subscription.Subscription; -import com.chargebee.v4.core.models.card.Card; +import com.chargebee.v4.models.card.Card; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionsForCustomerResponse.java b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionsForCustomerResponse.java new file mode 100644 index 00000000..6c0d27c1 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscription/responses/SubscriptionsForCustomerResponse.java @@ -0,0 +1,177 @@ +package com.chargebee.v4.models.subscription.responses; + +import java.util.List; + +import com.chargebee.v4.models.subscription.Subscription; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.SubscriptionService; +import com.chargebee.v4.models.subscription.params.SubscriptionsForCustomerParams; + +/** + * Immutable response object for SubscriptionsForCustomer operation. Contains paginated list data. + */ +public final class SubscriptionsForCustomerResponse { + + private final List list; + + private final String nextOffset; + + private final String customerId; + + private final SubscriptionService service; + private final SubscriptionsForCustomerParams originalParams; + private final Response httpResponse; + + private SubscriptionsForCustomerResponse( + List list, + String nextOffset, + String customerId, + SubscriptionService service, + SubscriptionsForCustomerParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.customerId = customerId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into SubscriptionsForCustomerResponse object (no service context). Use this + * when you only need to read a single page (no nextPage()). + */ + public static SubscriptionsForCustomerResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(SubscriptionSubscriptionsForCustomerItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new SubscriptionsForCustomerResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse SubscriptionsForCustomerResponse from JSON", e); + } + } + + /** + * Parse JSON response into SubscriptionsForCustomerResponse object with service context for + * pagination (enables nextPage()). + */ + public static SubscriptionsForCustomerResponse fromJson( + String json, + SubscriptionService service, + SubscriptionsForCustomerParams originalParams, + String customerId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(SubscriptionSubscriptionsForCustomerItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new SubscriptionsForCustomerResponse( + list, nextOffset, customerId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse SubscriptionsForCustomerResponse 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 SubscriptionsForCustomerResponse 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)."); + } + + SubscriptionsForCustomerParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : SubscriptionsForCustomerParams.builder()) + .offset(nextOffset) + .build(); + + return service.subscriptionsForCustomer(customerId, 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 SubscriptionSubscriptionsForCustomerItem { + + private Subscription subscription; + + public Subscription getSubscription() { + return subscription; + } + + public static SubscriptionSubscriptionsForCustomerItem fromJson(String json) { + SubscriptionSubscriptionsForCustomerItem item = + new SubscriptionSubscriptionsForCustomerItem(); + + String __subscriptionJson = JsonUtil.getObject(json, "subscription"); + if (__subscriptionJson != null) { + item.subscription = Subscription.fromJson(__subscriptionJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlement/SubscriptionEntitlement.java b/src/main/java/com/chargebee/v4/models/subscriptionEntitlement/SubscriptionEntitlement.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/subscriptionEntitlement/SubscriptionEntitlement.java rename to src/main/java/com/chargebee/v4/models/subscriptionEntitlement/SubscriptionEntitlement.java index 68e2e88f..1b166d5a 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlement/SubscriptionEntitlement.java +++ b/src/main/java/com/chargebee/v4/models/subscriptionEntitlement/SubscriptionEntitlement.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionEntitlement; +package com.chargebee.v4.models.subscriptionEntitlement; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/subscriptionEntitlement/params/SetSubscriptionEntitlementAvailabilityParams.java b/src/main/java/com/chargebee/v4/models/subscriptionEntitlement/params/SetSubscriptionEntitlementAvailabilityParams.java new file mode 100644 index 00000000..fbc2bb82 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscriptionEntitlement/params/SetSubscriptionEntitlementAvailabilityParams.java @@ -0,0 +1,141 @@ +/* + * 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.subscriptionEntitlement.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class SetSubscriptionEntitlementAvailabilityParams { + + private final Boolean isEnabled; + + private final List subscriptionEntitlements; + + private SetSubscriptionEntitlementAvailabilityParams( + SetSubscriptionEntitlementAvailabilityBuilder builder) { + + this.isEnabled = builder.isEnabled; + + this.subscriptionEntitlements = builder.subscriptionEntitlements; + } + + public Boolean getIsEnabled() { + return isEnabled; + } + + public List getSubscriptionEntitlements() { + return subscriptionEntitlements; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.isEnabled != null) { + + formData.put("is_enabled", this.isEnabled); + } + + if (this.subscriptionEntitlements != null) { + + // List of objects + for (int i = 0; i < this.subscriptionEntitlements.size(); i++) { + SubscriptionEntitlementsParams item = this.subscriptionEntitlements.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "subscription_entitlements[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for SetSubscriptionEntitlementAvailabilityParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SetSubscriptionEntitlementAvailabilityBuilder builder() { + return new SetSubscriptionEntitlementAvailabilityBuilder(); + } + + public static final class SetSubscriptionEntitlementAvailabilityBuilder { + + private Boolean isEnabled; + + private List subscriptionEntitlements; + + private SetSubscriptionEntitlementAvailabilityBuilder() {} + + public SetSubscriptionEntitlementAvailabilityBuilder isEnabled(Boolean value) { + this.isEnabled = value; + return this; + } + + public SetSubscriptionEntitlementAvailabilityBuilder subscriptionEntitlements( + List value) { + this.subscriptionEntitlements = value; + return this; + } + + public SetSubscriptionEntitlementAvailabilityParams build() { + return new SetSubscriptionEntitlementAvailabilityParams(this); + } + } + + public static final class SubscriptionEntitlementsParams { + + private final String featureId; + + private SubscriptionEntitlementsParams(SubscriptionEntitlementsBuilder builder) { + + this.featureId = builder.featureId; + } + + public String getFeatureId() { + return featureId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.featureId != null) { + + formData.put("feature_id", this.featureId); + } + + return formData; + } + + /** Create a new builder for SubscriptionEntitlementsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionEntitlementsBuilder builder() { + return new SubscriptionEntitlementsBuilder(); + } + + public static final class SubscriptionEntitlementsBuilder { + + private String featureId; + + private SubscriptionEntitlementsBuilder() {} + + public SubscriptionEntitlementsBuilder featureId(String value) { + this.featureId = value; + return this; + } + + public SubscriptionEntitlementsParams build() { + return new SubscriptionEntitlementsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscriptionEntitlement/params/SubscriptionEntitlementsForSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/subscriptionEntitlement/params/SubscriptionEntitlementsForSubscriptionParams.java new file mode 100644 index 00000000..12940405 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscriptionEntitlement/params/SubscriptionEntitlementsForSubscriptionParams.java @@ -0,0 +1,80 @@ +/* + * 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.subscriptionEntitlement.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class SubscriptionEntitlementsForSubscriptionParams { + + private final Map queryParams; + + private SubscriptionEntitlementsForSubscriptionParams( + SubscriptionEntitlementsForSubscriptionBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public SubscriptionEntitlementsForSubscriptionBuilder toBuilder() { + SubscriptionEntitlementsForSubscriptionBuilder builder = + new SubscriptionEntitlementsForSubscriptionBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for SubscriptionEntitlementsForSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SubscriptionEntitlementsForSubscriptionBuilder builder() { + return new SubscriptionEntitlementsForSubscriptionBuilder(); + } + + public static final class SubscriptionEntitlementsForSubscriptionBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private SubscriptionEntitlementsForSubscriptionBuilder() {} + + public SubscriptionEntitlementsForSubscriptionBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public SubscriptionEntitlementsForSubscriptionBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + @Deprecated + public SubscriptionEntitlementsForSubscriptionBuilder includeDrafts(Boolean value) { + queryParams.put("include_drafts", value); + return this; + } + + @Deprecated + public SubscriptionEntitlementsForSubscriptionBuilder embed(String value) { + queryParams.put("embed", value); + return this; + } + + @Deprecated + public SubscriptionEntitlementsForSubscriptionBuilder includeScheduledOverrides(Boolean value) { + queryParams.put("include_scheduled_overrides", value); + return this; + } + + public SubscriptionEntitlementsForSubscriptionParams build() { + return new SubscriptionEntitlementsForSubscriptionParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscriptionEntitlement/responses/SetSubscriptionEntitlementAvailabilityResponse.java b/src/main/java/com/chargebee/v4/models/subscriptionEntitlement/responses/SetSubscriptionEntitlementAvailabilityResponse.java new file mode 100644 index 00000000..31065b34 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscriptionEntitlement/responses/SetSubscriptionEntitlementAvailabilityResponse.java @@ -0,0 +1,84 @@ +package com.chargebee.v4.models.subscriptionEntitlement.responses; + +import java.util.List; + +import com.chargebee.v4.models.subscriptionEntitlement.SubscriptionEntitlement; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for SetSubscriptionEntitlementAvailability operation. Contains the + * response data from the API. + */ +public final class SetSubscriptionEntitlementAvailabilityResponse extends BaseResponse { + private final List list; + + private SetSubscriptionEntitlementAvailabilityResponse(Builder builder) { + super(builder.httpResponse); + + this.list = builder.list; + } + + /** Parse JSON response into SetSubscriptionEntitlementAvailabilityResponse object. */ + public static SetSubscriptionEntitlementAvailabilityResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into SetSubscriptionEntitlementAvailabilityResponse object with HTTP + * response. + */ + public static SetSubscriptionEntitlementAvailabilityResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + builder.list( + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(SubscriptionEntitlement::fromJson) + .collect(java.util.stream.Collectors.toList())); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse SetSubscriptionEntitlementAvailabilityResponse from JSON", e); + } + } + + /** Create a new builder for SetSubscriptionEntitlementAvailabilityResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SetSubscriptionEntitlementAvailabilityResponse. */ + public static class Builder { + + private List list; + + private Response httpResponse; + + private Builder() {} + + public Builder list(List list) { + this.list = list; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public SetSubscriptionEntitlementAvailabilityResponse build() { + return new SetSubscriptionEntitlementAvailabilityResponse(this); + } + } + + /** Get the list from the response. */ + public List getList() { + return list; + } +} diff --git a/src/main/java/com/chargebee/v4/models/subscriptionEntitlement/responses/SubscriptionEntitlementsForSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/subscriptionEntitlement/responses/SubscriptionEntitlementsForSubscriptionResponse.java new file mode 100644 index 00000000..5d783637 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscriptionEntitlement/responses/SubscriptionEntitlementsForSubscriptionResponse.java @@ -0,0 +1,183 @@ +package com.chargebee.v4.models.subscriptionEntitlement.responses; + +import java.util.List; + +import com.chargebee.v4.models.subscriptionEntitlement.SubscriptionEntitlement; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.SubscriptionEntitlementService; +import com.chargebee.v4.models.subscriptionEntitlement.params.SubscriptionEntitlementsForSubscriptionParams; + +/** + * Immutable response object for SubscriptionEntitlementsForSubscription operation. Contains + * paginated list data. + */ +public final class SubscriptionEntitlementsForSubscriptionResponse { + + private final List list; + + private final String nextOffset; + + private final String subscriptionId; + + private final SubscriptionEntitlementService service; + private final SubscriptionEntitlementsForSubscriptionParams originalParams; + private final Response httpResponse; + + private SubscriptionEntitlementsForSubscriptionResponse( + List list, + String nextOffset, + String subscriptionId, + SubscriptionEntitlementService service, + SubscriptionEntitlementsForSubscriptionParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.subscriptionId = subscriptionId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into SubscriptionEntitlementsForSubscriptionResponse object (no service + * context). Use this when you only need to read a single page (no nextPage()). + */ + public static SubscriptionEntitlementsForSubscriptionResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new SubscriptionEntitlementsForSubscriptionResponse( + list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse SubscriptionEntitlementsForSubscriptionResponse from JSON", e); + } + } + + /** + * Parse JSON response into SubscriptionEntitlementsForSubscriptionResponse object with service + * context for pagination (enables nextPage()). + */ + public static SubscriptionEntitlementsForSubscriptionResponse fromJson( + String json, + SubscriptionEntitlementService service, + SubscriptionEntitlementsForSubscriptionParams originalParams, + String subscriptionId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new SubscriptionEntitlementsForSubscriptionResponse( + list, nextOffset, subscriptionId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse SubscriptionEntitlementsForSubscriptionResponse 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 SubscriptionEntitlementsForSubscriptionResponse 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)."); + } + + SubscriptionEntitlementsForSubscriptionParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : SubscriptionEntitlementsForSubscriptionParams.builder()) + .offset(nextOffset) + .build(); + + return service.subscriptionEntitlementsForSubscription(subscriptionId, 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 SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionItem { + + private SubscriptionEntitlement subscriptionEntitlement; + + public SubscriptionEntitlement getSubscriptionEntitlement() { + return subscriptionEntitlement; + } + + public static SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionItem fromJson( + String json) { + SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionItem item = + new SubscriptionEntitlementSubscriptionEntitlementsForSubscriptionItem(); + + String __subscriptionEntitlementJson = JsonUtil.getObject(json, "subscription_entitlement"); + if (__subscriptionEntitlementJson != null) { + item.subscriptionEntitlement = + SubscriptionEntitlement.fromJson(__subscriptionEntitlementJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlementsCreatedDetail/SubscriptionEntitlementsCreatedDetail.java b/src/main/java/com/chargebee/v4/models/subscriptionEntitlementsCreatedDetail/SubscriptionEntitlementsCreatedDetail.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/models/subscriptionEntitlementsCreatedDetail/SubscriptionEntitlementsCreatedDetail.java rename to src/main/java/com/chargebee/v4/models/subscriptionEntitlementsCreatedDetail/SubscriptionEntitlementsCreatedDetail.java index 9f83595f..de85eeea 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlementsCreatedDetail/SubscriptionEntitlementsCreatedDetail.java +++ b/src/main/java/com/chargebee/v4/models/subscriptionEntitlementsCreatedDetail/SubscriptionEntitlementsCreatedDetail.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionEntitlementsCreatedDetail; +package com.chargebee.v4.models.subscriptionEntitlementsCreatedDetail; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlementsUpdatedDetail/SubscriptionEntitlementsUpdatedDetail.java b/src/main/java/com/chargebee/v4/models/subscriptionEntitlementsUpdatedDetail/SubscriptionEntitlementsUpdatedDetail.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/models/subscriptionEntitlementsUpdatedDetail/SubscriptionEntitlementsUpdatedDetail.java rename to src/main/java/com/chargebee/v4/models/subscriptionEntitlementsUpdatedDetail/SubscriptionEntitlementsUpdatedDetail.java index c2e941b3..8eecaf11 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionEntitlementsUpdatedDetail/SubscriptionEntitlementsUpdatedDetail.java +++ b/src/main/java/com/chargebee/v4/models/subscriptionEntitlementsUpdatedDetail/SubscriptionEntitlementsUpdatedDetail.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionEntitlementsUpdatedDetail; +package com.chargebee.v4.models.subscriptionEntitlementsUpdatedDetail; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionEstimate/SubscriptionEstimate.java b/src/main/java/com/chargebee/v4/models/subscriptionEstimate/SubscriptionEstimate.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/subscriptionEstimate/SubscriptionEstimate.java rename to src/main/java/com/chargebee/v4/models/subscriptionEstimate/SubscriptionEstimate.java index d4d096ac..b971d339 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionEstimate/SubscriptionEstimate.java +++ b/src/main/java/com/chargebee/v4/models/subscriptionEstimate/SubscriptionEstimate.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionEstimate; +package com.chargebee.v4.models.subscriptionEstimate; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/subscriptionSetting/params/SubscriptionSettingRetrieveParams.java b/src/main/java/com/chargebee/v4/models/subscriptionSetting/params/SubscriptionSettingRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/subscriptionSetting/params/SubscriptionSettingRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/subscriptionSetting/params/SubscriptionSettingRetrieveParams.java index 0aabcb25..9ec1c10a 100644 --- a/src/main/java/com/chargebee/v4/core/models/subscriptionSetting/params/SubscriptionSettingRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/subscriptionSetting/params/SubscriptionSettingRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.subscriptionSetting.params; +package com.chargebee.v4.models.subscriptionSetting.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/subscriptionSetting/responses/SubscriptionSettingRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/subscriptionSetting/responses/SubscriptionSettingRetrieveResponse.java new file mode 100644 index 00000000..28a26ff8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/subscriptionSetting/responses/SubscriptionSettingRetrieveResponse.java @@ -0,0 +1,73 @@ +package com.chargebee.v4.models.subscriptionSetting.responses; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for SubscriptionSettingRetrieve operation. Contains the response data + * from a single resource get operation. + */ +public final class SubscriptionSettingRetrieveResponse extends BaseResponse { + private final Object subscriptionSetting; + + private SubscriptionSettingRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.subscriptionSetting = builder.subscriptionSetting; + } + + /** Parse JSON response into SubscriptionSettingRetrieveResponse object. */ + public static SubscriptionSettingRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into SubscriptionSettingRetrieveResponse object with HTTP response. */ + public static SubscriptionSettingRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + builder.subscriptionSetting(JsonUtil.getObject(json, "subscription_setting")); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse SubscriptionSettingRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for SubscriptionSettingRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SubscriptionSettingRetrieveResponse. */ + public static class Builder { + + private Object subscriptionSetting; + + private Response httpResponse; + + private Builder() {} + + public Builder subscriptionSetting(Object subscriptionSetting) { + this.subscriptionSetting = subscriptionSetting; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public SubscriptionSettingRetrieveResponse build() { + return new SubscriptionSettingRetrieveResponse(this); + } + } + + /** Get the subscriptionSetting from the response. */ + public Object getSubscriptionSetting() { + return subscriptionSetting; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/taxWithheld/TaxWithheld.java b/src/main/java/com/chargebee/v4/models/taxWithheld/TaxWithheld.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/taxWithheld/TaxWithheld.java rename to src/main/java/com/chargebee/v4/models/taxWithheld/TaxWithheld.java index 78cf55af..408cb660 100644 --- a/src/main/java/com/chargebee/v4/core/models/taxWithheld/TaxWithheld.java +++ b/src/main/java/com/chargebee/v4/models/taxWithheld/TaxWithheld.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.taxWithheld; +package com.chargebee.v4.models.taxWithheld; import com.chargebee.v4.internal.JsonUtil; import java.math.BigDecimal; diff --git a/src/main/java/com/chargebee/v4/core/models/thirdPartyConfiguration/ThirdPartyConfiguration.java b/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/ThirdPartyConfiguration.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/thirdPartyConfiguration/ThirdPartyConfiguration.java rename to src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/ThirdPartyConfiguration.java index 4f4c7ad2..55a5e443 100644 --- a/src/main/java/com/chargebee/v4/core/models/thirdPartyConfiguration/ThirdPartyConfiguration.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/ThirdPartyConfiguration.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.thirdPartyConfiguration; +package com.chargebee.v4.models.thirdPartyConfiguration; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/thirdPartyConfiguration/params/ThirdPartyConfigurationConfigurationsParams.java b/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/params/ThirdPartyConfigurationConfigurationsParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/thirdPartyConfiguration/params/ThirdPartyConfigurationConfigurationsParams.java rename to src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/params/ThirdPartyConfigurationConfigurationsParams.java index a88c8aba..d3f84344 100644 --- a/src/main/java/com/chargebee/v4/core/models/thirdPartyConfiguration/params/ThirdPartyConfigurationConfigurationsParams.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/params/ThirdPartyConfigurationConfigurationsParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.thirdPartyConfiguration.params; +package com.chargebee.v4.models.thirdPartyConfiguration.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/thirdPartyConfiguration/params/ThirdPartyConfigurationRetrieveParams.java b/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/params/ThirdPartyConfigurationRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/thirdPartyConfiguration/params/ThirdPartyConfigurationRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/params/ThirdPartyConfigurationRetrieveParams.java index a46006b6..57f35768 100644 --- a/src/main/java/com/chargebee/v4/core/models/thirdPartyConfiguration/params/ThirdPartyConfigurationRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/params/ThirdPartyConfigurationRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.thirdPartyConfiguration.params; +package com.chargebee.v4.models.thirdPartyConfiguration.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/params/ThirdPartyConfigurationUpdateParams.java b/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/params/ThirdPartyConfigurationUpdateParams.java new file mode 100644 index 00000000..7ae998d8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/params/ThirdPartyConfigurationUpdateParams.java @@ -0,0 +1,122 @@ +/* + * 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.thirdPartyConfiguration.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class ThirdPartyConfigurationUpdateParams { + + private final String integrationName; + + private final java.util.Map configJson; + + private final java.util.Map authJson; + + private final Timestamp lastSyncAt; + + private ThirdPartyConfigurationUpdateParams(ThirdPartyConfigurationUpdateBuilder builder) { + + this.integrationName = builder.integrationName; + + this.configJson = builder.configJson; + + this.authJson = builder.authJson; + + this.lastSyncAt = builder.lastSyncAt; + } + + public String getIntegrationName() { + return integrationName; + } + + public java.util.Map getConfigJson() { + return configJson; + } + + public java.util.Map getAuthJson() { + return authJson; + } + + public Timestamp getLastSyncAt() { + return lastSyncAt; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.integrationName != null) { + + formData.put("integration_name", this.integrationName); + } + + if (this.configJson != null) { + + formData.put("config_json", JsonUtil.toJson(this.configJson)); + } + + if (this.authJson != null) { + + formData.put("auth_json", JsonUtil.toJson(this.authJson)); + } + + if (this.lastSyncAt != null) { + + formData.put("last_sync_at", this.lastSyncAt); + } + + return formData; + } + + /** Create a new builder for ThirdPartyConfigurationUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ThirdPartyConfigurationUpdateBuilder builder() { + return new ThirdPartyConfigurationUpdateBuilder(); + } + + public static final class ThirdPartyConfigurationUpdateBuilder { + + private String integrationName; + + private java.util.Map configJson; + + private java.util.Map authJson; + + private Timestamp lastSyncAt; + + private ThirdPartyConfigurationUpdateBuilder() {} + + public ThirdPartyConfigurationUpdateBuilder integrationName(String value) { + this.integrationName = value; + return this; + } + + public ThirdPartyConfigurationUpdateBuilder configJson(java.util.Map value) { + this.configJson = value; + return this; + } + + public ThirdPartyConfigurationUpdateBuilder authJson(java.util.Map value) { + this.authJson = value; + return this; + } + + public ThirdPartyConfigurationUpdateBuilder lastSyncAt(Timestamp value) { + this.lastSyncAt = value; + return this; + } + + public ThirdPartyConfigurationUpdateParams build() { + return new ThirdPartyConfigurationUpdateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/responses/ThirdPartyConfigurationConfigurationsResponse.java b/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/responses/ThirdPartyConfigurationConfigurationsResponse.java new file mode 100644 index 00000000..dbb53d71 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/responses/ThirdPartyConfigurationConfigurationsResponse.java @@ -0,0 +1,83 @@ +package com.chargebee.v4.models.thirdPartyConfiguration.responses; + +import com.chargebee.v4.models.thirdPartyConfiguration.ThirdPartyConfiguration; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ThirdPartyConfigurationConfigurations operation. Contains the + * response data from a single resource get operation. + */ +public final class ThirdPartyConfigurationConfigurationsResponse extends BaseResponse { + private final ThirdPartyConfiguration thirdPartyConfiguration; + + private ThirdPartyConfigurationConfigurationsResponse(Builder builder) { + super(builder.httpResponse); + + this.thirdPartyConfiguration = builder.thirdPartyConfiguration; + } + + /** Parse JSON response into ThirdPartyConfigurationConfigurationsResponse object. */ + public static ThirdPartyConfigurationConfigurationsResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into ThirdPartyConfigurationConfigurationsResponse object with HTTP + * response. + */ + public static ThirdPartyConfigurationConfigurationsResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __thirdPartyConfigurationJson = JsonUtil.getObject(json, "third_party_configuration"); + if (__thirdPartyConfigurationJson != null) { + builder.thirdPartyConfiguration( + ThirdPartyConfiguration.fromJson(__thirdPartyConfigurationJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ThirdPartyConfigurationConfigurationsResponse from JSON", e); + } + } + + /** Create a new builder for ThirdPartyConfigurationConfigurationsResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ThirdPartyConfigurationConfigurationsResponse. */ + public static class Builder { + + private ThirdPartyConfiguration thirdPartyConfiguration; + + private Response httpResponse; + + private Builder() {} + + public Builder thirdPartyConfiguration(ThirdPartyConfiguration thirdPartyConfiguration) { + this.thirdPartyConfiguration = thirdPartyConfiguration; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ThirdPartyConfigurationConfigurationsResponse build() { + return new ThirdPartyConfigurationConfigurationsResponse(this); + } + } + + /** Get the thirdPartyConfiguration from the response. */ + public ThirdPartyConfiguration getThirdPartyConfiguration() { + return thirdPartyConfiguration; + } +} diff --git a/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/responses/ThirdPartyConfigurationRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/responses/ThirdPartyConfigurationRetrieveResponse.java new file mode 100644 index 00000000..77390791 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/responses/ThirdPartyConfigurationRetrieveResponse.java @@ -0,0 +1,80 @@ +package com.chargebee.v4.models.thirdPartyConfiguration.responses; + +import com.chargebee.v4.models.thirdPartyConfiguration.ThirdPartyConfiguration; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ThirdPartyConfigurationRetrieve operation. Contains the response + * data from a single resource get operation. + */ +public final class ThirdPartyConfigurationRetrieveResponse extends BaseResponse { + private final ThirdPartyConfiguration thirdPartyConfiguration; + + private ThirdPartyConfigurationRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.thirdPartyConfiguration = builder.thirdPartyConfiguration; + } + + /** Parse JSON response into ThirdPartyConfigurationRetrieveResponse object. */ + public static ThirdPartyConfigurationRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ThirdPartyConfigurationRetrieveResponse object with HTTP response. */ + public static ThirdPartyConfigurationRetrieveResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __thirdPartyConfigurationJson = JsonUtil.getObject(json, "third_party_configuration"); + if (__thirdPartyConfigurationJson != null) { + builder.thirdPartyConfiguration( + ThirdPartyConfiguration.fromJson(__thirdPartyConfigurationJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ThirdPartyConfigurationRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for ThirdPartyConfigurationRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ThirdPartyConfigurationRetrieveResponse. */ + public static class Builder { + + private ThirdPartyConfiguration thirdPartyConfiguration; + + private Response httpResponse; + + private Builder() {} + + public Builder thirdPartyConfiguration(ThirdPartyConfiguration thirdPartyConfiguration) { + this.thirdPartyConfiguration = thirdPartyConfiguration; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ThirdPartyConfigurationRetrieveResponse build() { + return new ThirdPartyConfigurationRetrieveResponse(this); + } + } + + /** Get the thirdPartyConfiguration from the response. */ + public ThirdPartyConfiguration getThirdPartyConfiguration() { + return thirdPartyConfiguration; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/thirdPartyConfiguration/ThirdPartyConfigurationUpdateResponse.java b/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/responses/ThirdPartyConfigurationUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/thirdPartyConfiguration/ThirdPartyConfigurationUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/responses/ThirdPartyConfigurationUpdateResponse.java index 9c9f9a54..a40a3c40 100644 --- a/src/main/java/com/chargebee/v4/core/responses/thirdPartyConfiguration/ThirdPartyConfigurationUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyConfiguration/responses/ThirdPartyConfigurationUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.thirdPartyConfiguration; +package com.chargebee.v4.models.thirdPartyConfiguration.responses; -import com.chargebee.v4.core.models.thirdPartyConfiguration.ThirdPartyConfiguration; +import com.chargebee.v4.models.thirdPartyConfiguration.ThirdPartyConfiguration; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/thirdPartyEntityMapping/ThirdPartyEntityMapping.java b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/ThirdPartyEntityMapping.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/thirdPartyEntityMapping/ThirdPartyEntityMapping.java rename to src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/ThirdPartyEntityMapping.java index 29ecc827..114d6081 100644 --- a/src/main/java/com/chargebee/v4/core/models/thirdPartyEntityMapping/ThirdPartyEntityMapping.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/ThirdPartyEntityMapping.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.thirdPartyEntityMapping; +package com.chargebee.v4.models.thirdPartyEntityMapping; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListAllParams.java b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListAllParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListAllParams.java rename to src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListAllParams.java index ffc6b1b1..8b96cde8 100644 --- a/src/main/java/com/chargebee/v4/core/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListAllParams.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListAllParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.thirdPartyEntityMapping.params; +package com.chargebee.v4.models.thirdPartyEntityMapping.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListParams.java b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListParams.java rename to src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListParams.java index 963197b0..61f252ef 100644 --- a/src/main/java/com/chargebee/v4/core/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListParams.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.thirdPartyEntityMapping.params; +package com.chargebee.v4.models.thirdPartyEntityMapping.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingRetrieveEntityParams.java b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingRetrieveEntityParams.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingRetrieveEntityParams.java rename to src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingRetrieveEntityParams.java index e0fba193..520a528b 100644 --- a/src/main/java/com/chargebee/v4/core/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingRetrieveEntityParams.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingRetrieveEntityParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.thirdPartyEntityMapping.params; +package com.chargebee.v4.models.thirdPartyEntityMapping.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingUpdateEntityParams.java b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingUpdateEntityParams.java new file mode 100644 index 00000000..1a7b51e4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingUpdateEntityParams.java @@ -0,0 +1,426 @@ +/* + * 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.thirdPartyEntityMapping.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ThirdPartyEntityMappingUpdateEntityParams { + + private final EntityType entityType; + + private final String entityId; + + private final String thirdPartyEntityId; + + private final String integrationName; + + private final Status status; + + private final java.util.Map oldResource; + + private final java.util.Map mappingMeta; + + private final String failedDependentEntityId; + + private final FailedDependentEntityType failedDependentEntityType; + + private final String errorMessage; + + private final String url; + + private ThirdPartyEntityMappingUpdateEntityParams( + ThirdPartyEntityMappingUpdateEntityBuilder builder) { + + this.entityType = builder.entityType; + + this.entityId = builder.entityId; + + this.thirdPartyEntityId = builder.thirdPartyEntityId; + + this.integrationName = builder.integrationName; + + this.status = builder.status; + + this.oldResource = builder.oldResource; + + this.mappingMeta = builder.mappingMeta; + + this.failedDependentEntityId = builder.failedDependentEntityId; + + this.failedDependentEntityType = builder.failedDependentEntityType; + + this.errorMessage = builder.errorMessage; + + this.url = builder.url; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + + public String getThirdPartyEntityId() { + return thirdPartyEntityId; + } + + public String getIntegrationName() { + return integrationName; + } + + public Status getStatus() { + return status; + } + + public java.util.Map getOldResource() { + return oldResource; + } + + public java.util.Map getMappingMeta() { + return mappingMeta; + } + + public String getFailedDependentEntityId() { + return failedDependentEntityId; + } + + public FailedDependentEntityType getFailedDependentEntityType() { + return failedDependentEntityType; + } + + public String getErrorMessage() { + return errorMessage; + } + + public String getUrl() { + return url; + } + + /** 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.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + if (this.thirdPartyEntityId != null) { + + formData.put("third_party_entity_id", this.thirdPartyEntityId); + } + + if (this.integrationName != null) { + + formData.put("integration_name", this.integrationName); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.oldResource != null) { + + formData.put("old_resource", JsonUtil.toJson(this.oldResource)); + } + + if (this.mappingMeta != null) { + + formData.put("mapping_meta", JsonUtil.toJson(this.mappingMeta)); + } + + if (this.failedDependentEntityId != null) { + + formData.put("failed_dependent_entity_id", this.failedDependentEntityId); + } + + if (this.failedDependentEntityType != null) { + + formData.put("failed_dependent_entity_type", this.failedDependentEntityType); + } + + if (this.errorMessage != null) { + + formData.put("error_message", this.errorMessage); + } + + if (this.url != null) { + + formData.put("url", this.url); + } + + return formData; + } + + /** Create a new builder for ThirdPartyEntityMappingUpdateEntityParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ThirdPartyEntityMappingUpdateEntityBuilder builder() { + return new ThirdPartyEntityMappingUpdateEntityBuilder(); + } + + public static final class ThirdPartyEntityMappingUpdateEntityBuilder { + + private EntityType entityType; + + private String entityId; + + private String thirdPartyEntityId; + + private String integrationName; + + private Status status; + + private java.util.Map oldResource; + + private java.util.Map mappingMeta; + + private String failedDependentEntityId; + + private FailedDependentEntityType failedDependentEntityType; + + private String errorMessage; + + private String url; + + private ThirdPartyEntityMappingUpdateEntityBuilder() {} + + public ThirdPartyEntityMappingUpdateEntityBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public ThirdPartyEntityMappingUpdateEntityBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public ThirdPartyEntityMappingUpdateEntityBuilder thirdPartyEntityId(String value) { + this.thirdPartyEntityId = value; + return this; + } + + public ThirdPartyEntityMappingUpdateEntityBuilder integrationName(String value) { + this.integrationName = value; + return this; + } + + public ThirdPartyEntityMappingUpdateEntityBuilder status(Status value) { + this.status = value; + return this; + } + + public ThirdPartyEntityMappingUpdateEntityBuilder oldResource( + java.util.Map value) { + this.oldResource = value; + return this; + } + + public ThirdPartyEntityMappingUpdateEntityBuilder mappingMeta( + java.util.Map value) { + this.mappingMeta = value; + return this; + } + + public ThirdPartyEntityMappingUpdateEntityBuilder failedDependentEntityId(String value) { + this.failedDependentEntityId = value; + return this; + } + + public ThirdPartyEntityMappingUpdateEntityBuilder failedDependentEntityType( + FailedDependentEntityType value) { + this.failedDependentEntityType = value; + return this; + } + + public ThirdPartyEntityMappingUpdateEntityBuilder errorMessage(String value) { + this.errorMessage = value; + return this; + } + + public ThirdPartyEntityMappingUpdateEntityBuilder url(String value) { + this.url = value; + return this; + } + + public ThirdPartyEntityMappingUpdateEntityParams build() { + return new ThirdPartyEntityMappingUpdateEntityParams(this); + } + } + + public enum EntityType { + CUSTOMER("customer"), + + INVOICE("invoice"), + + CREDIT_NOTE("credit_note"), + + TRANSACTION("transaction"), + + PLAN("plan"), + + ADDON("addon"), + + COUPON("coupon"), + + SUBSCRIPTION("subscription"), + + ORDER("order"), + + QUOTE("quote"), + + ITEM_FAMILY("item_family"), + + ITEM("item"), + + ITEM_PRICE("item_price"), + + TAX_RATE("tax_rate"), + + TAX_GROUP("tax_group"), + + /** 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 Status { + SYNCED("synced"), + + PARTIALLY_SYNCED("partially_synced"), + + CREATE_FAILED("create_failed"), + + UPDATE_FAILED("update_failed"), + + STOPPED("stopped"), + + IGNORED("ignored"), + + TO_BE_PICKED("to_be_picked"), + + FORCE_SYNC("force_sync"), + + MISMATCH("mismatch"), + + DELETED("deleted"), + + QUEUED("queued"), + + DELETE_FAILED("delete_failed"), + + DELETE_SUCCESS("delete_success"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum FailedDependentEntityType { + CUSTOMER("customer"), + + INVOICE("invoice"), + + CREDIT_NOTE("credit_note"), + + TRANSACTION("transaction"), + + PLAN("plan"), + + ADDON("addon"), + + COUPON("coupon"), + + SUBSCRIPTION("subscription"), + + ORDER("order"), + + QUOTE("quote"), + + ITEM_FAMILY("item_family"), + + ITEM("item"), + + ITEM_PRICE("item_price"), + + TAX_RATE("tax_rate"), + + TAX_GROUP("tax_group"), + + /** + * An enum member indicating that FailedDependentEntityType was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + FailedDependentEntityType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static FailedDependentEntityType fromString(String value) { + if (value == null) return _UNKNOWN; + for (FailedDependentEntityType enumValue : FailedDependentEntityType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/responses/ThirdPartyEntityMappingListAllResponse.java b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/responses/ThirdPartyEntityMappingListAllResponse.java new file mode 100644 index 00000000..15fa8315 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/responses/ThirdPartyEntityMappingListAllResponse.java @@ -0,0 +1,80 @@ +package com.chargebee.v4.models.thirdPartyEntityMapping.responses; + +import com.chargebee.v4.models.thirdPartyEntityMapping.ThirdPartyEntityMapping; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ThirdPartyEntityMappingListAll operation. Contains the response + * data from a single resource get operation. + */ +public final class ThirdPartyEntityMappingListAllResponse extends BaseResponse { + private final ThirdPartyEntityMapping thirdPartyEntityMapping; + + private ThirdPartyEntityMappingListAllResponse(Builder builder) { + super(builder.httpResponse); + + this.thirdPartyEntityMapping = builder.thirdPartyEntityMapping; + } + + /** Parse JSON response into ThirdPartyEntityMappingListAllResponse object. */ + public static ThirdPartyEntityMappingListAllResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ThirdPartyEntityMappingListAllResponse object with HTTP response. */ + public static ThirdPartyEntityMappingListAllResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __thirdPartyEntityMappingJson = JsonUtil.getObject(json, "third_party_entity_mapping"); + if (__thirdPartyEntityMappingJson != null) { + builder.thirdPartyEntityMapping( + ThirdPartyEntityMapping.fromJson(__thirdPartyEntityMappingJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ThirdPartyEntityMappingListAllResponse from JSON", e); + } + } + + /** Create a new builder for ThirdPartyEntityMappingListAllResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ThirdPartyEntityMappingListAllResponse. */ + public static class Builder { + + private ThirdPartyEntityMapping thirdPartyEntityMapping; + + private Response httpResponse; + + private Builder() {} + + public Builder thirdPartyEntityMapping(ThirdPartyEntityMapping thirdPartyEntityMapping) { + this.thirdPartyEntityMapping = thirdPartyEntityMapping; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ThirdPartyEntityMappingListAllResponse build() { + return new ThirdPartyEntityMappingListAllResponse(this); + } + } + + /** Get the thirdPartyEntityMapping from the response. */ + public ThirdPartyEntityMapping getThirdPartyEntityMapping() { + return thirdPartyEntityMapping; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/thirdPartyEntityMapping/ThirdPartyEntityMappingListResponse.java b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/responses/ThirdPartyEntityMappingListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/thirdPartyEntityMapping/ThirdPartyEntityMappingListResponse.java rename to src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/responses/ThirdPartyEntityMappingListResponse.java index 54ca9045..6432857c 100644 --- a/src/main/java/com/chargebee/v4/core/responses/thirdPartyEntityMapping/ThirdPartyEntityMappingListResponse.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/responses/ThirdPartyEntityMappingListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.thirdPartyEntityMapping; +package com.chargebee.v4.models.thirdPartyEntityMapping.responses; import java.util.List; -import com.chargebee.v4.core.models.thirdPartyEntityMapping.ThirdPartyEntityMapping; +import com.chargebee.v4.models.thirdPartyEntityMapping.ThirdPartyEntityMapping; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.ThirdPartyEntityMappingService; -import com.chargebee.v4.core.models.thirdPartyEntityMapping.params.ThirdPartyEntityMappingListParams; +import com.chargebee.v4.services.ThirdPartyEntityMappingService; +import com.chargebee.v4.models.thirdPartyEntityMapping.params.ThirdPartyEntityMappingListParams; /** * Immutable response object for ThirdPartyEntityMappingList operation. Contains paginated list @@ -104,9 +105,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 ThirdPartyEntityMappingListResponse nextPage() throws Exception { + public ThirdPartyEntityMappingListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/responses/ThirdPartyEntityMappingRetrieveEntityResponse.java b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/responses/ThirdPartyEntityMappingRetrieveEntityResponse.java new file mode 100644 index 00000000..ebc254f6 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/responses/ThirdPartyEntityMappingRetrieveEntityResponse.java @@ -0,0 +1,83 @@ +package com.chargebee.v4.models.thirdPartyEntityMapping.responses; + +import com.chargebee.v4.models.thirdPartyEntityMapping.ThirdPartyEntityMapping; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ThirdPartyEntityMappingRetrieveEntity operation. Contains the + * response data from a single resource get operation. + */ +public final class ThirdPartyEntityMappingRetrieveEntityResponse extends BaseResponse { + private final ThirdPartyEntityMapping thirdPartyEntityMapping; + + private ThirdPartyEntityMappingRetrieveEntityResponse(Builder builder) { + super(builder.httpResponse); + + this.thirdPartyEntityMapping = builder.thirdPartyEntityMapping; + } + + /** Parse JSON response into ThirdPartyEntityMappingRetrieveEntityResponse object. */ + public static ThirdPartyEntityMappingRetrieveEntityResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into ThirdPartyEntityMappingRetrieveEntityResponse object with HTTP + * response. + */ + public static ThirdPartyEntityMappingRetrieveEntityResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __thirdPartyEntityMappingJson = JsonUtil.getObject(json, "third_party_entity_mapping"); + if (__thirdPartyEntityMappingJson != null) { + builder.thirdPartyEntityMapping( + ThirdPartyEntityMapping.fromJson(__thirdPartyEntityMappingJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ThirdPartyEntityMappingRetrieveEntityResponse from JSON", e); + } + } + + /** Create a new builder for ThirdPartyEntityMappingRetrieveEntityResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ThirdPartyEntityMappingRetrieveEntityResponse. */ + public static class Builder { + + private ThirdPartyEntityMapping thirdPartyEntityMapping; + + private Response httpResponse; + + private Builder() {} + + public Builder thirdPartyEntityMapping(ThirdPartyEntityMapping thirdPartyEntityMapping) { + this.thirdPartyEntityMapping = thirdPartyEntityMapping; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ThirdPartyEntityMappingRetrieveEntityResponse build() { + return new ThirdPartyEntityMappingRetrieveEntityResponse(this); + } + } + + /** Get the thirdPartyEntityMapping from the response. */ + public ThirdPartyEntityMapping getThirdPartyEntityMapping() { + return thirdPartyEntityMapping; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/thirdPartyEntityMapping/ThirdPartyEntityMappingUpdateEntityResponse.java b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/responses/ThirdPartyEntityMappingUpdateEntityResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/thirdPartyEntityMapping/ThirdPartyEntityMappingUpdateEntityResponse.java rename to src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/responses/ThirdPartyEntityMappingUpdateEntityResponse.java index a91c5727..dab348e1 100644 --- a/src/main/java/com/chargebee/v4/core/responses/thirdPartyEntityMapping/ThirdPartyEntityMappingUpdateEntityResponse.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/responses/ThirdPartyEntityMappingUpdateEntityResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.thirdPartyEntityMapping; +package com.chargebee.v4.models.thirdPartyEntityMapping.responses; -import com.chargebee.v4.core.models.thirdPartyEntityMapping.ThirdPartyEntityMapping; +import com.chargebee.v4.models.thirdPartyEntityMapping.ThirdPartyEntityMapping; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java b/src/main/java/com/chargebee/v4/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java rename to src/main/java/com/chargebee/v4/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java index 9f1926c8..14a622c4 100644 --- a/src/main/java/com/chargebee/v4/core/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.thirdPartyPaymentMethod; +package com.chargebee.v4.models.thirdPartyPaymentMethod; import com.chargebee.v4.internal.JsonUtil; @@ -83,6 +83,16 @@ public enum Type { PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -217,6 +227,8 @@ public enum Gateway { DEUTSCHE_BANK("deutsche_bank"), + EZIDEBIT("ezidebit"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/core/models/thirdPartySyncDetail/ThirdPartySyncDetail.java b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/ThirdPartySyncDetail.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/thirdPartySyncDetail/ThirdPartySyncDetail.java rename to src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/ThirdPartySyncDetail.java index 558132aa..bb526ed3 100644 --- a/src/main/java/com/chargebee/v4/core/models/thirdPartySyncDetail/ThirdPartySyncDetail.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/ThirdPartySyncDetail.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.thirdPartySyncDetail; +package com.chargebee.v4.models.thirdPartySyncDetail; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/params/ThirdPartySyncDetailCreateParams.java b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/params/ThirdPartySyncDetailCreateParams.java new file mode 100644 index 00000000..0e3b3bd4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/params/ThirdPartySyncDetailCreateParams.java @@ -0,0 +1,135 @@ +/* + * 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.thirdPartySyncDetail.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ThirdPartySyncDetailCreateParams { + + private final java.util.Map context; + + private final ThirdPartyConfigurationParams thirdPartyConfiguration; + + private ThirdPartySyncDetailCreateParams(ThirdPartySyncDetailCreateBuilder builder) { + + this.context = builder.context; + + this.thirdPartyConfiguration = builder.thirdPartyConfiguration; + } + + public java.util.Map getContext() { + return context; + } + + public ThirdPartyConfigurationParams getThirdPartyConfiguration() { + return thirdPartyConfiguration; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.context != null) { + + formData.put("context", JsonUtil.toJson(this.context)); + } + + if (this.thirdPartyConfiguration != null) { + + // Single object + Map nestedData = this.thirdPartyConfiguration.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "third_party_configuration[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ThirdPartySyncDetailCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ThirdPartySyncDetailCreateBuilder builder() { + return new ThirdPartySyncDetailCreateBuilder(); + } + + public static final class ThirdPartySyncDetailCreateBuilder { + + private java.util.Map context; + + private ThirdPartyConfigurationParams thirdPartyConfiguration; + + private ThirdPartySyncDetailCreateBuilder() {} + + public ThirdPartySyncDetailCreateBuilder context(java.util.Map value) { + this.context = value; + return this; + } + + public ThirdPartySyncDetailCreateBuilder thirdPartyConfiguration( + ThirdPartyConfigurationParams value) { + this.thirdPartyConfiguration = value; + return this; + } + + public ThirdPartySyncDetailCreateParams build() { + return new ThirdPartySyncDetailCreateParams(this); + } + } + + public static final class ThirdPartyConfigurationParams { + + private final String integrationName; + + private ThirdPartyConfigurationParams(ThirdPartyConfigurationBuilder builder) { + + this.integrationName = builder.integrationName; + } + + public String getIntegrationName() { + return integrationName; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.integrationName != null) { + + formData.put("integration_name", this.integrationName); + } + + return formData; + } + + /** Create a new builder for ThirdPartyConfigurationParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ThirdPartyConfigurationBuilder builder() { + return new ThirdPartyConfigurationBuilder(); + } + + public static final class ThirdPartyConfigurationBuilder { + + private String integrationName; + + private ThirdPartyConfigurationBuilder() {} + + public ThirdPartyConfigurationBuilder integrationName(String value) { + this.integrationName = value; + return this; + } + + public ThirdPartyConfigurationParams build() { + return new ThirdPartyConfigurationParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/thirdPartySyncDetail/params/ThirdPartySyncDetailRetrieveLatestSyncParams.java b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/params/ThirdPartySyncDetailRetrieveLatestSyncParams.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/thirdPartySyncDetail/params/ThirdPartySyncDetailRetrieveLatestSyncParams.java rename to src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/params/ThirdPartySyncDetailRetrieveLatestSyncParams.java index 51dde98d..e662beef 100644 --- a/src/main/java/com/chargebee/v4/core/models/thirdPartySyncDetail/params/ThirdPartySyncDetailRetrieveLatestSyncParams.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/params/ThirdPartySyncDetailRetrieveLatestSyncParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.thirdPartySyncDetail.params; +package com.chargebee.v4.models.thirdPartySyncDetail.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/thirdPartySyncDetail/params/ThirdPartySyncDetailRetrieveParams.java b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/params/ThirdPartySyncDetailRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/thirdPartySyncDetail/params/ThirdPartySyncDetailRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/params/ThirdPartySyncDetailRetrieveParams.java index eaade793..f2b23cdb 100644 --- a/src/main/java/com/chargebee/v4/core/models/thirdPartySyncDetail/params/ThirdPartySyncDetailRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/params/ThirdPartySyncDetailRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.thirdPartySyncDetail.params; +package com.chargebee.v4.models.thirdPartySyncDetail.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/params/ThirdPartySyncDetailUpdateParams.java b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/params/ThirdPartySyncDetailUpdateParams.java new file mode 100644 index 00000000..cfaa9010 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/params/ThirdPartySyncDetailUpdateParams.java @@ -0,0 +1,115 @@ +/* + * 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.thirdPartySyncDetail.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ThirdPartySyncDetailUpdateParams { + + private final Status status; + + private final java.util.Map context; + + private ThirdPartySyncDetailUpdateParams(ThirdPartySyncDetailUpdateBuilder builder) { + + this.status = builder.status; + + this.context = builder.context; + } + + public Status getStatus() { + return status; + } + + public java.util.Map getContext() { + return context; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.context != null) { + + formData.put("context", JsonUtil.toJson(this.context)); + } + + return formData; + } + + /** Create a new builder for ThirdPartySyncDetailUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ThirdPartySyncDetailUpdateBuilder builder() { + return new ThirdPartySyncDetailUpdateBuilder(); + } + + public static final class ThirdPartySyncDetailUpdateBuilder { + + private Status status; + + private java.util.Map context; + + private ThirdPartySyncDetailUpdateBuilder() {} + + public ThirdPartySyncDetailUpdateBuilder status(Status value) { + this.status = value; + return this; + } + + public ThirdPartySyncDetailUpdateBuilder context(java.util.Map value) { + this.context = value; + return this; + } + + public ThirdPartySyncDetailUpdateParams build() { + return new ThirdPartySyncDetailUpdateParams(this); + } + } + + public enum Status { + SUCCEEDED("succeeded"), + + FAILED("failed"), + + STARTED("started"), + + RUNNING("running"), + + ABORTED("aborted"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/thirdPartySyncDetail/ThirdPartySyncDetailCreateResponse.java b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/responses/ThirdPartySyncDetailCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/thirdPartySyncDetail/ThirdPartySyncDetailCreateResponse.java rename to src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/responses/ThirdPartySyncDetailCreateResponse.java index 2bd8aa3f..a42c2a72 100644 --- a/src/main/java/com/chargebee/v4/core/responses/thirdPartySyncDetail/ThirdPartySyncDetailCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/responses/ThirdPartySyncDetailCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.thirdPartySyncDetail; +package com.chargebee.v4.models.thirdPartySyncDetail.responses; -import com.chargebee.v4.core.models.thirdPartySyncDetail.ThirdPartySyncDetail; +import com.chargebee.v4.models.thirdPartySyncDetail.ThirdPartySyncDetail; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/responses/ThirdPartySyncDetailRetrieveLatestSyncResponse.java b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/responses/ThirdPartySyncDetailRetrieveLatestSyncResponse.java new file mode 100644 index 00000000..789aae18 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/responses/ThirdPartySyncDetailRetrieveLatestSyncResponse.java @@ -0,0 +1,82 @@ +package com.chargebee.v4.models.thirdPartySyncDetail.responses; + +import com.chargebee.v4.models.thirdPartySyncDetail.ThirdPartySyncDetail; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ThirdPartySyncDetailRetrieveLatestSync operation. Contains the + * response data from a single resource get operation. + */ +public final class ThirdPartySyncDetailRetrieveLatestSyncResponse extends BaseResponse { + private final ThirdPartySyncDetail thirdPartySyncDetail; + + private ThirdPartySyncDetailRetrieveLatestSyncResponse(Builder builder) { + super(builder.httpResponse); + + this.thirdPartySyncDetail = builder.thirdPartySyncDetail; + } + + /** Parse JSON response into ThirdPartySyncDetailRetrieveLatestSyncResponse object. */ + public static ThirdPartySyncDetailRetrieveLatestSyncResponse fromJson(String json) { + return fromJson(json, null); + } + + /** + * Parse JSON response into ThirdPartySyncDetailRetrieveLatestSyncResponse object with HTTP + * response. + */ + public static ThirdPartySyncDetailRetrieveLatestSyncResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __thirdPartySyncDetailJson = JsonUtil.getObject(json, "third_party_sync_detail"); + if (__thirdPartySyncDetailJson != null) { + builder.thirdPartySyncDetail(ThirdPartySyncDetail.fromJson(__thirdPartySyncDetailJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ThirdPartySyncDetailRetrieveLatestSyncResponse from JSON", e); + } + } + + /** Create a new builder for ThirdPartySyncDetailRetrieveLatestSyncResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ThirdPartySyncDetailRetrieveLatestSyncResponse. */ + public static class Builder { + + private ThirdPartySyncDetail thirdPartySyncDetail; + + private Response httpResponse; + + private Builder() {} + + public Builder thirdPartySyncDetail(ThirdPartySyncDetail thirdPartySyncDetail) { + this.thirdPartySyncDetail = thirdPartySyncDetail; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ThirdPartySyncDetailRetrieveLatestSyncResponse build() { + return new ThirdPartySyncDetailRetrieveLatestSyncResponse(this); + } + } + + /** Get the thirdPartySyncDetail from the response. */ + public ThirdPartySyncDetail getThirdPartySyncDetail() { + return thirdPartySyncDetail; + } +} diff --git a/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/responses/ThirdPartySyncDetailRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/responses/ThirdPartySyncDetailRetrieveResponse.java new file mode 100644 index 00000000..8359f0ad --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/responses/ThirdPartySyncDetailRetrieveResponse.java @@ -0,0 +1,78 @@ +package com.chargebee.v4.models.thirdPartySyncDetail.responses; + +import com.chargebee.v4.models.thirdPartySyncDetail.ThirdPartySyncDetail; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for ThirdPartySyncDetailRetrieve operation. Contains the response data + * from a single resource get operation. + */ +public final class ThirdPartySyncDetailRetrieveResponse extends BaseResponse { + private final ThirdPartySyncDetail thirdPartySyncDetail; + + private ThirdPartySyncDetailRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.thirdPartySyncDetail = builder.thirdPartySyncDetail; + } + + /** Parse JSON response into ThirdPartySyncDetailRetrieveResponse object. */ + public static ThirdPartySyncDetailRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ThirdPartySyncDetailRetrieveResponse object with HTTP response. */ + public static ThirdPartySyncDetailRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __thirdPartySyncDetailJson = JsonUtil.getObject(json, "third_party_sync_detail"); + if (__thirdPartySyncDetailJson != null) { + builder.thirdPartySyncDetail(ThirdPartySyncDetail.fromJson(__thirdPartySyncDetailJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ThirdPartySyncDetailRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for ThirdPartySyncDetailRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ThirdPartySyncDetailRetrieveResponse. */ + public static class Builder { + + private ThirdPartySyncDetail thirdPartySyncDetail; + + private Response httpResponse; + + private Builder() {} + + public Builder thirdPartySyncDetail(ThirdPartySyncDetail thirdPartySyncDetail) { + this.thirdPartySyncDetail = thirdPartySyncDetail; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ThirdPartySyncDetailRetrieveResponse build() { + return new ThirdPartySyncDetailRetrieveResponse(this); + } + } + + /** Get the thirdPartySyncDetail from the response. */ + public ThirdPartySyncDetail getThirdPartySyncDetail() { + return thirdPartySyncDetail; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/thirdPartySyncDetail/ThirdPartySyncDetailUpdateResponse.java b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/responses/ThirdPartySyncDetailUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/thirdPartySyncDetail/ThirdPartySyncDetailUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/responses/ThirdPartySyncDetailUpdateResponse.java index fe15089c..6f57e8f2 100644 --- a/src/main/java/com/chargebee/v4/core/responses/thirdPartySyncDetail/ThirdPartySyncDetailUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartySyncDetail/responses/ThirdPartySyncDetailUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.thirdPartySyncDetail; +package com.chargebee.v4.models.thirdPartySyncDetail.responses; -import com.chargebee.v4.core.models.thirdPartySyncDetail.ThirdPartySyncDetail; +import com.chargebee.v4.models.thirdPartySyncDetail.ThirdPartySyncDetail; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/timeMachine/TimeMachine.java b/src/main/java/com/chargebee/v4/models/timeMachine/TimeMachine.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/timeMachine/TimeMachine.java rename to src/main/java/com/chargebee/v4/models/timeMachine/TimeMachine.java index e634e4e9..a9dec38b 100644 --- a/src/main/java/com/chargebee/v4/core/models/timeMachine/TimeMachine.java +++ b/src/main/java/com/chargebee/v4/models/timeMachine/TimeMachine.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.timeMachine; +package com.chargebee.v4.models.timeMachine; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/timeMachine/params/TimeMachineRetrieveParams.java b/src/main/java/com/chargebee/v4/models/timeMachine/params/TimeMachineRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/timeMachine/params/TimeMachineRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/timeMachine/params/TimeMachineRetrieveParams.java index 6be10504..a956f280 100644 --- a/src/main/java/com/chargebee/v4/core/models/timeMachine/params/TimeMachineRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/timeMachine/params/TimeMachineRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.timeMachine.params; +package com.chargebee.v4.models.timeMachine.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/timeMachine/params/TimeMachineStartAfreshParams.java b/src/main/java/com/chargebee/v4/models/timeMachine/params/TimeMachineStartAfreshParams.java new file mode 100644 index 00000000..68dd9c7c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/timeMachine/params/TimeMachineStartAfreshParams.java @@ -0,0 +1,61 @@ +/* + * 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.timeMachine.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class TimeMachineStartAfreshParams { + + private final Timestamp genesisTime; + + private TimeMachineStartAfreshParams(TimeMachineStartAfreshBuilder builder) { + + this.genesisTime = builder.genesisTime; + } + + public Timestamp getGenesisTime() { + return genesisTime; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.genesisTime != null) { + + formData.put("genesis_time", this.genesisTime); + } + + return formData; + } + + /** Create a new builder for TimeMachineStartAfreshParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TimeMachineStartAfreshBuilder builder() { + return new TimeMachineStartAfreshBuilder(); + } + + public static final class TimeMachineStartAfreshBuilder { + + private Timestamp genesisTime; + + private TimeMachineStartAfreshBuilder() {} + + public TimeMachineStartAfreshBuilder genesisTime(Timestamp value) { + this.genesisTime = value; + return this; + } + + public TimeMachineStartAfreshParams build() { + return new TimeMachineStartAfreshParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/timeMachine/params/TimeMachineTravelForwardParams.java b/src/main/java/com/chargebee/v4/models/timeMachine/params/TimeMachineTravelForwardParams.java new file mode 100644 index 00000000..56db0411 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/timeMachine/params/TimeMachineTravelForwardParams.java @@ -0,0 +1,61 @@ +/* + * 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.timeMachine.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class TimeMachineTravelForwardParams { + + private final Timestamp destinationTime; + + private TimeMachineTravelForwardParams(TimeMachineTravelForwardBuilder builder) { + + this.destinationTime = builder.destinationTime; + } + + public Timestamp getDestinationTime() { + return destinationTime; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.destinationTime != null) { + + formData.put("destination_time", this.destinationTime); + } + + return formData; + } + + /** Create a new builder for TimeMachineTravelForwardParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TimeMachineTravelForwardBuilder builder() { + return new TimeMachineTravelForwardBuilder(); + } + + public static final class TimeMachineTravelForwardBuilder { + + private Timestamp destinationTime; + + private TimeMachineTravelForwardBuilder() {} + + public TimeMachineTravelForwardBuilder destinationTime(Timestamp value) { + this.destinationTime = value; + return this; + } + + public TimeMachineTravelForwardParams build() { + return new TimeMachineTravelForwardParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/timeMachine/responses/TimeMachineRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/timeMachine/responses/TimeMachineRetrieveResponse.java new file mode 100644 index 00000000..4820eec7 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/timeMachine/responses/TimeMachineRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.timeMachine.responses; + +import com.chargebee.v4.models.timeMachine.TimeMachine; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for TimeMachineRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class TimeMachineRetrieveResponse extends BaseResponse { + private final TimeMachine timeMachine; + + private TimeMachineRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.timeMachine = builder.timeMachine; + } + + /** Parse JSON response into TimeMachineRetrieveResponse object. */ + public static TimeMachineRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into TimeMachineRetrieveResponse object with HTTP response. */ + public static TimeMachineRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __timeMachineJson = JsonUtil.getObject(json, "time_machine"); + if (__timeMachineJson != null) { + builder.timeMachine(TimeMachine.fromJson(__timeMachineJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse TimeMachineRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for TimeMachineRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for TimeMachineRetrieveResponse. */ + public static class Builder { + + private TimeMachine timeMachine; + + private Response httpResponse; + + private Builder() {} + + public Builder timeMachine(TimeMachine timeMachine) { + this.timeMachine = timeMachine; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public TimeMachineRetrieveResponse build() { + return new TimeMachineRetrieveResponse(this); + } + } + + /** Get the timeMachine from the response. */ + public TimeMachine getTimeMachine() { + return timeMachine; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/timeMachine/TimeMachineStartAfreshResponse.java b/src/main/java/com/chargebee/v4/models/timeMachine/responses/TimeMachineStartAfreshResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/timeMachine/TimeMachineStartAfreshResponse.java rename to src/main/java/com/chargebee/v4/models/timeMachine/responses/TimeMachineStartAfreshResponse.java index 13cdf409..14354d6d 100644 --- a/src/main/java/com/chargebee/v4/core/responses/timeMachine/TimeMachineStartAfreshResponse.java +++ b/src/main/java/com/chargebee/v4/models/timeMachine/responses/TimeMachineStartAfreshResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.timeMachine; +package com.chargebee.v4.models.timeMachine.responses; -import com.chargebee.v4.core.models.timeMachine.TimeMachine; +import com.chargebee.v4.models.timeMachine.TimeMachine; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/timeMachine/TimeMachineTravelForwardResponse.java b/src/main/java/com/chargebee/v4/models/timeMachine/responses/TimeMachineTravelForwardResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/timeMachine/TimeMachineTravelForwardResponse.java rename to src/main/java/com/chargebee/v4/models/timeMachine/responses/TimeMachineTravelForwardResponse.java index 84194416..64ff03a6 100644 --- a/src/main/java/com/chargebee/v4/core/responses/timeMachine/TimeMachineTravelForwardResponse.java +++ b/src/main/java/com/chargebee/v4/models/timeMachine/responses/TimeMachineTravelForwardResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.timeMachine; +package com.chargebee.v4.models.timeMachine.responses; -import com.chargebee.v4.core.models.timeMachine.TimeMachine; +import com.chargebee.v4.models.timeMachine.TimeMachine; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/token/Token.java b/src/main/java/com/chargebee/v4/models/token/Token.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/token/Token.java rename to src/main/java/com/chargebee/v4/models/token/Token.java index 30f48632..0a7b020e 100644 --- a/src/main/java/com/chargebee/v4/core/models/token/Token.java +++ b/src/main/java/com/chargebee/v4/models/token/Token.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.token; +package com.chargebee.v4.models.token; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; @@ -184,6 +184,8 @@ public enum Gateway { DEUTSCHE_BANK("deutsche_bank"), + EZIDEBIT("ezidebit"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ @@ -260,6 +262,16 @@ public enum PaymentMethodType { PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + /** An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/core/models/tpSiteUser/TpSiteUser.java b/src/main/java/com/chargebee/v4/models/tpSiteUser/TpSiteUser.java similarity index 94% rename from src/main/java/com/chargebee/v4/core/models/tpSiteUser/TpSiteUser.java rename to src/main/java/com/chargebee/v4/models/tpSiteUser/TpSiteUser.java index a067bf03..02f24dff 100644 --- a/src/main/java/com/chargebee/v4/core/models/tpSiteUser/TpSiteUser.java +++ b/src/main/java/com/chargebee/v4/models/tpSiteUser/TpSiteUser.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.tpSiteUser; +package com.chargebee.v4.models.tpSiteUser; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/models/tpSiteUser/params/GuestsForTpSiteUserParams.java b/src/main/java/com/chargebee/v4/models/tpSiteUser/params/GuestsForTpSiteUserParams.java new file mode 100644 index 00000000..a143889f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/tpSiteUser/params/GuestsForTpSiteUserParams.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.tpSiteUser.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class GuestsForTpSiteUserParams { + + private final Map queryParams; + + private GuestsForTpSiteUserParams(GuestsForTpSiteUserBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public GuestsForTpSiteUserBuilder toBuilder() { + GuestsForTpSiteUserBuilder builder = new GuestsForTpSiteUserBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for GuestsForTpSiteUserParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static GuestsForTpSiteUserBuilder builder() { + return new GuestsForTpSiteUserBuilder(); + } + + public static final class GuestsForTpSiteUserBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private GuestsForTpSiteUserBuilder() {} + + public GuestsForTpSiteUserBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public GuestsForTpSiteUserBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public GuestsForTpSiteUserParams build() { + return new GuestsForTpSiteUserParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/tpSiteUser/params/TpSiteUserPayNowEnableLiveParams.java b/src/main/java/com/chargebee/v4/models/tpSiteUser/params/TpSiteUserPayNowEnableLiveParams.java new file mode 100644 index 00000000..d107b4a5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/tpSiteUser/params/TpSiteUserPayNowEnableLiveParams.java @@ -0,0 +1,80 @@ +/* + * 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.tpSiteUser.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class TpSiteUserPayNowEnableLiveParams { + + private final String domain; + + private final String hostedPageToken; + + private TpSiteUserPayNowEnableLiveParams(TpSiteUserPayNowEnableLiveBuilder builder) { + + this.domain = builder.domain; + + this.hostedPageToken = builder.hostedPageToken; + } + + public String getDomain() { + return domain; + } + + public String getHostedPageToken() { + return hostedPageToken; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.domain != null) { + + formData.put("domain", this.domain); + } + + if (this.hostedPageToken != null) { + + formData.put("hosted_page_token", this.hostedPageToken); + } + + return formData; + } + + /** Create a new builder for TpSiteUserPayNowEnableLiveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TpSiteUserPayNowEnableLiveBuilder builder() { + return new TpSiteUserPayNowEnableLiveBuilder(); + } + + public static final class TpSiteUserPayNowEnableLiveBuilder { + + private String domain; + + private String hostedPageToken; + + private TpSiteUserPayNowEnableLiveBuilder() {} + + public TpSiteUserPayNowEnableLiveBuilder domain(String value) { + this.domain = value; + return this; + } + + public TpSiteUserPayNowEnableLiveBuilder hostedPageToken(String value) { + this.hostedPageToken = value; + return this; + } + + public TpSiteUserPayNowEnableLiveParams build() { + return new TpSiteUserPayNowEnableLiveParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/tpSiteUser/params/UsersForTpSiteUserParams.java b/src/main/java/com/chargebee/v4/models/tpSiteUser/params/UsersForTpSiteUserParams.java new file mode 100644 index 00000000..257d528c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/tpSiteUser/params/UsersForTpSiteUserParams.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.tpSiteUser.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class UsersForTpSiteUserParams { + + private final Map queryParams; + + private UsersForTpSiteUserParams(UsersForTpSiteUserBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public UsersForTpSiteUserBuilder toBuilder() { + UsersForTpSiteUserBuilder builder = new UsersForTpSiteUserBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for UsersForTpSiteUserParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UsersForTpSiteUserBuilder builder() { + return new UsersForTpSiteUserBuilder(); + } + + public static final class UsersForTpSiteUserBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private UsersForTpSiteUserBuilder() {} + + public UsersForTpSiteUserBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public UsersForTpSiteUserBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public UsersForTpSiteUserParams build() { + return new UsersForTpSiteUserParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/tpSiteUser/responses/GuestsForTpSiteUserResponse.java b/src/main/java/com/chargebee/v4/models/tpSiteUser/responses/GuestsForTpSiteUserResponse.java new file mode 100644 index 00000000..cc63602f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/tpSiteUser/responses/GuestsForTpSiteUserResponse.java @@ -0,0 +1,172 @@ +package com.chargebee.v4.models.tpSiteUser.responses; + +import java.util.List; + +import com.chargebee.v4.models.tpSiteUser.TpSiteUser; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.TpSiteUserService; +import com.chargebee.v4.models.tpSiteUser.params.GuestsForTpSiteUserParams; + +/** Immutable response object for GuestsForTpSiteUser operation. Contains paginated list data. */ +public final class GuestsForTpSiteUserResponse { + + private final List list; + + private final String nextOffset; + + private final String tpSiteUserDomain; + + private final TpSiteUserService service; + private final GuestsForTpSiteUserParams originalParams; + private final Response httpResponse; + + private GuestsForTpSiteUserResponse( + List list, + String nextOffset, + String tpSiteUserDomain, + TpSiteUserService service, + GuestsForTpSiteUserParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.tpSiteUserDomain = tpSiteUserDomain; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into GuestsForTpSiteUserResponse object (no service context). Use this when + * you only need to read a single page (no nextPage()). + */ + public static GuestsForTpSiteUserResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(TpSiteUserGuestsForTpSiteUserItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new GuestsForTpSiteUserResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse GuestsForTpSiteUserResponse from JSON", e); + } + } + + /** + * Parse JSON response into GuestsForTpSiteUserResponse object with service context for pagination + * (enables nextPage()). + */ + public static GuestsForTpSiteUserResponse fromJson( + String json, + TpSiteUserService service, + GuestsForTpSiteUserParams originalParams, + String tpSiteUserDomain, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(TpSiteUserGuestsForTpSiteUserItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new GuestsForTpSiteUserResponse( + list, nextOffset, tpSiteUserDomain, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse GuestsForTpSiteUserResponse 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 GuestsForTpSiteUserResponse 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)."); + } + + GuestsForTpSiteUserParams nextParams = + (originalParams != null ? originalParams.toBuilder() : GuestsForTpSiteUserParams.builder()) + .offset(nextOffset) + .build(); + + return service.guestsForTpSiteUser(tpSiteUserDomain, 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 TpSiteUserGuestsForTpSiteUserItem { + + private TpSiteUser tpSiteUser; + + public TpSiteUser getTpSiteUser() { + return tpSiteUser; + } + + public static TpSiteUserGuestsForTpSiteUserItem fromJson(String json) { + TpSiteUserGuestsForTpSiteUserItem item = new TpSiteUserGuestsForTpSiteUserItem(); + + String __tpSiteUserJson = JsonUtil.getObject(json, "tp_site_user"); + if (__tpSiteUserJson != null) { + item.tpSiteUser = TpSiteUser.fromJson(__tpSiteUserJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/tpSiteUser/TpSiteUserPayNowEnableLiveResponse.java b/src/main/java/com/chargebee/v4/models/tpSiteUser/responses/TpSiteUserPayNowEnableLiveResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/tpSiteUser/TpSiteUserPayNowEnableLiveResponse.java rename to src/main/java/com/chargebee/v4/models/tpSiteUser/responses/TpSiteUserPayNowEnableLiveResponse.java index c62a93d5..764683fa 100644 --- a/src/main/java/com/chargebee/v4/core/responses/tpSiteUser/TpSiteUserPayNowEnableLiveResponse.java +++ b/src/main/java/com/chargebee/v4/models/tpSiteUser/responses/TpSiteUserPayNowEnableLiveResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.tpSiteUser; +package com.chargebee.v4.models.tpSiteUser.responses; -import com.chargebee.v4.core.models.tpSiteUser.TpSiteUser; +import com.chargebee.v4.models.tpSiteUser.TpSiteUser; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/tpSiteUser/responses/UsersForTpSiteUserResponse.java b/src/main/java/com/chargebee/v4/models/tpSiteUser/responses/UsersForTpSiteUserResponse.java new file mode 100644 index 00000000..74e09df6 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/tpSiteUser/responses/UsersForTpSiteUserResponse.java @@ -0,0 +1,172 @@ +package com.chargebee.v4.models.tpSiteUser.responses; + +import java.util.List; + +import com.chargebee.v4.models.tpSiteUser.TpSiteUser; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.TpSiteUserService; +import com.chargebee.v4.models.tpSiteUser.params.UsersForTpSiteUserParams; + +/** Immutable response object for UsersForTpSiteUser operation. Contains paginated list data. */ +public final class UsersForTpSiteUserResponse { + + private final List list; + + private final String nextOffset; + + private final String tpSiteUserDomain; + + private final TpSiteUserService service; + private final UsersForTpSiteUserParams originalParams; + private final Response httpResponse; + + private UsersForTpSiteUserResponse( + List list, + String nextOffset, + String tpSiteUserDomain, + TpSiteUserService service, + UsersForTpSiteUserParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.tpSiteUserDomain = tpSiteUserDomain; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into UsersForTpSiteUserResponse object (no service context). Use this when + * you only need to read a single page (no nextPage()). + */ + public static UsersForTpSiteUserResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(TpSiteUserUsersForTpSiteUserItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new UsersForTpSiteUserResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse UsersForTpSiteUserResponse from JSON", e); + } + } + + /** + * Parse JSON response into UsersForTpSiteUserResponse object with service context for pagination + * (enables nextPage()). + */ + public static UsersForTpSiteUserResponse fromJson( + String json, + TpSiteUserService service, + UsersForTpSiteUserParams originalParams, + String tpSiteUserDomain, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(TpSiteUserUsersForTpSiteUserItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new UsersForTpSiteUserResponse( + list, nextOffset, tpSiteUserDomain, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse UsersForTpSiteUserResponse 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 UsersForTpSiteUserResponse 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)."); + } + + UsersForTpSiteUserParams nextParams = + (originalParams != null ? originalParams.toBuilder() : UsersForTpSiteUserParams.builder()) + .offset(nextOffset) + .build(); + + return service.usersForTpSiteUser(tpSiteUserDomain, 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 TpSiteUserUsersForTpSiteUserItem { + + private TpSiteUser tpSiteUser; + + public TpSiteUser getTpSiteUser() { + return tpSiteUser; + } + + public static TpSiteUserUsersForTpSiteUserItem fromJson(String json) { + TpSiteUserUsersForTpSiteUserItem item = new TpSiteUserUsersForTpSiteUserItem(); + + String __tpSiteUserJson = JsonUtil.getObject(json, "tp_site_user"); + if (__tpSiteUserJson != null) { + item.tpSiteUser = TpSiteUser.fromJson(__tpSiteUserJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/transaction/Transaction.java b/src/main/java/com/chargebee/v4/models/transaction/Transaction.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/transaction/Transaction.java rename to src/main/java/com/chargebee/v4/models/transaction/Transaction.java index 4ce96396..f68e2db6 100644 --- a/src/main/java/com/chargebee/v4/core/models/transaction/Transaction.java +++ b/src/main/java/com/chargebee/v4/models/transaction/Transaction.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.transaction; +package com.chargebee.v4.models.transaction; import com.chargebee.v4.internal.JsonUtil; import java.math.BigDecimal; @@ -316,6 +316,16 @@ public enum PaymentMethod { PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -450,6 +460,8 @@ public enum Gateway { DEUTSCHE_BANK("deutsche_bank"), + EZIDEBIT("ezidebit"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/transaction/params/DeleteOfflineTransactionParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/DeleteOfflineTransactionParams.java new file mode 100644 index 00000000..a8418299 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/transaction/params/DeleteOfflineTransactionParams.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.transaction.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class DeleteOfflineTransactionParams { + + private final String comment; + + private DeleteOfflineTransactionParams(DeleteOfflineTransactionBuilder builder) { + + this.comment = builder.comment; + } + + public String getComment() { + return comment; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + return formData; + } + + /** Create a new builder for DeleteOfflineTransactionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DeleteOfflineTransactionBuilder builder() { + return new DeleteOfflineTransactionBuilder(); + } + + public static final class DeleteOfflineTransactionBuilder { + + private String comment; + + private DeleteOfflineTransactionBuilder() {} + + public DeleteOfflineTransactionBuilder comment(String value) { + this.comment = value; + return this; + } + + public DeleteOfflineTransactionParams build() { + return new DeleteOfflineTransactionParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/transaction/params/SyncTransactionParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/SyncTransactionParams.java new file mode 100644 index 00000000..0a254ebb --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/transaction/params/SyncTransactionParams.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.transaction.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class SyncTransactionParams { + + private SyncTransactionParams(SyncTransactionBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for SyncTransactionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static SyncTransactionBuilder builder() { + return new SyncTransactionBuilder(); + } + + public static final class SyncTransactionBuilder { + + private SyncTransactionBuilder() {} + + public SyncTransactionParams build() { + return new SyncTransactionParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/transaction/params/TransactionCreateAuthorizationParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionCreateAuthorizationParams.java new file mode 100644 index 00000000..7a9acac7 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionCreateAuthorizationParams.java @@ -0,0 +1,120 @@ +/* + * 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.transaction.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class TransactionCreateAuthorizationParams { + + private final String customerId; + + private final String paymentSourceId; + + private final String currencyCode; + + private final Long amount; + + private TransactionCreateAuthorizationParams(TransactionCreateAuthorizationBuilder builder) { + + this.customerId = builder.customerId; + + this.paymentSourceId = builder.paymentSourceId; + + this.currencyCode = builder.currencyCode; + + this.amount = builder.amount; + } + + public String getCustomerId() { + return customerId; + } + + public String getPaymentSourceId() { + return paymentSourceId; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public Long getAmount() { + return amount; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.paymentSourceId != null) { + + formData.put("payment_source_id", this.paymentSourceId); + } + + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + return formData; + } + + /** Create a new builder for TransactionCreateAuthorizationParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionCreateAuthorizationBuilder builder() { + return new TransactionCreateAuthorizationBuilder(); + } + + public static final class TransactionCreateAuthorizationBuilder { + + private String customerId; + + private String paymentSourceId; + + private String currencyCode; + + private Long amount; + + private TransactionCreateAuthorizationBuilder() {} + + public TransactionCreateAuthorizationBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public TransactionCreateAuthorizationBuilder paymentSourceId(String value) { + this.paymentSourceId = value; + return this; + } + + public TransactionCreateAuthorizationBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public TransactionCreateAuthorizationBuilder amount(Long value) { + this.amount = value; + return this; + } + + public TransactionCreateAuthorizationParams build() { + return new TransactionCreateAuthorizationParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionListParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionListParams.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionListParams.java rename to src/main/java/com/chargebee/v4/models/transaction/params/TransactionListParams.java index 82b9ad3e..80eecd61 100644 --- a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionListParams.java +++ b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.transaction.params; +package com.chargebee.v4.models.transaction.params; import com.chargebee.v4.internal.Recommended; @@ -814,6 +814,16 @@ public enum PaymentMethodIs { PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + /** An enum member indicating that PaymentMethodIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -908,6 +918,16 @@ public enum PaymentMethodIsNot { PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + /** An enum member indicating that PaymentMethodIsNot was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1042,6 +1062,8 @@ public enum GatewayIs { DEUTSCHE_BANK("deutsche_bank"), + EZIDEBIT("ezidebit"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that GatewayIs was instantiated with an unknown value. */ @@ -1178,6 +1200,8 @@ public enum GatewayIsNot { DEUTSCHE_BANK("deutsche_bank"), + EZIDEBIT("ezidebit"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that GatewayIsNot was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionPaymentsForInvoiceParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionPaymentsForInvoiceParams.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionPaymentsForInvoiceParams.java rename to src/main/java/com/chargebee/v4/models/transaction/params/TransactionPaymentsForInvoiceParams.java index 1becc6f3..dd8b407e 100644 --- a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionPaymentsForInvoiceParams.java +++ b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionPaymentsForInvoiceParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.transaction.params; +package com.chargebee.v4.models.transaction.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/transaction/params/TransactionReconcileParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionReconcileParams.java new file mode 100644 index 00000000..4fcfe608 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionReconcileParams.java @@ -0,0 +1,128 @@ +/* + * 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.transaction.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class TransactionReconcileParams { + + private final String idAtGateway; + + private final String customerId; + + private final Status status; + + private TransactionReconcileParams(TransactionReconcileBuilder builder) { + + this.idAtGateway = builder.idAtGateway; + + this.customerId = builder.customerId; + + this.status = builder.status; + } + + public String getIdAtGateway() { + return idAtGateway; + } + + public String getCustomerId() { + return customerId; + } + + public Status getStatus() { + return status; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.idAtGateway != null) { + + formData.put("id_at_gateway", this.idAtGateway); + } + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + return formData; + } + + /** Create a new builder for TransactionReconcileParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionReconcileBuilder builder() { + return new TransactionReconcileBuilder(); + } + + public static final class TransactionReconcileBuilder { + + private String idAtGateway; + + private String customerId; + + private Status status; + + private TransactionReconcileBuilder() {} + + public TransactionReconcileBuilder idAtGateway(String value) { + this.idAtGateway = value; + return this; + } + + public TransactionReconcileBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public TransactionReconcileBuilder status(Status value) { + this.status = value; + return this; + } + + public TransactionReconcileParams build() { + return new TransactionReconcileParams(this); + } + } + + public enum Status { + SUCCESS("success"), + + FAILURE("failure"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/transaction/params/TransactionRecordRefundParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionRecordRefundParams.java new file mode 100644 index 00000000..73d6690f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionRecordRefundParams.java @@ -0,0 +1,201 @@ +/* + * 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.transaction.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class TransactionRecordRefundParams { + + private final Long amount; + + private final PaymentMethod paymentMethod; + + private final Timestamp date; + + private final String referenceNumber; + + private final String customPaymentMethodId; + + private final String comment; + + private TransactionRecordRefundParams(TransactionRecordRefundBuilder builder) { + + this.amount = builder.amount; + + this.paymentMethod = builder.paymentMethod; + + this.date = builder.date; + + this.referenceNumber = builder.referenceNumber; + + this.customPaymentMethodId = builder.customPaymentMethodId; + + this.comment = builder.comment; + } + + public Long getAmount() { + return amount; + } + + public PaymentMethod getPaymentMethod() { + return paymentMethod; + } + + public Timestamp getDate() { + return date; + } + + public String getReferenceNumber() { + return referenceNumber; + } + + public String getCustomPaymentMethodId() { + return customPaymentMethodId; + } + + public String getComment() { + return comment; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.paymentMethod != null) { + + formData.put("payment_method", this.paymentMethod); + } + + if (this.date != null) { + + formData.put("date", this.date); + } + + if (this.referenceNumber != null) { + + formData.put("reference_number", this.referenceNumber); + } + + if (this.customPaymentMethodId != null) { + + formData.put("custom_payment_method_id", this.customPaymentMethodId); + } + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + return formData; + } + + /** Create a new builder for TransactionRecordRefundParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionRecordRefundBuilder builder() { + return new TransactionRecordRefundBuilder(); + } + + public static final class TransactionRecordRefundBuilder { + + private Long amount; + + private PaymentMethod paymentMethod; + + private Timestamp date; + + private String referenceNumber; + + private String customPaymentMethodId; + + private String comment; + + private TransactionRecordRefundBuilder() {} + + public TransactionRecordRefundBuilder amount(Long value) { + this.amount = value; + return this; + } + + public TransactionRecordRefundBuilder paymentMethod(PaymentMethod value) { + this.paymentMethod = value; + return this; + } + + public TransactionRecordRefundBuilder date(Timestamp value) { + this.date = value; + return this; + } + + public TransactionRecordRefundBuilder referenceNumber(String value) { + this.referenceNumber = value; + return this; + } + + public TransactionRecordRefundBuilder customPaymentMethodId(String value) { + this.customPaymentMethodId = value; + return this; + } + + public TransactionRecordRefundBuilder comment(String value) { + this.comment = value; + return this; + } + + public TransactionRecordRefundParams build() { + return new TransactionRecordRefundParams(this); + } + } + + public enum PaymentMethod { + CASH("cash"), + + CHECK("check"), + + CHARGEBACK("chargeback"), + + BANK_TRANSFER("bank_transfer"), + + OTHER("other"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + CUSTOM("custom"), + + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethod enumValue : PaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/transaction/params/TransactionRefundParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionRefundParams.java new file mode 100644 index 00000000..d35f13a7 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionRefundParams.java @@ -0,0 +1,80 @@ +/* + * 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.transaction.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class TransactionRefundParams { + + private final Long amount; + + private final String comment; + + private TransactionRefundParams(TransactionRefundBuilder builder) { + + this.amount = builder.amount; + + this.comment = builder.comment; + } + + public Long getAmount() { + return amount; + } + + public String getComment() { + return comment; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + return formData; + } + + /** Create a new builder for TransactionRefundParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionRefundBuilder builder() { + return new TransactionRefundBuilder(); + } + + public static final class TransactionRefundBuilder { + + private Long amount; + + private String comment; + + private TransactionRefundBuilder() {} + + public TransactionRefundBuilder amount(Long value) { + this.amount = value; + return this; + } + + public TransactionRefundBuilder comment(String value) { + this.comment = value; + return this; + } + + public TransactionRefundParams build() { + return new TransactionRefundParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionRetrieveParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/transaction/params/TransactionRetrieveParams.java index 8e14af54..b4260a89 100644 --- a/src/main/java/com/chargebee/v4/core/models/transaction/params/TransactionRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.transaction.params; +package com.chargebee.v4.models.transaction.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/transaction/params/TransactionsForCustomerParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionsForCustomerParams.java new file mode 100644 index 00000000..348c99b9 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionsForCustomerParams.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.transaction.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class TransactionsForCustomerParams { + + private final Map queryParams; + + private TransactionsForCustomerParams(TransactionsForCustomerBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public TransactionsForCustomerBuilder toBuilder() { + TransactionsForCustomerBuilder builder = new TransactionsForCustomerBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for TransactionsForCustomerParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionsForCustomerBuilder builder() { + return new TransactionsForCustomerBuilder(); + } + + public static final class TransactionsForCustomerBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private TransactionsForCustomerBuilder() {} + + public TransactionsForCustomerBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public TransactionsForCustomerBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public TransactionsForCustomerParams build() { + return new TransactionsForCustomerParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/transaction/params/TransactionsForSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionsForSubscriptionParams.java new file mode 100644 index 00000000..77b18131 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionsForSubscriptionParams.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.transaction.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class TransactionsForSubscriptionParams { + + private final Map queryParams; + + private TransactionsForSubscriptionParams(TransactionsForSubscriptionBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public TransactionsForSubscriptionBuilder toBuilder() { + TransactionsForSubscriptionBuilder builder = new TransactionsForSubscriptionBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for TransactionsForSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TransactionsForSubscriptionBuilder builder() { + return new TransactionsForSubscriptionBuilder(); + } + + public static final class TransactionsForSubscriptionBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private TransactionsForSubscriptionBuilder() {} + + public TransactionsForSubscriptionBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public TransactionsForSubscriptionBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public TransactionsForSubscriptionParams build() { + return new TransactionsForSubscriptionParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/transaction/params/VoidTransactionParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/VoidTransactionParams.java new file mode 100644 index 00000000..d1809839 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/transaction/params/VoidTransactionParams.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.transaction.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class VoidTransactionParams { + + private VoidTransactionParams(VoidTransactionBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for VoidTransactionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static VoidTransactionBuilder builder() { + return new VoidTransactionBuilder(); + } + + public static final class VoidTransactionBuilder { + + private VoidTransactionBuilder() {} + + public VoidTransactionParams build() { + return new VoidTransactionParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/transaction/responses/DeleteOfflineTransactionResponse.java b/src/main/java/com/chargebee/v4/models/transaction/responses/DeleteOfflineTransactionResponse.java new file mode 100644 index 00000000..4681b5bd --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/transaction/responses/DeleteOfflineTransactionResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.transaction.responses; + +import com.chargebee.v4.models.transaction.Transaction; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for DeleteOfflineTransaction operation. Contains the response data from + * the API. + */ +public final class DeleteOfflineTransactionResponse extends BaseResponse { + private final Transaction transaction; + + private DeleteOfflineTransactionResponse(Builder builder) { + super(builder.httpResponse); + + this.transaction = builder.transaction; + } + + /** Parse JSON response into DeleteOfflineTransactionResponse object. */ + public static DeleteOfflineTransactionResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into DeleteOfflineTransactionResponse object with HTTP response. */ + public static DeleteOfflineTransactionResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __transactionJson = JsonUtil.getObject(json, "transaction"); + if (__transactionJson != null) { + builder.transaction(Transaction.fromJson(__transactionJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse DeleteOfflineTransactionResponse from JSON", e); + } + } + + /** Create a new builder for DeleteOfflineTransactionResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for DeleteOfflineTransactionResponse. */ + public static class Builder { + + private Transaction transaction; + + private Response httpResponse; + + private Builder() {} + + public Builder transaction(Transaction transaction) { + this.transaction = transaction; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public DeleteOfflineTransactionResponse build() { + return new DeleteOfflineTransactionResponse(this); + } + } + + /** Get the transaction from the response. */ + public Transaction getTransaction() { + return transaction; + } +} diff --git a/src/main/java/com/chargebee/v4/models/transaction/responses/SyncTransactionResponse.java b/src/main/java/com/chargebee/v4/models/transaction/responses/SyncTransactionResponse.java new file mode 100644 index 00000000..c251bf61 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/transaction/responses/SyncTransactionResponse.java @@ -0,0 +1,76 @@ +package com.chargebee.v4.models.transaction.responses; + +import com.chargebee.v4.models.transaction.Transaction; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for SyncTransaction operation. Contains the response data from the API. + */ +public final class SyncTransactionResponse extends BaseResponse { + private final Transaction transaction; + + private SyncTransactionResponse(Builder builder) { + super(builder.httpResponse); + + this.transaction = builder.transaction; + } + + /** Parse JSON response into SyncTransactionResponse object. */ + public static SyncTransactionResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into SyncTransactionResponse object with HTTP response. */ + public static SyncTransactionResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __transactionJson = JsonUtil.getObject(json, "transaction"); + if (__transactionJson != null) { + builder.transaction(Transaction.fromJson(__transactionJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse SyncTransactionResponse from JSON", e); + } + } + + /** Create a new builder for SyncTransactionResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SyncTransactionResponse. */ + public static class Builder { + + private Transaction transaction; + + private Response httpResponse; + + private Builder() {} + + public Builder transaction(Transaction transaction) { + this.transaction = transaction; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public SyncTransactionResponse build() { + return new SyncTransactionResponse(this); + } + } + + /** Get the transaction from the response. */ + public Transaction getTransaction() { + return transaction; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionCreateAuthorizationResponse.java b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionCreateAuthorizationResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/transaction/TransactionCreateAuthorizationResponse.java rename to src/main/java/com/chargebee/v4/models/transaction/responses/TransactionCreateAuthorizationResponse.java index 0f48d79b..f9dc9311 100644 --- a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionCreateAuthorizationResponse.java +++ b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionCreateAuthorizationResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.transaction; +package com.chargebee.v4.models.transaction.responses; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionListResponse.java b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/transaction/TransactionListResponse.java rename to src/main/java/com/chargebee/v4/models/transaction/responses/TransactionListResponse.java index e14e77e1..2918150c 100644 --- a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionListResponse.java +++ b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.transaction; +package com.chargebee.v4.models.transaction.responses; import java.util.List; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.TransactionService; -import com.chargebee.v4.core.models.transaction.params.TransactionListParams; +import com.chargebee.v4.services.TransactionService; +import com.chargebee.v4.models.transaction.params.TransactionListParams; /** Immutable response object for TransactionList operation. Contains paginated list data. */ public final class TransactionListResponse { @@ -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 TransactionListResponse nextPage() throws Exception { + public TransactionListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionPaymentsForInvoiceResponse.java b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionPaymentsForInvoiceResponse.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/responses/transaction/TransactionPaymentsForInvoiceResponse.java rename to src/main/java/com/chargebee/v4/models/transaction/responses/TransactionPaymentsForInvoiceResponse.java index 4f3ccf99..655917f5 100644 --- a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionPaymentsForInvoiceResponse.java +++ b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionPaymentsForInvoiceResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.transaction; +package com.chargebee.v4.models.transaction.responses; import java.util.List; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.TransactionService; -import com.chargebee.v4.core.models.transaction.params.TransactionPaymentsForInvoiceParams; +import com.chargebee.v4.services.TransactionService; +import com.chargebee.v4.models.transaction.params.TransactionPaymentsForInvoiceParams; /** * Immutable response object for TransactionPaymentsForInvoice operation. Contains paginated list @@ -110,9 +111,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 TransactionPaymentsForInvoiceResponse nextPage() throws Exception { + public TransactionPaymentsForInvoiceResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionReconcileResponse.java b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionReconcileResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/transaction/TransactionReconcileResponse.java rename to src/main/java/com/chargebee/v4/models/transaction/responses/TransactionReconcileResponse.java index 4dc3d0de..2a5dabf3 100644 --- a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionReconcileResponse.java +++ b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionReconcileResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.transaction; +package com.chargebee.v4.models.transaction.responses; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionRecordRefundResponse.java b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionRecordRefundResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/transaction/TransactionRecordRefundResponse.java rename to src/main/java/com/chargebee/v4/models/transaction/responses/TransactionRecordRefundResponse.java index 72f3bdac..8e4faa07 100644 --- a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionRecordRefundResponse.java +++ b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionRecordRefundResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.transaction; +package com.chargebee.v4.models.transaction.responses; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionRefundResponse.java b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionRefundResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/transaction/TransactionRefundResponse.java rename to src/main/java/com/chargebee/v4/models/transaction/responses/TransactionRefundResponse.java index 3aa39f7d..8e8b9792 100644 --- a/src/main/java/com/chargebee/v4/core/responses/transaction/TransactionRefundResponse.java +++ b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionRefundResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.transaction; +package com.chargebee.v4.models.transaction.responses; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionRetrieveResponse.java new file mode 100644 index 00000000..2961c7c1 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.transaction.responses; + +import com.chargebee.v4.models.transaction.Transaction; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for TransactionRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class TransactionRetrieveResponse extends BaseResponse { + private final Transaction transaction; + + private TransactionRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.transaction = builder.transaction; + } + + /** Parse JSON response into TransactionRetrieveResponse object. */ + public static TransactionRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into TransactionRetrieveResponse object with HTTP response. */ + public static TransactionRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __transactionJson = JsonUtil.getObject(json, "transaction"); + if (__transactionJson != null) { + builder.transaction(Transaction.fromJson(__transactionJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse TransactionRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for TransactionRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for TransactionRetrieveResponse. */ + public static class Builder { + + private Transaction transaction; + + private Response httpResponse; + + private Builder() {} + + public Builder transaction(Transaction transaction) { + this.transaction = transaction; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public TransactionRetrieveResponse build() { + return new TransactionRetrieveResponse(this); + } + } + + /** Get the transaction from the response. */ + public Transaction getTransaction() { + return transaction; + } +} diff --git a/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionsForCustomerResponse.java b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionsForCustomerResponse.java new file mode 100644 index 00000000..5f2c8651 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionsForCustomerResponse.java @@ -0,0 +1,176 @@ +package com.chargebee.v4.models.transaction.responses; + +import java.util.List; + +import com.chargebee.v4.models.transaction.Transaction; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.TransactionService; +import com.chargebee.v4.models.transaction.params.TransactionsForCustomerParams; + +/** + * Immutable response object for TransactionsForCustomer operation. Contains paginated list data. + */ +public final class TransactionsForCustomerResponse { + + private final List list; + + private final String nextOffset; + + private final String customerId; + + private final TransactionService service; + private final TransactionsForCustomerParams originalParams; + private final Response httpResponse; + + private TransactionsForCustomerResponse( + List list, + String nextOffset, + String customerId, + TransactionService service, + TransactionsForCustomerParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.customerId = customerId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into TransactionsForCustomerResponse object (no service context). Use this + * when you only need to read a single page (no nextPage()). + */ + public static TransactionsForCustomerResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(TransactionTransactionsForCustomerItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new TransactionsForCustomerResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse TransactionsForCustomerResponse from JSON", e); + } + } + + /** + * Parse JSON response into TransactionsForCustomerResponse object with service context for + * pagination (enables nextPage()). + */ + public static TransactionsForCustomerResponse fromJson( + String json, + TransactionService service, + TransactionsForCustomerParams originalParams, + String customerId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(TransactionTransactionsForCustomerItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new TransactionsForCustomerResponse( + list, nextOffset, customerId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse TransactionsForCustomerResponse 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 TransactionsForCustomerResponse 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)."); + } + + TransactionsForCustomerParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : TransactionsForCustomerParams.builder()) + .offset(nextOffset) + .build(); + + return service.transactionsForCustomer(customerId, 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 TransactionTransactionsForCustomerItem { + + private Transaction transaction; + + public Transaction getTransaction() { + return transaction; + } + + public static TransactionTransactionsForCustomerItem fromJson(String json) { + TransactionTransactionsForCustomerItem item = new TransactionTransactionsForCustomerItem(); + + String __transactionJson = JsonUtil.getObject(json, "transaction"); + if (__transactionJson != null) { + item.transaction = Transaction.fromJson(__transactionJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionsForSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionsForSubscriptionResponse.java new file mode 100644 index 00000000..6607d906 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/transaction/responses/TransactionsForSubscriptionResponse.java @@ -0,0 +1,180 @@ +package com.chargebee.v4.models.transaction.responses; + +import java.util.List; + +import com.chargebee.v4.models.transaction.Transaction; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.TransactionService; +import com.chargebee.v4.models.transaction.params.TransactionsForSubscriptionParams; + +/** + * Immutable response object for TransactionsForSubscription operation. Contains paginated list + * data. + */ +public final class TransactionsForSubscriptionResponse { + + private final List list; + + private final String nextOffset; + + private final String subscriptionId; + + private final TransactionService service; + private final TransactionsForSubscriptionParams originalParams; + private final Response httpResponse; + + private TransactionsForSubscriptionResponse( + List list, + String nextOffset, + String subscriptionId, + TransactionService service, + TransactionsForSubscriptionParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.subscriptionId = subscriptionId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into TransactionsForSubscriptionResponse object (no service context). Use + * this when you only need to read a single page (no nextPage()). + */ + public static TransactionsForSubscriptionResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(TransactionTransactionsForSubscriptionItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new TransactionsForSubscriptionResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse TransactionsForSubscriptionResponse from JSON", e); + } + } + + /** + * Parse JSON response into TransactionsForSubscriptionResponse object with service context for + * pagination (enables nextPage()). + */ + public static TransactionsForSubscriptionResponse fromJson( + String json, + TransactionService service, + TransactionsForSubscriptionParams originalParams, + String subscriptionId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(TransactionTransactionsForSubscriptionItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new TransactionsForSubscriptionResponse( + list, nextOffset, subscriptionId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse TransactionsForSubscriptionResponse 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 TransactionsForSubscriptionResponse 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)."); + } + + TransactionsForSubscriptionParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : TransactionsForSubscriptionParams.builder()) + .offset(nextOffset) + .build(); + + return service.transactionsForSubscription(subscriptionId, 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 TransactionTransactionsForSubscriptionItem { + + private Transaction transaction; + + public Transaction getTransaction() { + return transaction; + } + + public static TransactionTransactionsForSubscriptionItem fromJson(String json) { + TransactionTransactionsForSubscriptionItem item = + new TransactionTransactionsForSubscriptionItem(); + + String __transactionJson = JsonUtil.getObject(json, "transaction"); + if (__transactionJson != null) { + item.transaction = Transaction.fromJson(__transactionJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/transaction/responses/VoidTransactionResponse.java b/src/main/java/com/chargebee/v4/models/transaction/responses/VoidTransactionResponse.java new file mode 100644 index 00000000..f7f86136 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/transaction/responses/VoidTransactionResponse.java @@ -0,0 +1,76 @@ +package com.chargebee.v4.models.transaction.responses; + +import com.chargebee.v4.models.transaction.Transaction; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for VoidTransaction operation. Contains the response data from the API. + */ +public final class VoidTransactionResponse extends BaseResponse { + private final Transaction transaction; + + private VoidTransactionResponse(Builder builder) { + super(builder.httpResponse); + + this.transaction = builder.transaction; + } + + /** Parse JSON response into VoidTransactionResponse object. */ + public static VoidTransactionResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into VoidTransactionResponse object with HTTP response. */ + public static VoidTransactionResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __transactionJson = JsonUtil.getObject(json, "transaction"); + if (__transactionJson != null) { + builder.transaction(Transaction.fromJson(__transactionJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse VoidTransactionResponse from JSON", e); + } + } + + /** Create a new builder for VoidTransactionResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for VoidTransactionResponse. */ + public static class Builder { + + private Transaction transaction; + + private Response httpResponse; + + private Builder() {} + + public Builder transaction(Transaction transaction) { + this.transaction = transaction; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public VoidTransactionResponse build() { + return new VoidTransactionResponse(this); + } + } + + /** Get the transaction from the response. */ + public Transaction getTransaction() { + return transaction; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/unbilledCharge/UnbilledCharge.java b/src/main/java/com/chargebee/v4/models/unbilledCharge/UnbilledCharge.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/unbilledCharge/UnbilledCharge.java rename to src/main/java/com/chargebee/v4/models/unbilledCharge/UnbilledCharge.java index ee507db2..ad2381d9 100644 --- a/src/main/java/com/chargebee/v4/core/models/unbilledCharge/UnbilledCharge.java +++ b/src/main/java/com/chargebee/v4/models/unbilledCharge/UnbilledCharge.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.unbilledCharge; +package com.chargebee.v4.models.unbilledCharge; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/unbilledCharge/params/CreateUnbilledChargeParams.java b/src/main/java/com/chargebee/v4/models/unbilledCharge/params/CreateUnbilledChargeParams.java new file mode 100644 index 00000000..64656b82 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/unbilledCharge/params/CreateUnbilledChargeParams.java @@ -0,0 +1,748 @@ +/* + * 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.unbilledCharge.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class CreateUnbilledChargeParams { + + private final String subscriptionId; + + private final String currencyCode; + + private final List addons; + + private final List charges; + + private final List taxProvidersFields; + + private CreateUnbilledChargeParams(CreateUnbilledChargeBuilder builder) { + + this.subscriptionId = builder.subscriptionId; + + this.currencyCode = builder.currencyCode; + + this.addons = builder.addons; + + this.charges = builder.charges; + + this.taxProvidersFields = builder.taxProvidersFields; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public List getAddons() { + return addons; + } + + public List getCharges() { + return charges; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + /** 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.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.addons != null) { + + // List of objects + for (int i = 0; i < this.addons.size(); i++) { + AddonsParams item = this.addons.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "addons[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.charges != null) { + + // List of objects + for (int i = 0; i < this.charges.size(); i++) { + ChargesParams item = this.charges.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for CreateUnbilledChargeParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreateUnbilledChargeBuilder builder() { + return new CreateUnbilledChargeBuilder(); + } + + public static final class CreateUnbilledChargeBuilder { + + private String subscriptionId; + + private String currencyCode; + + private List addons; + + private List charges; + + private List taxProvidersFields; + + private CreateUnbilledChargeBuilder() {} + + public CreateUnbilledChargeBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public CreateUnbilledChargeBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public CreateUnbilledChargeBuilder addons(List value) { + this.addons = value; + return this; + } + + public CreateUnbilledChargeBuilder charges(List value) { + this.charges = value; + return this; + } + + public CreateUnbilledChargeBuilder taxProvidersFields(List value) { + this.taxProvidersFields = value; + return this; + } + + public CreateUnbilledChargeParams build() { + return new CreateUnbilledChargeParams(this); + } + } + + public static final class AddonsParams { + + private final String id; + + private final Integer quantity; + + private final Long unitPrice; + + private final String quantityInDecimal; + + private final String unitPriceInDecimal; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private AddonsParams(AddonsBuilder builder) { + + this.id = builder.id; + + this.quantity = builder.quantity; + + this.unitPrice = builder.unitPrice; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public String getId() { + return id; + } + + public Integer getQuantity() { + return quantity; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for AddonsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AddonsBuilder builder() { + return new AddonsBuilder(); + } + + public static final class AddonsBuilder { + + private String id; + + private Integer quantity; + + private Long unitPrice; + + private String quantityInDecimal; + + private String unitPriceInDecimal; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private AddonsBuilder() {} + + public AddonsBuilder id(String value) { + this.id = value; + return this; + } + + public AddonsBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public AddonsBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public AddonsBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public AddonsBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public AddonsBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public AddonsBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public AddonsParams build() { + return new AddonsParams(this); + } + } + } + + public static final class ChargesParams { + + private final Long amount; + + private final String amountInDecimal; + + private final String description; + + private final Boolean taxable; + + private final String taxProfileId; + + private final String avalaraTaxCode; + + private final String hsnCode; + + private final String taxjarProductCode; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private ChargesParams(ChargesBuilder builder) { + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.description = builder.description; + + this.taxable = builder.taxable; + + this.taxProfileId = builder.taxProfileId; + + this.avalaraTaxCode = builder.avalaraTaxCode; + + this.hsnCode = builder.hsnCode; + + this.taxjarProductCode = builder.taxjarProductCode; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getDescription() { + return description; + } + + public Boolean getTaxable() { + return taxable; + } + + public String getTaxProfileId() { + return taxProfileId; + } + + public String getAvalaraTaxCode() { + return avalaraTaxCode; + } + + public String getHsnCode() { + return hsnCode; + } + + public String getTaxjarProductCode() { + return taxjarProductCode; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.taxable != null) { + + formData.put("taxable", this.taxable); + } + + if (this.taxProfileId != null) { + + formData.put("tax_profile_id", this.taxProfileId); + } + + if (this.avalaraTaxCode != null) { + + formData.put("avalara_tax_code", this.avalaraTaxCode); + } + + if (this.hsnCode != null) { + + formData.put("hsn_code", this.hsnCode); + } + + if (this.taxjarProductCode != null) { + + formData.put("taxjar_product_code", this.taxjarProductCode); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for ChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargesBuilder builder() { + return new ChargesBuilder(); + } + + public static final class ChargesBuilder { + + private Long amount; + + private String amountInDecimal; + + private String description; + + private Boolean taxable; + + private String taxProfileId; + + private String avalaraTaxCode; + + private String hsnCode; + + private String taxjarProductCode; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private ChargesBuilder() {} + + public ChargesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public ChargesBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public ChargesBuilder description(String value) { + this.description = value; + return this; + } + + public ChargesBuilder taxable(Boolean value) { + this.taxable = value; + return this; + } + + public ChargesBuilder taxProfileId(String value) { + this.taxProfileId = value; + return this; + } + + public ChargesBuilder avalaraTaxCode(String value) { + this.avalaraTaxCode = value; + return this; + } + + public ChargesBuilder hsnCode(String value) { + this.hsnCode = value; + return this; + } + + public ChargesBuilder taxjarProductCode(String value) { + this.taxjarProductCode = value; + return this; + } + + public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public ChargesBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public ChargesBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public ChargesBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public ChargesBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public ChargesParams build() { + return new ChargesParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/unbilledCharge/params/InvoiceUnbilledChargesParams.java b/src/main/java/com/chargebee/v4/models/unbilledCharge/params/InvoiceUnbilledChargesParams.java new file mode 100644 index 00000000..f90efa5c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/unbilledCharge/params/InvoiceUnbilledChargesParams.java @@ -0,0 +1,80 @@ +/* + * 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.unbilledCharge.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InvoiceUnbilledChargesParams { + + private final String subscriptionId; + + private final String customerId; + + private InvoiceUnbilledChargesParams(InvoiceUnbilledChargesBuilder builder) { + + this.subscriptionId = builder.subscriptionId; + + this.customerId = builder.customerId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getCustomerId() { + return customerId; + } + + /** 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.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + return formData; + } + + /** Create a new builder for InvoiceUnbilledChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceUnbilledChargesBuilder builder() { + return new InvoiceUnbilledChargesBuilder(); + } + + public static final class InvoiceUnbilledChargesBuilder { + + private String subscriptionId; + + private String customerId; + + private InvoiceUnbilledChargesBuilder() {} + + public InvoiceUnbilledChargesBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public InvoiceUnbilledChargesBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public InvoiceUnbilledChargesParams build() { + return new InvoiceUnbilledChargesParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/unbilledCharge/params/UnbilledChargeCreateParams.java b/src/main/java/com/chargebee/v4/models/unbilledCharge/params/UnbilledChargeCreateParams.java new file mode 100644 index 00000000..497d1151 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/unbilledCharge/params/UnbilledChargeCreateParams.java @@ -0,0 +1,1016 @@ +/* + * 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.unbilledCharge.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class UnbilledChargeCreateParams { + + private final String subscriptionId; + + private final String currencyCode; + + private final List itemPrices; + + private final List itemTiers; + + private final List charges; + + private final List taxProvidersFields; + + private UnbilledChargeCreateParams(UnbilledChargeCreateBuilder builder) { + + this.subscriptionId = builder.subscriptionId; + + this.currencyCode = builder.currencyCode; + + this.itemPrices = builder.itemPrices; + + this.itemTiers = builder.itemTiers; + + this.charges = builder.charges; + + this.taxProvidersFields = builder.taxProvidersFields; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public List getItemPrices() { + return itemPrices; + } + + public List getItemTiers() { + return itemTiers; + } + + public List getCharges() { + return charges; + } + + public List getTaxProvidersFields() { + return taxProvidersFields; + } + + /** 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.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + + if (this.itemPrices != null) { + + // List of objects + for (int i = 0; i < this.itemPrices.size(); i++) { + ItemPricesParams item = this.itemPrices.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_prices[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.itemTiers != null) { + + // List of objects + for (int i = 0; i < this.itemTiers.size(); i++) { + ItemTiersParams item = this.itemTiers.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "item_tiers[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.charges != null) { + + // List of objects + for (int i = 0; i < this.charges.size(); i++) { + ChargesParams item = this.charges.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "charges[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + if (this.taxProvidersFields != null) { + + // List of objects + for (int i = 0; i < this.taxProvidersFields.size(); i++) { + TaxProvidersFieldsParams item = this.taxProvidersFields.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "tax_providers_fields[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for UnbilledChargeCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UnbilledChargeCreateBuilder builder() { + return new UnbilledChargeCreateBuilder(); + } + + public static final class UnbilledChargeCreateBuilder { + + private String subscriptionId; + + private String currencyCode; + + private List itemPrices; + + private List itemTiers; + + private List charges; + + private List taxProvidersFields; + + private UnbilledChargeCreateBuilder() {} + + public UnbilledChargeCreateBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public UnbilledChargeCreateBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + + public UnbilledChargeCreateBuilder itemPrices(List value) { + this.itemPrices = value; + return this; + } + + public UnbilledChargeCreateBuilder itemTiers(List value) { + this.itemTiers = value; + return this; + } + + public UnbilledChargeCreateBuilder charges(List value) { + this.charges = value; + return this; + } + + public UnbilledChargeCreateBuilder taxProvidersFields(List value) { + this.taxProvidersFields = value; + return this; + } + + public UnbilledChargeCreateParams build() { + return new UnbilledChargeCreateParams(this); + } + } + + public static final class ItemPricesParams { + + private final String itemPriceId; + + private final Integer quantity; + + private final String quantityInDecimal; + + private final Long unitPrice; + + private final String unitPriceInDecimal; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private ItemPricesParams(ItemPricesBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.quantityInDecimal = builder.quantityInDecimal; + + this.unitPrice = builder.unitPrice; + + this.unitPriceInDecimal = builder.unitPriceInDecimal; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getQuantity() { + return quantity; + } + + public String getQuantityInDecimal() { + return quantityInDecimal; + } + + public Long getUnitPrice() { + return unitPrice; + } + + public String getUnitPriceInDecimal() { + return unitPriceInDecimal; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.quantityInDecimal != null) { + + formData.put("quantity_in_decimal", this.quantityInDecimal); + } + + if (this.unitPrice != null) { + + formData.put("unit_price", this.unitPrice); + } + + if (this.unitPriceInDecimal != null) { + + formData.put("unit_price_in_decimal", this.unitPriceInDecimal); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for ItemPricesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemPricesBuilder builder() { + return new ItemPricesBuilder(); + } + + public static final class ItemPricesBuilder { + + private String itemPriceId; + + private Integer quantity; + + private String quantityInDecimal; + + private Long unitPrice; + + private String unitPriceInDecimal; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private ItemPricesBuilder() {} + + public ItemPricesBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemPricesBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + + public ItemPricesBuilder quantityInDecimal(String value) { + this.quantityInDecimal = value; + return this; + } + + public ItemPricesBuilder unitPrice(Long value) { + this.unitPrice = value; + return this; + } + + public ItemPricesBuilder unitPriceInDecimal(String value) { + this.unitPriceInDecimal = value; + return this; + } + + public ItemPricesBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public ItemPricesBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public ItemPricesParams build() { + return new ItemPricesParams(this); + } + } + } + + public static final class ItemTiersParams { + + private final String itemPriceId; + + private final Integer startingUnit; + + private final Integer endingUnit; + + private final Long price; + + private final String startingUnitInDecimal; + + private final String endingUnitInDecimal; + + private final String priceInDecimal; + + private final PricingType pricingType; + + private final Integer packageSize; + + private ItemTiersParams(ItemTiersBuilder builder) { + + this.itemPriceId = builder.itemPriceId; + + this.startingUnit = builder.startingUnit; + + this.endingUnit = builder.endingUnit; + + this.price = builder.price; + + this.startingUnitInDecimal = builder.startingUnitInDecimal; + + this.endingUnitInDecimal = builder.endingUnitInDecimal; + + this.priceInDecimal = builder.priceInDecimal; + + this.pricingType = builder.pricingType; + + this.packageSize = builder.packageSize; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public Integer getStartingUnit() { + return startingUnit; + } + + public Integer getEndingUnit() { + return endingUnit; + } + + public Long getPrice() { + return price; + } + + public String getStartingUnitInDecimal() { + return startingUnitInDecimal; + } + + public String getEndingUnitInDecimal() { + return endingUnitInDecimal; + } + + public String getPriceInDecimal() { + return priceInDecimal; + } + + public PricingType getPricingType() { + return pricingType; + } + + public Integer getPackageSize() { + return packageSize; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.startingUnit != null) { + + formData.put("starting_unit", this.startingUnit); + } + + if (this.endingUnit != null) { + + formData.put("ending_unit", this.endingUnit); + } + + if (this.price != null) { + + formData.put("price", this.price); + } + + if (this.startingUnitInDecimal != null) { + + formData.put("starting_unit_in_decimal", this.startingUnitInDecimal); + } + + if (this.endingUnitInDecimal != null) { + + formData.put("ending_unit_in_decimal", this.endingUnitInDecimal); + } + + if (this.priceInDecimal != null) { + + formData.put("price_in_decimal", this.priceInDecimal); + } + + if (this.pricingType != null) { + + formData.put("pricing_type", this.pricingType); + } + + if (this.packageSize != null) { + + formData.put("package_size", this.packageSize); + } + + return formData; + } + + /** Create a new builder for ItemTiersParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ItemTiersBuilder builder() { + return new ItemTiersBuilder(); + } + + public static final class ItemTiersBuilder { + + private String itemPriceId; + + private Integer startingUnit; + + private Integer endingUnit; + + private Long price; + + private String startingUnitInDecimal; + + private String endingUnitInDecimal; + + private String priceInDecimal; + + private PricingType pricingType; + + private Integer packageSize; + + private ItemTiersBuilder() {} + + public ItemTiersBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public ItemTiersBuilder startingUnit(Integer value) { + this.startingUnit = value; + return this; + } + + public ItemTiersBuilder endingUnit(Integer value) { + this.endingUnit = value; + return this; + } + + public ItemTiersBuilder price(Long value) { + this.price = value; + return this; + } + + public ItemTiersBuilder startingUnitInDecimal(String value) { + this.startingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder endingUnitInDecimal(String value) { + this.endingUnitInDecimal = value; + return this; + } + + public ItemTiersBuilder priceInDecimal(String value) { + this.priceInDecimal = value; + return this; + } + + public ItemTiersBuilder pricingType(PricingType value) { + this.pricingType = value; + return this; + } + + public ItemTiersBuilder packageSize(Integer value) { + this.packageSize = value; + return this; + } + + public ItemTiersParams build() { + return new ItemTiersParams(this); + } + } + + public enum PricingType { + PER_UNIT("per_unit"), + + FLAT_FEE("flat_fee"), + + PACKAGE("package"), + + /** An enum member indicating that PricingType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingType enumValue : PricingType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class ChargesParams { + + private final Long amount; + + private final String amountInDecimal; + + private final String description; + + private final Boolean taxable; + + private final String taxProfileId; + + private final String avalaraTaxCode; + + private final String hsnCode; + + private final String taxjarProductCode; + + private final AvalaraSaleType avalaraSaleType; + + private final Integer avalaraTransactionType; + + private final Integer avalaraServiceType; + + private final Timestamp dateFrom; + + private final Timestamp dateTo; + + private ChargesParams(ChargesBuilder builder) { + + this.amount = builder.amount; + + this.amountInDecimal = builder.amountInDecimal; + + this.description = builder.description; + + this.taxable = builder.taxable; + + this.taxProfileId = builder.taxProfileId; + + this.avalaraTaxCode = builder.avalaraTaxCode; + + this.hsnCode = builder.hsnCode; + + this.taxjarProductCode = builder.taxjarProductCode; + + this.avalaraSaleType = builder.avalaraSaleType; + + this.avalaraTransactionType = builder.avalaraTransactionType; + + this.avalaraServiceType = builder.avalaraServiceType; + + this.dateFrom = builder.dateFrom; + + this.dateTo = builder.dateTo; + } + + public Long getAmount() { + return amount; + } + + public String getAmountInDecimal() { + return amountInDecimal; + } + + public String getDescription() { + return description; + } + + public Boolean getTaxable() { + return taxable; + } + + public String getTaxProfileId() { + return taxProfileId; + } + + public String getAvalaraTaxCode() { + return avalaraTaxCode; + } + + public String getHsnCode() { + return hsnCode; + } + + public String getTaxjarProductCode() { + return taxjarProductCode; + } + + public AvalaraSaleType getAvalaraSaleType() { + return avalaraSaleType; + } + + public Integer getAvalaraTransactionType() { + return avalaraTransactionType; + } + + public Integer getAvalaraServiceType() { + return avalaraServiceType; + } + + public Timestamp getDateFrom() { + return dateFrom; + } + + public Timestamp getDateTo() { + return dateTo; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.amount != null) { + + formData.put("amount", this.amount); + } + + if (this.amountInDecimal != null) { + + formData.put("amount_in_decimal", this.amountInDecimal); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.taxable != null) { + + formData.put("taxable", this.taxable); + } + + if (this.taxProfileId != null) { + + formData.put("tax_profile_id", this.taxProfileId); + } + + if (this.avalaraTaxCode != null) { + + formData.put("avalara_tax_code", this.avalaraTaxCode); + } + + if (this.hsnCode != null) { + + formData.put("hsn_code", this.hsnCode); + } + + if (this.taxjarProductCode != null) { + + formData.put("taxjar_product_code", this.taxjarProductCode); + } + + if (this.avalaraSaleType != null) { + + formData.put("avalara_sale_type", this.avalaraSaleType); + } + + if (this.avalaraTransactionType != null) { + + formData.put("avalara_transaction_type", this.avalaraTransactionType); + } + + if (this.avalaraServiceType != null) { + + formData.put("avalara_service_type", this.avalaraServiceType); + } + + if (this.dateFrom != null) { + + formData.put("date_from", this.dateFrom); + } + + if (this.dateTo != null) { + + formData.put("date_to", this.dateTo); + } + + return formData; + } + + /** Create a new builder for ChargesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ChargesBuilder builder() { + return new ChargesBuilder(); + } + + public static final class ChargesBuilder { + + private Long amount; + + private String amountInDecimal; + + private String description; + + private Boolean taxable; + + private String taxProfileId; + + private String avalaraTaxCode; + + private String hsnCode; + + private String taxjarProductCode; + + private AvalaraSaleType avalaraSaleType; + + private Integer avalaraTransactionType; + + private Integer avalaraServiceType; + + private Timestamp dateFrom; + + private Timestamp dateTo; + + private ChargesBuilder() {} + + public ChargesBuilder amount(Long value) { + this.amount = value; + return this; + } + + public ChargesBuilder amountInDecimal(String value) { + this.amountInDecimal = value; + return this; + } + + public ChargesBuilder description(String value) { + this.description = value; + return this; + } + + public ChargesBuilder taxable(Boolean value) { + this.taxable = value; + return this; + } + + public ChargesBuilder taxProfileId(String value) { + this.taxProfileId = value; + return this; + } + + public ChargesBuilder avalaraTaxCode(String value) { + this.avalaraTaxCode = value; + return this; + } + + public ChargesBuilder hsnCode(String value) { + this.hsnCode = value; + return this; + } + + public ChargesBuilder taxjarProductCode(String value) { + this.taxjarProductCode = value; + return this; + } + + public ChargesBuilder avalaraSaleType(AvalaraSaleType value) { + this.avalaraSaleType = value; + return this; + } + + public ChargesBuilder avalaraTransactionType(Integer value) { + this.avalaraTransactionType = value; + return this; + } + + public ChargesBuilder avalaraServiceType(Integer value) { + this.avalaraServiceType = value; + return this; + } + + public ChargesBuilder dateFrom(Timestamp value) { + this.dateFrom = value; + return this; + } + + public ChargesBuilder dateTo(Timestamp value) { + this.dateTo = value; + return this; + } + + public ChargesParams build() { + return new ChargesParams(this); + } + } + + public enum AvalaraSaleType { + WHOLESALE("wholesale"), + + RETAIL("retail"), + + CONSUMED("consumed"), + + VENDOR_USE("vendor_use"), + + /** An enum member indicating that AvalaraSaleType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AvalaraSaleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AvalaraSaleType fromString(String value) { + if (value == null) return _UNKNOWN; + for (AvalaraSaleType enumValue : AvalaraSaleType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class TaxProvidersFieldsParams { + + private final String providerName; + + private final String fieldId; + + private final String fieldValue; + + private TaxProvidersFieldsParams(TaxProvidersFieldsBuilder builder) { + + this.providerName = builder.providerName; + + this.fieldId = builder.fieldId; + + this.fieldValue = builder.fieldValue; + } + + public String getProviderName() { + return providerName; + } + + public String getFieldId() { + return fieldId; + } + + public String getFieldValue() { + return fieldValue; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.providerName != null) { + + formData.put("provider_name", this.providerName); + } + + if (this.fieldId != null) { + + formData.put("field_id", this.fieldId); + } + + if (this.fieldValue != null) { + + formData.put("field_value", this.fieldValue); + } + + return formData; + } + + /** Create a new builder for TaxProvidersFieldsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static TaxProvidersFieldsBuilder builder() { + return new TaxProvidersFieldsBuilder(); + } + + public static final class TaxProvidersFieldsBuilder { + + private String providerName; + + private String fieldId; + + private String fieldValue; + + private TaxProvidersFieldsBuilder() {} + + public TaxProvidersFieldsBuilder providerName(String value) { + this.providerName = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldId(String value) { + this.fieldId = value; + return this; + } + + public TaxProvidersFieldsBuilder fieldValue(String value) { + this.fieldValue = value; + return this; + } + + public TaxProvidersFieldsParams build() { + return new TaxProvidersFieldsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeDeleteParams.java b/src/main/java/com/chargebee/v4/models/unbilledCharge/params/UnbilledChargeDeleteParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeDeleteParams.java rename to src/main/java/com/chargebee/v4/models/unbilledCharge/params/UnbilledChargeDeleteParams.java index 68789ccb..b2d4baf5 100644 --- a/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeDeleteParams.java +++ b/src/main/java/com/chargebee/v4/models/unbilledCharge/params/UnbilledChargeDeleteParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.unbilledCharge.params; +package com.chargebee.v4.models.unbilledCharge.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class UnbilledChargeDeleteParams { - private final Map formData; - - private UnbilledChargeDeleteParams(UnbilledChargeDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private UnbilledChargeDeleteParams(UnbilledChargeDeleteBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static UnbilledChargeDeleteBuilder builder() { } public static final class UnbilledChargeDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); private UnbilledChargeDeleteBuilder() {} diff --git a/src/main/java/com/chargebee/v4/models/unbilledCharge/params/UnbilledChargeInvoiceNowEstimateParams.java b/src/main/java/com/chargebee/v4/models/unbilledCharge/params/UnbilledChargeInvoiceNowEstimateParams.java new file mode 100644 index 00000000..123fe3ce --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/unbilledCharge/params/UnbilledChargeInvoiceNowEstimateParams.java @@ -0,0 +1,80 @@ +/* + * 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.unbilledCharge.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class UnbilledChargeInvoiceNowEstimateParams { + + private final String subscriptionId; + + private final String customerId; + + private UnbilledChargeInvoiceNowEstimateParams(UnbilledChargeInvoiceNowEstimateBuilder builder) { + + this.subscriptionId = builder.subscriptionId; + + this.customerId = builder.customerId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getCustomerId() { + return customerId; + } + + /** 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.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + return formData; + } + + /** Create a new builder for UnbilledChargeInvoiceNowEstimateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UnbilledChargeInvoiceNowEstimateBuilder builder() { + return new UnbilledChargeInvoiceNowEstimateBuilder(); + } + + public static final class UnbilledChargeInvoiceNowEstimateBuilder { + + private String subscriptionId; + + private String customerId; + + private UnbilledChargeInvoiceNowEstimateBuilder() {} + + public UnbilledChargeInvoiceNowEstimateBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public UnbilledChargeInvoiceNowEstimateBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public UnbilledChargeInvoiceNowEstimateParams build() { + return new UnbilledChargeInvoiceNowEstimateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeListParams.java b/src/main/java/com/chargebee/v4/models/unbilledCharge/params/UnbilledChargeListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeListParams.java rename to src/main/java/com/chargebee/v4/models/unbilledCharge/params/UnbilledChargeListParams.java index c5dafca6..f9b2a5c7 100644 --- a/src/main/java/com/chargebee/v4/core/models/unbilledCharge/params/UnbilledChargeListParams.java +++ b/src/main/java/com/chargebee/v4/models/unbilledCharge/params/UnbilledChargeListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.unbilledCharge.params; +package com.chargebee.v4.models.unbilledCharge.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/unbilledCharge/responses/CreateUnbilledChargeResponse.java b/src/main/java/com/chargebee/v4/models/unbilledCharge/responses/CreateUnbilledChargeResponse.java new file mode 100644 index 00000000..6e68308b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/unbilledCharge/responses/CreateUnbilledChargeResponse.java @@ -0,0 +1,79 @@ +package com.chargebee.v4.models.unbilledCharge.responses; + +import java.util.List; + +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CreateUnbilledCharge operation. Contains the response data from the + * API. + */ +public final class CreateUnbilledChargeResponse extends BaseResponse { + private final List unbilledCharges; + + private CreateUnbilledChargeResponse(Builder builder) { + super(builder.httpResponse); + + this.unbilledCharges = builder.unbilledCharges; + } + + /** Parse JSON response into CreateUnbilledChargeResponse object. */ + public static CreateUnbilledChargeResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CreateUnbilledChargeResponse object with HTTP response. */ + public static CreateUnbilledChargeResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + builder.unbilledCharges( + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "unbilled_charges")).stream() + .map(UnbilledCharge::fromJson) + .collect(java.util.stream.Collectors.toList())); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CreateUnbilledChargeResponse from JSON", e); + } + } + + /** Create a new builder for CreateUnbilledChargeResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CreateUnbilledChargeResponse. */ + public static class Builder { + + private List unbilledCharges; + + private Response httpResponse; + + private Builder() {} + + public Builder unbilledCharges(List unbilledCharges) { + this.unbilledCharges = unbilledCharges; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CreateUnbilledChargeResponse build() { + return new CreateUnbilledChargeResponse(this); + } + } + + /** Get the unbilledCharges from the response. */ + public List getUnbilledCharges() { + return unbilledCharges; + } +} diff --git a/src/main/java/com/chargebee/v4/models/unbilledCharge/responses/InvoiceUnbilledChargesResponse.java b/src/main/java/com/chargebee/v4/models/unbilledCharge/responses/InvoiceUnbilledChargesResponse.java new file mode 100644 index 00000000..30d41104 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/unbilledCharge/responses/InvoiceUnbilledChargesResponse.java @@ -0,0 +1,79 @@ +package com.chargebee.v4.models.unbilledCharge.responses; + +import java.util.List; + +import com.chargebee.v4.models.invoice.Invoice; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for InvoiceUnbilledCharges operation. Contains the response data from + * the API. + */ +public final class InvoiceUnbilledChargesResponse extends BaseResponse { + private final List invoices; + + private InvoiceUnbilledChargesResponse(Builder builder) { + super(builder.httpResponse); + + this.invoices = builder.invoices; + } + + /** Parse JSON response into InvoiceUnbilledChargesResponse object. */ + public static InvoiceUnbilledChargesResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into InvoiceUnbilledChargesResponse object with HTTP response. */ + public static InvoiceUnbilledChargesResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + builder.invoices( + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "invoices")).stream() + .map(Invoice::fromJson) + .collect(java.util.stream.Collectors.toList())); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse InvoiceUnbilledChargesResponse from JSON", e); + } + } + + /** Create a new builder for InvoiceUnbilledChargesResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for InvoiceUnbilledChargesResponse. */ + public static class Builder { + + private List invoices; + + private Response httpResponse; + + private Builder() {} + + public Builder invoices(List invoices) { + this.invoices = invoices; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public InvoiceUnbilledChargesResponse build() { + return new InvoiceUnbilledChargesResponse(this); + } + } + + /** Get the invoices from the response. */ + public List getInvoices() { + return invoices; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeCreateResponse.java b/src/main/java/com/chargebee/v4/models/unbilledCharge/responses/UnbilledChargeCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeCreateResponse.java rename to src/main/java/com/chargebee/v4/models/unbilledCharge/responses/UnbilledChargeCreateResponse.java index a9174e05..50a31f7f 100644 --- a/src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/unbilledCharge/responses/UnbilledChargeCreateResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.unbilledCharge; +package com.chargebee.v4.models.unbilledCharge.responses; import java.util.List; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeDeleteResponse.java b/src/main/java/com/chargebee/v4/models/unbilledCharge/responses/UnbilledChargeDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/unbilledCharge/responses/UnbilledChargeDeleteResponse.java index 3161665e..225b3e9f 100644 --- a/src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/unbilledCharge/responses/UnbilledChargeDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.unbilledCharge; +package com.chargebee.v4.models.unbilledCharge.responses; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeInvoiceNowEstimateResponse.java b/src/main/java/com/chargebee/v4/models/unbilledCharge/responses/UnbilledChargeInvoiceNowEstimateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeInvoiceNowEstimateResponse.java rename to src/main/java/com/chargebee/v4/models/unbilledCharge/responses/UnbilledChargeInvoiceNowEstimateResponse.java index 7c8f1ff6..0e97bf7a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeInvoiceNowEstimateResponse.java +++ b/src/main/java/com/chargebee/v4/models/unbilledCharge/responses/UnbilledChargeInvoiceNowEstimateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.unbilledCharge; +package com.chargebee.v4.models.unbilledCharge.responses; -import com.chargebee.v4.core.models.estimate.Estimate; +import com.chargebee.v4.models.estimate.Estimate; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeListResponse.java b/src/main/java/com/chargebee/v4/models/unbilledCharge/responses/UnbilledChargeListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeListResponse.java rename to src/main/java/com/chargebee/v4/models/unbilledCharge/responses/UnbilledChargeListResponse.java index 27c86ce6..216dea96 100644 --- a/src/main/java/com/chargebee/v4/core/responses/unbilledCharge/UnbilledChargeListResponse.java +++ b/src/main/java/com/chargebee/v4/models/unbilledCharge/responses/UnbilledChargeListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.unbilledCharge; +package com.chargebee.v4.models.unbilledCharge.responses; import java.util.List; -import com.chargebee.v4.core.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.models.unbilledCharge.UnbilledCharge; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.UnbilledChargeService; -import com.chargebee.v4.core.models.unbilledCharge.params.UnbilledChargeListParams; +import com.chargebee.v4.services.UnbilledChargeService; +import com.chargebee.v4.models.unbilledCharge.params.UnbilledChargeListParams; /** Immutable response object for UnbilledChargeList operation. Contains paginated list data. */ public final class UnbilledChargeListResponse { @@ -99,9 +100,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 UnbilledChargeListResponse nextPage() throws Exception { + public UnbilledChargeListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/models/unbilledChargesSetting/params/UnbilledChargesSettingRetrieveParams.java b/src/main/java/com/chargebee/v4/models/unbilledChargesSetting/params/UnbilledChargesSettingRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/unbilledChargesSetting/params/UnbilledChargesSettingRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/unbilledChargesSetting/params/UnbilledChargesSettingRetrieveParams.java index d561f6b4..6a584118 100644 --- a/src/main/java/com/chargebee/v4/core/models/unbilledChargesSetting/params/UnbilledChargesSettingRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/unbilledChargesSetting/params/UnbilledChargesSettingRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.unbilledChargesSetting.params; +package com.chargebee.v4.models.unbilledChargesSetting.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/unbilledChargesSetting/responses/UnbilledChargesSettingRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/unbilledChargesSetting/responses/UnbilledChargesSettingRetrieveResponse.java new file mode 100644 index 00000000..27652056 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/unbilledChargesSetting/responses/UnbilledChargesSettingRetrieveResponse.java @@ -0,0 +1,74 @@ +package com.chargebee.v4.models.unbilledChargesSetting.responses; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for UnbilledChargesSettingRetrieve operation. Contains the response + * data from a single resource get operation. + */ +public final class UnbilledChargesSettingRetrieveResponse extends BaseResponse { + private final Object unbilledChargesSetting; + + private UnbilledChargesSettingRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.unbilledChargesSetting = builder.unbilledChargesSetting; + } + + /** Parse JSON response into UnbilledChargesSettingRetrieveResponse object. */ + public static UnbilledChargesSettingRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into UnbilledChargesSettingRetrieveResponse object with HTTP response. */ + public static UnbilledChargesSettingRetrieveResponse fromJson( + String json, Response httpResponse) { + try { + Builder builder = builder(); + + builder.unbilledChargesSetting(JsonUtil.getObject(json, "unbilled_charges_setting")); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse UnbilledChargesSettingRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for UnbilledChargesSettingRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UnbilledChargesSettingRetrieveResponse. */ + public static class Builder { + + private Object unbilledChargesSetting; + + private Response httpResponse; + + private Builder() {} + + public Builder unbilledChargesSetting(Object unbilledChargesSetting) { + this.unbilledChargesSetting = unbilledChargesSetting; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public UnbilledChargesSettingRetrieveResponse build() { + return new UnbilledChargesSettingRetrieveResponse(this); + } + } + + /** Get the unbilledChargesSetting from the response. */ + public Object getUnbilledChargesSetting() { + return unbilledChargesSetting; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/usage/Usage.java b/src/main/java/com/chargebee/v4/models/usage/Usage.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/usage/Usage.java rename to src/main/java/com/chargebee/v4/models/usage/Usage.java index bcc6c044..52c32d93 100644 --- a/src/main/java/com/chargebee/v4/core/models/usage/Usage.java +++ b/src/main/java/com/chargebee/v4/models/usage/Usage.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.usage; +package com.chargebee.v4.models.usage; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/usage/params/UsageCreateParams.java b/src/main/java/com/chargebee/v4/models/usage/params/UsageCreateParams.java new file mode 100644 index 00000000..99ca7dc5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/usage/params/UsageCreateParams.java @@ -0,0 +1,190 @@ +/* + * 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.usage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.sql.Timestamp; + +public final class UsageCreateParams { + + private final String id; + + private final String itemPriceId; + + private final String quantity; + + private final Timestamp usageDate; + + private final DedupeOption dedupeOption; + + private final String note; + + private UsageCreateParams(UsageCreateBuilder builder) { + + this.id = builder.id; + + this.itemPriceId = builder.itemPriceId; + + this.quantity = builder.quantity; + + this.usageDate = builder.usageDate; + + this.dedupeOption = builder.dedupeOption; + + this.note = builder.note; + } + + public String getId() { + return id; + } + + public String getItemPriceId() { + return itemPriceId; + } + + public String getQuantity() { + return quantity; + } + + public Timestamp getUsageDate() { + return usageDate; + } + + public DedupeOption getDedupeOption() { + return dedupeOption; + } + + public String getNote() { + return note; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.itemPriceId != null) { + + formData.put("item_price_id", this.itemPriceId); + } + + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + + if (this.usageDate != null) { + + formData.put("usage_date", this.usageDate); + } + + if (this.dedupeOption != null) { + + formData.put("dedupe_option", this.dedupeOption); + } + + if (this.note != null) { + + formData.put("note", this.note); + } + + return formData; + } + + /** Create a new builder for UsageCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UsageCreateBuilder builder() { + return new UsageCreateBuilder(); + } + + public static final class UsageCreateBuilder { + + private String id; + + private String itemPriceId; + + private String quantity; + + private Timestamp usageDate; + + private DedupeOption dedupeOption; + + private String note; + + private UsageCreateBuilder() {} + + public UsageCreateBuilder id(String value) { + this.id = value; + return this; + } + + public UsageCreateBuilder itemPriceId(String value) { + this.itemPriceId = value; + return this; + } + + public UsageCreateBuilder quantity(String value) { + this.quantity = value; + return this; + } + + public UsageCreateBuilder usageDate(Timestamp value) { + this.usageDate = value; + return this; + } + + @Deprecated + public UsageCreateBuilder dedupeOption(DedupeOption value) { + this.dedupeOption = value; + return this; + } + + public UsageCreateBuilder note(String value) { + this.note = value; + return this; + } + + public UsageCreateParams build() { + return new UsageCreateParams(this); + } + } + + public enum DedupeOption { + SKIP("skip"), + + UPDATE_EXISTING("update_existing"), + + /** An enum member indicating that DedupeOption was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + DedupeOption(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static DedupeOption fromString(String value) { + if (value == null) return _UNKNOWN; + for (DedupeOption enumValue : DedupeOption.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/usage/params/UsageDeleteParams.java b/src/main/java/com/chargebee/v4/models/usage/params/UsageDeleteParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/usage/params/UsageDeleteParams.java rename to src/main/java/com/chargebee/v4/models/usage/params/UsageDeleteParams.java index 7c254c62..97f847a5 100644 --- a/src/main/java/com/chargebee/v4/core/models/usage/params/UsageDeleteParams.java +++ b/src/main/java/com/chargebee/v4/models/usage/params/UsageDeleteParams.java @@ -4,24 +4,35 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.usage.params; +package com.chargebee.v4.models.usage.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class UsageDeleteParams { - private final Map formData; + private final String id; private UsageDeleteParams(UsageDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); + + this.id = builder.id; + } + + public String getId() { + return id; } /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + return formData; } @@ -32,14 +43,13 @@ public static UsageDeleteBuilder builder() { } public static final class UsageDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); + + private String id; private UsageDeleteBuilder() {} public UsageDeleteBuilder id(String value) { - - formData.put("id", value); - + this.id = value; return this; } diff --git a/src/main/java/com/chargebee/v4/core/models/usage/params/UsageListParams.java b/src/main/java/com/chargebee/v4/models/usage/params/UsageListParams.java similarity index 99% rename from src/main/java/com/chargebee/v4/core/models/usage/params/UsageListParams.java rename to src/main/java/com/chargebee/v4/models/usage/params/UsageListParams.java index 1bcbd550..8f051190 100644 --- a/src/main/java/com/chargebee/v4/core/models/usage/params/UsageListParams.java +++ b/src/main/java/com/chargebee/v4/models/usage/params/UsageListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.usage.params; +package com.chargebee.v4.models.usage.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/usage/params/UsagePdfParams.java b/src/main/java/com/chargebee/v4/models/usage/params/UsagePdfParams.java new file mode 100644 index 00000000..5df037c6 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/usage/params/UsagePdfParams.java @@ -0,0 +1,161 @@ +/* + * 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.usage.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class UsagePdfParams { + + private final DispositionType dispositionType; + + private final InvoiceParams invoice; + + private UsagePdfParams(UsagePdfBuilder builder) { + + this.dispositionType = builder.dispositionType; + + this.invoice = builder.invoice; + } + + public DispositionType getDispositionType() { + return dispositionType; + } + + public InvoiceParams getInvoice() { + return invoice; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.dispositionType != null) { + + formData.put("disposition_type", this.dispositionType); + } + + if (this.invoice != null) { + + // Single object + Map nestedData = this.invoice.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "invoice[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for UsagePdfParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UsagePdfBuilder builder() { + return new UsagePdfBuilder(); + } + + public static final class UsagePdfBuilder { + + private DispositionType dispositionType; + + private InvoiceParams invoice; + + private UsagePdfBuilder() {} + + public UsagePdfBuilder dispositionType(DispositionType value) { + this.dispositionType = value; + return this; + } + + public UsagePdfBuilder invoice(InvoiceParams value) { + this.invoice = value; + return this; + } + + public UsagePdfParams build() { + return new UsagePdfParams(this); + } + } + + public enum DispositionType { + ATTACHMENT("attachment"), + + INLINE("inline"), + + /** An enum member indicating that DispositionType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + DispositionType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static DispositionType fromString(String value) { + if (value == null) return _UNKNOWN; + for (DispositionType enumValue : DispositionType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class InvoiceParams { + + private final String id; + + private InvoiceParams(InvoiceBuilder builder) { + + this.id = builder.id; + } + + public String getId() { + return id; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + return formData; + } + + /** Create a new builder for InvoiceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceBuilder builder() { + return new InvoiceBuilder(); + } + + public static final class InvoiceBuilder { + + private String id; + + private InvoiceBuilder() {} + + public InvoiceBuilder id(String value) { + this.id = value; + return this; + } + + public InvoiceParams build() { + return new InvoiceParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/usage/params/UsageRetrieveParams.java b/src/main/java/com/chargebee/v4/models/usage/params/UsageRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/usage/params/UsageRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/usage/params/UsageRetrieveParams.java index d7feab47..44f04222 100644 --- a/src/main/java/com/chargebee/v4/core/models/usage/params/UsageRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/usage/params/UsageRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.usage.params; +package com.chargebee.v4.models.usage.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/responses/usage/UsageCreateResponse.java b/src/main/java/com/chargebee/v4/models/usage/responses/UsageCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/usage/UsageCreateResponse.java rename to src/main/java/com/chargebee/v4/models/usage/responses/UsageCreateResponse.java index e9468385..fe481c8b 100644 --- a/src/main/java/com/chargebee/v4/core/responses/usage/UsageCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/usage/responses/UsageCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.usage; +package com.chargebee.v4.models.usage.responses; -import com.chargebee.v4.core.models.usage.Usage; +import com.chargebee.v4.models.usage.Usage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/usage/UsageDeleteResponse.java b/src/main/java/com/chargebee/v4/models/usage/responses/UsageDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/usage/UsageDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/usage/responses/UsageDeleteResponse.java index e8d5294b..28818eb5 100644 --- a/src/main/java/com/chargebee/v4/core/responses/usage/UsageDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/usage/responses/UsageDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.usage; +package com.chargebee.v4.models.usage.responses; -import com.chargebee.v4.core.models.usage.Usage; +import com.chargebee.v4.models.usage.Usage; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/usage/UsageListResponse.java b/src/main/java/com/chargebee/v4/models/usage/responses/UsageListResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/usage/UsageListResponse.java rename to src/main/java/com/chargebee/v4/models/usage/responses/UsageListResponse.java index 1f8c644d..b872fd12 100644 --- a/src/main/java/com/chargebee/v4/core/responses/usage/UsageListResponse.java +++ b/src/main/java/com/chargebee/v4/models/usage/responses/UsageListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.usage; +package com.chargebee.v4.models.usage.responses; import java.util.List; -import com.chargebee.v4.core.models.usage.Usage; +import com.chargebee.v4.models.usage.Usage; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.UsageService; -import com.chargebee.v4.core.models.usage.params.UsageListParams; +import com.chargebee.v4.services.UsageService; +import com.chargebee.v4.models.usage.params.UsageListParams; /** Immutable response object for UsageList operation. Contains paginated list data. */ public final class UsageListResponse { @@ -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 UsageListResponse nextPage() throws Exception { + public UsageListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/core/responses/usage/UsagePdfResponse.java b/src/main/java/com/chargebee/v4/models/usage/responses/UsagePdfResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/usage/UsagePdfResponse.java rename to src/main/java/com/chargebee/v4/models/usage/responses/UsagePdfResponse.java index 987534e9..148b39f7 100644 --- a/src/main/java/com/chargebee/v4/core/responses/usage/UsagePdfResponse.java +++ b/src/main/java/com/chargebee/v4/models/usage/responses/UsagePdfResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.usage; +package com.chargebee.v4.models.usage.responses; -import com.chargebee.v4.core.models.download.Download; +import com.chargebee.v4.models.download.Download; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/usage/responses/UsageRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/usage/responses/UsageRetrieveResponse.java new file mode 100644 index 00000000..65103296 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/usage/responses/UsageRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.usage.responses; + +import com.chargebee.v4.models.usage.Usage; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for UsageRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class UsageRetrieveResponse extends BaseResponse { + private final Usage usage; + + private UsageRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.usage = builder.usage; + } + + /** Parse JSON response into UsageRetrieveResponse object. */ + public static UsageRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into UsageRetrieveResponse object with HTTP response. */ + public static UsageRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __usageJson = JsonUtil.getObject(json, "usage"); + if (__usageJson != null) { + builder.usage(Usage.fromJson(__usageJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse UsageRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for UsageRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UsageRetrieveResponse. */ + public static class Builder { + + private Usage usage; + + private Response httpResponse; + + private Builder() {} + + public Builder usage(Usage usage) { + this.usage = usage; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public UsageRetrieveResponse build() { + return new UsageRetrieveResponse(this); + } + } + + /** Get the usage from the response. */ + public Usage getUsage() { + return usage; + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/usageEvent/UsageEvent.java b/src/main/java/com/chargebee/v4/models/usageEvent/UsageEvent.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/usageEvent/UsageEvent.java rename to src/main/java/com/chargebee/v4/models/usageEvent/UsageEvent.java index 23cc3999..10647be4 100644 --- a/src/main/java/com/chargebee/v4/core/models/usageEvent/UsageEvent.java +++ b/src/main/java/com/chargebee/v4/models/usageEvent/UsageEvent.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.usageEvent; +package com.chargebee.v4.models.usageEvent; import com.chargebee.v4.internal.JsonUtil; diff --git a/src/main/java/com/chargebee/v4/models/usageEvent/params/UsageEventBatchIngestParams.java b/src/main/java/com/chargebee/v4/models/usageEvent/params/UsageEventBatchIngestParams.java new file mode 100644 index 00000000..033255d1 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/usageEvent/params/UsageEventBatchIngestParams.java @@ -0,0 +1,181 @@ +/* + * 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.usageEvent.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; +import java.sql.Timestamp; + +public final class UsageEventBatchIngestParams { + + private final List events; + + private UsageEventBatchIngestParams(UsageEventBatchIngestBuilder builder) { + + this.events = builder.events; + } + + public List getEvents() { + return events; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.events != null) { + + // List of objects + for (int i = 0; i < this.events.size(); i++) { + EventsParams item = this.events.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "events[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for UsageEventBatchIngestParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UsageEventBatchIngestBuilder builder() { + return new UsageEventBatchIngestBuilder(); + } + + public static final class UsageEventBatchIngestBuilder { + + private List events; + + private UsageEventBatchIngestBuilder() {} + + public UsageEventBatchIngestBuilder events(List value) { + this.events = value; + return this; + } + + public UsageEventBatchIngestParams build() { + return new UsageEventBatchIngestParams(this); + } + } + + public static final class EventsParams { + + private final String deduplicationId; + + private final String subscriptionId; + + private final Timestamp usageTimestamp; + + private final java.util.Map properties; + + private EventsParams(EventsBuilder builder) { + + this.deduplicationId = builder.deduplicationId; + + this.subscriptionId = builder.subscriptionId; + + this.usageTimestamp = builder.usageTimestamp; + + this.properties = builder.properties; + } + + public String getDeduplicationId() { + return deduplicationId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public Timestamp getUsageTimestamp() { + return usageTimestamp; + } + + public java.util.Map getProperties() { + return properties; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.deduplicationId != null) { + + formData.put("deduplication_id", this.deduplicationId); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.usageTimestamp != null) { + + formData.put("usage_timestamp", this.usageTimestamp); + } + + if (this.properties != null) { + + formData.put("properties", JsonUtil.toJson(this.properties)); + } + + return formData; + } + + /** Create a new builder for EventsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EventsBuilder builder() { + return new EventsBuilder(); + } + + public static final class EventsBuilder { + + private String deduplicationId; + + private String subscriptionId; + + private Timestamp usageTimestamp; + + private java.util.Map properties; + + private EventsBuilder() {} + + public EventsBuilder deduplicationId(String value) { + this.deduplicationId = value; + return this; + } + + public EventsBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public EventsBuilder usageTimestamp(Timestamp value) { + this.usageTimestamp = value; + return this; + } + + public EventsBuilder properties(java.util.Map value) { + this.properties = value; + return this; + } + + public EventsParams build() { + return new EventsParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/usageEvent/params/UsageEventCreateParams.java b/src/main/java/com/chargebee/v4/models/usageEvent/params/UsageEventCreateParams.java new file mode 100644 index 00000000..ad7c895a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/usageEvent/params/UsageEventCreateParams.java @@ -0,0 +1,121 @@ +/* + * 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.usageEvent.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class UsageEventCreateParams { + + private final String deduplicationId; + + private final String subscriptionId; + + private final Long usageTimestamp; + + private final java.util.Map properties; + + private UsageEventCreateParams(UsageEventCreateBuilder builder) { + + this.deduplicationId = builder.deduplicationId; + + this.subscriptionId = builder.subscriptionId; + + this.usageTimestamp = builder.usageTimestamp; + + this.properties = builder.properties; + } + + public String getDeduplicationId() { + return deduplicationId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public Long getUsageTimestamp() { + return usageTimestamp; + } + + public java.util.Map getProperties() { + return properties; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.deduplicationId != null) { + + formData.put("deduplication_id", this.deduplicationId); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.usageTimestamp != null) { + + formData.put("usage_timestamp", this.usageTimestamp); + } + + if (this.properties != null) { + + formData.put("properties", JsonUtil.toJson(this.properties)); + } + + return formData; + } + + /** Create a new builder for UsageEventCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UsageEventCreateBuilder builder() { + return new UsageEventCreateBuilder(); + } + + public static final class UsageEventCreateBuilder { + + private String deduplicationId; + + private String subscriptionId; + + private Long usageTimestamp; + + private java.util.Map properties; + + private UsageEventCreateBuilder() {} + + public UsageEventCreateBuilder deduplicationId(String value) { + this.deduplicationId = value; + return this; + } + + public UsageEventCreateBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public UsageEventCreateBuilder usageTimestamp(Long value) { + this.usageTimestamp = value; + return this; + } + + public UsageEventCreateBuilder properties(java.util.Map value) { + this.properties = value; + return this; + } + + public UsageEventCreateParams build() { + return new UsageEventCreateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/usageEvent/UsageEventBatchIngestResponse.java b/src/main/java/com/chargebee/v4/models/usageEvent/responses/UsageEventBatchIngestResponse.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/responses/usageEvent/UsageEventBatchIngestResponse.java rename to src/main/java/com/chargebee/v4/models/usageEvent/responses/UsageEventBatchIngestResponse.java index db497834..fd073344 100644 --- a/src/main/java/com/chargebee/v4/core/responses/usageEvent/UsageEventBatchIngestResponse.java +++ b/src/main/java/com/chargebee/v4/models/usageEvent/responses/UsageEventBatchIngestResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.usageEvent; +package com.chargebee.v4.models.usageEvent.responses; import java.util.List; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/usageEvent/UsageEventCreateResponse.java b/src/main/java/com/chargebee/v4/models/usageEvent/responses/UsageEventCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/usageEvent/UsageEventCreateResponse.java rename to src/main/java/com/chargebee/v4/models/usageEvent/responses/UsageEventCreateResponse.java index 00f2af57..59d3a19a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/usageEvent/UsageEventCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/usageEvent/responses/UsageEventCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.usageEvent; +package com.chargebee.v4.models.usageEvent.responses; -import com.chargebee.v4.core.models.usageEvent.UsageEvent; +import com.chargebee.v4.models.usageEvent.UsageEvent; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/usageFile/UsageFile.java b/src/main/java/com/chargebee/v4/models/usageFile/UsageFile.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/usageFile/UsageFile.java rename to src/main/java/com/chargebee/v4/models/usageFile/UsageFile.java index bdcc2fcb..7f78b55e 100644 --- a/src/main/java/com/chargebee/v4/core/models/usageFile/UsageFile.java +++ b/src/main/java/com/chargebee/v4/models/usageFile/UsageFile.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.usageFile; +package com.chargebee.v4.models.usageFile; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/usageFile/params/UsageFileProcessingStatusParams.java b/src/main/java/com/chargebee/v4/models/usageFile/params/UsageFileProcessingStatusParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/usageFile/params/UsageFileProcessingStatusParams.java rename to src/main/java/com/chargebee/v4/models/usageFile/params/UsageFileProcessingStatusParams.java index b23a5628..5bde6620 100644 --- a/src/main/java/com/chargebee/v4/core/models/usageFile/params/UsageFileProcessingStatusParams.java +++ b/src/main/java/com/chargebee/v4/models/usageFile/params/UsageFileProcessingStatusParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.usageFile.params; +package com.chargebee.v4.models.usageFile.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/usageFile/params/UsageFileUploadUrlParams.java b/src/main/java/com/chargebee/v4/models/usageFile/params/UsageFileUploadUrlParams.java new file mode 100644 index 00000000..a00da439 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/usageFile/params/UsageFileUploadUrlParams.java @@ -0,0 +1,80 @@ +/* + * 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.usageFile.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class UsageFileUploadUrlParams { + + private final String fileName; + + private final String mimeType; + + private UsageFileUploadUrlParams(UsageFileUploadUrlBuilder builder) { + + this.fileName = builder.fileName; + + this.mimeType = builder.mimeType; + } + + public String getFileName() { + return fileName; + } + + public String getMimeType() { + return mimeType; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.fileName != null) { + + formData.put("file_name", this.fileName); + } + + if (this.mimeType != null) { + + formData.put("mime_type", this.mimeType); + } + + return formData; + } + + /** Create a new builder for UsageFileUploadUrlParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static UsageFileUploadUrlBuilder builder() { + return new UsageFileUploadUrlBuilder(); + } + + public static final class UsageFileUploadUrlBuilder { + + private String fileName; + + private String mimeType; + + private UsageFileUploadUrlBuilder() {} + + public UsageFileUploadUrlBuilder fileName(String value) { + this.fileName = value; + return this; + } + + public UsageFileUploadUrlBuilder mimeType(String value) { + this.mimeType = value; + return this; + } + + public UsageFileUploadUrlParams build() { + return new UsageFileUploadUrlParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/usageFile/responses/UsageFileProcessingStatusResponse.java b/src/main/java/com/chargebee/v4/models/usageFile/responses/UsageFileProcessingStatusResponse.java new file mode 100644 index 00000000..4e488e61 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/usageFile/responses/UsageFileProcessingStatusResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.usageFile.responses; + +import com.chargebee.v4.models.usageFile.UsageFile; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for UsageFileProcessingStatus operation. Contains the response data + * from a single resource get operation. + */ +public final class UsageFileProcessingStatusResponse extends BaseResponse { + private final UsageFile usageFile; + + private UsageFileProcessingStatusResponse(Builder builder) { + super(builder.httpResponse); + + this.usageFile = builder.usageFile; + } + + /** Parse JSON response into UsageFileProcessingStatusResponse object. */ + public static UsageFileProcessingStatusResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into UsageFileProcessingStatusResponse object with HTTP response. */ + public static UsageFileProcessingStatusResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __usageFileJson = JsonUtil.getObject(json, "usage_file"); + if (__usageFileJson != null) { + builder.usageFile(UsageFile.fromJson(__usageFileJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse UsageFileProcessingStatusResponse from JSON", e); + } + } + + /** Create a new builder for UsageFileProcessingStatusResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UsageFileProcessingStatusResponse. */ + public static class Builder { + + private UsageFile usageFile; + + private Response httpResponse; + + private Builder() {} + + public Builder usageFile(UsageFile usageFile) { + this.usageFile = usageFile; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public UsageFileProcessingStatusResponse build() { + return new UsageFileProcessingStatusResponse(this); + } + } + + /** Get the usageFile from the response. */ + public UsageFile getUsageFile() { + return usageFile; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/usageFile/UsageFileUploadUrlResponse.java b/src/main/java/com/chargebee/v4/models/usageFile/responses/UsageFileUploadUrlResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/usageFile/UsageFileUploadUrlResponse.java rename to src/main/java/com/chargebee/v4/models/usageFile/responses/UsageFileUploadUrlResponse.java index 92da79e9..a198e45e 100644 --- a/src/main/java/com/chargebee/v4/core/responses/usageFile/UsageFileUploadUrlResponse.java +++ b/src/main/java/com/chargebee/v4/models/usageFile/responses/UsageFileUploadUrlResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.usageFile; +package com.chargebee.v4.models.usageFile.responses; -import com.chargebee.v4.core.models.usageFile.UsageFile; +import com.chargebee.v4.models.usageFile.UsageFile; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/usageReminderInfo/UsageReminderInfo.java b/src/main/java/com/chargebee/v4/models/usageReminderInfo/UsageReminderInfo.java similarity index 93% rename from src/main/java/com/chargebee/v4/core/models/usageReminderInfo/UsageReminderInfo.java rename to src/main/java/com/chargebee/v4/models/usageReminderInfo/UsageReminderInfo.java index d3c22466..231fa99d 100644 --- a/src/main/java/com/chargebee/v4/core/models/usageReminderInfo/UsageReminderInfo.java +++ b/src/main/java/com/chargebee/v4/models/usageReminderInfo/UsageReminderInfo.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.usageReminderInfo; +package com.chargebee.v4.models.usageReminderInfo; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/core/models/variant/Variant.java b/src/main/java/com/chargebee/v4/models/variant/Variant.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/variant/Variant.java rename to src/main/java/com/chargebee/v4/models/variant/Variant.java index d350d442..794452b0 100644 --- a/src/main/java/com/chargebee/v4/core/models/variant/Variant.java +++ b/src/main/java/com/chargebee/v4/models/variant/Variant.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.variant; +package com.chargebee.v4.models.variant; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; diff --git a/src/main/java/com/chargebee/v4/models/variant/params/CreateProductVariantParams.java b/src/main/java/com/chargebee/v4/models/variant/params/CreateProductVariantParams.java new file mode 100644 index 00000000..cb5e76b5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/variant/params/CreateProductVariantParams.java @@ -0,0 +1,308 @@ +/* + * 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.variant.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class CreateProductVariantParams { + + private final String id; + + private final String name; + + private final String externalName; + + private final String description; + + private final String sku; + + private final java.util.Map metadata; + + private final Status status; + + private final List optionValues; + + private CreateProductVariantParams(CreateProductVariantBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.externalName = builder.externalName; + + this.description = builder.description; + + this.sku = builder.sku; + + this.metadata = builder.metadata; + + this.status = builder.status; + + this.optionValues = builder.optionValues; + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getExternalName() { + return externalName; + } + + public String getDescription() { + return description; + } + + public String getSku() { + return sku; + } + + public java.util.Map getMetadata() { + return metadata; + } + + public Status getStatus() { + return status; + } + + public List getOptionValues() { + return optionValues; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.externalName != null) { + + formData.put("external_name", this.externalName); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.sku != null) { + + formData.put("sku", this.sku); + } + + if (this.metadata != null) { + + formData.put("metadata", JsonUtil.toJson(this.metadata)); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.optionValues != null) { + + // List of objects + for (int i = 0; i < this.optionValues.size(); i++) { + OptionValuesParams item = this.optionValues.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "option_values[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for CreateProductVariantParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreateProductVariantBuilder builder() { + return new CreateProductVariantBuilder(); + } + + public static final class CreateProductVariantBuilder { + + private String id; + + private String name; + + private String externalName; + + private String description; + + private String sku; + + private java.util.Map metadata; + + private Status status; + + private List optionValues; + + private CreateProductVariantBuilder() {} + + public CreateProductVariantBuilder id(String value) { + this.id = value; + return this; + } + + public CreateProductVariantBuilder name(String value) { + this.name = value; + return this; + } + + public CreateProductVariantBuilder externalName(String value) { + this.externalName = value; + return this; + } + + public CreateProductVariantBuilder description(String value) { + this.description = value; + return this; + } + + public CreateProductVariantBuilder sku(String value) { + this.sku = value; + return this; + } + + public CreateProductVariantBuilder metadata(java.util.Map value) { + this.metadata = value; + return this; + } + + public CreateProductVariantBuilder status(Status value) { + this.status = value; + return this; + } + + public CreateProductVariantBuilder optionValues(List value) { + this.optionValues = value; + return this; + } + + public CreateProductVariantParams build() { + return new CreateProductVariantParams(this); + } + } + + public enum Status { + ACTIVE("active"), + + INACTIVE("inactive"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class OptionValuesParams { + + private final String name; + + private final String value; + + private OptionValuesParams(OptionValuesBuilder builder) { + + this.name = builder.name; + + this.value = builder.value; + } + + public String getName() { + return name; + } + + public String getValue() { + return value; + } + + /** 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.value != null) { + + formData.put("value", this.value); + } + + return formData; + } + + /** Create a new builder for OptionValuesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static OptionValuesBuilder builder() { + return new OptionValuesBuilder(); + } + + public static final class OptionValuesBuilder { + + private String name; + + private String value; + + private OptionValuesBuilder() {} + + public OptionValuesBuilder name(String value) { + this.name = value; + return this; + } + + public OptionValuesBuilder value(String value) { + this.value = value; + return this; + } + + public OptionValuesParams build() { + return new OptionValuesParams(this); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/variant/params/ListProductVariantsParams.java b/src/main/java/com/chargebee/v4/models/variant/params/ListProductVariantsParams.java new file mode 100644 index 00000000..da0a5f21 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/variant/params/ListProductVariantsParams.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.variant.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 ListProductVariantsParams { + + private final Map queryParams; + + private ListProductVariantsParams(ListProductVariantsBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public ListProductVariantsBuilder toBuilder() { + ListProductVariantsBuilder builder = new ListProductVariantsBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for ListProductVariantsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ListProductVariantsBuilder builder() { + return new ListProductVariantsBuilder(); + } + + public static final class ListProductVariantsBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private ListProductVariantsBuilder() {} + + public ListProductVariantsBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public ListProductVariantsBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public ListProductVariantsBuilder includeDeleted(Boolean value) { + queryParams.put("include_deleted", value); + return this; + } + + public IdFilter id() { + return new IdFilter("id", this); + } + + public NameFilter name() { + return new NameFilter("name", this); + } + + public SkuFilter sku() { + return new SkuFilter("sku", this); + } + + public StatusFilter status() { + return new StatusFilter("status", this); + } + + public UpdatedAtFilter updatedAt() { + return new UpdatedAtFilter("updated_at", this); + } + + public CreatedAtFilter createdAt() { + return new CreatedAtFilter("created_at", this); + } + + public SortBySortBuilder sortBy() { + return new SortBySortBuilder("sort_by", this); + } + + public ListProductVariantsParams build() { + return new ListProductVariantsParams(this); + } + + public static final class IdFilter { + private final String fieldName; + private final ListProductVariantsBuilder builder; + + IdFilter(String fieldName, ListProductVariantsBuilder builder) { + this.fieldName = fieldName; + this.builder = builder; + } + + public ListProductVariantsBuilder is(String value) { + builder.queryParams.put(fieldName + "[is]", value); + return builder; + } + + public ListProductVariantsBuilder isNot(String value) { + builder.queryParams.put(fieldName + "[is_not]", value); + return builder; + } + + public ListProductVariantsBuilder startsWith(String value) { + builder.queryParams.put(fieldName + "[starts_with]", value); + return builder; + } + + public ListProductVariantsBuilder in(String... values) { + builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + public ListProductVariantsBuilder notIn(String... values) { + builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + + public static final class NameFilter { + private final String fieldName; + private final ListProductVariantsBuilder builder; + + NameFilter(String fieldName, ListProductVariantsBuilder builder) { + this.fieldName = fieldName; + this.builder = builder; + } + + public ListProductVariantsBuilder is(String value) { + builder.queryParams.put(fieldName + "[is]", value); + return builder; + } + + public ListProductVariantsBuilder isNot(String value) { + builder.queryParams.put(fieldName + "[is_not]", value); + return builder; + } + + public ListProductVariantsBuilder startsWith(String value) { + builder.queryParams.put(fieldName + "[starts_with]", value); + return builder; + } + + public ListProductVariantsBuilder in(String... values) { + builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + public ListProductVariantsBuilder notIn(String... values) { + builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + + public static final class SkuFilter { + private final String fieldName; + private final ListProductVariantsBuilder builder; + + SkuFilter(String fieldName, ListProductVariantsBuilder builder) { + this.fieldName = fieldName; + this.builder = builder; + } + + public ListProductVariantsBuilder is(String value) { + builder.queryParams.put(fieldName + "[is]", value); + return builder; + } + + public ListProductVariantsBuilder isNot(String value) { + builder.queryParams.put(fieldName + "[is_not]", value); + return builder; + } + + public ListProductVariantsBuilder startsWith(String value) { + builder.queryParams.put(fieldName + "[starts_with]", value); + return builder; + } + + public ListProductVariantsBuilder in(String... values) { + builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + public ListProductVariantsBuilder notIn(String... values) { + builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + + public static final class StatusFilter { + private final String fieldName; + private final ListProductVariantsBuilder builder; + + StatusFilter(String fieldName, ListProductVariantsBuilder builder) { + this.fieldName = fieldName; + this.builder = builder; + } + + public ListProductVariantsBuilder is(String value) { + builder.queryParams.put(fieldName + "[is]", value); + return builder; + } + + public ListProductVariantsBuilder isNot(String value) { + builder.queryParams.put(fieldName + "[is_not]", value); + return builder; + } + + public ListProductVariantsBuilder in(String... values) { + builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + public ListProductVariantsBuilder 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 ListProductVariantsBuilder builder; + + UpdatedAtFilter(String fieldName, ListProductVariantsBuilder builder) { + this.fieldName = fieldName; + this.builder = builder; + } + + public ListProductVariantsBuilder after(Timestamp timestamp) { + builder.queryParams.put(fieldName + "[after]", timestamp.getTime() / 1000); + return builder; + } + + public ListProductVariantsBuilder before(Timestamp timestamp) { + builder.queryParams.put(fieldName + "[before]", timestamp.getTime() / 1000); + return builder; + } + + public ListProductVariantsBuilder on(Timestamp timestamp) { + builder.queryParams.put(fieldName + "[on]", timestamp.getTime() / 1000); + return builder; + } + + public ListProductVariantsBuilder between(Timestamp start, Timestamp end) { + builder.queryParams.put( + fieldName + "[between]", + "[" + (start.getTime() / 1000) + "," + (end.getTime() / 1000) + "]"); + return builder; + } + } + + public static final class CreatedAtFilter { + private final String fieldName; + private final ListProductVariantsBuilder builder; + + CreatedAtFilter(String fieldName, ListProductVariantsBuilder builder) { + this.fieldName = fieldName; + this.builder = builder; + } + + public ListProductVariantsBuilder after(Timestamp timestamp) { + builder.queryParams.put(fieldName + "[after]", timestamp.getTime() / 1000); + return builder; + } + + public ListProductVariantsBuilder before(Timestamp timestamp) { + builder.queryParams.put(fieldName + "[before]", timestamp.getTime() / 1000); + return builder; + } + + public ListProductVariantsBuilder on(Timestamp timestamp) { + builder.queryParams.put(fieldName + "[on]", timestamp.getTime() / 1000); + return builder; + } + + public ListProductVariantsBuilder 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 ListProductVariantsBuilder builder; + + SortBySortBuilder(String fieldName, ListProductVariantsBuilder builder) { + this.fieldName = fieldName; + this.builder = builder; + } + + public SortDirection name() { + return new SortDirection(fieldName, "name", builder); + } + + public SortDirection id() { + return new SortDirection(fieldName, "id", builder); + } + + public SortDirection status() { + return new SortDirection(fieldName, "status", builder); + } + + public SortDirection created_at() { + return new SortDirection(fieldName, "created_at", builder); + } + + public SortDirection updated_at() { + return new SortDirection(fieldName, "updated_at", builder); + } + } + + public static final class SortDirection { + private final String fieldName; + private final String selectedField; + private final ListProductVariantsBuilder builder; + + SortDirection(String fieldName, String selectedField, ListProductVariantsBuilder builder) { + this.fieldName = fieldName; + this.selectedField = selectedField; + this.builder = builder; + } + + public ListProductVariantsBuilder asc() { + builder.queryParams.put(fieldName + "[asc]", selectedField); + return builder; + } + + public ListProductVariantsBuilder desc() { + builder.queryParams.put(fieldName + "[desc]", selectedField); + return builder; + } + } + } + + public enum StatusIs { + ACTIVE("active"), + + INACTIVE("inactive"), + + /** An enum member indicating that StatusIs was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + StatusIs(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static StatusIs fromString(String value) { + if (value == null) return _UNKNOWN; + for (StatusIs enumValue : StatusIs.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum StatusIsNot { + ACTIVE("active"), + + INACTIVE("inactive"), + + /** An enum member indicating that StatusIsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + StatusIsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static StatusIsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (StatusIsNot enumValue : StatusIsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum SortByAsc { + NAME("name"), + + ID("id"), + + STATUS("status"), + + CREATED_AT("created_at"), + + UPDATED_AT("updated_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 { + NAME("name"), + + ID("id"), + + STATUS("status"), + + CREATED_AT("created_at"), + + UPDATED_AT("updated_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/variant/params/VariantDeleteParams.java b/src/main/java/com/chargebee/v4/models/variant/params/VariantDeleteParams.java new file mode 100644 index 00000000..eb351fb4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/variant/params/VariantDeleteParams.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.variant.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class VariantDeleteParams { + + private VariantDeleteParams(VariantDeleteBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for VariantDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static VariantDeleteBuilder builder() { + return new VariantDeleteBuilder(); + } + + public static final class VariantDeleteBuilder { + + private VariantDeleteBuilder() {} + + public VariantDeleteParams build() { + return new VariantDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/variant/params/VariantRetrieveParams.java b/src/main/java/com/chargebee/v4/models/variant/params/VariantRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/variant/params/VariantRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/variant/params/VariantRetrieveParams.java index 3855e330..c908577e 100644 --- a/src/main/java/com/chargebee/v4/core/models/variant/params/VariantRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/variant/params/VariantRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.variant.params; +package com.chargebee.v4.models.variant.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/variant/params/VariantUpdateParams.java b/src/main/java/com/chargebee/v4/models/variant/params/VariantUpdateParams.java new file mode 100644 index 00000000..0269fe29 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/variant/params/VariantUpdateParams.java @@ -0,0 +1,189 @@ +/* + * 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.variant.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class VariantUpdateParams { + + private final String name; + + private final String description; + + private final Status status; + + private final String externalName; + + private final String sku; + + private final java.util.Map metadata; + + private VariantUpdateParams(VariantUpdateBuilder builder) { + + this.name = builder.name; + + this.description = builder.description; + + this.status = builder.status; + + this.externalName = builder.externalName; + + this.sku = builder.sku; + + this.metadata = builder.metadata; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public Status getStatus() { + return status; + } + + public String getExternalName() { + return externalName; + } + + public String getSku() { + return sku; + } + + public java.util.Map getMetadata() { + return metadata; + } + + /** 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.description != null) { + + formData.put("description", this.description); + } + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.externalName != null) { + + formData.put("external_name", this.externalName); + } + + if (this.sku != null) { + + formData.put("sku", this.sku); + } + + if (this.metadata != null) { + + formData.put("metadata", JsonUtil.toJson(this.metadata)); + } + + return formData; + } + + /** Create a new builder for VariantUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static VariantUpdateBuilder builder() { + return new VariantUpdateBuilder(); + } + + public static final class VariantUpdateBuilder { + + private String name; + + private String description; + + private Status status; + + private String externalName; + + private String sku; + + private java.util.Map metadata; + + private VariantUpdateBuilder() {} + + public VariantUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public VariantUpdateBuilder description(String value) { + this.description = value; + return this; + } + + public VariantUpdateBuilder status(Status value) { + this.status = value; + return this; + } + + public VariantUpdateBuilder externalName(String value) { + this.externalName = value; + return this; + } + + public VariantUpdateBuilder sku(String value) { + this.sku = value; + return this; + } + + public VariantUpdateBuilder metadata(java.util.Map value) { + this.metadata = value; + return this; + } + + public VariantUpdateParams build() { + return new VariantUpdateParams(this); + } + } + + public enum Status { + ACTIVE("active"), + + INACTIVE("inactive"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/variant/responses/CreateProductVariantResponse.java b/src/main/java/com/chargebee/v4/models/variant/responses/CreateProductVariantResponse.java new file mode 100644 index 00000000..fc97a581 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/variant/responses/CreateProductVariantResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.variant.responses; + +import com.chargebee.v4.models.variant.Variant; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CreateProductVariant operation. Contains the response data from the + * API. + */ +public final class CreateProductVariantResponse extends BaseResponse { + private final Variant variant; + + private CreateProductVariantResponse(Builder builder) { + super(builder.httpResponse); + + this.variant = builder.variant; + } + + /** Parse JSON response into CreateProductVariantResponse object. */ + public static CreateProductVariantResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CreateProductVariantResponse object with HTTP response. */ + public static CreateProductVariantResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __variantJson = JsonUtil.getObject(json, "variant"); + if (__variantJson != null) { + builder.variant(Variant.fromJson(__variantJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CreateProductVariantResponse from JSON", e); + } + } + + /** Create a new builder for CreateProductVariantResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CreateProductVariantResponse. */ + public static class Builder { + + private Variant variant; + + private Response httpResponse; + + private Builder() {} + + public Builder variant(Variant variant) { + this.variant = variant; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CreateProductVariantResponse build() { + return new CreateProductVariantResponse(this); + } + } + + /** Get the variant from the response. */ + public Variant getVariant() { + return variant; + } +} diff --git a/src/main/java/com/chargebee/v4/models/variant/responses/ListProductVariantsResponse.java b/src/main/java/com/chargebee/v4/models/variant/responses/ListProductVariantsResponse.java new file mode 100644 index 00000000..10db0f20 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/variant/responses/ListProductVariantsResponse.java @@ -0,0 +1,172 @@ +package com.chargebee.v4.models.variant.responses; + +import java.util.List; + +import com.chargebee.v4.models.variant.Variant; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.VariantService; +import com.chargebee.v4.models.variant.params.ListProductVariantsParams; + +/** Immutable response object for ListProductVariants operation. Contains paginated list data. */ +public final class ListProductVariantsResponse { + + private final List list; + + private final String nextOffset; + + private final String productId; + + private final VariantService service; + private final ListProductVariantsParams originalParams; + private final Response httpResponse; + + private ListProductVariantsResponse( + List list, + String nextOffset, + String productId, + VariantService service, + ListProductVariantsParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.productId = productId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into ListProductVariantsResponse object (no service context). Use this when + * you only need to read a single page (no nextPage()). + */ + public static ListProductVariantsResponse fromJson(String json) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(VariantListProductVariantsItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new ListProductVariantsResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ListProductVariantsResponse from JSON", e); + } + } + + /** + * Parse JSON response into ListProductVariantsResponse object with service context for pagination + * (enables nextPage()). + */ + public static ListProductVariantsResponse fromJson( + String json, + VariantService service, + ListProductVariantsParams originalParams, + String productId, + Response httpResponse) { + try { + + List list = + JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream() + .map(VariantListProductVariantsItem::fromJson) + .collect(java.util.stream.Collectors.toList()); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + + return new ListProductVariantsResponse( + list, nextOffset, productId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ListProductVariantsResponse 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 ListProductVariantsResponse 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)."); + } + + ListProductVariantsParams nextParams = + (originalParams != null ? originalParams.toBuilder() : ListProductVariantsParams.builder()) + .offset(nextOffset) + .build(); + + return service.listProductVariants(productId, 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 VariantListProductVariantsItem { + + private Variant variant; + + public Variant getVariant() { + return variant; + } + + public static VariantListProductVariantsItem fromJson(String json) { + VariantListProductVariantsItem item = new VariantListProductVariantsItem(); + + String __variantJson = JsonUtil.getObject(json, "variant"); + if (__variantJson != null) { + item.variant = Variant.fromJson(__variantJson); + } + + return item; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/variant/VariantDeleteResponse.java b/src/main/java/com/chargebee/v4/models/variant/responses/VariantDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/variant/VariantDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/variant/responses/VariantDeleteResponse.java index 6b157fb9..d18daabc 100644 --- a/src/main/java/com/chargebee/v4/core/responses/variant/VariantDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/variant/responses/VariantDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.variant; +package com.chargebee.v4.models.variant.responses; -import com.chargebee.v4.core.models.variant.Variant; +import com.chargebee.v4.models.variant.Variant; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/models/variant/responses/VariantRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/variant/responses/VariantRetrieveResponse.java new file mode 100644 index 00000000..105c696e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/variant/responses/VariantRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.variant.responses; + +import com.chargebee.v4.models.variant.Variant; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for VariantRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class VariantRetrieveResponse extends BaseResponse { + private final Variant variant; + + private VariantRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.variant = builder.variant; + } + + /** Parse JSON response into VariantRetrieveResponse object. */ + public static VariantRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into VariantRetrieveResponse object with HTTP response. */ + public static VariantRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __variantJson = JsonUtil.getObject(json, "variant"); + if (__variantJson != null) { + builder.variant(Variant.fromJson(__variantJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse VariantRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for VariantRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for VariantRetrieveResponse. */ + public static class Builder { + + private Variant variant; + + private Response httpResponse; + + private Builder() {} + + public Builder variant(Variant variant) { + this.variant = variant; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public VariantRetrieveResponse build() { + return new VariantRetrieveResponse(this); + } + } + + /** Get the variant from the response. */ + public Variant getVariant() { + return variant; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/variant/VariantUpdateResponse.java b/src/main/java/com/chargebee/v4/models/variant/responses/VariantUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/variant/VariantUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/variant/responses/VariantUpdateResponse.java index 15634a93..2cedba26 100644 --- a/src/main/java/com/chargebee/v4/core/responses/variant/VariantUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/variant/responses/VariantUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.variant; +package com.chargebee.v4.models.variant.responses; -import com.chargebee.v4.core.models.variant.Variant; +import com.chargebee.v4.models.variant.Variant; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/VirtualBankAccount.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/VirtualBankAccount.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/virtualBankAccount/VirtualBankAccount.java rename to src/main/java/com/chargebee/v4/models/virtualBankAccount/VirtualBankAccount.java index 17c17d35..00f5ed73 100644 --- a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/VirtualBankAccount.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/VirtualBankAccount.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.virtualBankAccount; +package com.chargebee.v4.models.virtualBankAccount; import com.chargebee.v4.internal.JsonUtil; import java.sql.Timestamp; @@ -237,6 +237,8 @@ public enum Gateway { DEUTSCHE_BANK("deutsche_bank"), + EZIDEBIT("ezidebit"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountCreateParams.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountCreateParams.java new file mode 100644 index 00000000..4adb9a13 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountCreateParams.java @@ -0,0 +1,138 @@ +/* + * 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.virtualBankAccount.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class VirtualBankAccountCreateParams { + + private final String customerId; + + private final String email; + + private final Scheme scheme; + + private VirtualBankAccountCreateParams(VirtualBankAccountCreateBuilder builder) { + + this.customerId = builder.customerId; + + this.email = builder.email; + + this.scheme = builder.scheme; + } + + public String getCustomerId() { + return customerId; + } + + public String getEmail() { + return email; + } + + public Scheme getScheme() { + return scheme; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.scheme != null) { + + formData.put("scheme", this.scheme); + } + + return formData; + } + + /** Create a new builder for VirtualBankAccountCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static VirtualBankAccountCreateBuilder builder() { + return new VirtualBankAccountCreateBuilder(); + } + + public static final class VirtualBankAccountCreateBuilder { + + private String customerId; + + private String email; + + private Scheme scheme; + + private VirtualBankAccountCreateBuilder() {} + + public VirtualBankAccountCreateBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public VirtualBankAccountCreateBuilder email(String value) { + this.email = value; + return this; + } + + public VirtualBankAccountCreateBuilder scheme(Scheme value) { + this.scheme = value; + return this; + } + + public VirtualBankAccountCreateParams build() { + return new VirtualBankAccountCreateParams(this); + } + } + + public enum Scheme { + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + GB_AUTOMATED_BANK_TRANSFER("gb_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + /** An enum member indicating that Scheme was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Scheme(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Scheme fromString(String value) { + if (value == null) return _UNKNOWN; + for (Scheme enumValue : Scheme.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountCreateUsingPermanentTokenParams.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountCreateUsingPermanentTokenParams.java new file mode 100644 index 00000000..ff7dbdd2 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountCreateUsingPermanentTokenParams.java @@ -0,0 +1,139 @@ +/* + * 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.virtualBankAccount.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class VirtualBankAccountCreateUsingPermanentTokenParams { + + private final String customerId; + + private final String referenceId; + + private final Scheme scheme; + + private VirtualBankAccountCreateUsingPermanentTokenParams( + VirtualBankAccountCreateUsingPermanentTokenBuilder builder) { + + this.customerId = builder.customerId; + + this.referenceId = builder.referenceId; + + this.scheme = builder.scheme; + } + + public String getCustomerId() { + return customerId; + } + + public String getReferenceId() { + return referenceId; + } + + public Scheme getScheme() { + return scheme; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.customerId != null) { + + formData.put("customer_id", this.customerId); + } + + if (this.referenceId != null) { + + formData.put("reference_id", this.referenceId); + } + + if (this.scheme != null) { + + formData.put("scheme", this.scheme); + } + + return formData; + } + + /** Create a new builder for VirtualBankAccountCreateUsingPermanentTokenParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static VirtualBankAccountCreateUsingPermanentTokenBuilder builder() { + return new VirtualBankAccountCreateUsingPermanentTokenBuilder(); + } + + public static final class VirtualBankAccountCreateUsingPermanentTokenBuilder { + + private String customerId; + + private String referenceId; + + private Scheme scheme; + + private VirtualBankAccountCreateUsingPermanentTokenBuilder() {} + + public VirtualBankAccountCreateUsingPermanentTokenBuilder customerId(String value) { + this.customerId = value; + return this; + } + + public VirtualBankAccountCreateUsingPermanentTokenBuilder referenceId(String value) { + this.referenceId = value; + return this; + } + + public VirtualBankAccountCreateUsingPermanentTokenBuilder scheme(Scheme value) { + this.scheme = value; + return this; + } + + public VirtualBankAccountCreateUsingPermanentTokenParams build() { + return new VirtualBankAccountCreateUsingPermanentTokenParams(this); + } + } + + public enum Scheme { + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + GB_AUTOMATED_BANK_TRANSFER("gb_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + /** An enum member indicating that Scheme was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Scheme(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Scheme fromString(String value) { + if (value == null) return _UNKNOWN; + for (Scheme enumValue : Scheme.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountDeleteLocalParams.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountDeleteLocalParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountDeleteLocalParams.java rename to src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountDeleteLocalParams.java index be6588e5..b91169a1 100644 --- a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountDeleteLocalParams.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountDeleteLocalParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.virtualBankAccount.params; +package com.chargebee.v4.models.virtualBankAccount.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class VirtualBankAccountDeleteLocalParams { - private final Map formData; - - private VirtualBankAccountDeleteLocalParams(VirtualBankAccountDeleteLocalBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private VirtualBankAccountDeleteLocalParams(VirtualBankAccountDeleteLocalBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static VirtualBankAccountDeleteLocalBuilder builder() { } public static final class VirtualBankAccountDeleteLocalBuilder { - private final Map formData = new LinkedHashMap<>(); private VirtualBankAccountDeleteLocalBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountDeleteParams.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountDeleteParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountDeleteParams.java rename to src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountDeleteParams.java index aeae47cd..ba6a42da 100644 --- a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountDeleteParams.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountDeleteParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.virtualBankAccount.params; +package com.chargebee.v4.models.virtualBankAccount.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class VirtualBankAccountDeleteParams { - private final Map formData; - - private VirtualBankAccountDeleteParams(VirtualBankAccountDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private VirtualBankAccountDeleteParams(VirtualBankAccountDeleteBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static VirtualBankAccountDeleteBuilder builder() { } public static final class VirtualBankAccountDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); private VirtualBankAccountDeleteBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountListParams.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountListParams.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountListParams.java rename to src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountListParams.java index 29c00de5..9c8b0366 100644 --- a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountListParams.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.virtualBankAccount.params; +package com.chargebee.v4.models.virtualBankAccount.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountRetrieveParams.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountRetrieveParams.java index ce08bc52..532f0ecd 100644 --- a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.virtualBankAccount.params; +package com.chargebee.v4.models.virtualBankAccount.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountSyncFundParams.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountSyncFundParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountSyncFundParams.java rename to src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountSyncFundParams.java index 1d02c9e3..a36c17c4 100644 --- a/src/main/java/com/chargebee/v4/core/models/virtualBankAccount/params/VirtualBankAccountSyncFundParams.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountSyncFundParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.virtualBankAccount.params; +package com.chargebee.v4.models.virtualBankAccount.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class VirtualBankAccountSyncFundParams { - private final Map formData; - - private VirtualBankAccountSyncFundParams(VirtualBankAccountSyncFundBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private VirtualBankAccountSyncFundParams(VirtualBankAccountSyncFundBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static VirtualBankAccountSyncFundBuilder builder() { } public static final class VirtualBankAccountSyncFundBuilder { - private final Map formData = new LinkedHashMap<>(); private VirtualBankAccountSyncFundBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountCreateResponse.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountCreateResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountCreateResponse.java rename to src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountCreateResponse.java index 90503f16..2cd4f897 100644 --- a/src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountCreateResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.virtualBankAccount; +package com.chargebee.v4.models.virtualBankAccount.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.virtualBankAccount.VirtualBankAccount; +import com.chargebee.v4.models.virtualBankAccount.VirtualBankAccount; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountCreateUsingPermanentTokenResponse.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountCreateUsingPermanentTokenResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountCreateUsingPermanentTokenResponse.java rename to src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountCreateUsingPermanentTokenResponse.java index b2171b00..78aaf9aa 100644 --- a/src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountCreateUsingPermanentTokenResponse.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountCreateUsingPermanentTokenResponse.java @@ -1,10 +1,10 @@ -package com.chargebee.v4.core.responses.virtualBankAccount; +package com.chargebee.v4.models.virtualBankAccount.responses; -import com.chargebee.v4.core.models.customer.Customer; +import com.chargebee.v4.models.customer.Customer; -import com.chargebee.v4.core.models.virtualBankAccount.VirtualBankAccount; +import com.chargebee.v4.models.virtualBankAccount.VirtualBankAccount; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountDeleteLocalResponse.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountDeleteLocalResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountDeleteLocalResponse.java rename to src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountDeleteLocalResponse.java index fac3e9e7..e5287124 100644 --- a/src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountDeleteLocalResponse.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountDeleteLocalResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.virtualBankAccount; +package com.chargebee.v4.models.virtualBankAccount.responses; -import com.chargebee.v4.core.models.virtualBankAccount.VirtualBankAccount; +import com.chargebee.v4.models.virtualBankAccount.VirtualBankAccount; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountDeleteResponse.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountDeleteResponse.java index 5c31397e..3b6a9c1d 100644 --- a/src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.virtualBankAccount; +package com.chargebee.v4.models.virtualBankAccount.responses; -import com.chargebee.v4.core.models.virtualBankAccount.VirtualBankAccount; +import com.chargebee.v4.models.virtualBankAccount.VirtualBankAccount; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountListResponse.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountListResponse.java rename to src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountListResponse.java index 0fc35021..4d4df63a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountListResponse.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.virtualBankAccount; +package com.chargebee.v4.models.virtualBankAccount.responses; import java.util.List; -import com.chargebee.v4.core.models.virtualBankAccount.VirtualBankAccount; +import com.chargebee.v4.models.virtualBankAccount.VirtualBankAccount; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.VirtualBankAccountService; -import com.chargebee.v4.core.models.virtualBankAccount.params.VirtualBankAccountListParams; +import com.chargebee.v4.services.VirtualBankAccountService; +import com.chargebee.v4.models.virtualBankAccount.params.VirtualBankAccountListParams; /** Immutable response object for VirtualBankAccountList operation. Contains paginated list data. */ public final class VirtualBankAccountListResponse { @@ -99,9 +100,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 VirtualBankAccountListResponse nextPage() throws Exception { + public VirtualBankAccountListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountRetrieveResponse.java new file mode 100644 index 00000000..9e0161ee --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.virtualBankAccount.responses; + +import com.chargebee.v4.models.virtualBankAccount.VirtualBankAccount; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for VirtualBankAccountRetrieve operation. Contains the response data + * from a single resource get operation. + */ +public final class VirtualBankAccountRetrieveResponse extends BaseResponse { + private final VirtualBankAccount virtualBankAccount; + + private VirtualBankAccountRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.virtualBankAccount = builder.virtualBankAccount; + } + + /** Parse JSON response into VirtualBankAccountRetrieveResponse object. */ + public static VirtualBankAccountRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into VirtualBankAccountRetrieveResponse object with HTTP response. */ + public static VirtualBankAccountRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __virtualBankAccountJson = JsonUtil.getObject(json, "virtual_bank_account"); + if (__virtualBankAccountJson != null) { + builder.virtualBankAccount(VirtualBankAccount.fromJson(__virtualBankAccountJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse VirtualBankAccountRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for VirtualBankAccountRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for VirtualBankAccountRetrieveResponse. */ + public static class Builder { + + private VirtualBankAccount virtualBankAccount; + + private Response httpResponse; + + private Builder() {} + + public Builder virtualBankAccount(VirtualBankAccount virtualBankAccount) { + this.virtualBankAccount = virtualBankAccount; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public VirtualBankAccountRetrieveResponse build() { + return new VirtualBankAccountRetrieveResponse(this); + } + } + + /** Get the virtualBankAccount from the response. */ + public VirtualBankAccount getVirtualBankAccount() { + return virtualBankAccount; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountSyncFundResponse.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountSyncFundResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountSyncFundResponse.java rename to src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountSyncFundResponse.java index 16414833..5f78b7b9 100644 --- a/src/main/java/com/chargebee/v4/core/responses/virtualBankAccount/VirtualBankAccountSyncFundResponse.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/responses/VirtualBankAccountSyncFundResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.virtualBankAccount; +package com.chargebee.v4.models.virtualBankAccount.responses; -import com.chargebee.v4.core.models.transaction.Transaction; +import com.chargebee.v4.models.transaction.Transaction; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/models/webhookEndpoint/WebhookEndpoint.java b/src/main/java/com/chargebee/v4/models/webhookEndpoint/WebhookEndpoint.java similarity index 98% rename from src/main/java/com/chargebee/v4/core/models/webhookEndpoint/WebhookEndpoint.java rename to src/main/java/com/chargebee/v4/models/webhookEndpoint/WebhookEndpoint.java index 1ba2a568..11087da7 100644 --- a/src/main/java/com/chargebee/v4/core/models/webhookEndpoint/WebhookEndpoint.java +++ b/src/main/java/com/chargebee/v4/models/webhookEndpoint/WebhookEndpoint.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.webhookEndpoint; +package com.chargebee.v4.models.webhookEndpoint; import com.chargebee.v4.internal.JsonUtil; import java.util.List; diff --git a/src/main/java/com/chargebee/v4/models/webhookEndpoint/params/WebhookEndpointCreateParams.java b/src/main/java/com/chargebee/v4/models/webhookEndpoint/params/WebhookEndpointCreateParams.java new file mode 100644 index 00000000..34228303 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/webhookEndpoint/params/WebhookEndpointCreateParams.java @@ -0,0 +1,303 @@ +/* + * 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.webhookEndpoint.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class WebhookEndpointCreateParams { + + private final String name; + + private final ApiVersion apiVersion; + + private final String url; + + private final Boolean primaryUrl; + + private final Boolean disabled; + + private final String basicAuthPassword; + + private final String basicAuthUsername; + + private final Boolean sendCardResource; + + private final ChargebeeResponseSchemaType chargebeeResponseSchemaType; + + private final List enabledEvents; + + private WebhookEndpointCreateParams(WebhookEndpointCreateBuilder builder) { + + this.name = builder.name; + + this.apiVersion = builder.apiVersion; + + this.url = builder.url; + + this.primaryUrl = builder.primaryUrl; + + this.disabled = builder.disabled; + + this.basicAuthPassword = builder.basicAuthPassword; + + this.basicAuthUsername = builder.basicAuthUsername; + + this.sendCardResource = builder.sendCardResource; + + this.chargebeeResponseSchemaType = builder.chargebeeResponseSchemaType; + + this.enabledEvents = builder.enabledEvents; + } + + public String getName() { + return name; + } + + public ApiVersion getApiVersion() { + return apiVersion; + } + + public String getUrl() { + return url; + } + + public Boolean getPrimaryUrl() { + return primaryUrl; + } + + public Boolean getDisabled() { + return disabled; + } + + public String getBasicAuthPassword() { + return basicAuthPassword; + } + + public String getBasicAuthUsername() { + return basicAuthUsername; + } + + public Boolean getSendCardResource() { + return sendCardResource; + } + + public ChargebeeResponseSchemaType getChargebeeResponseSchemaType() { + return chargebeeResponseSchemaType; + } + + public List getEnabledEvents() { + return enabledEvents; + } + + /** 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.apiVersion != null) { + + formData.put("api_version", this.apiVersion); + } + + if (this.url != null) { + + formData.put("url", this.url); + } + + if (this.primaryUrl != null) { + + formData.put("primary_url", this.primaryUrl); + } + + if (this.disabled != null) { + + formData.put("disabled", this.disabled); + } + + if (this.basicAuthPassword != null) { + + formData.put("basic_auth_password", this.basicAuthPassword); + } + + if (this.basicAuthUsername != null) { + + formData.put("basic_auth_username", this.basicAuthUsername); + } + + if (this.sendCardResource != null) { + + formData.put("send_card_resource", this.sendCardResource); + } + + if (this.chargebeeResponseSchemaType != null) { + + formData.put("chargebee_response_schema_type", this.chargebeeResponseSchemaType); + } + + if (this.enabledEvents != null) { + + formData.put("enabled_events", this.enabledEvents); + } + + return formData; + } + + /** Create a new builder for WebhookEndpointCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static WebhookEndpointCreateBuilder builder() { + return new WebhookEndpointCreateBuilder(); + } + + public static final class WebhookEndpointCreateBuilder { + + private String name; + + private ApiVersion apiVersion; + + private String url; + + private Boolean primaryUrl; + + private Boolean disabled; + + private String basicAuthPassword; + + private String basicAuthUsername; + + private Boolean sendCardResource; + + private ChargebeeResponseSchemaType chargebeeResponseSchemaType; + + private List enabledEvents; + + private WebhookEndpointCreateBuilder() {} + + public WebhookEndpointCreateBuilder name(String value) { + this.name = value; + return this; + } + + public WebhookEndpointCreateBuilder apiVersion(ApiVersion value) { + this.apiVersion = value; + return this; + } + + public WebhookEndpointCreateBuilder url(String value) { + this.url = value; + return this; + } + + public WebhookEndpointCreateBuilder primaryUrl(Boolean value) { + this.primaryUrl = value; + return this; + } + + public WebhookEndpointCreateBuilder disabled(Boolean value) { + this.disabled = value; + return this; + } + + public WebhookEndpointCreateBuilder basicAuthPassword(String value) { + this.basicAuthPassword = value; + return this; + } + + public WebhookEndpointCreateBuilder basicAuthUsername(String value) { + this.basicAuthUsername = value; + return this; + } + + public WebhookEndpointCreateBuilder sendCardResource(Boolean value) { + this.sendCardResource = value; + return this; + } + + public WebhookEndpointCreateBuilder chargebeeResponseSchemaType( + ChargebeeResponseSchemaType value) { + this.chargebeeResponseSchemaType = value; + return this; + } + + public WebhookEndpointCreateBuilder enabledEvents(List value) { + this.enabledEvents = value; + return this; + } + + public WebhookEndpointCreateParams build() { + return new WebhookEndpointCreateParams(this); + } + } + + public enum ApiVersion { + V1("v1"), + + V2("v2"), + + /** An enum member indicating that ApiVersion was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ApiVersion(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ApiVersion fromString(String value) { + if (value == null) return _UNKNOWN; + for (ApiVersion enumValue : ApiVersion.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChargebeeResponseSchemaType { + PLANS_ADDONS("plans_addons"), + + ITEMS("items"), + + COMPAT("compat"), + + /** + * An enum member indicating that ChargebeeResponseSchemaType was instantiated with an unknown + * value. + */ + _UNKNOWN(null); + private final String value; + + ChargebeeResponseSchemaType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargebeeResponseSchemaType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargebeeResponseSchemaType enumValue : ChargebeeResponseSchemaType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/models/webhookEndpoint/params/WebhookEndpointDeleteParams.java b/src/main/java/com/chargebee/v4/models/webhookEndpoint/params/WebhookEndpointDeleteParams.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/models/webhookEndpoint/params/WebhookEndpointDeleteParams.java rename to src/main/java/com/chargebee/v4/models/webhookEndpoint/params/WebhookEndpointDeleteParams.java index 9dc04ca8..659f556c 100644 --- a/src/main/java/com/chargebee/v4/core/models/webhookEndpoint/params/WebhookEndpointDeleteParams.java +++ b/src/main/java/com/chargebee/v4/models/webhookEndpoint/params/WebhookEndpointDeleteParams.java @@ -4,24 +4,21 @@ * Reach out to dx@chargebee.com for any questions. * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.webhookEndpoint.params; +package com.chargebee.v4.models.webhookEndpoint.params; import com.chargebee.v4.internal.Recommended; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; public final class WebhookEndpointDeleteParams { - private final Map formData; - - private WebhookEndpointDeleteParams(WebhookEndpointDeleteBuilder builder) { - this.formData = Collections.unmodifiableMap(new LinkedHashMap<>(builder.formData)); - } + private WebhookEndpointDeleteParams(WebhookEndpointDeleteBuilder builder) {} /** Get the form data for this request. */ public Map toFormData() { + Map formData = new LinkedHashMap<>(); + return formData; } @@ -32,7 +29,6 @@ public static WebhookEndpointDeleteBuilder builder() { } public static final class WebhookEndpointDeleteBuilder { - private final Map formData = new LinkedHashMap<>(); private WebhookEndpointDeleteBuilder() {} diff --git a/src/main/java/com/chargebee/v4/core/models/webhookEndpoint/params/WebhookEndpointListParams.java b/src/main/java/com/chargebee/v4/models/webhookEndpoint/params/WebhookEndpointListParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/webhookEndpoint/params/WebhookEndpointListParams.java rename to src/main/java/com/chargebee/v4/models/webhookEndpoint/params/WebhookEndpointListParams.java index f3bb1e42..bece6751 100644 --- a/src/main/java/com/chargebee/v4/core/models/webhookEndpoint/params/WebhookEndpointListParams.java +++ b/src/main/java/com/chargebee/v4/models/webhookEndpoint/params/WebhookEndpointListParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.webhookEndpoint.params; +package com.chargebee.v4.models.webhookEndpoint.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/core/models/webhookEndpoint/params/WebhookEndpointRetrieveParams.java b/src/main/java/com/chargebee/v4/models/webhookEndpoint/params/WebhookEndpointRetrieveParams.java similarity index 96% rename from src/main/java/com/chargebee/v4/core/models/webhookEndpoint/params/WebhookEndpointRetrieveParams.java rename to src/main/java/com/chargebee/v4/models/webhookEndpoint/params/WebhookEndpointRetrieveParams.java index 5a792121..53ae81f0 100644 --- a/src/main/java/com/chargebee/v4/core/models/webhookEndpoint/params/WebhookEndpointRetrieveParams.java +++ b/src/main/java/com/chargebee/v4/models/webhookEndpoint/params/WebhookEndpointRetrieveParams.java @@ -5,7 +5,7 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.models.webhookEndpoint.params; +package com.chargebee.v4.models.webhookEndpoint.params; import com.chargebee.v4.internal.Recommended; diff --git a/src/main/java/com/chargebee/v4/models/webhookEndpoint/params/WebhookEndpointUpdateParams.java b/src/main/java/com/chargebee/v4/models/webhookEndpoint/params/WebhookEndpointUpdateParams.java new file mode 100644 index 00000000..93800f60 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/webhookEndpoint/params/WebhookEndpointUpdateParams.java @@ -0,0 +1,249 @@ +/* + * 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.webhookEndpoint.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class WebhookEndpointUpdateParams { + + private final String name; + + private final ApiVersion apiVersion; + + private final String url; + + private final Boolean primaryUrl; + + private final Boolean sendCardResource; + + private final String basicAuthPassword; + + private final String basicAuthUsername; + + private final Boolean disabled; + + private final List enabledEvents; + + private WebhookEndpointUpdateParams(WebhookEndpointUpdateBuilder builder) { + + this.name = builder.name; + + this.apiVersion = builder.apiVersion; + + this.url = builder.url; + + this.primaryUrl = builder.primaryUrl; + + this.sendCardResource = builder.sendCardResource; + + this.basicAuthPassword = builder.basicAuthPassword; + + this.basicAuthUsername = builder.basicAuthUsername; + + this.disabled = builder.disabled; + + this.enabledEvents = builder.enabledEvents; + } + + public String getName() { + return name; + } + + public ApiVersion getApiVersion() { + return apiVersion; + } + + public String getUrl() { + return url; + } + + public Boolean getPrimaryUrl() { + return primaryUrl; + } + + public Boolean getSendCardResource() { + return sendCardResource; + } + + public String getBasicAuthPassword() { + return basicAuthPassword; + } + + public String getBasicAuthUsername() { + return basicAuthUsername; + } + + public Boolean getDisabled() { + return disabled; + } + + public List getEnabledEvents() { + return enabledEvents; + } + + /** 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.apiVersion != null) { + + formData.put("api_version", this.apiVersion); + } + + if (this.url != null) { + + formData.put("url", this.url); + } + + if (this.primaryUrl != null) { + + formData.put("primary_url", this.primaryUrl); + } + + if (this.sendCardResource != null) { + + formData.put("send_card_resource", this.sendCardResource); + } + + if (this.basicAuthPassword != null) { + + formData.put("basic_auth_password", this.basicAuthPassword); + } + + if (this.basicAuthUsername != null) { + + formData.put("basic_auth_username", this.basicAuthUsername); + } + + if (this.disabled != null) { + + formData.put("disabled", this.disabled); + } + + if (this.enabledEvents != null) { + + formData.put("enabled_events", this.enabledEvents); + } + + return formData; + } + + /** Create a new builder for WebhookEndpointUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static WebhookEndpointUpdateBuilder builder() { + return new WebhookEndpointUpdateBuilder(); + } + + public static final class WebhookEndpointUpdateBuilder { + + private String name; + + private ApiVersion apiVersion; + + private String url; + + private Boolean primaryUrl; + + private Boolean sendCardResource; + + private String basicAuthPassword; + + private String basicAuthUsername; + + private Boolean disabled; + + private List enabledEvents; + + private WebhookEndpointUpdateBuilder() {} + + public WebhookEndpointUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public WebhookEndpointUpdateBuilder apiVersion(ApiVersion value) { + this.apiVersion = value; + return this; + } + + public WebhookEndpointUpdateBuilder url(String value) { + this.url = value; + return this; + } + + public WebhookEndpointUpdateBuilder primaryUrl(Boolean value) { + this.primaryUrl = value; + return this; + } + + public WebhookEndpointUpdateBuilder sendCardResource(Boolean value) { + this.sendCardResource = value; + return this; + } + + public WebhookEndpointUpdateBuilder basicAuthPassword(String value) { + this.basicAuthPassword = value; + return this; + } + + public WebhookEndpointUpdateBuilder basicAuthUsername(String value) { + this.basicAuthUsername = value; + return this; + } + + public WebhookEndpointUpdateBuilder disabled(Boolean value) { + this.disabled = value; + return this; + } + + public WebhookEndpointUpdateBuilder enabledEvents(List value) { + this.enabledEvents = value; + return this; + } + + public WebhookEndpointUpdateParams build() { + return new WebhookEndpointUpdateParams(this); + } + } + + public enum ApiVersion { + V1("v1"), + + V2("v2"), + + /** An enum member indicating that ApiVersion was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ApiVersion(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ApiVersion fromString(String value) { + if (value == null) return _UNKNOWN; + for (ApiVersion enumValue : ApiVersion.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/webhookEndpoint/WebhookEndpointCreateResponse.java b/src/main/java/com/chargebee/v4/models/webhookEndpoint/responses/WebhookEndpointCreateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/webhookEndpoint/WebhookEndpointCreateResponse.java rename to src/main/java/com/chargebee/v4/models/webhookEndpoint/responses/WebhookEndpointCreateResponse.java index e60895b1..54af1da8 100644 --- a/src/main/java/com/chargebee/v4/core/responses/webhookEndpoint/WebhookEndpointCreateResponse.java +++ b/src/main/java/com/chargebee/v4/models/webhookEndpoint/responses/WebhookEndpointCreateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.webhookEndpoint; +package com.chargebee.v4.models.webhookEndpoint.responses; -import com.chargebee.v4.core.models.webhookEndpoint.WebhookEndpoint; +import com.chargebee.v4.models.webhookEndpoint.WebhookEndpoint; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/webhookEndpoint/WebhookEndpointDeleteResponse.java b/src/main/java/com/chargebee/v4/models/webhookEndpoint/responses/WebhookEndpointDeleteResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/webhookEndpoint/WebhookEndpointDeleteResponse.java rename to src/main/java/com/chargebee/v4/models/webhookEndpoint/responses/WebhookEndpointDeleteResponse.java index 3248716e..6d2e4511 100644 --- a/src/main/java/com/chargebee/v4/core/responses/webhookEndpoint/WebhookEndpointDeleteResponse.java +++ b/src/main/java/com/chargebee/v4/models/webhookEndpoint/responses/WebhookEndpointDeleteResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.webhookEndpoint; +package com.chargebee.v4.models.webhookEndpoint.responses; -import com.chargebee.v4.core.models.webhookEndpoint.WebhookEndpoint; +import com.chargebee.v4.models.webhookEndpoint.WebhookEndpoint; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/responses/webhookEndpoint/WebhookEndpointListResponse.java b/src/main/java/com/chargebee/v4/models/webhookEndpoint/responses/WebhookEndpointListResponse.java similarity index 91% rename from src/main/java/com/chargebee/v4/core/responses/webhookEndpoint/WebhookEndpointListResponse.java rename to src/main/java/com/chargebee/v4/models/webhookEndpoint/responses/WebhookEndpointListResponse.java index 59102e28..cb3157a5 100644 --- a/src/main/java/com/chargebee/v4/core/responses/webhookEndpoint/WebhookEndpointListResponse.java +++ b/src/main/java/com/chargebee/v4/models/webhookEndpoint/responses/WebhookEndpointListResponse.java @@ -1,13 +1,14 @@ -package com.chargebee.v4.core.responses.webhookEndpoint; +package com.chargebee.v4.models.webhookEndpoint.responses; import java.util.List; -import com.chargebee.v4.core.models.webhookEndpoint.WebhookEndpoint; +import com.chargebee.v4.models.webhookEndpoint.WebhookEndpoint; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.services.WebhookEndpointService; -import com.chargebee.v4.core.models.webhookEndpoint.params.WebhookEndpointListParams; +import com.chargebee.v4.services.WebhookEndpointService; +import com.chargebee.v4.models.webhookEndpoint.params.WebhookEndpointListParams; /** Immutable response object for WebhookEndpointList operation. Contains paginated list data. */ public final class WebhookEndpointListResponse { @@ -99,9 +100,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 WebhookEndpointListResponse nextPage() throws Exception { + public WebhookEndpointListResponse nextPage() throws ChargebeeException { if (!hasNextPage()) { throw new IllegalStateException("No more pages available"); } diff --git a/src/main/java/com/chargebee/v4/models/webhookEndpoint/responses/WebhookEndpointRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/webhookEndpoint/responses/WebhookEndpointRetrieveResponse.java new file mode 100644 index 00000000..934be825 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/webhookEndpoint/responses/WebhookEndpointRetrieveResponse.java @@ -0,0 +1,77 @@ +package com.chargebee.v4.models.webhookEndpoint.responses; + +import com.chargebee.v4.models.webhookEndpoint.WebhookEndpoint; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for WebhookEndpointRetrieve operation. Contains the response data from + * a single resource get operation. + */ +public final class WebhookEndpointRetrieveResponse extends BaseResponse { + private final WebhookEndpoint webhookEndpoint; + + private WebhookEndpointRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.webhookEndpoint = builder.webhookEndpoint; + } + + /** Parse JSON response into WebhookEndpointRetrieveResponse object. */ + public static WebhookEndpointRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into WebhookEndpointRetrieveResponse object with HTTP response. */ + public static WebhookEndpointRetrieveResponse fromJson(String json, Response httpResponse) { + try { + Builder builder = builder(); + + String __webhookEndpointJson = JsonUtil.getObject(json, "webhook_endpoint"); + if (__webhookEndpointJson != null) { + builder.webhookEndpoint(WebhookEndpoint.fromJson(__webhookEndpointJson)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse WebhookEndpointRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for WebhookEndpointRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for WebhookEndpointRetrieveResponse. */ + public static class Builder { + + private WebhookEndpoint webhookEndpoint; + + private Response httpResponse; + + private Builder() {} + + public Builder webhookEndpoint(WebhookEndpoint webhookEndpoint) { + this.webhookEndpoint = webhookEndpoint; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public WebhookEndpointRetrieveResponse build() { + return new WebhookEndpointRetrieveResponse(this); + } + } + + /** Get the webhookEndpoint from the response. */ + public WebhookEndpoint getWebhookEndpoint() { + return webhookEndpoint; + } +} diff --git a/src/main/java/com/chargebee/v4/core/responses/webhookEndpoint/WebhookEndpointUpdateResponse.java b/src/main/java/com/chargebee/v4/models/webhookEndpoint/responses/WebhookEndpointUpdateResponse.java similarity index 92% rename from src/main/java/com/chargebee/v4/core/responses/webhookEndpoint/WebhookEndpointUpdateResponse.java rename to src/main/java/com/chargebee/v4/models/webhookEndpoint/responses/WebhookEndpointUpdateResponse.java index 91ae6310..0392b53a 100644 --- a/src/main/java/com/chargebee/v4/core/responses/webhookEndpoint/WebhookEndpointUpdateResponse.java +++ b/src/main/java/com/chargebee/v4/models/webhookEndpoint/responses/WebhookEndpointUpdateResponse.java @@ -1,8 +1,8 @@ -package com.chargebee.v4.core.responses.webhookEndpoint; +package com.chargebee.v4.models.webhookEndpoint.responses; -import com.chargebee.v4.core.models.webhookEndpoint.WebhookEndpoint; +import com.chargebee.v4.models.webhookEndpoint.WebhookEndpoint; -import com.chargebee.v4.core.responses.BaseResponse; +import com.chargebee.v4.models.BaseResponse; import com.chargebee.v4.internal.JsonUtil; import com.chargebee.v4.transport.Response; diff --git a/src/main/java/com/chargebee/v4/core/services/AdditionalBillingLogiqService.java b/src/main/java/com/chargebee/v4/services/AdditionalBillingLogiqService.java similarity index 82% rename from src/main/java/com/chargebee/v4/core/services/AdditionalBillingLogiqService.java rename to src/main/java/com/chargebee/v4/services/AdditionalBillingLogiqService.java index 2cec45e8..e493a30d 100644 --- a/src/main/java/com/chargebee/v4/core/services/AdditionalBillingLogiqService.java +++ b/src/main/java/com/chargebee/v4/services/AdditionalBillingLogiqService.java @@ -5,15 +5,16 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.additionalBillingLogiq.params.AdditionalBillingLogiqRetrieveParams; +import com.chargebee.v4.models.additionalBillingLogiq.params.AdditionalBillingLogiqRetrieveParams; -import com.chargebee.v4.core.responses.additionalBillingLogiq.AdditionalBillingLogiqRetrieveResponse; +import com.chargebee.v4.models.additionalBillingLogiq.responses.AdditionalBillingLogiqRetrieveResponse; public final class AdditionalBillingLogiqService extends BaseService { @@ -55,7 +56,7 @@ public AdditionalBillingLogiqService withOptions(RequestOptions options) { * retrieve a additionalBillingLogiq using immutable params (executes immediately) - returns raw * Response. */ - Response retrieveRaw(AdditionalBillingLogiqRetrieveParams params) throws Exception { + Response retrieveRaw(AdditionalBillingLogiqRetrieveParams params) throws ChargebeeException { return get("/additional_billing_logiqs", params != null ? params.toQueryParams() : null); } @@ -64,13 +65,13 @@ Response retrieveRaw(AdditionalBillingLogiqRetrieveParams params) throws Excepti * retrieve a additionalBillingLogiq using raw JSON payload (executes immediately) - returns raw * Response. */ - Response retrieveRaw(String jsonPayload) throws Exception { + Response retrieveRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public AdditionalBillingLogiqRetrieveResponse retrieve( - AdditionalBillingLogiqRetrieveParams params) throws Exception { + AdditionalBillingLogiqRetrieveParams params) throws ChargebeeException { Response response = retrieveRaw(params); return AdditionalBillingLogiqRetrieveResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/services/AddonService.java b/src/main/java/com/chargebee/v4/services/AddonService.java new file mode 100644 index 00000000..483f1da2 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/AddonService.java @@ -0,0 +1,196 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.addon.params.AddonCopyParams; + +import com.chargebee.v4.models.addon.params.AddonUpdateParams; + +import com.chargebee.v4.models.addon.params.AddonListParams; + +import com.chargebee.v4.models.addon.params.AddonCreateParams; + +import com.chargebee.v4.models.addon.responses.AddonCopyResponse; + +import com.chargebee.v4.models.addon.responses.AddonUnarchiveResponse; + +import com.chargebee.v4.models.addon.responses.AddonRetrieveResponse; + +import com.chargebee.v4.models.addon.responses.AddonUpdateResponse; + +import com.chargebee.v4.models.addon.responses.AddonListResponse; + +import com.chargebee.v4.models.addon.responses.AddonCreateResponse; + +import com.chargebee.v4.models.addon.responses.AddonDeleteResponse; + +public final class AddonService extends BaseService { + + private final ServiceConfig config; + + public AddonService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private AddonService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private AddonService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + AddonService with(RequestOptions newOptions) { + return new AddonService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public AddonService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** copy a addon using immutable params (executes immediately) - returns raw Response. */ + Response copyRaw(AddonCopyParams params) throws ChargebeeException { + + return post("/addons/copy", params != null ? params.toFormData() : null); + } + + /** copy a addon using raw JSON payload (executes immediately) - returns raw Response. */ + Response copyRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/addons/copy", jsonPayload); + } + + public AddonCopyResponse copy(AddonCopyParams params) throws ChargebeeException { + Response response = copyRaw(params); + + return AddonCopyResponse.fromJson(response.getBodyAsString(), response); + } + + /** unarchive a addon (executes immediately) - returns raw Response. */ + Response unarchiveRaw(String addonId) throws ChargebeeException { + String path = buildPathWithParams("/addons/{addon-id}/unarchive", "addon-id", addonId); + + return post(path, null); + } + + public AddonUnarchiveResponse unarchive(String addonId) throws ChargebeeException { + Response response = unarchiveRaw(addonId); + return AddonUnarchiveResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a addon (executes immediately) - returns raw Response. */ + Response retrieveRaw(String addonId) throws ChargebeeException { + String path = buildPathWithParams("/addons/{addon-id}", "addon-id", addonId); + + return get(path, null); + } + + public AddonRetrieveResponse retrieve(String addonId) throws ChargebeeException { + Response response = retrieveRaw(addonId); + return AddonRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** update a addon (executes immediately) - returns raw Response. */ + Response updateRaw(String addonId) throws ChargebeeException { + String path = buildPathWithParams("/addons/{addon-id}", "addon-id", addonId); + + return post(path, null); + } + + /** update a addon using immutable params (executes immediately) - returns raw Response. */ + Response updateRaw(String addonId, AddonUpdateParams params) throws ChargebeeException { + String path = buildPathWithParams("/addons/{addon-id}", "addon-id", addonId); + return post(path, params.toFormData()); + } + + /** update a addon using raw JSON payload (executes immediately) - returns raw Response. */ + Response updateRaw(String addonId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/addons/{addon-id}", "addon-id", addonId); + return postJson(path, jsonPayload); + } + + public AddonUpdateResponse update(String addonId, AddonUpdateParams params) + throws ChargebeeException { + Response response = updateRaw(addonId, params); + return AddonUpdateResponse.fromJson(response.getBodyAsString(), response); + } + + /** list a addon using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(AddonListParams params) throws ChargebeeException { + + return get("/addons", params != null ? params.toQueryParams() : null); + } + + /** list a addon without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/addons", null); + } + + /** list a addon using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public AddonListResponse list(AddonListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return AddonListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public AddonListResponse list() throws ChargebeeException { + Response response = listRaw(); + return AddonListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** create a addon using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(AddonCreateParams params) throws ChargebeeException { + + return post("/addons", params != null ? params.toFormData() : null); + } + + /** create a addon using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/addons", jsonPayload); + } + + public AddonCreateResponse create(AddonCreateParams params) throws ChargebeeException { + Response response = createRaw(params); + + return AddonCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** delete a addon (executes immediately) - returns raw Response. */ + Response deleteRaw(String addonId) throws ChargebeeException { + String path = buildPathWithParams("/addons/{addon-id}/delete", "addon-id", addonId); + + return post(path, null); + } + + public AddonDeleteResponse delete(String addonId) throws ChargebeeException { + Response response = deleteRaw(addonId); + return AddonDeleteResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/AddressService.java b/src/main/java/com/chargebee/v4/services/AddressService.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/services/AddressService.java rename to src/main/java/com/chargebee/v4/services/AddressService.java index 9d6e8e60..dd8de8df 100644 --- a/src/main/java/com/chargebee/v4/core/services/AddressService.java +++ b/src/main/java/com/chargebee/v4/services/AddressService.java @@ -5,19 +5,20 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.address.params.AddressRetrieveParams; +import com.chargebee.v4.models.address.params.AddressRetrieveParams; -import com.chargebee.v4.core.models.address.params.AddressUpdateParams; +import com.chargebee.v4.models.address.params.AddressUpdateParams; -import com.chargebee.v4.core.responses.address.AddressRetrieveResponse; +import com.chargebee.v4.models.address.responses.AddressRetrieveResponse; -import com.chargebee.v4.core.responses.address.AddressUpdateResponse; +import com.chargebee.v4.models.address.responses.AddressUpdateResponse; public final class AddressService extends BaseService { @@ -54,36 +55,36 @@ public AddressService withOptions(RequestOptions options) { // === Operations === /** retrieve a address using immutable params (executes immediately) - returns raw Response. */ - Response retrieveRaw(AddressRetrieveParams params) throws Exception { + Response retrieveRaw(AddressRetrieveParams params) throws ChargebeeException { return get("/addresses", params != null ? params.toQueryParams() : null); } /** retrieve a address using raw JSON payload (executes immediately) - returns raw Response. */ - Response retrieveRaw(String jsonPayload) throws Exception { + Response retrieveRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public AddressRetrieveResponse retrieve(AddressRetrieveParams params) throws Exception { + public AddressRetrieveResponse retrieve(AddressRetrieveParams params) throws ChargebeeException { Response response = retrieveRaw(params); return AddressRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** update a address using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(AddressUpdateParams params) throws Exception { + Response updateRaw(AddressUpdateParams params) throws ChargebeeException { return post("/addresses", params != null ? params.toFormData() : null); } /** update a address using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String jsonPayload) throws Exception { + Response updateRaw(String jsonPayload) throws ChargebeeException { return postJson("/addresses", jsonPayload); } - public AddressUpdateResponse update(AddressUpdateParams params) throws Exception { + public AddressUpdateResponse update(AddressUpdateParams params) throws ChargebeeException { Response response = updateRaw(params); return AddressUpdateResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/services/AttachedItemService.java b/src/main/java/com/chargebee/v4/services/AttachedItemService.java new file mode 100644 index 00000000..81c197e3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/AttachedItemService.java @@ -0,0 +1,220 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.attachedItem.params.AttachedItemRetrieveParams; + +import com.chargebee.v4.models.attachedItem.params.AttachedItemUpdateParams; + +import com.chargebee.v4.models.attachedItem.params.AttachedItemListParams; + +import com.chargebee.v4.models.attachedItem.params.AttachedItemCreateParams; + +import com.chargebee.v4.models.attachedItem.params.AttachedItemDeleteParams; + +import com.chargebee.v4.models.attachedItem.responses.AttachedItemRetrieveResponse; + +import com.chargebee.v4.models.attachedItem.responses.AttachedItemUpdateResponse; + +import com.chargebee.v4.models.attachedItem.responses.AttachedItemListResponse; + +import com.chargebee.v4.models.attachedItem.responses.AttachedItemCreateResponse; + +import com.chargebee.v4.models.attachedItem.responses.AttachedItemDeleteResponse; + +public final class AttachedItemService extends BaseService { + + private final ServiceConfig config; + + public AttachedItemService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private AttachedItemService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private AttachedItemService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + AttachedItemService with(RequestOptions newOptions) { + return new AttachedItemService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public AttachedItemService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** retrieve a attachedItem (executes immediately) - returns raw Response. */ + Response retrieveRaw(String attachedItemId) throws ChargebeeException { + String path = + buildPathWithParams( + "/attached_items/{attached-item-id}", "attached-item-id", attachedItemId); + + return get(path, null); + } + + /** + * retrieve a attachedItem using immutable params (executes immediately) - returns raw Response. + */ + Response retrieveRaw(String attachedItemId, AttachedItemRetrieveParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/attached_items/{attached-item-id}", "attached-item-id", attachedItemId); + return get(path, params != null ? params.toQueryParams() : null); + } + + public AttachedItemRetrieveResponse retrieve( + String attachedItemId, AttachedItemRetrieveParams params) throws ChargebeeException { + Response response = retrieveRaw(attachedItemId, params); + return AttachedItemRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + public AttachedItemRetrieveResponse retrieve(String attachedItemId) throws ChargebeeException { + Response response = retrieveRaw(attachedItemId); + return AttachedItemRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** update a attachedItem (executes immediately) - returns raw Response. */ + Response updateRaw(String attachedItemId) throws ChargebeeException { + String path = + buildPathWithParams( + "/attached_items/{attached-item-id}", "attached-item-id", attachedItemId); + + return post(path, null); + } + + /** update a attachedItem using immutable params (executes immediately) - returns raw Response. */ + Response updateRaw(String attachedItemId, AttachedItemUpdateParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/attached_items/{attached-item-id}", "attached-item-id", attachedItemId); + return post(path, params.toFormData()); + } + + /** update a attachedItem using raw JSON payload (executes immediately) - returns raw Response. */ + Response updateRaw(String attachedItemId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/attached_items/{attached-item-id}", "attached-item-id", attachedItemId); + return postJson(path, jsonPayload); + } + + public AttachedItemUpdateResponse update(String attachedItemId, AttachedItemUpdateParams params) + throws ChargebeeException { + Response response = updateRaw(attachedItemId, params); + return AttachedItemUpdateResponse.fromJson(response.getBodyAsString(), response); + } + + /** list a attachedItem using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(String itemId, AttachedItemListParams params) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/attached_items", "item-id", itemId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** list a attachedItem without params (executes immediately) - returns raw Response. */ + Response listRaw(String itemId) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/attached_items", "item-id", itemId); + return get(path, null); + } + + /** list a attachedItem using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String itemId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/attached_items", "item-id", itemId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public AttachedItemListResponse list(String itemId, AttachedItemListParams params) + throws ChargebeeException { + Response response = listRaw(itemId, params); + return AttachedItemListResponse.fromJson( + response.getBodyAsString(), this, params, itemId, response); + } + + public AttachedItemListResponse list(String itemId) throws ChargebeeException { + Response response = listRaw(itemId); + return AttachedItemListResponse.fromJson( + response.getBodyAsString(), this, null, itemId, response); + } + + /** create a attachedItem (executes immediately) - returns raw Response. */ + Response createRaw(String itemId) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/attached_items", "item-id", itemId); + + return post(path, null); + } + + /** create a attachedItem using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(String itemId, AttachedItemCreateParams params) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/attached_items", "item-id", itemId); + return post(path, params.toFormData()); + } + + /** create a attachedItem using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String itemId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/attached_items", "item-id", itemId); + return postJson(path, jsonPayload); + } + + public AttachedItemCreateResponse create(String itemId, AttachedItemCreateParams params) + throws ChargebeeException { + Response response = createRaw(itemId, params); + return AttachedItemCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** delete a attachedItem (executes immediately) - returns raw Response. */ + Response deleteRaw(String attachedItemId) throws ChargebeeException { + String path = + buildPathWithParams( + "/attached_items/{attached-item-id}/delete", "attached-item-id", attachedItemId); + + return post(path, null); + } + + /** delete a attachedItem using immutable params (executes immediately) - returns raw Response. */ + Response deleteRaw(String attachedItemId, AttachedItemDeleteParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/attached_items/{attached-item-id}/delete", "attached-item-id", attachedItemId); + return post(path, params.toFormData()); + } + + /** delete a attachedItem using raw JSON payload (executes immediately) - returns raw Response. */ + Response deleteRaw(String attachedItemId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/attached_items/{attached-item-id}/delete", "attached-item-id", attachedItemId); + return postJson(path, jsonPayload); + } + + public AttachedItemDeleteResponse delete(String attachedItemId, AttachedItemDeleteParams params) + throws ChargebeeException { + Response response = deleteRaw(attachedItemId, params); + return AttachedItemDeleteResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/BaseService.java b/src/main/java/com/chargebee/v4/services/BaseService.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/services/BaseService.java rename to src/main/java/com/chargebee/v4/services/BaseService.java index e5ddcf48..d8f2a1cd 100644 --- a/src/main/java/com/chargebee/v4/core/services/BaseService.java +++ b/src/main/java/com/chargebee/v4/services/BaseService.java @@ -1,8 +1,9 @@ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.request.RequestContext; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Request; import com.chargebee.v4.transport.Response; import com.chargebee.v4.transport.UrlBuilder; @@ -97,7 +98,7 @@ protected Object clientForBuilders() { /** * Helper: POST with optional headers. */ - protected Response post(String path, Map formData) throws Exception { + protected Response post(String path, Map formData) throws ChargebeeException { String fullUrl = UrlBuilder.buildUrl(client.getBaseUrl(), path, null); Request.Builder builder = Request.builder() .method("POST") @@ -110,7 +111,7 @@ protected Response post(String path, Map formData) throws Except /** * Helper: POST JSON with optional headers. */ - protected Response postJson(String path, String jsonData) throws Exception { + protected Response postJson(String path, String jsonData) throws ChargebeeException { String fullUrl = UrlBuilder.buildUrl(client.getBaseUrl(), path, null); Request.Builder builder = Request.builder() .method("POST") @@ -173,7 +174,7 @@ protected R parseResponse(Response response, Class responseClass) { /** * GET with Object query parameters. */ - protected Response get(String path, Map queryParams) throws Exception { + protected Response get(String path, Map queryParams) throws ChargebeeException { String fullUrl = UrlBuilder.buildUrl(client.getBaseUrl(), path, queryParams); Request.Builder builder = Request.builder() .method("GET") diff --git a/src/main/java/com/chargebee/v4/core/services/BrandConfigurationService.java b/src/main/java/com/chargebee/v4/services/BrandConfigurationService.java similarity index 84% rename from src/main/java/com/chargebee/v4/core/services/BrandConfigurationService.java rename to src/main/java/com/chargebee/v4/services/BrandConfigurationService.java index 2237295c..d9794724 100644 --- a/src/main/java/com/chargebee/v4/core/services/BrandConfigurationService.java +++ b/src/main/java/com/chargebee/v4/services/BrandConfigurationService.java @@ -5,15 +5,16 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.brandConfiguration.params.BrandConfigurationRetrieveParams; +import com.chargebee.v4.models.brandConfiguration.params.BrandConfigurationRetrieveParams; -import com.chargebee.v4.core.responses.brandConfiguration.BrandConfigurationRetrieveResponse; +import com.chargebee.v4.models.brandConfiguration.responses.BrandConfigurationRetrieveResponse; public final class BrandConfigurationService extends BaseService { @@ -54,7 +55,7 @@ public BrandConfigurationService withOptions(RequestOptions options) { * retrieve a brandConfiguration using immutable params (executes immediately) - returns raw * Response. */ - Response retrieveRaw(BrandConfigurationRetrieveParams params) throws Exception { + Response retrieveRaw(BrandConfigurationRetrieveParams params) throws ChargebeeException { return get("/brand_configurations", params != null ? params.toQueryParams() : null); } @@ -63,13 +64,13 @@ Response retrieveRaw(BrandConfigurationRetrieveParams params) throws Exception { * retrieve a brandConfiguration using raw JSON payload (executes immediately) - returns raw * Response. */ - Response retrieveRaw(String jsonPayload) throws Exception { + Response retrieveRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public BrandConfigurationRetrieveResponse retrieve(BrandConfigurationRetrieveParams params) - throws Exception { + throws ChargebeeException { Response response = retrieveRaw(params); return BrandConfigurationRetrieveResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/core/services/BusinessEntityService.java b/src/main/java/com/chargebee/v4/services/BusinessEntityService.java similarity index 78% rename from src/main/java/com/chargebee/v4/core/services/BusinessEntityService.java rename to src/main/java/com/chargebee/v4/services/BusinessEntityService.java index 71643a46..fef0494a 100644 --- a/src/main/java/com/chargebee/v4/core/services/BusinessEntityService.java +++ b/src/main/java/com/chargebee/v4/services/BusinessEntityService.java @@ -5,19 +5,20 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.businessEntity.params.BusinessEntityGetTransfersParams; +import com.chargebee.v4.models.businessEntity.params.BusinessEntityGetTransfersParams; -import com.chargebee.v4.core.models.businessEntity.params.BusinessEntityCreateTransfersParams; +import com.chargebee.v4.models.businessEntity.params.BusinessEntityCreateTransfersParams; -import com.chargebee.v4.core.responses.businessEntity.BusinessEntityGetTransfersResponse; +import com.chargebee.v4.models.businessEntity.responses.BusinessEntityGetTransfersResponse; -import com.chargebee.v4.core.responses.businessEntity.BusinessEntityCreateTransfersResponse; +import com.chargebee.v4.models.businessEntity.responses.BusinessEntityCreateTransfersResponse; public final class BusinessEntityService extends BaseService { @@ -58,13 +59,13 @@ public BusinessEntityService withOptions(RequestOptions options) { * getTransfers a businessEntity using immutable params (executes immediately) - returns raw * Response. */ - Response getTransfersRaw(BusinessEntityGetTransfersParams params) throws Exception { + Response getTransfersRaw(BusinessEntityGetTransfersParams params) throws ChargebeeException { return get("/business_entities/transfers", params != null ? params.toQueryParams() : null); } /** getTransfers a businessEntity without params (executes immediately) - returns raw Response. */ - Response getTransfersRaw() throws Exception { + Response getTransfersRaw() throws ChargebeeException { return get("/business_entities/transfers", null); } @@ -73,20 +74,20 @@ Response getTransfersRaw() throws Exception { * getTransfers a businessEntity using raw JSON payload (executes immediately) - returns raw * Response. */ - Response getTransfersRaw(String jsonPayload) throws Exception { + Response getTransfersRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public BusinessEntityGetTransfersResponse getTransfers(BusinessEntityGetTransfersParams params) - throws Exception { + throws ChargebeeException { Response response = getTransfersRaw(params); return BusinessEntityGetTransfersResponse.fromJson( response.getBodyAsString(), this, params, response); } - public BusinessEntityGetTransfersResponse getTransfers() throws Exception { + public BusinessEntityGetTransfersResponse getTransfers() throws ChargebeeException { Response response = getTransfersRaw(); return BusinessEntityGetTransfersResponse.fromJson( response.getBodyAsString(), this, null, response); @@ -96,7 +97,8 @@ public BusinessEntityGetTransfersResponse getTransfers() throws Exception { * createTransfers a businessEntity using immutable params (executes immediately) - returns raw * Response. */ - Response createTransfersRaw(BusinessEntityCreateTransfersParams params) throws Exception { + Response createTransfersRaw(BusinessEntityCreateTransfersParams params) + throws ChargebeeException { return post("/business_entities/transfers", params != null ? params.toFormData() : null); } @@ -105,13 +107,13 @@ Response createTransfersRaw(BusinessEntityCreateTransfersParams params) throws E * createTransfers a businessEntity using raw JSON payload (executes immediately) - returns raw * Response. */ - Response createTransfersRaw(String jsonPayload) throws Exception { + Response createTransfersRaw(String jsonPayload) throws ChargebeeException { return postJson("/business_entities/transfers", jsonPayload); } public BusinessEntityCreateTransfersResponse createTransfers( - BusinessEntityCreateTransfersParams params) throws Exception { + BusinessEntityCreateTransfersParams params) throws ChargebeeException { Response response = createTransfersRaw(params); return BusinessEntityCreateTransfersResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/core/services/BusinessProfileService.java b/src/main/java/com/chargebee/v4/services/BusinessProfileService.java similarity index 84% rename from src/main/java/com/chargebee/v4/core/services/BusinessProfileService.java rename to src/main/java/com/chargebee/v4/services/BusinessProfileService.java index a96fd893..65cea03d 100644 --- a/src/main/java/com/chargebee/v4/core/services/BusinessProfileService.java +++ b/src/main/java/com/chargebee/v4/services/BusinessProfileService.java @@ -5,15 +5,16 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.businessProfile.params.BusinessProfileRetrieveParams; +import com.chargebee.v4.models.businessProfile.params.BusinessProfileRetrieveParams; -import com.chargebee.v4.core.responses.businessProfile.BusinessProfileRetrieveResponse; +import com.chargebee.v4.models.businessProfile.responses.BusinessProfileRetrieveResponse; public final class BusinessProfileService extends BaseService { @@ -54,7 +55,7 @@ public BusinessProfileService withOptions(RequestOptions options) { * retrieve a businessProfile using immutable params (executes immediately) - returns raw * Response. */ - Response retrieveRaw(BusinessProfileRetrieveParams params) throws Exception { + Response retrieveRaw(BusinessProfileRetrieveParams params) throws ChargebeeException { return get("/business_profiles", params != null ? params.toQueryParams() : null); } @@ -63,13 +64,13 @@ Response retrieveRaw(BusinessProfileRetrieveParams params) throws Exception { * retrieve a businessProfile using raw JSON payload (executes immediately) - returns raw * Response. */ - Response retrieveRaw(String jsonPayload) throws Exception { + Response retrieveRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public BusinessProfileRetrieveResponse retrieve(BusinessProfileRetrieveParams params) - throws Exception { + throws ChargebeeException { Response response = retrieveRaw(params); return BusinessProfileRetrieveResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/services/CardService.java b/src/main/java/com/chargebee/v4/services/CardService.java new file mode 100644 index 00000000..7df2fa95 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/CardService.java @@ -0,0 +1,197 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.card.params.CopyCardForCustomerParams; + +import com.chargebee.v4.models.card.params.CardSwitchGatewayForCustomerParams; + +import com.chargebee.v4.models.card.params.UpdateCardForCustomerParams; + +import com.chargebee.v4.models.card.responses.CopyCardForCustomerResponse; + +import com.chargebee.v4.models.card.responses.CardRetrieveResponse; + +import com.chargebee.v4.models.card.responses.CardSwitchGatewayForCustomerResponse; + +import com.chargebee.v4.models.card.responses.DeleteCardForCustomerResponse; + +import com.chargebee.v4.models.card.responses.UpdateCardForCustomerResponse; + +public final class CardService extends BaseService { + + private final ServiceConfig config; + + public CardService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private CardService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private CardService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + CardService with(RequestOptions newOptions) { + return new CardService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public CardService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** copyCardForCustomer a card (executes immediately) - returns raw Response. */ + Response copyCardForCustomerRaw(String customerId) throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/copy_card", "customer-id", customerId); + + return post(path, null); + } + + /** + * copyCardForCustomer a card using immutable params (executes immediately) - returns raw + * Response. + */ + Response copyCardForCustomerRaw(String customerId, CopyCardForCustomerParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/copy_card", "customer-id", customerId); + return post(path, params.toFormData()); + } + + /** + * copyCardForCustomer a card using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response copyCardForCustomerRaw(String customerId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/copy_card", "customer-id", customerId); + return postJson(path, jsonPayload); + } + + public CopyCardForCustomerResponse copyCardForCustomer( + String customerId, CopyCardForCustomerParams params) throws ChargebeeException { + Response response = copyCardForCustomerRaw(customerId, params); + return CopyCardForCustomerResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a card (executes immediately) - returns raw Response. */ + Response retrieveRaw(String customerId) throws ChargebeeException { + String path = buildPathWithParams("/cards/{customer-id}", "customer-id", customerId); + + return get(path, null); + } + + public CardRetrieveResponse retrieve(String customerId) throws ChargebeeException { + Response response = retrieveRaw(customerId); + return CardRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** switchGatewayForCustomer a card (executes immediately) - returns raw Response. */ + Response switchGatewayForCustomerRaw(String customerId) throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/switch_gateway", "customer-id", customerId); + + return post(path, null); + } + + /** + * switchGatewayForCustomer a card using immutable params (executes immediately) - returns raw + * Response. + */ + Response switchGatewayForCustomerRaw(String customerId, CardSwitchGatewayForCustomerParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/switch_gateway", "customer-id", customerId); + return post(path, params.toFormData()); + } + + /** + * switchGatewayForCustomer a card using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response switchGatewayForCustomerRaw(String customerId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/switch_gateway", "customer-id", customerId); + return postJson(path, jsonPayload); + } + + public CardSwitchGatewayForCustomerResponse switchGatewayForCustomer( + String customerId, CardSwitchGatewayForCustomerParams params) throws ChargebeeException { + Response response = switchGatewayForCustomerRaw(customerId, params); + return CardSwitchGatewayForCustomerResponse.fromJson(response.getBodyAsString(), response); + } + + /** deleteCardForCustomer a card (executes immediately) - returns raw Response. */ + Response deleteCardForCustomerRaw(String customerId) throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/delete_card", "customer-id", customerId); + + return post(path, null); + } + + public DeleteCardForCustomerResponse deleteCardForCustomer(String customerId) + throws ChargebeeException { + Response response = deleteCardForCustomerRaw(customerId); + return DeleteCardForCustomerResponse.fromJson(response.getBodyAsString(), response); + } + + /** updateCardForCustomer a card (executes immediately) - returns raw Response. */ + Response updateCardForCustomerRaw(String customerId) throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/credit_card", "customer-id", customerId); + + return post(path, null); + } + + /** + * updateCardForCustomer a card using immutable params (executes immediately) - returns raw + * Response. + */ + Response updateCardForCustomerRaw(String customerId, UpdateCardForCustomerParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/credit_card", "customer-id", customerId); + return post(path, params.toFormData()); + } + + /** + * updateCardForCustomer a card using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response updateCardForCustomerRaw(String customerId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/credit_card", "customer-id", customerId); + return postJson(path, jsonPayload); + } + + public UpdateCardForCustomerResponse updateCardForCustomer( + String customerId, UpdateCardForCustomerParams params) throws ChargebeeException { + Response response = updateCardForCustomerRaw(customerId, params); + return UpdateCardForCustomerResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/services/CommentService.java b/src/main/java/com/chargebee/v4/services/CommentService.java new file mode 100644 index 00000000..19c69d32 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/CommentService.java @@ -0,0 +1,131 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.comment.params.CommentListParams; + +import com.chargebee.v4.models.comment.params.CommentCreateParams; + +import com.chargebee.v4.models.comment.responses.CommentDeleteResponse; + +import com.chargebee.v4.models.comment.responses.CommentRetrieveResponse; + +import com.chargebee.v4.models.comment.responses.CommentListResponse; + +import com.chargebee.v4.models.comment.responses.CommentCreateResponse; + +public final class CommentService extends BaseService { + + private final ServiceConfig config; + + public CommentService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private CommentService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private CommentService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + CommentService with(RequestOptions newOptions) { + return new CommentService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public CommentService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** delete a comment (executes immediately) - returns raw Response. */ + Response deleteRaw(String commentId) throws ChargebeeException { + String path = buildPathWithParams("/comments/{comment-id}/delete", "comment-id", commentId); + + return post(path, null); + } + + public CommentDeleteResponse delete(String commentId) throws ChargebeeException { + Response response = deleteRaw(commentId); + return CommentDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a comment (executes immediately) - returns raw Response. */ + Response retrieveRaw(String commentId) throws ChargebeeException { + String path = buildPathWithParams("/comments/{comment-id}", "comment-id", commentId); + + return get(path, null); + } + + public CommentRetrieveResponse retrieve(String commentId) throws ChargebeeException { + Response response = retrieveRaw(commentId); + return CommentRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** list a comment using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(CommentListParams params) throws ChargebeeException { + + return get("/comments", params != null ? params.toQueryParams() : null); + } + + /** list a comment without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/comments", null); + } + + /** list a comment using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public CommentListResponse list(CommentListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return CommentListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public CommentListResponse list() throws ChargebeeException { + Response response = listRaw(); + return CommentListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** create a comment using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(CommentCreateParams params) throws ChargebeeException { + + return post("/comments", params != null ? params.toFormData() : null); + } + + /** create a comment using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/comments", jsonPayload); + } + + public CommentCreateResponse create(CommentCreateParams params) throws ChargebeeException { + Response response = createRaw(params); + + return CommentCreateResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/ConfigurationService.java b/src/main/java/com/chargebee/v4/services/ConfigurationService.java similarity index 81% rename from src/main/java/com/chargebee/v4/core/services/ConfigurationService.java rename to src/main/java/com/chargebee/v4/services/ConfigurationService.java index ac084cad..79d38235 100644 --- a/src/main/java/com/chargebee/v4/core/services/ConfigurationService.java +++ b/src/main/java/com/chargebee/v4/services/ConfigurationService.java @@ -5,15 +5,16 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.configuration.params.ConfigurationListParams; +import com.chargebee.v4.models.configuration.params.ConfigurationListParams; -import com.chargebee.v4.core.responses.configuration.ConfigurationListResponse; +import com.chargebee.v4.models.configuration.responses.ConfigurationListResponse; public final class ConfigurationService extends BaseService { @@ -51,18 +52,18 @@ public ConfigurationService withOptions(RequestOptions options) { // === Operations === /** list a configuration using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(ConfigurationListParams params) throws Exception { + Response listRaw(ConfigurationListParams params) throws ChargebeeException { return get("/configurations", params != null ? params.toQueryParams() : null); } /** list a configuration using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public ConfigurationListResponse list(ConfigurationListParams params) throws Exception { + public ConfigurationListResponse list(ConfigurationListParams params) throws ChargebeeException { Response response = listRaw(params); return ConfigurationListResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/services/CouponCodeService.java b/src/main/java/com/chargebee/v4/services/CouponCodeService.java new file mode 100644 index 00000000..5da0cb04 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/CouponCodeService.java @@ -0,0 +1,134 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.couponCode.params.CouponCodeListParams; + +import com.chargebee.v4.models.couponCode.params.CouponCodeCreateParams; + +import com.chargebee.v4.models.couponCode.responses.CouponCodeListResponse; + +import com.chargebee.v4.models.couponCode.responses.CouponCodeCreateResponse; + +import com.chargebee.v4.models.couponCode.responses.CouponCodeRetrieveResponse; + +import com.chargebee.v4.models.couponCode.responses.CouponCodeArchiveResponse; + +public final class CouponCodeService extends BaseService { + + private final ServiceConfig config; + + public CouponCodeService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private CouponCodeService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private CouponCodeService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + CouponCodeService with(RequestOptions newOptions) { + return new CouponCodeService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public CouponCodeService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** list a couponCode using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(CouponCodeListParams params) throws ChargebeeException { + + return get("/coupon_codes", params != null ? params.toQueryParams() : null); + } + + /** list a couponCode without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/coupon_codes", null); + } + + /** list a couponCode using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public CouponCodeListResponse list(CouponCodeListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return CouponCodeListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public CouponCodeListResponse list() throws ChargebeeException { + Response response = listRaw(); + return CouponCodeListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** create a couponCode using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(CouponCodeCreateParams params) throws ChargebeeException { + + return post("/coupon_codes", params != null ? params.toFormData() : null); + } + + /** create a couponCode using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/coupon_codes", jsonPayload); + } + + public CouponCodeCreateResponse create(CouponCodeCreateParams params) throws ChargebeeException { + Response response = createRaw(params); + + return CouponCodeCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a couponCode (executes immediately) - returns raw Response. */ + Response retrieveRaw(String couponCodeCode) throws ChargebeeException { + String path = + buildPathWithParams("/coupon_codes/{coupon-code-code}", "coupon-code-code", couponCodeCode); + + return get(path, null); + } + + public CouponCodeRetrieveResponse retrieve(String couponCodeCode) throws ChargebeeException { + Response response = retrieveRaw(couponCodeCode); + return CouponCodeRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** archive a couponCode (executes immediately) - returns raw Response. */ + Response archiveRaw(String couponCodeCode) throws ChargebeeException { + String path = + buildPathWithParams( + "/coupon_codes/{coupon-code-code}/archive", "coupon-code-code", couponCodeCode); + + return post(path, null); + } + + public CouponCodeArchiveResponse archive(String couponCodeCode) throws ChargebeeException { + Response response = archiveRaw(couponCodeCode); + return CouponCodeArchiveResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/services/CouponService.java b/src/main/java/com/chargebee/v4/services/CouponService.java new file mode 100644 index 00000000..f3765e19 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/CouponService.java @@ -0,0 +1,260 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.coupon.params.CouponListParams; + +import com.chargebee.v4.models.coupon.params.CouponCreateParams; + +import com.chargebee.v4.models.coupon.params.CouponUpdateForItemsParams; + +import com.chargebee.v4.models.coupon.params.CouponCopyParams; + +import com.chargebee.v4.models.coupon.params.CouponUpdateParams; + +import com.chargebee.v4.models.coupon.params.CouponCreateForItemsParams; + +import com.chargebee.v4.models.coupon.responses.CouponListResponse; + +import com.chargebee.v4.models.coupon.responses.CouponCreateResponse; + +import com.chargebee.v4.models.coupon.responses.CouponUpdateForItemsResponse; + +import com.chargebee.v4.models.coupon.responses.CouponUnarchiveResponse; + +import com.chargebee.v4.models.coupon.responses.CouponDeleteResponse; + +import com.chargebee.v4.models.coupon.responses.CouponCopyResponse; + +import com.chargebee.v4.models.coupon.responses.CouponRetrieveResponse; + +import com.chargebee.v4.models.coupon.responses.CouponUpdateResponse; + +import com.chargebee.v4.models.coupon.responses.CouponCreateForItemsResponse; + +public final class CouponService extends BaseService { + + private final ServiceConfig config; + + public CouponService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private CouponService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private CouponService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + CouponService with(RequestOptions newOptions) { + return new CouponService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public CouponService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** list a coupon using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(CouponListParams params) throws ChargebeeException { + + return get("/coupons", params != null ? params.toQueryParams() : null); + } + + /** list a coupon without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/coupons", null); + } + + /** list a coupon using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public CouponListResponse list(CouponListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return CouponListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public CouponListResponse list() throws ChargebeeException { + Response response = listRaw(); + return CouponListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** create a coupon using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(CouponCreateParams params) throws ChargebeeException { + + return post("/coupons", params != null ? params.toFormData() : null); + } + + /** create a coupon using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/coupons", jsonPayload); + } + + public CouponCreateResponse create(CouponCreateParams params) throws ChargebeeException { + Response response = createRaw(params); + + return CouponCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** updateForItems a coupon (executes immediately) - returns raw Response. */ + Response updateForItemsRaw(String couponId) throws ChargebeeException { + String path = + buildPathWithParams("/coupons/{coupon-id}/update_for_items", "coupon-id", couponId); + + return post(path, null); + } + + /** + * updateForItems a coupon using immutable params (executes immediately) - returns raw Response. + */ + Response updateForItemsRaw(String couponId, CouponUpdateForItemsParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/coupons/{coupon-id}/update_for_items", "coupon-id", couponId); + return post(path, params.toFormData()); + } + + /** + * updateForItems a coupon using raw JSON payload (executes immediately) - returns raw Response. + */ + Response updateForItemsRaw(String couponId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/coupons/{coupon-id}/update_for_items", "coupon-id", couponId); + return postJson(path, jsonPayload); + } + + public CouponUpdateForItemsResponse updateForItems( + String couponId, CouponUpdateForItemsParams params) throws ChargebeeException { + Response response = updateForItemsRaw(couponId, params); + return CouponUpdateForItemsResponse.fromJson(response.getBodyAsString(), response); + } + + /** unarchive a coupon (executes immediately) - returns raw Response. */ + Response unarchiveRaw(String couponId) throws ChargebeeException { + String path = buildPathWithParams("/coupons/{coupon-id}/unarchive", "coupon-id", couponId); + + return post(path, null); + } + + public CouponUnarchiveResponse unarchive(String couponId) throws ChargebeeException { + Response response = unarchiveRaw(couponId); + return CouponUnarchiveResponse.fromJson(response.getBodyAsString(), response); + } + + /** delete a coupon (executes immediately) - returns raw Response. */ + Response deleteRaw(String couponId) throws ChargebeeException { + String path = buildPathWithParams("/coupons/{coupon-id}/delete", "coupon-id", couponId); + + return post(path, null); + } + + public CouponDeleteResponse delete(String couponId) throws ChargebeeException { + Response response = deleteRaw(couponId); + return CouponDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** copy a coupon using immutable params (executes immediately) - returns raw Response. */ + Response copyRaw(CouponCopyParams params) throws ChargebeeException { + + return post("/coupons/copy", params != null ? params.toFormData() : null); + } + + /** copy a coupon using raw JSON payload (executes immediately) - returns raw Response. */ + Response copyRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/coupons/copy", jsonPayload); + } + + public CouponCopyResponse copy(CouponCopyParams params) throws ChargebeeException { + Response response = copyRaw(params); + + return CouponCopyResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a coupon (executes immediately) - returns raw Response. */ + Response retrieveRaw(String couponId) throws ChargebeeException { + String path = buildPathWithParams("/coupons/{coupon-id}", "coupon-id", couponId); + + return get(path, null); + } + + public CouponRetrieveResponse retrieve(String couponId) throws ChargebeeException { + Response response = retrieveRaw(couponId); + return CouponRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** update a coupon (executes immediately) - returns raw Response. */ + Response updateRaw(String couponId) throws ChargebeeException { + String path = buildPathWithParams("/coupons/{coupon-id}", "coupon-id", couponId); + + return post(path, null); + } + + /** update a coupon using immutable params (executes immediately) - returns raw Response. */ + Response updateRaw(String couponId, CouponUpdateParams params) throws ChargebeeException { + String path = buildPathWithParams("/coupons/{coupon-id}", "coupon-id", couponId); + return post(path, params.toFormData()); + } + + /** update a coupon using raw JSON payload (executes immediately) - returns raw Response. */ + Response updateRaw(String couponId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/coupons/{coupon-id}", "coupon-id", couponId); + return postJson(path, jsonPayload); + } + + public CouponUpdateResponse update(String couponId, CouponUpdateParams params) + throws ChargebeeException { + Response response = updateRaw(couponId, params); + return CouponUpdateResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createForItems a coupon using immutable params (executes immediately) - returns raw Response. + */ + Response createForItemsRaw(CouponCreateForItemsParams params) throws ChargebeeException { + + return post("/coupons/create_for_items", params != null ? params.toFormData() : null); + } + + /** + * createForItems a coupon using raw JSON payload (executes immediately) - returns raw Response. + */ + Response createForItemsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/coupons/create_for_items", jsonPayload); + } + + public CouponCreateForItemsResponse createForItems(CouponCreateForItemsParams params) + throws ChargebeeException { + Response response = createForItemsRaw(params); + + return CouponCreateForItemsResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/CouponSetService.java b/src/main/java/com/chargebee/v4/services/CouponSetService.java similarity index 77% rename from src/main/java/com/chargebee/v4/core/services/CouponSetService.java rename to src/main/java/com/chargebee/v4/services/CouponSetService.java index 3e9b69d4..1fc65517 100644 --- a/src/main/java/com/chargebee/v4/core/services/CouponSetService.java +++ b/src/main/java/com/chargebee/v4/services/CouponSetService.java @@ -5,33 +5,34 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.couponSet.params.CouponSetListParams; +import com.chargebee.v4.models.couponSet.params.CouponSetListParams; -import com.chargebee.v4.core.models.couponSet.params.CouponSetCreateParams; +import com.chargebee.v4.models.couponSet.params.CouponSetCreateParams; -import com.chargebee.v4.core.models.couponSet.params.CouponSetUpdateParams; +import com.chargebee.v4.models.couponSet.params.CouponSetUpdateParams; -import com.chargebee.v4.core.models.couponSet.params.CouponSetAddCouponCodesParams; +import com.chargebee.v4.models.couponSet.params.CouponSetAddCouponCodesParams; -import com.chargebee.v4.core.responses.couponSet.CouponSetListResponse; +import com.chargebee.v4.models.couponSet.responses.CouponSetListResponse; -import com.chargebee.v4.core.responses.couponSet.CouponSetCreateResponse; +import com.chargebee.v4.models.couponSet.responses.CouponSetCreateResponse; -import com.chargebee.v4.core.responses.couponSet.CouponSetUpdateResponse; +import com.chargebee.v4.models.couponSet.responses.CouponSetUpdateResponse; -import com.chargebee.v4.core.responses.couponSet.CouponSetRetrieveResponse; +import com.chargebee.v4.models.couponSet.responses.CouponSetRetrieveResponse; -import com.chargebee.v4.core.responses.couponSet.CouponSetAddCouponCodesResponse; +import com.chargebee.v4.models.couponSet.responses.CouponSetAddCouponCodesResponse; -import com.chargebee.v4.core.responses.couponSet.CouponSetDeleteUnusedCouponCodesResponse; +import com.chargebee.v4.models.couponSet.responses.CouponSetDeleteUnusedCouponCodesResponse; -import com.chargebee.v4.core.responses.couponSet.CouponSetDeleteResponse; +import com.chargebee.v4.models.couponSet.responses.CouponSetDeleteResponse; public final class CouponSetService extends BaseService { @@ -68,54 +69,54 @@ public CouponSetService withOptions(RequestOptions options) { // === Operations === /** list a couponSet using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(CouponSetListParams params) throws Exception { + Response listRaw(CouponSetListParams params) throws ChargebeeException { return get("/coupon_sets", params != null ? params.toQueryParams() : null); } /** list a couponSet without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/coupon_sets", null); } /** list a couponSet using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public CouponSetListResponse list(CouponSetListParams params) throws Exception { + public CouponSetListResponse list(CouponSetListParams params) throws ChargebeeException { Response response = listRaw(params); return CouponSetListResponse.fromJson(response.getBodyAsString(), this, params, response); } - public CouponSetListResponse list() throws Exception { + public CouponSetListResponse list() throws ChargebeeException { Response response = listRaw(); return CouponSetListResponse.fromJson(response.getBodyAsString(), this, null, response); } /** create a couponSet using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(CouponSetCreateParams params) throws Exception { + Response createRaw(CouponSetCreateParams params) throws ChargebeeException { return post("/coupon_sets", params != null ? params.toFormData() : null); } /** create a couponSet using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/coupon_sets", jsonPayload); } - public CouponSetCreateResponse create(CouponSetCreateParams params) throws Exception { + public CouponSetCreateResponse create(CouponSetCreateParams params) throws ChargebeeException { Response response = createRaw(params); return CouponSetCreateResponse.fromJson(response.getBodyAsString(), response); } /** update a couponSet (executes immediately) - returns raw Response. */ - Response updateRaw(String couponSetId) throws Exception { + Response updateRaw(String couponSetId) throws ChargebeeException { String path = buildPathWithParams("/coupon_sets/{coupon-set-id}/update", "coupon-set-id", couponSetId); @@ -123,39 +124,39 @@ Response updateRaw(String couponSetId) throws Exception { } /** update a couponSet using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String couponSetId, CouponSetUpdateParams params) throws Exception { + Response updateRaw(String couponSetId, CouponSetUpdateParams params) throws ChargebeeException { String path = buildPathWithParams("/coupon_sets/{coupon-set-id}/update", "coupon-set-id", couponSetId); return post(path, params.toFormData()); } /** update a couponSet using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String couponSetId, String jsonPayload) throws Exception { + Response updateRaw(String couponSetId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/coupon_sets/{coupon-set-id}/update", "coupon-set-id", couponSetId); return postJson(path, jsonPayload); } public CouponSetUpdateResponse update(String couponSetId, CouponSetUpdateParams params) - throws Exception { + throws ChargebeeException { Response response = updateRaw(couponSetId, params); return CouponSetUpdateResponse.fromJson(response.getBodyAsString(), response); } /** retrieve a couponSet (executes immediately) - returns raw Response. */ - Response retrieveRaw(String couponSetId) throws Exception { + Response retrieveRaw(String couponSetId) throws ChargebeeException { String path = buildPathWithParams("/coupon_sets/{coupon-set-id}", "coupon-set-id", couponSetId); return get(path, null); } - public CouponSetRetrieveResponse retrieve(String couponSetId) throws Exception { + public CouponSetRetrieveResponse retrieve(String couponSetId) throws ChargebeeException { Response response = retrieveRaw(couponSetId); return CouponSetRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** addCouponCodes a couponSet (executes immediately) - returns raw Response. */ - Response addCouponCodesRaw(String couponSetId) throws Exception { + Response addCouponCodesRaw(String couponSetId) throws ChargebeeException { String path = buildPathWithParams( "/coupon_sets/{coupon-set-id}/add_coupon_codes", "coupon-set-id", couponSetId); @@ -168,7 +169,7 @@ Response addCouponCodesRaw(String couponSetId) throws Exception { * Response. */ Response addCouponCodesRaw(String couponSetId, CouponSetAddCouponCodesParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/coupon_sets/{coupon-set-id}/add_coupon_codes", "coupon-set-id", couponSetId); @@ -179,7 +180,7 @@ Response addCouponCodesRaw(String couponSetId, CouponSetAddCouponCodesParams par * addCouponCodes a couponSet using raw JSON payload (executes immediately) - returns raw * Response. */ - Response addCouponCodesRaw(String couponSetId, String jsonPayload) throws Exception { + Response addCouponCodesRaw(String couponSetId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/coupon_sets/{coupon-set-id}/add_coupon_codes", "coupon-set-id", couponSetId); @@ -187,13 +188,13 @@ Response addCouponCodesRaw(String couponSetId, String jsonPayload) throws Except } public CouponSetAddCouponCodesResponse addCouponCodes( - String couponSetId, CouponSetAddCouponCodesParams params) throws Exception { + String couponSetId, CouponSetAddCouponCodesParams params) throws ChargebeeException { Response response = addCouponCodesRaw(couponSetId, params); return CouponSetAddCouponCodesResponse.fromJson(response.getBodyAsString(), response); } /** deleteUnusedCouponCodes a couponSet (executes immediately) - returns raw Response. */ - Response deleteUnusedCouponCodesRaw(String couponSetId) throws Exception { + Response deleteUnusedCouponCodesRaw(String couponSetId) throws ChargebeeException { String path = buildPathWithParams( "/coupon_sets/{coupon-set-id}/delete_unused_coupon_codes", @@ -204,20 +205,20 @@ Response deleteUnusedCouponCodesRaw(String couponSetId) throws Exception { } public CouponSetDeleteUnusedCouponCodesResponse deleteUnusedCouponCodes(String couponSetId) - throws Exception { + throws ChargebeeException { Response response = deleteUnusedCouponCodesRaw(couponSetId); return CouponSetDeleteUnusedCouponCodesResponse.fromJson(response.getBodyAsString(), response); } /** delete a couponSet (executes immediately) - returns raw Response. */ - Response deleteRaw(String couponSetId) throws Exception { + Response deleteRaw(String couponSetId) throws ChargebeeException { String path = buildPathWithParams("/coupon_sets/{coupon-set-id}/delete", "coupon-set-id", couponSetId); return post(path, null); } - public CouponSetDeleteResponse delete(String couponSetId) throws Exception { + public CouponSetDeleteResponse delete(String couponSetId) throws ChargebeeException { Response response = deleteRaw(couponSetId); return CouponSetDeleteResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/services/CreditNoteService.java b/src/main/java/com/chargebee/v4/services/CreditNoteService.java new file mode 100644 index 00000000..d05572c0 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/CreditNoteService.java @@ -0,0 +1,496 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.creditNote.params.CreditNoteRecordRefundParams; + +import com.chargebee.v4.models.creditNote.params.ImportCreditNoteParams; + +import com.chargebee.v4.models.creditNote.params.CreditNoteDeleteParams; + +import com.chargebee.v4.models.creditNote.params.CreditNotesForCustomerParams; + +import com.chargebee.v4.models.creditNote.params.CreditNotePdfParams; + +import com.chargebee.v4.models.creditNote.params.VoidCreditNoteParams; + +import com.chargebee.v4.models.creditNote.params.CreditNoteRefundParams; + +import com.chargebee.v4.models.creditNote.params.CreditNoteListParams; + +import com.chargebee.v4.models.creditNote.params.CreditNoteCreateParams; + +import com.chargebee.v4.models.creditNote.params.CreditNoteRemoveTaxWithheldRefundParams; + +import com.chargebee.v4.models.creditNote.params.CreditNoteRetrieveParams; + +import com.chargebee.v4.models.creditNote.responses.CreditNoteRecordRefundResponse; + +import com.chargebee.v4.models.creditNote.responses.ImportCreditNoteResponse; + +import com.chargebee.v4.models.creditNote.responses.CreditNoteDeleteResponse; + +import com.chargebee.v4.models.creditNote.responses.CreditNotesForCustomerResponse; + +import com.chargebee.v4.models.creditNote.responses.CreditNotePdfResponse; + +import com.chargebee.v4.models.creditNote.responses.CreditNoteSendEinvoiceResponse; + +import com.chargebee.v4.models.creditNote.responses.VoidCreditNoteResponse; + +import com.chargebee.v4.models.creditNote.responses.CreditNoteRefundResponse; + +import com.chargebee.v4.models.creditNote.responses.CreditNoteListResponse; + +import com.chargebee.v4.models.creditNote.responses.CreditNoteCreateResponse; + +import com.chargebee.v4.models.creditNote.responses.CreditNoteDownloadEinvoiceResponse; + +import com.chargebee.v4.models.creditNote.responses.CreditNoteResendEinvoiceResponse; + +import com.chargebee.v4.models.creditNote.responses.CreditNoteRemoveTaxWithheldRefundResponse; + +import com.chargebee.v4.models.creditNote.responses.CreditNoteRetrieveResponse; + +public final class CreditNoteService extends BaseService { + + private final ServiceConfig config; + + public CreditNoteService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private CreditNoteService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private CreditNoteService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + CreditNoteService with(RequestOptions newOptions) { + return new CreditNoteService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public CreditNoteService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** recordRefund a creditNote (executes immediately) - returns raw Response. */ + Response recordRefundRaw(String creditNoteId) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/record_refund", "credit-note-id", creditNoteId); + + return post(path, null); + } + + /** + * recordRefund a creditNote using immutable params (executes immediately) - returns raw Response. + */ + Response recordRefundRaw(String creditNoteId, CreditNoteRecordRefundParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/record_refund", "credit-note-id", creditNoteId); + return post(path, params.toFormData()); + } + + /** + * recordRefund a creditNote using raw JSON payload (executes immediately) - returns raw Response. + */ + Response recordRefundRaw(String creditNoteId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/record_refund", "credit-note-id", creditNoteId); + return postJson(path, jsonPayload); + } + + public CreditNoteRecordRefundResponse recordRefund( + String creditNoteId, CreditNoteRecordRefundParams params) throws ChargebeeException { + Response response = recordRefundRaw(creditNoteId, params); + return CreditNoteRecordRefundResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * importCreditNote a creditNote using immutable params (executes immediately) - returns raw + * Response. + */ + Response importCreditNoteRaw(ImportCreditNoteParams params) throws ChargebeeException { + + return post("/credit_notes/import_credit_note", params != null ? params.toFormData() : null); + } + + /** + * importCreditNote a creditNote using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response importCreditNoteRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/credit_notes/import_credit_note", jsonPayload); + } + + public ImportCreditNoteResponse importCreditNote(ImportCreditNoteParams params) + throws ChargebeeException { + Response response = importCreditNoteRaw(params); + + return ImportCreditNoteResponse.fromJson(response.getBodyAsString(), response); + } + + /** delete a creditNote (executes immediately) - returns raw Response. */ + Response deleteRaw(String creditNoteId) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/delete", "credit-note-id", creditNoteId); + + return post(path, null); + } + + /** delete a creditNote using immutable params (executes immediately) - returns raw Response. */ + Response deleteRaw(String creditNoteId, CreditNoteDeleteParams params) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/delete", "credit-note-id", creditNoteId); + return post(path, params.toFormData()); + } + + /** delete a creditNote using raw JSON payload (executes immediately) - returns raw Response. */ + Response deleteRaw(String creditNoteId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/delete", "credit-note-id", creditNoteId); + return postJson(path, jsonPayload); + } + + public CreditNoteDeleteResponse delete(String creditNoteId, CreditNoteDeleteParams params) + throws ChargebeeException { + Response response = deleteRaw(creditNoteId, params); + return CreditNoteDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * creditNotesForCustomer a creditNote using immutable params (executes immediately) - returns raw + * Response. + */ + Response creditNotesForCustomerRaw(String customerId, CreditNotesForCustomerParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/credit_notes", "customer-id", customerId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * creditNotesForCustomer a creditNote without params (executes immediately) - returns raw + * Response. + */ + Response creditNotesForCustomerRaw(String customerId) throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/credit_notes", "customer-id", customerId); + return get(path, null); + } + + /** + * creditNotesForCustomer a creditNote using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response creditNotesForCustomerRaw(String customerId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/credit_notes", "customer-id", customerId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public CreditNotesForCustomerResponse creditNotesForCustomer( + String customerId, CreditNotesForCustomerParams params) throws ChargebeeException { + Response response = creditNotesForCustomerRaw(customerId, params); + return CreditNotesForCustomerResponse.fromJson( + response.getBodyAsString(), this, params, customerId, response); + } + + public CreditNotesForCustomerResponse creditNotesForCustomer(String customerId) + throws ChargebeeException { + Response response = creditNotesForCustomerRaw(customerId); + return CreditNotesForCustomerResponse.fromJson( + response.getBodyAsString(), this, null, customerId, response); + } + + /** pdf a creditNote (executes immediately) - returns raw Response. */ + Response pdfRaw(String creditNoteId) throws ChargebeeException { + String path = + buildPathWithParams("/credit_notes/{credit-note-id}/pdf", "credit-note-id", creditNoteId); + + return post(path, null); + } + + /** pdf a creditNote using immutable params (executes immediately) - returns raw Response. */ + Response pdfRaw(String creditNoteId, CreditNotePdfParams params) throws ChargebeeException { + String path = + buildPathWithParams("/credit_notes/{credit-note-id}/pdf", "credit-note-id", creditNoteId); + return post(path, params.toFormData()); + } + + /** pdf a creditNote using raw JSON payload (executes immediately) - returns raw Response. */ + Response pdfRaw(String creditNoteId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/credit_notes/{credit-note-id}/pdf", "credit-note-id", creditNoteId); + return postJson(path, jsonPayload); + } + + public CreditNotePdfResponse pdf(String creditNoteId, CreditNotePdfParams params) + throws ChargebeeException { + Response response = pdfRaw(creditNoteId, params); + return CreditNotePdfResponse.fromJson(response.getBodyAsString(), response); + } + + /** sendEinvoice a creditNote (executes immediately) - returns raw Response. */ + Response sendEinvoiceRaw(String creditNoteId) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/send_einvoice", "credit-note-id", creditNoteId); + + return post(path, null); + } + + public CreditNoteSendEinvoiceResponse sendEinvoice(String creditNoteId) + throws ChargebeeException { + Response response = sendEinvoiceRaw(creditNoteId); + return CreditNoteSendEinvoiceResponse.fromJson(response.getBodyAsString(), response); + } + + /** voidCreditNote a creditNote (executes immediately) - returns raw Response. */ + Response voidCreditNoteRaw(String creditNoteId) throws ChargebeeException { + String path = + buildPathWithParams("/credit_notes/{credit-note-id}/void", "credit-note-id", creditNoteId); + + return post(path, null); + } + + /** + * voidCreditNote a creditNote using immutable params (executes immediately) - returns raw + * Response. + */ + Response voidCreditNoteRaw(String creditNoteId, VoidCreditNoteParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/credit_notes/{credit-note-id}/void", "credit-note-id", creditNoteId); + return post(path, params.toFormData()); + } + + /** + * voidCreditNote a creditNote using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response voidCreditNoteRaw(String creditNoteId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/credit_notes/{credit-note-id}/void", "credit-note-id", creditNoteId); + return postJson(path, jsonPayload); + } + + public VoidCreditNoteResponse voidCreditNote(String creditNoteId, VoidCreditNoteParams params) + throws ChargebeeException { + Response response = voidCreditNoteRaw(creditNoteId, params); + return VoidCreditNoteResponse.fromJson(response.getBodyAsString(), response); + } + + /** refund a creditNote (executes immediately) - returns raw Response. */ + Response refundRaw(String creditNoteId) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/refund", "credit-note-id", creditNoteId); + + return post(path, null); + } + + /** refund a creditNote using immutable params (executes immediately) - returns raw Response. */ + Response refundRaw(String creditNoteId, CreditNoteRefundParams params) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/refund", "credit-note-id", creditNoteId); + return post(path, params.toFormData()); + } + + /** refund a creditNote using raw JSON payload (executes immediately) - returns raw Response. */ + Response refundRaw(String creditNoteId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/refund", "credit-note-id", creditNoteId); + return postJson(path, jsonPayload); + } + + public CreditNoteRefundResponse refund(String creditNoteId, CreditNoteRefundParams params) + throws ChargebeeException { + Response response = refundRaw(creditNoteId, params); + return CreditNoteRefundResponse.fromJson(response.getBodyAsString(), response); + } + + /** list a creditNote using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(CreditNoteListParams params) throws ChargebeeException { + + return get("/credit_notes", params != null ? params.toQueryParams() : null); + } + + /** list a creditNote without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/credit_notes", null); + } + + /** list a creditNote using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public CreditNoteListResponse list(CreditNoteListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return CreditNoteListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public CreditNoteListResponse list() throws ChargebeeException { + Response response = listRaw(); + return CreditNoteListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** create a creditNote using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(CreditNoteCreateParams params) throws ChargebeeException { + + return post("/credit_notes", params != null ? params.toFormData() : null); + } + + /** create a creditNote using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/credit_notes", jsonPayload); + } + + public CreditNoteCreateResponse create(CreditNoteCreateParams params) throws ChargebeeException { + Response response = createRaw(params); + + return CreditNoteCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** downloadEinvoice a creditNote (executes immediately) - returns raw Response. */ + Response downloadEinvoiceRaw(String creditNoteId) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/download_einvoice", "credit-note-id", creditNoteId); + + return get(path, null); + } + + public CreditNoteDownloadEinvoiceResponse downloadEinvoice(String creditNoteId) + throws ChargebeeException { + Response response = downloadEinvoiceRaw(creditNoteId); + return CreditNoteDownloadEinvoiceResponse.fromJson(response.getBodyAsString(), response); + } + + /** resendEinvoice a creditNote (executes immediately) - returns raw Response. */ + Response resendEinvoiceRaw(String creditNoteId) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/resend_einvoice", "credit-note-id", creditNoteId); + + return post(path, null); + } + + public CreditNoteResendEinvoiceResponse resendEinvoice(String creditNoteId) + throws ChargebeeException { + Response response = resendEinvoiceRaw(creditNoteId); + return CreditNoteResendEinvoiceResponse.fromJson(response.getBodyAsString(), response); + } + + /** removeTaxWithheldRefund a creditNote (executes immediately) - returns raw Response. */ + Response removeTaxWithheldRefundRaw(String creditNoteId) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/remove_tax_withheld_refund", + "credit-note-id", + creditNoteId); + + return post(path, null); + } + + /** + * removeTaxWithheldRefund a creditNote using immutable params (executes immediately) - returns + * raw Response. + */ + Response removeTaxWithheldRefundRaw( + String creditNoteId, CreditNoteRemoveTaxWithheldRefundParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/remove_tax_withheld_refund", + "credit-note-id", + creditNoteId); + return post(path, params.toFormData()); + } + + /** + * removeTaxWithheldRefund a creditNote using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response removeTaxWithheldRefundRaw(String creditNoteId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/remove_tax_withheld_refund", + "credit-note-id", + creditNoteId); + return postJson(path, jsonPayload); + } + + public CreditNoteRemoveTaxWithheldRefundResponse removeTaxWithheldRefund( + String creditNoteId, CreditNoteRemoveTaxWithheldRefundParams params) + throws ChargebeeException { + Response response = removeTaxWithheldRefundRaw(creditNoteId, params); + return CreditNoteRemoveTaxWithheldRefundResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a creditNote (executes immediately) - returns raw Response. */ + Response retrieveRaw(String creditNoteId) throws ChargebeeException { + String path = + buildPathWithParams("/credit_notes/{credit-note-id}", "credit-note-id", creditNoteId); + + return get(path, null); + } + + /** retrieve a creditNote using immutable params (executes immediately) - returns raw Response. */ + Response retrieveRaw(String creditNoteId, CreditNoteRetrieveParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/credit_notes/{credit-note-id}", "credit-note-id", creditNoteId); + return get(path, params != null ? params.toQueryParams() : null); + } + + public CreditNoteRetrieveResponse retrieve(String creditNoteId, CreditNoteRetrieveParams params) + throws ChargebeeException { + Response response = retrieveRaw(creditNoteId, params); + return CreditNoteRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + public CreditNoteRetrieveResponse retrieve(String creditNoteId) throws ChargebeeException { + Response response = retrieveRaw(creditNoteId); + return CreditNoteRetrieveResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/CsvTaxRuleService.java b/src/main/java/com/chargebee/v4/services/CsvTaxRuleService.java similarity index 81% rename from src/main/java/com/chargebee/v4/core/services/CsvTaxRuleService.java rename to src/main/java/com/chargebee/v4/services/CsvTaxRuleService.java index befb762e..0dd52a44 100644 --- a/src/main/java/com/chargebee/v4/core/services/CsvTaxRuleService.java +++ b/src/main/java/com/chargebee/v4/services/CsvTaxRuleService.java @@ -5,15 +5,16 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.csvTaxRule.params.CsvTaxRuleCreateParams; +import com.chargebee.v4.models.csvTaxRule.params.CsvTaxRuleCreateParams; -import com.chargebee.v4.core.responses.csvTaxRule.CsvTaxRuleCreateResponse; +import com.chargebee.v4.models.csvTaxRule.responses.CsvTaxRuleCreateResponse; public final class CsvTaxRuleService extends BaseService { @@ -50,18 +51,18 @@ public CsvTaxRuleService withOptions(RequestOptions options) { // === Operations === /** create a csvTaxRule using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(CsvTaxRuleCreateParams params) throws Exception { + Response createRaw(CsvTaxRuleCreateParams params) throws ChargebeeException { return post("/csv_tax_rules", params != null ? params.toFormData() : null); } /** create a csvTaxRule using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/csv_tax_rules", jsonPayload); } - public CsvTaxRuleCreateResponse create(CsvTaxRuleCreateParams params) throws Exception { + public CsvTaxRuleCreateResponse create(CsvTaxRuleCreateParams params) throws ChargebeeException { Response response = createRaw(params); return CsvTaxRuleCreateResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/core/services/CurrencyService.java b/src/main/java/com/chargebee/v4/services/CurrencyService.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/services/CurrencyService.java rename to src/main/java/com/chargebee/v4/services/CurrencyService.java index 350b2e7d..f6f010d3 100644 --- a/src/main/java/com/chargebee/v4/core/services/CurrencyService.java +++ b/src/main/java/com/chargebee/v4/services/CurrencyService.java @@ -5,31 +5,32 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.currency.params.CurrencyAddScheduleParams; +import com.chargebee.v4.models.currency.params.CurrencyAddScheduleParams; -import com.chargebee.v4.core.models.currency.params.CurrencyCreateParams; +import com.chargebee.v4.models.currency.params.CurrencyCreateParams; -import com.chargebee.v4.core.models.currency.params.CurrencyUpdateParams; +import com.chargebee.v4.models.currency.params.CurrencyUpdateParams; -import com.chargebee.v4.core.models.currency.params.CurrencyListParams; +import com.chargebee.v4.models.currency.params.CurrencyListParams; -import com.chargebee.v4.core.responses.currency.CurrencyAddScheduleResponse; +import com.chargebee.v4.models.currency.responses.CurrencyAddScheduleResponse; -import com.chargebee.v4.core.responses.currency.CurrencyCreateResponse; +import com.chargebee.v4.models.currency.responses.CurrencyCreateResponse; -import com.chargebee.v4.core.responses.currency.CurrencyRetrieveResponse; +import com.chargebee.v4.models.currency.responses.CurrencyRetrieveResponse; -import com.chargebee.v4.core.responses.currency.CurrencyUpdateResponse; +import com.chargebee.v4.models.currency.responses.CurrencyUpdateResponse; -import com.chargebee.v4.core.responses.currency.CurrencyRemoveScheduleResponse; +import com.chargebee.v4.models.currency.responses.CurrencyRemoveScheduleResponse; -import com.chargebee.v4.core.responses.currency.CurrencyListResponse; +import com.chargebee.v4.models.currency.responses.CurrencyListResponse; public final class CurrencyService extends BaseService { @@ -66,7 +67,7 @@ public CurrencyService withOptions(RequestOptions options) { // === Operations === /** addSchedule a currency (executes immediately) - returns raw Response. */ - Response addScheduleRaw(String siteCurrencyId) throws Exception { + Response addScheduleRaw(String siteCurrencyId) throws ChargebeeException { String path = buildPathWithParams( "/currencies/{site-currency-id}/add_schedule", "site-currency-id", siteCurrencyId); @@ -78,7 +79,7 @@ Response addScheduleRaw(String siteCurrencyId) throws Exception { * addSchedule a currency using immutable params (executes immediately) - returns raw Response. */ Response addScheduleRaw(String siteCurrencyId, CurrencyAddScheduleParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/currencies/{site-currency-id}/add_schedule", "site-currency-id", siteCurrencyId); @@ -88,7 +89,7 @@ Response addScheduleRaw(String siteCurrencyId, CurrencyAddScheduleParams params) /** * addSchedule a currency using raw JSON payload (executes immediately) - returns raw Response. */ - Response addScheduleRaw(String siteCurrencyId, String jsonPayload) throws Exception { + Response addScheduleRaw(String siteCurrencyId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/currencies/{site-currency-id}/add_schedule", "site-currency-id", siteCurrencyId); @@ -96,44 +97,44 @@ Response addScheduleRaw(String siteCurrencyId, String jsonPayload) throws Except } public CurrencyAddScheduleResponse addSchedule( - String siteCurrencyId, CurrencyAddScheduleParams params) throws Exception { + String siteCurrencyId, CurrencyAddScheduleParams params) throws ChargebeeException { Response response = addScheduleRaw(siteCurrencyId, params); return CurrencyAddScheduleResponse.fromJson(response.getBodyAsString(), response); } /** create a currency using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(CurrencyCreateParams params) throws Exception { + Response createRaw(CurrencyCreateParams params) throws ChargebeeException { return post("/currencies", params != null ? params.toFormData() : null); } /** create a currency using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/currencies", jsonPayload); } - public CurrencyCreateResponse create(CurrencyCreateParams params) throws Exception { + public CurrencyCreateResponse create(CurrencyCreateParams params) throws ChargebeeException { Response response = createRaw(params); return CurrencyCreateResponse.fromJson(response.getBodyAsString(), response); } /** retrieve a currency (executes immediately) - returns raw Response. */ - Response retrieveRaw(String siteCurrencyId) throws Exception { + Response retrieveRaw(String siteCurrencyId) throws ChargebeeException { String path = buildPathWithParams("/currencies/{site-currency-id}", "site-currency-id", siteCurrencyId); return get(path, null); } - public CurrencyRetrieveResponse retrieve(String siteCurrencyId) throws Exception { + public CurrencyRetrieveResponse retrieve(String siteCurrencyId) throws ChargebeeException { Response response = retrieveRaw(siteCurrencyId); return CurrencyRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** update a currency (executes immediately) - returns raw Response. */ - Response updateRaw(String siteCurrencyId) throws Exception { + Response updateRaw(String siteCurrencyId) throws ChargebeeException { String path = buildPathWithParams("/currencies/{site-currency-id}", "site-currency-id", siteCurrencyId); @@ -141,27 +142,27 @@ Response updateRaw(String siteCurrencyId) throws Exception { } /** update a currency using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String siteCurrencyId, CurrencyUpdateParams params) throws Exception { + Response updateRaw(String siteCurrencyId, CurrencyUpdateParams params) throws ChargebeeException { String path = buildPathWithParams("/currencies/{site-currency-id}", "site-currency-id", siteCurrencyId); return post(path, params.toFormData()); } /** update a currency using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String siteCurrencyId, String jsonPayload) throws Exception { + Response updateRaw(String siteCurrencyId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/currencies/{site-currency-id}", "site-currency-id", siteCurrencyId); return postJson(path, jsonPayload); } public CurrencyUpdateResponse update(String siteCurrencyId, CurrencyUpdateParams params) - throws Exception { + throws ChargebeeException { Response response = updateRaw(siteCurrencyId, params); return CurrencyUpdateResponse.fromJson(response.getBodyAsString(), response); } /** removeSchedule a currency (executes immediately) - returns raw Response. */ - Response removeScheduleRaw(String siteCurrencyId) throws Exception { + Response removeScheduleRaw(String siteCurrencyId) throws ChargebeeException { String path = buildPathWithParams( "/currencies/{site-currency-id}/remove_schedule", "site-currency-id", siteCurrencyId); @@ -169,36 +170,37 @@ Response removeScheduleRaw(String siteCurrencyId) throws Exception { return post(path, null); } - public CurrencyRemoveScheduleResponse removeSchedule(String siteCurrencyId) throws Exception { + public CurrencyRemoveScheduleResponse removeSchedule(String siteCurrencyId) + throws ChargebeeException { Response response = removeScheduleRaw(siteCurrencyId); return CurrencyRemoveScheduleResponse.fromJson(response.getBodyAsString(), response); } /** list a currency using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(CurrencyListParams params) throws Exception { + Response listRaw(CurrencyListParams params) throws ChargebeeException { return get("/currencies/list", params != null ? params.toQueryParams() : null); } /** list a currency without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/currencies/list", null); } /** list a currency using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public CurrencyListResponse list(CurrencyListParams params) throws Exception { + public CurrencyListResponse list(CurrencyListParams params) throws ChargebeeException { Response response = listRaw(params); return CurrencyListResponse.fromJson(response.getBodyAsString(), this, params, response); } - public CurrencyListResponse list() throws Exception { + public CurrencyListResponse list() throws ChargebeeException { Response response = listRaw(); return CurrencyListResponse.fromJson(response.getBodyAsString(), this, null, response); } diff --git a/src/main/java/com/chargebee/v4/core/services/CustomerEntitlementService.java b/src/main/java/com/chargebee/v4/services/CustomerEntitlementService.java similarity index 86% rename from src/main/java/com/chargebee/v4/core/services/CustomerEntitlementService.java rename to src/main/java/com/chargebee/v4/services/CustomerEntitlementService.java index 04d4c7f2..22fcbe72 100644 --- a/src/main/java/com/chargebee/v4/core/services/CustomerEntitlementService.java +++ b/src/main/java/com/chargebee/v4/services/CustomerEntitlementService.java @@ -5,15 +5,16 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.customerEntitlement.params.CustomerEntitlementEntitlementsForCustomerParams; +import com.chargebee.v4.models.customerEntitlement.params.CustomerEntitlementEntitlementsForCustomerParams; -import com.chargebee.v4.core.responses.customerEntitlement.CustomerEntitlementEntitlementsForCustomerResponse; +import com.chargebee.v4.models.customerEntitlement.responses.CustomerEntitlementEntitlementsForCustomerResponse; public final class CustomerEntitlementService extends BaseService { @@ -55,7 +56,8 @@ public CustomerEntitlementService withOptions(RequestOptions options) { * returns raw Response. */ Response entitlementsForCustomerRaw( - String customerId, CustomerEntitlementEntitlementsForCustomerParams params) throws Exception { + String customerId, CustomerEntitlementEntitlementsForCustomerParams params) + throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/customer_entitlements", "customer-id", customerId); @@ -66,7 +68,7 @@ Response entitlementsForCustomerRaw( * entitlementsForCustomer a customerEntitlement without params (executes immediately) - returns * raw Response. */ - Response entitlementsForCustomerRaw(String customerId) throws Exception { + Response entitlementsForCustomerRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/customer_entitlements", "customer-id", customerId); @@ -77,7 +79,8 @@ Response entitlementsForCustomerRaw(String customerId) throws Exception { * entitlementsForCustomer a customerEntitlement using raw JSON payload (executes immediately) - * returns raw Response. */ - Response entitlementsForCustomerRaw(String customerId, String jsonPayload) throws Exception { + Response entitlementsForCustomerRaw(String customerId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/customer_entitlements", "customer-id", customerId); @@ -85,14 +88,15 @@ Response entitlementsForCustomerRaw(String customerId, String jsonPayload) throw } public CustomerEntitlementEntitlementsForCustomerResponse entitlementsForCustomer( - String customerId, CustomerEntitlementEntitlementsForCustomerParams params) throws Exception { + String customerId, CustomerEntitlementEntitlementsForCustomerParams params) + throws ChargebeeException { Response response = entitlementsForCustomerRaw(customerId, params); return CustomerEntitlementEntitlementsForCustomerResponse.fromJson( response.getBodyAsString(), this, params, customerId, response); } public CustomerEntitlementEntitlementsForCustomerResponse entitlementsForCustomer( - String customerId) throws Exception { + String customerId) throws ChargebeeException { Response response = entitlementsForCustomerRaw(customerId); return CustomerEntitlementEntitlementsForCustomerResponse.fromJson( response.getBodyAsString(), this, null, customerId, response); diff --git a/src/main/java/com/chargebee/v4/core/services/CustomerService.java b/src/main/java/com/chargebee/v4/services/CustomerService.java similarity index 75% rename from src/main/java/com/chargebee/v4/core/services/CustomerService.java rename to src/main/java/com/chargebee/v4/services/CustomerService.java index ade373b6..11787ba2 100644 --- a/src/main/java/com/chargebee/v4/core/services/CustomerService.java +++ b/src/main/java/com/chargebee/v4/services/CustomerService.java @@ -5,107 +5,110 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.customer.params.CustomerDeleteParams; +import com.chargebee.v4.models.customer.params.CustomerDeleteParams; -import com.chargebee.v4.core.models.customer.params.CustomerAddPromotionalCreditsParams; +import com.chargebee.v4.models.customer.params.CustomerAddPromotionalCreditsParams; -import com.chargebee.v4.core.models.customer.params.CustomerRelationshipsParams; +import com.chargebee.v4.models.customer.params.CustomerRelationshipsParams; -import com.chargebee.v4.core.models.customer.params.CustomerDeleteContactParams; +import com.chargebee.v4.models.customer.params.CustomerDeleteContactParams; -import com.chargebee.v4.core.models.customer.params.CustomerAssignPaymentRoleParams; +import com.chargebee.v4.models.customer.params.CustomerAssignPaymentRoleParams; -import com.chargebee.v4.core.models.customer.params.CustomerMoveParams; +import com.chargebee.v4.models.customer.params.CustomerMoveParams; -import com.chargebee.v4.core.models.customer.params.CustomerUpdatePaymentMethodParams; +import com.chargebee.v4.models.customer.params.CustomerHierarchyParams; -import com.chargebee.v4.core.models.customer.params.CustomerUpdateParams; +import com.chargebee.v4.models.customer.params.CustomerUpdatePaymentMethodParams; -import com.chargebee.v4.core.models.customer.params.CustomerListHierarchyDetailParams; +import com.chargebee.v4.models.customer.params.CustomerUpdateParams; -import com.chargebee.v4.core.models.customer.params.CustomerChangeBillingDateParams; +import com.chargebee.v4.models.customer.params.CustomerListHierarchyDetailParams; -import com.chargebee.v4.core.models.customer.params.CustomerListParams; +import com.chargebee.v4.models.customer.params.CustomerChangeBillingDateParams; -import com.chargebee.v4.core.models.customer.params.CustomerCreateParams; +import com.chargebee.v4.models.customer.params.CustomerListParams; -import com.chargebee.v4.core.models.customer.params.CustomerAddContactParams; +import com.chargebee.v4.models.customer.params.CustomerCreateParams; -import com.chargebee.v4.core.models.customer.params.CustomerContactsForCustomerParams; +import com.chargebee.v4.models.customer.params.CustomerAddContactParams; -import com.chargebee.v4.core.models.customer.params.CustomerDeductPromotionalCreditsParams; +import com.chargebee.v4.models.customer.params.ContactsForCustomerParams; -import com.chargebee.v4.core.models.customer.params.CustomerMergeParams; +import com.chargebee.v4.models.customer.params.CustomerDeductPromotionalCreditsParams; -import com.chargebee.v4.core.models.customer.params.CustomerCollectPaymentParams; +import com.chargebee.v4.models.customer.params.CustomerMergeParams; -import com.chargebee.v4.core.models.customer.params.CustomerRecordExcessPaymentParams; +import com.chargebee.v4.models.customer.params.CustomerCollectPaymentParams; -import com.chargebee.v4.core.models.customer.params.CustomerSetPromotionalCreditsParams; +import com.chargebee.v4.models.customer.params.CustomerRecordExcessPaymentParams; -import com.chargebee.v4.core.models.customer.params.CustomerUpdateContactParams; +import com.chargebee.v4.models.customer.params.CustomerSetPromotionalCreditsParams; -import com.chargebee.v4.core.models.customer.params.CustomerUpdateHierarchySettingsParams; +import com.chargebee.v4.models.customer.params.CustomerUpdateContactParams; -import com.chargebee.v4.core.models.customer.params.CustomerUpdateBillingInfoParams; +import com.chargebee.v4.models.customer.params.CustomerUpdateHierarchySettingsParams; -import com.chargebee.v4.core.responses.customer.CustomerDeleteResponse; +import com.chargebee.v4.models.customer.params.CustomerUpdateBillingInfoParams; -import com.chargebee.v4.core.responses.customer.CustomerAddPromotionalCreditsResponse; +import com.chargebee.v4.models.customer.responses.CustomerDeleteResponse; -import com.chargebee.v4.core.responses.customer.CustomerRelationshipsResponse; +import com.chargebee.v4.models.customer.responses.CustomerAddPromotionalCreditsResponse; -import com.chargebee.v4.core.responses.customer.CustomerDeleteRelationshipResponse; +import com.chargebee.v4.models.customer.responses.CustomerRelationshipsResponse; -import com.chargebee.v4.core.responses.customer.CustomerDeleteContactResponse; +import com.chargebee.v4.models.customer.responses.CustomerDeleteRelationshipResponse; -import com.chargebee.v4.core.responses.customer.CustomerAssignPaymentRoleResponse; +import com.chargebee.v4.models.customer.responses.CustomerDeleteContactResponse; -import com.chargebee.v4.core.responses.customer.CustomerMoveResponse; +import com.chargebee.v4.models.customer.responses.CustomerAssignPaymentRoleResponse; -import com.chargebee.v4.core.responses.customer.CustomerHierarchyResponse; +import com.chargebee.v4.models.customer.responses.CustomerMoveResponse; -import com.chargebee.v4.core.responses.customer.CustomerUpdatePaymentMethodResponse; +import com.chargebee.v4.models.customer.responses.CustomerHierarchyResponse; -import com.chargebee.v4.core.responses.customer.CustomerRetrieveResponse; +import com.chargebee.v4.models.customer.responses.CustomerUpdatePaymentMethodResponse; -import com.chargebee.v4.core.responses.customer.CustomerUpdateResponse; +import com.chargebee.v4.models.customer.responses.CustomerRetrieveResponse; -import com.chargebee.v4.core.responses.customer.CustomerListHierarchyDetailResponse; +import com.chargebee.v4.models.customer.responses.CustomerUpdateResponse; -import com.chargebee.v4.core.responses.customer.CustomerChangeBillingDateResponse; +import com.chargebee.v4.models.customer.responses.CustomerListHierarchyDetailResponse; -import com.chargebee.v4.core.responses.customer.CustomerListResponse; +import com.chargebee.v4.models.customer.responses.CustomerChangeBillingDateResponse; -import com.chargebee.v4.core.responses.customer.CustomerCreateResponse; +import com.chargebee.v4.models.customer.responses.CustomerListResponse; -import com.chargebee.v4.core.responses.customer.CustomerAddContactResponse; +import com.chargebee.v4.models.customer.responses.CustomerCreateResponse; -import com.chargebee.v4.core.responses.customer.CustomerContactsForCustomerResponse; +import com.chargebee.v4.models.customer.responses.CustomerAddContactResponse; -import com.chargebee.v4.core.responses.customer.CustomerDeductPromotionalCreditsResponse; +import com.chargebee.v4.models.customer.responses.ContactsForCustomerResponse; -import com.chargebee.v4.core.responses.customer.CustomerClearPersonalDataResponse; +import com.chargebee.v4.models.customer.responses.CustomerDeductPromotionalCreditsResponse; -import com.chargebee.v4.core.responses.customer.CustomerMergeResponse; +import com.chargebee.v4.models.customer.responses.CustomerClearPersonalDataResponse; -import com.chargebee.v4.core.responses.customer.CustomerCollectPaymentResponse; +import com.chargebee.v4.models.customer.responses.CustomerMergeResponse; -import com.chargebee.v4.core.responses.customer.CustomerRecordExcessPaymentResponse; +import com.chargebee.v4.models.customer.responses.CustomerCollectPaymentResponse; -import com.chargebee.v4.core.responses.customer.CustomerSetPromotionalCreditsResponse; +import com.chargebee.v4.models.customer.responses.CustomerRecordExcessPaymentResponse; -import com.chargebee.v4.core.responses.customer.CustomerUpdateContactResponse; +import com.chargebee.v4.models.customer.responses.CustomerSetPromotionalCreditsResponse; -import com.chargebee.v4.core.responses.customer.CustomerUpdateHierarchySettingsResponse; +import com.chargebee.v4.models.customer.responses.CustomerUpdateContactResponse; -import com.chargebee.v4.core.responses.customer.CustomerUpdateBillingInfoResponse; +import com.chargebee.v4.models.customer.responses.CustomerUpdateHierarchySettingsResponse; + +import com.chargebee.v4.models.customer.responses.CustomerUpdateBillingInfoResponse; public final class CustomerService extends BaseService { @@ -142,32 +145,32 @@ public CustomerService withOptions(RequestOptions options) { // === Operations === /** delete a customer (executes immediately) - returns raw Response. */ - Response deleteRaw(String customerId) throws Exception { + Response deleteRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/delete", "customer-id", customerId); return post(path, null); } /** delete a customer using immutable params (executes immediately) - returns raw Response. */ - Response deleteRaw(String customerId, CustomerDeleteParams params) throws Exception { + Response deleteRaw(String customerId, CustomerDeleteParams params) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/delete", "customer-id", customerId); return post(path, params.toFormData()); } /** delete a customer using raw JSON payload (executes immediately) - returns raw Response. */ - Response deleteRaw(String customerId, String jsonPayload) throws Exception { + Response deleteRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/delete", "customer-id", customerId); return postJson(path, jsonPayload); } public CustomerDeleteResponse delete(String customerId, CustomerDeleteParams params) - throws Exception { + throws ChargebeeException { Response response = deleteRaw(customerId, params); return CustomerDeleteResponse.fromJson(response.getBodyAsString(), response); } /** addPromotionalCredits a customer (executes immediately) - returns raw Response. */ - Response addPromotionalCreditsRaw(String customerId) throws Exception { + Response addPromotionalCreditsRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/add_promotional_credits", "customer-id", customerId); @@ -180,7 +183,7 @@ Response addPromotionalCreditsRaw(String customerId) throws Exception { * Response. */ Response addPromotionalCreditsRaw(String customerId, CustomerAddPromotionalCreditsParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/add_promotional_credits", "customer-id", customerId); @@ -191,7 +194,8 @@ Response addPromotionalCreditsRaw(String customerId, CustomerAddPromotionalCredi * addPromotionalCredits a customer using raw JSON payload (executes immediately) - returns raw * Response. */ - Response addPromotionalCreditsRaw(String customerId, String jsonPayload) throws Exception { + Response addPromotionalCreditsRaw(String customerId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/add_promotional_credits", "customer-id", customerId); @@ -199,13 +203,13 @@ Response addPromotionalCreditsRaw(String customerId, String jsonPayload) throws } public CustomerAddPromotionalCreditsResponse addPromotionalCredits( - String customerId, CustomerAddPromotionalCreditsParams params) throws Exception { + String customerId, CustomerAddPromotionalCreditsParams params) throws ChargebeeException { Response response = addPromotionalCreditsRaw(customerId, params); return CustomerAddPromotionalCreditsResponse.fromJson(response.getBodyAsString(), response); } /** relationships a customer (executes immediately) - returns raw Response. */ - Response relationshipsRaw(String customerId) throws Exception { + Response relationshipsRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/relationships", "customer-id", customerId); @@ -216,7 +220,7 @@ Response relationshipsRaw(String customerId) throws Exception { * relationships a customer using immutable params (executes immediately) - returns raw Response. */ Response relationshipsRaw(String customerId, CustomerRelationshipsParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/relationships", "customer-id", customerId); return post(path, params.toFormData()); @@ -225,20 +229,20 @@ Response relationshipsRaw(String customerId, CustomerRelationshipsParams params) /** * relationships a customer using raw JSON payload (executes immediately) - returns raw Response. */ - Response relationshipsRaw(String customerId, String jsonPayload) throws Exception { + Response relationshipsRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/relationships", "customer-id", customerId); return postJson(path, jsonPayload); } public CustomerRelationshipsResponse relationships( - String customerId, CustomerRelationshipsParams params) throws Exception { + String customerId, CustomerRelationshipsParams params) throws ChargebeeException { Response response = relationshipsRaw(customerId, params); return CustomerRelationshipsResponse.fromJson(response.getBodyAsString(), response); } /** deleteRelationship a customer (executes immediately) - returns raw Response. */ - Response deleteRelationshipRaw(String customerId) throws Exception { + Response deleteRelationshipRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/delete_relationship", "customer-id", customerId); @@ -246,13 +250,14 @@ Response deleteRelationshipRaw(String customerId) throws Exception { return post(path, null); } - public CustomerDeleteRelationshipResponse deleteRelationship(String customerId) throws Exception { + public CustomerDeleteRelationshipResponse deleteRelationship(String customerId) + throws ChargebeeException { Response response = deleteRelationshipRaw(customerId); return CustomerDeleteRelationshipResponse.fromJson(response.getBodyAsString(), response); } /** deleteContact a customer (executes immediately) - returns raw Response. */ - Response deleteContactRaw(String customerId) throws Exception { + Response deleteContactRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/delete_contact", "customer-id", customerId); @@ -263,7 +268,7 @@ Response deleteContactRaw(String customerId) throws Exception { * deleteContact a customer using immutable params (executes immediately) - returns raw Response. */ Response deleteContactRaw(String customerId, CustomerDeleteContactParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/delete_contact", "customer-id", customerId); return post(path, params.toFormData()); @@ -272,20 +277,20 @@ Response deleteContactRaw(String customerId, CustomerDeleteContactParams params) /** * deleteContact a customer using raw JSON payload (executes immediately) - returns raw Response. */ - Response deleteContactRaw(String customerId, String jsonPayload) throws Exception { + Response deleteContactRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/delete_contact", "customer-id", customerId); return postJson(path, jsonPayload); } public CustomerDeleteContactResponse deleteContact( - String customerId, CustomerDeleteContactParams params) throws Exception { + String customerId, CustomerDeleteContactParams params) throws ChargebeeException { Response response = deleteContactRaw(customerId, params); return CustomerDeleteContactResponse.fromJson(response.getBodyAsString(), response); } /** assignPaymentRole a customer (executes immediately) - returns raw Response. */ - Response assignPaymentRoleRaw(String customerId) throws Exception { + Response assignPaymentRoleRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/assign_payment_role", "customer-id", customerId); @@ -298,7 +303,7 @@ Response assignPaymentRoleRaw(String customerId) throws Exception { * Response. */ Response assignPaymentRoleRaw(String customerId, CustomerAssignPaymentRoleParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/assign_payment_role", "customer-id", customerId); @@ -309,7 +314,7 @@ Response assignPaymentRoleRaw(String customerId, CustomerAssignPaymentRoleParams * assignPaymentRole a customer using raw JSON payload (executes immediately) - returns raw * Response. */ - Response assignPaymentRoleRaw(String customerId, String jsonPayload) throws Exception { + Response assignPaymentRoleRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/assign_payment_role", "customer-id", customerId); @@ -317,44 +322,58 @@ Response assignPaymentRoleRaw(String customerId, String jsonPayload) throws Exce } public CustomerAssignPaymentRoleResponse assignPaymentRole( - String customerId, CustomerAssignPaymentRoleParams params) throws Exception { + String customerId, CustomerAssignPaymentRoleParams params) throws ChargebeeException { Response response = assignPaymentRoleRaw(customerId, params); return CustomerAssignPaymentRoleResponse.fromJson(response.getBodyAsString(), response); } /** move a customer using immutable params (executes immediately) - returns raw Response. */ - Response moveRaw(CustomerMoveParams params) throws Exception { + Response moveRaw(CustomerMoveParams params) throws ChargebeeException { return post("/customers/move", params != null ? params.toFormData() : null); } /** move a customer using raw JSON payload (executes immediately) - returns raw Response. */ - Response moveRaw(String jsonPayload) throws Exception { + Response moveRaw(String jsonPayload) throws ChargebeeException { return postJson("/customers/move", jsonPayload); } - public CustomerMoveResponse move(CustomerMoveParams params) throws Exception { + public CustomerMoveResponse move(CustomerMoveParams params) throws ChargebeeException { Response response = moveRaw(params); return CustomerMoveResponse.fromJson(response.getBodyAsString(), response); } /** hierarchy a customer (executes immediately) - returns raw Response. */ - Response hierarchyRaw(String customerId) throws Exception { + Response hierarchyRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/hierarchy", "customer-id", customerId); return get(path, null); } - public CustomerHierarchyResponse hierarchy(String customerId) throws Exception { + /** hierarchy a customer using immutable params (executes immediately) - returns raw Response. */ + Response hierarchyRaw(String customerId, CustomerHierarchyParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/hierarchy", "customer-id", customerId); + return get(path, params != null ? params.toQueryParams() : null); + } + + public CustomerHierarchyResponse hierarchy(String customerId, CustomerHierarchyParams params) + throws ChargebeeException { + Response response = hierarchyRaw(customerId, params); + return CustomerHierarchyResponse.fromJson(response.getBodyAsString(), response); + } + + public CustomerHierarchyResponse hierarchy(String customerId) throws ChargebeeException { Response response = hierarchyRaw(customerId); return CustomerHierarchyResponse.fromJson(response.getBodyAsString(), response); } /** updatePaymentMethod a customer (executes immediately) - returns raw Response. */ - Response updatePaymentMethodRaw(String customerId) throws Exception { + Response updatePaymentMethodRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/update_payment_method", "customer-id", customerId); @@ -367,7 +386,7 @@ Response updatePaymentMethodRaw(String customerId) throws Exception { * Response. */ Response updatePaymentMethodRaw(String customerId, CustomerUpdatePaymentMethodParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/update_payment_method", "customer-id", customerId); @@ -378,7 +397,7 @@ Response updatePaymentMethodRaw(String customerId, CustomerUpdatePaymentMethodPa * updatePaymentMethod a customer using raw JSON payload (executes immediately) - returns raw * Response. */ - Response updatePaymentMethodRaw(String customerId, String jsonPayload) throws Exception { + Response updatePaymentMethodRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/update_payment_method", "customer-id", customerId); @@ -386,44 +405,44 @@ Response updatePaymentMethodRaw(String customerId, String jsonPayload) throws Ex } public CustomerUpdatePaymentMethodResponse updatePaymentMethod( - String customerId, CustomerUpdatePaymentMethodParams params) throws Exception { + String customerId, CustomerUpdatePaymentMethodParams params) throws ChargebeeException { Response response = updatePaymentMethodRaw(customerId, params); return CustomerUpdatePaymentMethodResponse.fromJson(response.getBodyAsString(), response); } /** retrieve a customer (executes immediately) - returns raw Response. */ - Response retrieveRaw(String customerId) throws Exception { + Response retrieveRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}", "customer-id", customerId); return get(path, null); } - public CustomerRetrieveResponse retrieve(String customerId) throws Exception { + public CustomerRetrieveResponse retrieve(String customerId) throws ChargebeeException { Response response = retrieveRaw(customerId); return CustomerRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** update a customer (executes immediately) - returns raw Response. */ - Response updateRaw(String customerId) throws Exception { + Response updateRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}", "customer-id", customerId); return post(path, null); } /** update a customer using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String customerId, CustomerUpdateParams params) throws Exception { + Response updateRaw(String customerId, CustomerUpdateParams params) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}", "customer-id", customerId); return post(path, params.toFormData()); } /** update a customer using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String customerId, String jsonPayload) throws Exception { + Response updateRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}", "customer-id", customerId); return postJson(path, jsonPayload); } public CustomerUpdateResponse update(String customerId, CustomerUpdateParams params) - throws Exception { + throws ChargebeeException { Response response = updateRaw(customerId, params); return CustomerUpdateResponse.fromJson(response.getBodyAsString(), response); } @@ -433,7 +452,7 @@ public CustomerUpdateResponse update(String customerId, CustomerUpdateParams par * Response. */ Response listHierarchyDetailRaw(String customerId, CustomerListHierarchyDetailParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/hierarchy_detail", "customer-id", customerId); return get(path, params != null ? params.toQueryParams() : null); @@ -442,7 +461,7 @@ Response listHierarchyDetailRaw(String customerId, CustomerListHierarchyDetailPa /** * listHierarchyDetail a customer without params (executes immediately) - returns raw Response. */ - Response listHierarchyDetailRaw(String customerId) throws Exception { + Response listHierarchyDetailRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/hierarchy_detail", "customer-id", customerId); return get(path, null); @@ -452,28 +471,28 @@ Response listHierarchyDetailRaw(String customerId) throws Exception { * listHierarchyDetail a customer using raw JSON payload (executes immediately) - returns raw * Response. */ - Response listHierarchyDetailRaw(String customerId, String jsonPayload) throws Exception { + Response listHierarchyDetailRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/hierarchy_detail", "customer-id", customerId); throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public CustomerListHierarchyDetailResponse listHierarchyDetail( - String customerId, CustomerListHierarchyDetailParams params) throws Exception { + String customerId, CustomerListHierarchyDetailParams params) throws ChargebeeException { Response response = listHierarchyDetailRaw(customerId, params); return CustomerListHierarchyDetailResponse.fromJson( response.getBodyAsString(), this, params, customerId, response); } public CustomerListHierarchyDetailResponse listHierarchyDetail(String customerId) - throws Exception { + throws ChargebeeException { Response response = listHierarchyDetailRaw(customerId); return CustomerListHierarchyDetailResponse.fromJson( response.getBodyAsString(), this, null, customerId, response); } /** changeBillingDate a customer (executes immediately) - returns raw Response. */ - Response changeBillingDateRaw(String customerId) throws Exception { + Response changeBillingDateRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/change_billing_date", "customer-id", customerId); @@ -486,7 +505,7 @@ Response changeBillingDateRaw(String customerId) throws Exception { * Response. */ Response changeBillingDateRaw(String customerId, CustomerChangeBillingDateParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/change_billing_date", "customer-id", customerId); @@ -497,7 +516,7 @@ Response changeBillingDateRaw(String customerId, CustomerChangeBillingDateParams * changeBillingDate a customer using raw JSON payload (executes immediately) - returns raw * Response. */ - Response changeBillingDateRaw(String customerId, String jsonPayload) throws Exception { + Response changeBillingDateRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/change_billing_date", "customer-id", customerId); @@ -505,60 +524,60 @@ Response changeBillingDateRaw(String customerId, String jsonPayload) throws Exce } public CustomerChangeBillingDateResponse changeBillingDate( - String customerId, CustomerChangeBillingDateParams params) throws Exception { + String customerId, CustomerChangeBillingDateParams params) throws ChargebeeException { Response response = changeBillingDateRaw(customerId, params); return CustomerChangeBillingDateResponse.fromJson(response.getBodyAsString(), response); } /** list a customer using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(CustomerListParams params) throws Exception { + Response listRaw(CustomerListParams params) throws ChargebeeException { return get("/customers", params != null ? params.toQueryParams() : null); } /** list a customer without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/customers", null); } /** list a customer using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public CustomerListResponse list(CustomerListParams params) throws Exception { + public CustomerListResponse list(CustomerListParams params) throws ChargebeeException { Response response = listRaw(params); return CustomerListResponse.fromJson(response.getBodyAsString(), this, params, response); } - public CustomerListResponse list() throws Exception { + public CustomerListResponse list() throws ChargebeeException { Response response = listRaw(); return CustomerListResponse.fromJson(response.getBodyAsString(), this, null, response); } /** create a customer using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(CustomerCreateParams params) throws Exception { + Response createRaw(CustomerCreateParams params) throws ChargebeeException { return post("/customers", params != null ? params.toFormData() : null); } /** create a customer using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/customers", jsonPayload); } - public CustomerCreateResponse create(CustomerCreateParams params) throws Exception { + public CustomerCreateResponse create(CustomerCreateParams params) throws ChargebeeException { Response response = createRaw(params); return CustomerCreateResponse.fromJson(response.getBodyAsString(), response); } /** addContact a customer (executes immediately) - returns raw Response. */ - Response addContactRaw(String customerId) throws Exception { + Response addContactRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/add_contact", "customer-id", customerId); @@ -566,21 +585,22 @@ Response addContactRaw(String customerId) throws Exception { } /** addContact a customer using immutable params (executes immediately) - returns raw Response. */ - Response addContactRaw(String customerId, CustomerAddContactParams params) throws Exception { + Response addContactRaw(String customerId, CustomerAddContactParams params) + throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/add_contact", "customer-id", customerId); return post(path, params.toFormData()); } /** addContact a customer using raw JSON payload (executes immediately) - returns raw Response. */ - Response addContactRaw(String customerId, String jsonPayload) throws Exception { + Response addContactRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/add_contact", "customer-id", customerId); return postJson(path, jsonPayload); } public CustomerAddContactResponse addContact(String customerId, CustomerAddContactParams params) - throws Exception { + throws ChargebeeException { Response response = addContactRaw(customerId, params); return CustomerAddContactResponse.fromJson(response.getBodyAsString(), response); } @@ -589,8 +609,8 @@ public CustomerAddContactResponse addContact(String customerId, CustomerAddConta * contactsForCustomer a customer using immutable params (executes immediately) - returns raw * Response. */ - Response contactsForCustomerRaw(String customerId, CustomerContactsForCustomerParams params) - throws Exception { + Response contactsForCustomerRaw(String customerId, ContactsForCustomerParams params) + throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/contacts", "customer-id", customerId); return get(path, params != null ? params.toQueryParams() : null); @@ -599,7 +619,7 @@ Response contactsForCustomerRaw(String customerId, CustomerContactsForCustomerPa /** * contactsForCustomer a customer without params (executes immediately) - returns raw Response. */ - Response contactsForCustomerRaw(String customerId) throws Exception { + Response contactsForCustomerRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/contacts", "customer-id", customerId); return get(path, null); @@ -609,28 +629,28 @@ Response contactsForCustomerRaw(String customerId) throws Exception { * contactsForCustomer a customer using raw JSON payload (executes immediately) - returns raw * Response. */ - Response contactsForCustomerRaw(String customerId, String jsonPayload) throws Exception { + Response contactsForCustomerRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/contacts", "customer-id", customerId); throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public CustomerContactsForCustomerResponse contactsForCustomer( - String customerId, CustomerContactsForCustomerParams params) throws Exception { + public ContactsForCustomerResponse contactsForCustomer( + String customerId, ContactsForCustomerParams params) throws ChargebeeException { Response response = contactsForCustomerRaw(customerId, params); - return CustomerContactsForCustomerResponse.fromJson( + return ContactsForCustomerResponse.fromJson( response.getBodyAsString(), this, params, customerId, response); } - public CustomerContactsForCustomerResponse contactsForCustomer(String customerId) - throws Exception { + public ContactsForCustomerResponse contactsForCustomer(String customerId) + throws ChargebeeException { Response response = contactsForCustomerRaw(customerId); - return CustomerContactsForCustomerResponse.fromJson( + return ContactsForCustomerResponse.fromJson( response.getBodyAsString(), this, null, customerId, response); } /** deductPromotionalCredits a customer (executes immediately) - returns raw Response. */ - Response deductPromotionalCreditsRaw(String customerId) throws Exception { + Response deductPromotionalCreditsRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/deduct_promotional_credits", "customer-id", customerId); @@ -643,7 +663,7 @@ Response deductPromotionalCreditsRaw(String customerId) throws Exception { * Response. */ Response deductPromotionalCreditsRaw( - String customerId, CustomerDeductPromotionalCreditsParams params) throws Exception { + String customerId, CustomerDeductPromotionalCreditsParams params) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/deduct_promotional_credits", "customer-id", customerId); @@ -654,7 +674,8 @@ Response deductPromotionalCreditsRaw( * deductPromotionalCredits a customer using raw JSON payload (executes immediately) - returns raw * Response. */ - Response deductPromotionalCreditsRaw(String customerId, String jsonPayload) throws Exception { + Response deductPromotionalCreditsRaw(String customerId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/deduct_promotional_credits", "customer-id", customerId); @@ -662,13 +683,13 @@ Response deductPromotionalCreditsRaw(String customerId, String jsonPayload) thro } public CustomerDeductPromotionalCreditsResponse deductPromotionalCredits( - String customerId, CustomerDeductPromotionalCreditsParams params) throws Exception { + String customerId, CustomerDeductPromotionalCreditsParams params) throws ChargebeeException { Response response = deductPromotionalCreditsRaw(customerId, params); return CustomerDeductPromotionalCreditsResponse.fromJson(response.getBodyAsString(), response); } /** clearPersonalData a customer (executes immediately) - returns raw Response. */ - Response clearPersonalDataRaw(String customerId) throws Exception { + Response clearPersonalDataRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/clear_personal_data", "customer-id", customerId); @@ -676,31 +697,32 @@ Response clearPersonalDataRaw(String customerId) throws Exception { return post(path, null); } - public CustomerClearPersonalDataResponse clearPersonalData(String customerId) throws Exception { + public CustomerClearPersonalDataResponse clearPersonalData(String customerId) + throws ChargebeeException { Response response = clearPersonalDataRaw(customerId); return CustomerClearPersonalDataResponse.fromJson(response.getBodyAsString(), response); } /** merge a customer using immutable params (executes immediately) - returns raw Response. */ - Response mergeRaw(CustomerMergeParams params) throws Exception { + Response mergeRaw(CustomerMergeParams params) throws ChargebeeException { return post("/customers/merge", params != null ? params.toFormData() : null); } /** merge a customer using raw JSON payload (executes immediately) - returns raw Response. */ - Response mergeRaw(String jsonPayload) throws Exception { + Response mergeRaw(String jsonPayload) throws ChargebeeException { return postJson("/customers/merge", jsonPayload); } - public CustomerMergeResponse merge(CustomerMergeParams params) throws Exception { + public CustomerMergeResponse merge(CustomerMergeParams params) throws ChargebeeException { Response response = mergeRaw(params); return CustomerMergeResponse.fromJson(response.getBodyAsString(), response); } /** collectPayment a customer (executes immediately) - returns raw Response. */ - Response collectPaymentRaw(String customerId) throws Exception { + Response collectPaymentRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/collect_payment", "customer-id", customerId); @@ -711,7 +733,7 @@ Response collectPaymentRaw(String customerId) throws Exception { * collectPayment a customer using immutable params (executes immediately) - returns raw Response. */ Response collectPaymentRaw(String customerId, CustomerCollectPaymentParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/collect_payment", "customer-id", customerId); return post(path, params.toFormData()); @@ -720,20 +742,20 @@ Response collectPaymentRaw(String customerId, CustomerCollectPaymentParams param /** * collectPayment a customer using raw JSON payload (executes immediately) - returns raw Response. */ - Response collectPaymentRaw(String customerId, String jsonPayload) throws Exception { + Response collectPaymentRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/collect_payment", "customer-id", customerId); return postJson(path, jsonPayload); } public CustomerCollectPaymentResponse collectPayment( - String customerId, CustomerCollectPaymentParams params) throws Exception { + String customerId, CustomerCollectPaymentParams params) throws ChargebeeException { Response response = collectPaymentRaw(customerId, params); return CustomerCollectPaymentResponse.fromJson(response.getBodyAsString(), response); } /** recordExcessPayment a customer (executes immediately) - returns raw Response. */ - Response recordExcessPaymentRaw(String customerId) throws Exception { + Response recordExcessPaymentRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/record_excess_payment", "customer-id", customerId); @@ -746,7 +768,7 @@ Response recordExcessPaymentRaw(String customerId) throws Exception { * Response. */ Response recordExcessPaymentRaw(String customerId, CustomerRecordExcessPaymentParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/record_excess_payment", "customer-id", customerId); @@ -757,7 +779,7 @@ Response recordExcessPaymentRaw(String customerId, CustomerRecordExcessPaymentPa * recordExcessPayment a customer using raw JSON payload (executes immediately) - returns raw * Response. */ - Response recordExcessPaymentRaw(String customerId, String jsonPayload) throws Exception { + Response recordExcessPaymentRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/record_excess_payment", "customer-id", customerId); @@ -765,13 +787,13 @@ Response recordExcessPaymentRaw(String customerId, String jsonPayload) throws Ex } public CustomerRecordExcessPaymentResponse recordExcessPayment( - String customerId, CustomerRecordExcessPaymentParams params) throws Exception { + String customerId, CustomerRecordExcessPaymentParams params) throws ChargebeeException { Response response = recordExcessPaymentRaw(customerId, params); return CustomerRecordExcessPaymentResponse.fromJson(response.getBodyAsString(), response); } /** setPromotionalCredits a customer (executes immediately) - returns raw Response. */ - Response setPromotionalCreditsRaw(String customerId) throws Exception { + Response setPromotionalCreditsRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/set_promotional_credits", "customer-id", customerId); @@ -784,7 +806,7 @@ Response setPromotionalCreditsRaw(String customerId) throws Exception { * Response. */ Response setPromotionalCreditsRaw(String customerId, CustomerSetPromotionalCreditsParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/set_promotional_credits", "customer-id", customerId); @@ -795,7 +817,8 @@ Response setPromotionalCreditsRaw(String customerId, CustomerSetPromotionalCredi * setPromotionalCredits a customer using raw JSON payload (executes immediately) - returns raw * Response. */ - Response setPromotionalCreditsRaw(String customerId, String jsonPayload) throws Exception { + Response setPromotionalCreditsRaw(String customerId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/set_promotional_credits", "customer-id", customerId); @@ -803,13 +826,13 @@ Response setPromotionalCreditsRaw(String customerId, String jsonPayload) throws } public CustomerSetPromotionalCreditsResponse setPromotionalCredits( - String customerId, CustomerSetPromotionalCreditsParams params) throws Exception { + String customerId, CustomerSetPromotionalCreditsParams params) throws ChargebeeException { Response response = setPromotionalCreditsRaw(customerId, params); return CustomerSetPromotionalCreditsResponse.fromJson(response.getBodyAsString(), response); } /** updateContact a customer (executes immediately) - returns raw Response. */ - Response updateContactRaw(String customerId) throws Exception { + Response updateContactRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/update_contact", "customer-id", customerId); @@ -820,7 +843,7 @@ Response updateContactRaw(String customerId) throws Exception { * updateContact a customer using immutable params (executes immediately) - returns raw Response. */ Response updateContactRaw(String customerId, CustomerUpdateContactParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/update_contact", "customer-id", customerId); return post(path, params.toFormData()); @@ -829,20 +852,20 @@ Response updateContactRaw(String customerId, CustomerUpdateContactParams params) /** * updateContact a customer using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateContactRaw(String customerId, String jsonPayload) throws Exception { + Response updateContactRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/update_contact", "customer-id", customerId); return postJson(path, jsonPayload); } public CustomerUpdateContactResponse updateContact( - String customerId, CustomerUpdateContactParams params) throws Exception { + String customerId, CustomerUpdateContactParams params) throws ChargebeeException { Response response = updateContactRaw(customerId, params); return CustomerUpdateContactResponse.fromJson(response.getBodyAsString(), response); } /** updateHierarchySettings a customer (executes immediately) - returns raw Response. */ - Response updateHierarchySettingsRaw(String customerId) throws Exception { + Response updateHierarchySettingsRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/update_hierarchy_settings", "customer-id", customerId); @@ -855,7 +878,7 @@ Response updateHierarchySettingsRaw(String customerId) throws Exception { * Response. */ Response updateHierarchySettingsRaw( - String customerId, CustomerUpdateHierarchySettingsParams params) throws Exception { + String customerId, CustomerUpdateHierarchySettingsParams params) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/update_hierarchy_settings", "customer-id", customerId); @@ -866,7 +889,8 @@ Response updateHierarchySettingsRaw( * updateHierarchySettings a customer using raw JSON payload (executes immediately) - returns raw * Response. */ - Response updateHierarchySettingsRaw(String customerId, String jsonPayload) throws Exception { + Response updateHierarchySettingsRaw(String customerId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/update_hierarchy_settings", "customer-id", customerId); @@ -874,13 +898,13 @@ Response updateHierarchySettingsRaw(String customerId, String jsonPayload) throw } public CustomerUpdateHierarchySettingsResponse updateHierarchySettings( - String customerId, CustomerUpdateHierarchySettingsParams params) throws Exception { + String customerId, CustomerUpdateHierarchySettingsParams params) throws ChargebeeException { Response response = updateHierarchySettingsRaw(customerId, params); return CustomerUpdateHierarchySettingsResponse.fromJson(response.getBodyAsString(), response); } /** updateBillingInfo a customer (executes immediately) - returns raw Response. */ - Response updateBillingInfoRaw(String customerId) throws Exception { + Response updateBillingInfoRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/update_billing_info", "customer-id", customerId); @@ -893,7 +917,7 @@ Response updateBillingInfoRaw(String customerId) throws Exception { * Response. */ Response updateBillingInfoRaw(String customerId, CustomerUpdateBillingInfoParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/update_billing_info", "customer-id", customerId); @@ -904,7 +928,7 @@ Response updateBillingInfoRaw(String customerId, CustomerUpdateBillingInfoParams * updateBillingInfo a customer using raw JSON payload (executes immediately) - returns raw * Response. */ - Response updateBillingInfoRaw(String customerId, String jsonPayload) throws Exception { + Response updateBillingInfoRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/update_billing_info", "customer-id", customerId); @@ -912,7 +936,7 @@ Response updateBillingInfoRaw(String customerId, String jsonPayload) throws Exce } public CustomerUpdateBillingInfoResponse updateBillingInfo( - String customerId, CustomerUpdateBillingInfoParams params) throws Exception { + String customerId, CustomerUpdateBillingInfoParams params) throws ChargebeeException { Response response = updateBillingInfoRaw(customerId, params); return CustomerUpdateBillingInfoResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/services/DifferentialPriceService.java b/src/main/java/com/chargebee/v4/services/DifferentialPriceService.java new file mode 100644 index 00000000..5d9884a8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/DifferentialPriceService.java @@ -0,0 +1,268 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.differentialPrice.params.DifferentialPriceDeleteParams; + +import com.chargebee.v4.models.differentialPrice.params.DifferentialPriceCreateParams; + +import com.chargebee.v4.models.differentialPrice.params.DifferentialPriceListParams; + +import com.chargebee.v4.models.differentialPrice.params.DifferentialPriceRetrieveParams; + +import com.chargebee.v4.models.differentialPrice.params.DifferentialPriceUpdateParams; + +import com.chargebee.v4.models.differentialPrice.responses.DifferentialPriceDeleteResponse; + +import com.chargebee.v4.models.differentialPrice.responses.DifferentialPriceCreateResponse; + +import com.chargebee.v4.models.differentialPrice.responses.DifferentialPriceListResponse; + +import com.chargebee.v4.models.differentialPrice.responses.DifferentialPriceRetrieveResponse; + +import com.chargebee.v4.models.differentialPrice.responses.DifferentialPriceUpdateResponse; + +public final class DifferentialPriceService extends BaseService { + + private final ServiceConfig config; + + public DifferentialPriceService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private DifferentialPriceService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private DifferentialPriceService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + DifferentialPriceService with(RequestOptions newOptions) { + return new DifferentialPriceService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public DifferentialPriceService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** delete a differentialPrice (executes immediately) - returns raw Response. */ + Response deleteRaw(String differentialPriceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/differential_prices/{differential-price-id}/delete", + "differential-price-id", + differentialPriceId); + + return post(path, null); + } + + /** + * delete a differentialPrice using immutable params (executes immediately) - returns raw + * Response. + */ + Response deleteRaw(String differentialPriceId, DifferentialPriceDeleteParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/differential_prices/{differential-price-id}/delete", + "differential-price-id", + differentialPriceId); + return post(path, params.toFormData()); + } + + /** + * delete a differentialPrice using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response deleteRaw(String differentialPriceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/differential_prices/{differential-price-id}/delete", + "differential-price-id", + differentialPriceId); + return postJson(path, jsonPayload); + } + + public DifferentialPriceDeleteResponse delete( + String differentialPriceId, DifferentialPriceDeleteParams params) throws ChargebeeException { + Response response = deleteRaw(differentialPriceId, params); + return DifferentialPriceDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** create a differentialPrice (executes immediately) - returns raw Response. */ + Response createRaw(String itemPriceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/item_prices/{item-price-id}/differential_prices", "item-price-id", itemPriceId); + + return post(path, null); + } + + /** + * create a differentialPrice using immutable params (executes immediately) - returns raw + * Response. + */ + Response createRaw(String itemPriceId, DifferentialPriceCreateParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/item_prices/{item-price-id}/differential_prices", "item-price-id", itemPriceId); + return post(path, params.toFormData()); + } + + /** + * create a differentialPrice using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response createRaw(String itemPriceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/item_prices/{item-price-id}/differential_prices", "item-price-id", itemPriceId); + return postJson(path, jsonPayload); + } + + public DifferentialPriceCreateResponse create( + String itemPriceId, DifferentialPriceCreateParams params) throws ChargebeeException { + Response response = createRaw(itemPriceId, params); + return DifferentialPriceCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * list a differentialPrice using immutable params (executes immediately) - returns raw Response. + */ + Response listRaw(DifferentialPriceListParams params) throws ChargebeeException { + + return get("/differential_prices", params != null ? params.toQueryParams() : null); + } + + /** list a differentialPrice without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/differential_prices", null); + } + + /** + * list a differentialPrice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public DifferentialPriceListResponse list(DifferentialPriceListParams params) + throws ChargebeeException { + Response response = listRaw(params); + + return DifferentialPriceListResponse.fromJson( + response.getBodyAsString(), this, params, response); + } + + public DifferentialPriceListResponse list() throws ChargebeeException { + Response response = listRaw(); + return DifferentialPriceListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** retrieve a differentialPrice (executes immediately) - returns raw Response. */ + Response retrieveRaw(String differentialPriceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/differential_prices/{differential-price-id}", + "differential-price-id", + differentialPriceId); + + return get(path, null); + } + + /** + * retrieve a differentialPrice using immutable params (executes immediately) - returns raw + * Response. + */ + Response retrieveRaw(String differentialPriceId, DifferentialPriceRetrieveParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/differential_prices/{differential-price-id}", + "differential-price-id", + differentialPriceId); + return get(path, params != null ? params.toQueryParams() : null); + } + + public DifferentialPriceRetrieveResponse retrieve( + String differentialPriceId, DifferentialPriceRetrieveParams params) + throws ChargebeeException { + Response response = retrieveRaw(differentialPriceId, params); + return DifferentialPriceRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + public DifferentialPriceRetrieveResponse retrieve(String differentialPriceId) + throws ChargebeeException { + Response response = retrieveRaw(differentialPriceId); + return DifferentialPriceRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** update a differentialPrice (executes immediately) - returns raw Response. */ + Response updateRaw(String differentialPriceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/differential_prices/{differential-price-id}", + "differential-price-id", + differentialPriceId); + + return post(path, null); + } + + /** + * update a differentialPrice using immutable params (executes immediately) - returns raw + * Response. + */ + Response updateRaw(String differentialPriceId, DifferentialPriceUpdateParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/differential_prices/{differential-price-id}", + "differential-price-id", + differentialPriceId); + return post(path, params.toFormData()); + } + + /** + * update a differentialPrice using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response updateRaw(String differentialPriceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/differential_prices/{differential-price-id}", + "differential-price-id", + differentialPriceId); + return postJson(path, jsonPayload); + } + + public DifferentialPriceUpdateResponse update( + String differentialPriceId, DifferentialPriceUpdateParams params) throws ChargebeeException { + Response response = updateRaw(differentialPriceId, params); + return DifferentialPriceUpdateResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/services/EntitlementOverrideService.java b/src/main/java/com/chargebee/v4/services/EntitlementOverrideService.java new file mode 100644 index 00000000..96428647 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/EntitlementOverrideService.java @@ -0,0 +1,167 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.entitlementOverride.params.ListEntitlementOverrideForSubscriptionParams; + +import com.chargebee.v4.models.entitlementOverride.params.AddEntitlementOverrideForSubscriptionParams; + +import com.chargebee.v4.models.entitlementOverride.responses.ListEntitlementOverrideForSubscriptionResponse; + +import com.chargebee.v4.models.entitlementOverride.responses.AddEntitlementOverrideForSubscriptionResponse; + +public final class EntitlementOverrideService extends BaseService { + + private final ServiceConfig config; + + public EntitlementOverrideService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private EntitlementOverrideService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private EntitlementOverrideService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + EntitlementOverrideService with(RequestOptions newOptions) { + return new EntitlementOverrideService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public EntitlementOverrideService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * listEntitlementOverrideForSubscription a entitlementOverride using immutable params (executes + * immediately) - returns raw Response. + */ + Response listEntitlementOverrideForSubscriptionRaw( + String subscriptionId, ListEntitlementOverrideForSubscriptionParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/entitlement_overrides", + "subscription-id", + subscriptionId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * listEntitlementOverrideForSubscription a entitlementOverride without params (executes + * immediately) - returns raw Response. + */ + Response listEntitlementOverrideForSubscriptionRaw(String subscriptionId) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/entitlement_overrides", + "subscription-id", + subscriptionId); + return get(path, null); + } + + /** + * listEntitlementOverrideForSubscription a entitlementOverride using raw JSON payload (executes + * immediately) - returns raw Response. + */ + Response listEntitlementOverrideForSubscriptionRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/entitlement_overrides", + "subscription-id", + subscriptionId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ListEntitlementOverrideForSubscriptionResponse listEntitlementOverrideForSubscription( + String subscriptionId, ListEntitlementOverrideForSubscriptionParams params) + throws ChargebeeException { + Response response = listEntitlementOverrideForSubscriptionRaw(subscriptionId, params); + return ListEntitlementOverrideForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, params, subscriptionId, response); + } + + public ListEntitlementOverrideForSubscriptionResponse listEntitlementOverrideForSubscription( + String subscriptionId) throws ChargebeeException { + Response response = listEntitlementOverrideForSubscriptionRaw(subscriptionId); + return ListEntitlementOverrideForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, null, subscriptionId, response); + } + + /** + * addEntitlementOverrideForSubscription a entitlementOverride (executes immediately) - returns + * raw Response. + */ + Response addEntitlementOverrideForSubscriptionRaw(String subscriptionId) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/entitlement_overrides", + "subscription-id", + subscriptionId); + + return post(path, null); + } + + /** + * addEntitlementOverrideForSubscription a entitlementOverride using immutable params (executes + * immediately) - returns raw Response. + */ + Response addEntitlementOverrideForSubscriptionRaw( + String subscriptionId, AddEntitlementOverrideForSubscriptionParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/entitlement_overrides", + "subscription-id", + subscriptionId); + return post(path, params.toFormData()); + } + + /** + * addEntitlementOverrideForSubscription a entitlementOverride using raw JSON payload (executes + * immediately) - returns raw Response. + */ + Response addEntitlementOverrideForSubscriptionRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/entitlement_overrides", + "subscription-id", + subscriptionId); + return postJson(path, jsonPayload); + } + + public AddEntitlementOverrideForSubscriptionResponse addEntitlementOverrideForSubscription( + String subscriptionId, AddEntitlementOverrideForSubscriptionParams params) + throws ChargebeeException { + Response response = addEntitlementOverrideForSubscriptionRaw(subscriptionId, params); + return AddEntitlementOverrideForSubscriptionResponse.fromJson( + response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/EntitlementService.java b/src/main/java/com/chargebee/v4/services/EntitlementService.java similarity index 75% rename from src/main/java/com/chargebee/v4/core/services/EntitlementService.java rename to src/main/java/com/chargebee/v4/services/EntitlementService.java index da1dc62c..d1dac0b8 100644 --- a/src/main/java/com/chargebee/v4/core/services/EntitlementService.java +++ b/src/main/java/com/chargebee/v4/services/EntitlementService.java @@ -5,19 +5,20 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.entitlement.params.EntitlementListParams; +import com.chargebee.v4.models.entitlement.params.EntitlementListParams; -import com.chargebee.v4.core.models.entitlement.params.EntitlementCreateParams; +import com.chargebee.v4.models.entitlement.params.EntitlementCreateParams; -import com.chargebee.v4.core.responses.entitlement.EntitlementListResponse; +import com.chargebee.v4.models.entitlement.responses.EntitlementListResponse; -import com.chargebee.v4.core.responses.entitlement.EntitlementCreateResponse; +import com.chargebee.v4.models.entitlement.responses.EntitlementCreateResponse; public final class EntitlementService extends BaseService { @@ -54,47 +55,48 @@ public EntitlementService withOptions(RequestOptions options) { // === Operations === /** list a entitlement using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(EntitlementListParams params) throws Exception { + Response listRaw(EntitlementListParams params) throws ChargebeeException { return get("/entitlements", params != null ? params.toQueryParams() : null); } /** list a entitlement without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/entitlements", null); } /** list a entitlement using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public EntitlementListResponse list(EntitlementListParams params) throws Exception { + public EntitlementListResponse list(EntitlementListParams params) throws ChargebeeException { Response response = listRaw(params); return EntitlementListResponse.fromJson(response.getBodyAsString(), this, params, response); } - public EntitlementListResponse list() throws Exception { + public EntitlementListResponse list() throws ChargebeeException { Response response = listRaw(); return EntitlementListResponse.fromJson(response.getBodyAsString(), this, null, response); } /** create a entitlement using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(EntitlementCreateParams params) throws Exception { + Response createRaw(EntitlementCreateParams params) throws ChargebeeException { return post("/entitlements", params != null ? params.toFormData() : null); } /** create a entitlement using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/entitlements", jsonPayload); } - public EntitlementCreateResponse create(EntitlementCreateParams params) throws Exception { + public EntitlementCreateResponse create(EntitlementCreateParams params) + throws ChargebeeException { Response response = createRaw(params); return EntitlementCreateResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/services/EstimateService.java b/src/main/java/com/chargebee/v4/services/EstimateService.java new file mode 100644 index 00000000..3ec4de4a --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/EstimateService.java @@ -0,0 +1,813 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.estimate.params.RenewalEstimateParams; + +import com.chargebee.v4.models.estimate.params.CreateSubscriptionItemEstimateParams; + +import com.chargebee.v4.models.estimate.params.EstimatePaymentSchedulesParams; + +import com.chargebee.v4.models.estimate.params.EstimateCancelSubscriptionForItemsParams; + +import com.chargebee.v4.models.estimate.params.EstimateResumeSubscriptionParams; + +import com.chargebee.v4.models.estimate.params.EstimateCreateInvoiceForItemsParams; + +import com.chargebee.v4.models.estimate.params.EstimateGiftSubscriptionForItemsParams; + +import com.chargebee.v4.models.estimate.params.EstimateUpdateSubscriptionForItemsParams; + +import com.chargebee.v4.models.estimate.params.RegenerateInvoiceEstimateParams; + +import com.chargebee.v4.models.estimate.params.CreateSubscriptionItemForCustomerEstimateParams; + +import com.chargebee.v4.models.estimate.params.EstimateChangeTermEndParams; + +import com.chargebee.v4.models.estimate.params.EstimatePauseSubscriptionParams; + +import com.chargebee.v4.models.estimate.params.AdvanceInvoiceEstimateParams; + +import com.chargebee.v4.models.estimate.params.EstimateUpdateSubscriptionParams; + +import com.chargebee.v4.models.estimate.params.EstimateGiftSubscriptionParams; + +import com.chargebee.v4.models.estimate.params.CreateSubscriptionForCustomerEstimateParams; + +import com.chargebee.v4.models.estimate.params.EstimateCreateSubscriptionParams; + +import com.chargebee.v4.models.estimate.params.EstimateCreateInvoiceParams; + +import com.chargebee.v4.models.estimate.params.EstimateCancelSubscriptionParams; + +import com.chargebee.v4.models.estimate.responses.RenewalEstimateResponse; + +import com.chargebee.v4.models.estimate.responses.CreateSubscriptionItemEstimateResponse; + +import com.chargebee.v4.models.estimate.responses.EstimatePaymentSchedulesResponse; + +import com.chargebee.v4.models.estimate.responses.EstimateCancelSubscriptionForItemsResponse; + +import com.chargebee.v4.models.estimate.responses.EstimateResumeSubscriptionResponse; + +import com.chargebee.v4.models.estimate.responses.EstimateCreateInvoiceForItemsResponse; + +import com.chargebee.v4.models.estimate.responses.EstimateGiftSubscriptionForItemsResponse; + +import com.chargebee.v4.models.estimate.responses.EstimateUpdateSubscriptionForItemsResponse; + +import com.chargebee.v4.models.estimate.responses.UpcomingInvoicesEstimateResponse; + +import com.chargebee.v4.models.estimate.responses.RegenerateInvoiceEstimateResponse; + +import com.chargebee.v4.models.estimate.responses.CreateSubscriptionItemForCustomerEstimateResponse; + +import com.chargebee.v4.models.estimate.responses.EstimateChangeTermEndResponse; + +import com.chargebee.v4.models.estimate.responses.EstimatePauseSubscriptionResponse; + +import com.chargebee.v4.models.estimate.responses.AdvanceInvoiceEstimateResponse; + +import com.chargebee.v4.models.estimate.responses.EstimateUpdateSubscriptionResponse; + +import com.chargebee.v4.models.estimate.responses.EstimateGiftSubscriptionResponse; + +import com.chargebee.v4.models.estimate.responses.CreateSubscriptionForCustomerEstimateResponse; + +import com.chargebee.v4.models.estimate.responses.EstimateCreateSubscriptionResponse; + +import com.chargebee.v4.models.estimate.responses.EstimateCreateInvoiceResponse; + +import com.chargebee.v4.models.estimate.responses.EstimateCancelSubscriptionResponse; + +public final class EstimateService extends BaseService { + + private final ServiceConfig config; + + public EstimateService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private EstimateService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private EstimateService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + EstimateService with(RequestOptions newOptions) { + return new EstimateService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public EstimateService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** renewalEstimate a estimate (executes immediately) - returns raw Response. */ + Response renewalEstimateRaw(String subscriptionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/renewal_estimate", "subscription-id", subscriptionId); + + return get(path, null); + } + + /** + * renewalEstimate a estimate using immutable params (executes immediately) - returns raw + * Response. + */ + Response renewalEstimateRaw(String subscriptionId, RenewalEstimateParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/renewal_estimate", "subscription-id", subscriptionId); + return get(path, params != null ? params.toQueryParams() : null); + } + + public RenewalEstimateResponse renewalEstimate( + String subscriptionId, RenewalEstimateParams params) throws ChargebeeException { + Response response = renewalEstimateRaw(subscriptionId, params); + return RenewalEstimateResponse.fromJson(response.getBodyAsString(), response); + } + + public RenewalEstimateResponse renewalEstimate(String subscriptionId) throws ChargebeeException { + Response response = renewalEstimateRaw(subscriptionId); + return RenewalEstimateResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createSubscriptionItemEstimate a estimate using immutable params (executes immediately) - + * returns raw Response. + */ + Response createSubscriptionItemEstimateRaw(CreateSubscriptionItemEstimateParams params) + throws ChargebeeException { + + return post( + "/estimates/create_subscription_for_items", params != null ? params.toFormData() : null); + } + + /** + * createSubscriptionItemEstimate a estimate using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response createSubscriptionItemEstimateRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/estimates/create_subscription_for_items", jsonPayload); + } + + public CreateSubscriptionItemEstimateResponse createSubscriptionItemEstimate( + CreateSubscriptionItemEstimateParams params) throws ChargebeeException { + Response response = createSubscriptionItemEstimateRaw(params); + + return CreateSubscriptionItemEstimateResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * paymentSchedules a estimate using immutable params (executes immediately) - returns raw + * Response. + */ + Response paymentSchedulesRaw(EstimatePaymentSchedulesParams params) throws ChargebeeException { + + return post("/estimates/payment_schedules", params != null ? params.toFormData() : null); + } + + /** + * paymentSchedules a estimate using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response paymentSchedulesRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/estimates/payment_schedules", jsonPayload); + } + + public EstimatePaymentSchedulesResponse paymentSchedules(EstimatePaymentSchedulesParams params) + throws ChargebeeException { + Response response = paymentSchedulesRaw(params); + + return EstimatePaymentSchedulesResponse.fromJson(response.getBodyAsString(), response); + } + + /** cancelSubscriptionForItems a estimate (executes immediately) - returns raw Response. */ + Response cancelSubscriptionForItemsRaw(String subscriptionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/cancel_subscription_for_items_estimate", + "subscription-id", + subscriptionId); + + return post(path, null); + } + + /** + * cancelSubscriptionForItems a estimate using immutable params (executes immediately) - returns + * raw Response. + */ + Response cancelSubscriptionForItemsRaw( + String subscriptionId, EstimateCancelSubscriptionForItemsParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/cancel_subscription_for_items_estimate", + "subscription-id", + subscriptionId); + return post(path, params.toFormData()); + } + + /** + * cancelSubscriptionForItems a estimate using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response cancelSubscriptionForItemsRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/cancel_subscription_for_items_estimate", + "subscription-id", + subscriptionId); + return postJson(path, jsonPayload); + } + + public EstimateCancelSubscriptionForItemsResponse cancelSubscriptionForItems( + String subscriptionId, EstimateCancelSubscriptionForItemsParams params) + throws ChargebeeException { + Response response = cancelSubscriptionForItemsRaw(subscriptionId, params); + return EstimateCancelSubscriptionForItemsResponse.fromJson( + response.getBodyAsString(), response); + } + + /** resumeSubscription a estimate (executes immediately) - returns raw Response. */ + Response resumeSubscriptionRaw(String subscriptionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/resume_subscription_estimate", + "subscription-id", + subscriptionId); + + return post(path, null); + } + + /** + * resumeSubscription a estimate using immutable params (executes immediately) - returns raw + * Response. + */ + Response resumeSubscriptionRaw(String subscriptionId, EstimateResumeSubscriptionParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/resume_subscription_estimate", + "subscription-id", + subscriptionId); + return post(path, params.toFormData()); + } + + /** + * resumeSubscription a estimate using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response resumeSubscriptionRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/resume_subscription_estimate", + "subscription-id", + subscriptionId); + return postJson(path, jsonPayload); + } + + public EstimateResumeSubscriptionResponse resumeSubscription( + String subscriptionId, EstimateResumeSubscriptionParams params) throws ChargebeeException { + Response response = resumeSubscriptionRaw(subscriptionId, params); + return EstimateResumeSubscriptionResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createInvoiceForItems a estimate using immutable params (executes immediately) - returns raw + * Response. + */ + Response createInvoiceForItemsRaw(EstimateCreateInvoiceForItemsParams params) + throws ChargebeeException { + + return post("/estimates/create_invoice_for_items", params != null ? params.toFormData() : null); + } + + /** + * createInvoiceForItems a estimate using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response createInvoiceForItemsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/estimates/create_invoice_for_items", jsonPayload); + } + + public EstimateCreateInvoiceForItemsResponse createInvoiceForItems( + EstimateCreateInvoiceForItemsParams params) throws ChargebeeException { + Response response = createInvoiceForItemsRaw(params); + + return EstimateCreateInvoiceForItemsResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * giftSubscriptionForItems a estimate using immutable params (executes immediately) - returns raw + * Response. + */ + Response giftSubscriptionForItemsRaw(EstimateGiftSubscriptionForItemsParams params) + throws ChargebeeException { + + return post( + "/estimates/gift_subscription_for_items", params != null ? params.toFormData() : null); + } + + /** + * giftSubscriptionForItems a estimate using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response giftSubscriptionForItemsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/estimates/gift_subscription_for_items", jsonPayload); + } + + public EstimateGiftSubscriptionForItemsResponse giftSubscriptionForItems( + EstimateGiftSubscriptionForItemsParams params) throws ChargebeeException { + Response response = giftSubscriptionForItemsRaw(params); + + return EstimateGiftSubscriptionForItemsResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * updateSubscriptionForItems a estimate using immutable params (executes immediately) - returns + * raw Response. + */ + Response updateSubscriptionForItemsRaw(EstimateUpdateSubscriptionForItemsParams params) + throws ChargebeeException { + + return post( + "/estimates/update_subscription_for_items", params != null ? params.toFormData() : null); + } + + /** + * updateSubscriptionForItems a estimate using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response updateSubscriptionForItemsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/estimates/update_subscription_for_items", jsonPayload); + } + + public EstimateUpdateSubscriptionForItemsResponse updateSubscriptionForItems( + EstimateUpdateSubscriptionForItemsParams params) throws ChargebeeException { + Response response = updateSubscriptionForItemsRaw(params); + + return EstimateUpdateSubscriptionForItemsResponse.fromJson( + response.getBodyAsString(), response); + } + + /** upcomingInvoicesEstimate a estimate (executes immediately) - returns raw Response. */ + Response upcomingInvoicesEstimateRaw(String customerId) throws ChargebeeException { + String path = + buildPathWithParams( + "/customers/{customer-id}/upcoming_invoices_estimate", "customer-id", customerId); + + return get(path, null); + } + + public UpcomingInvoicesEstimateResponse upcomingInvoicesEstimate(String customerId) + throws ChargebeeException { + Response response = upcomingInvoicesEstimateRaw(customerId); + return UpcomingInvoicesEstimateResponse.fromJson(response.getBodyAsString(), response); + } + + /** regenerateInvoiceEstimate a estimate (executes immediately) - returns raw Response. */ + Response regenerateInvoiceEstimateRaw(String subscriptionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/regenerate_invoice_estimate", + "subscription-id", + subscriptionId); + + return post(path, null); + } + + /** + * regenerateInvoiceEstimate a estimate using immutable params (executes immediately) - returns + * raw Response. + */ + Response regenerateInvoiceEstimateRaw( + String subscriptionId, RegenerateInvoiceEstimateParams params) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/regenerate_invoice_estimate", + "subscription-id", + subscriptionId); + return post(path, params.toFormData()); + } + + /** + * regenerateInvoiceEstimate a estimate using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response regenerateInvoiceEstimateRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/regenerate_invoice_estimate", + "subscription-id", + subscriptionId); + return postJson(path, jsonPayload); + } + + public RegenerateInvoiceEstimateResponse regenerateInvoiceEstimate( + String subscriptionId, RegenerateInvoiceEstimateParams params) throws ChargebeeException { + Response response = regenerateInvoiceEstimateRaw(subscriptionId, params); + return RegenerateInvoiceEstimateResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createSubscriptionItemForCustomerEstimate a estimate (executes immediately) - returns raw + * Response. + */ + Response createSubscriptionItemForCustomerEstimateRaw(String customerId) + throws ChargebeeException { + String path = + buildPathWithParams( + "/customers/{customer-id}/create_subscription_for_items_estimate", + "customer-id", + customerId); + + return post(path, null); + } + + /** + * createSubscriptionItemForCustomerEstimate a estimate using immutable params (executes + * immediately) - returns raw Response. + */ + Response createSubscriptionItemForCustomerEstimateRaw( + String customerId, CreateSubscriptionItemForCustomerEstimateParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/customers/{customer-id}/create_subscription_for_items_estimate", + "customer-id", + customerId); + return post(path, params.toFormData()); + } + + /** + * createSubscriptionItemForCustomerEstimate a estimate using raw JSON payload (executes + * immediately) - returns raw Response. + */ + Response createSubscriptionItemForCustomerEstimateRaw(String customerId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/customers/{customer-id}/create_subscription_for_items_estimate", + "customer-id", + customerId); + return postJson(path, jsonPayload); + } + + public CreateSubscriptionItemForCustomerEstimateResponse + createSubscriptionItemForCustomerEstimate( + String customerId, CreateSubscriptionItemForCustomerEstimateParams params) + throws ChargebeeException { + Response response = createSubscriptionItemForCustomerEstimateRaw(customerId, params); + return CreateSubscriptionItemForCustomerEstimateResponse.fromJson( + response.getBodyAsString(), response); + } + + /** changeTermEnd a estimate (executes immediately) - returns raw Response. */ + Response changeTermEndRaw(String subscriptionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/change_term_end_estimate", + "subscription-id", + subscriptionId); + + return post(path, null); + } + + /** + * changeTermEnd a estimate using immutable params (executes immediately) - returns raw Response. + */ + Response changeTermEndRaw(String subscriptionId, EstimateChangeTermEndParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/change_term_end_estimate", + "subscription-id", + subscriptionId); + return post(path, params.toFormData()); + } + + /** + * changeTermEnd a estimate using raw JSON payload (executes immediately) - returns raw Response. + */ + Response changeTermEndRaw(String subscriptionId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/change_term_end_estimate", + "subscription-id", + subscriptionId); + return postJson(path, jsonPayload); + } + + public EstimateChangeTermEndResponse changeTermEnd( + String subscriptionId, EstimateChangeTermEndParams params) throws ChargebeeException { + Response response = changeTermEndRaw(subscriptionId, params); + return EstimateChangeTermEndResponse.fromJson(response.getBodyAsString(), response); + } + + /** pauseSubscription a estimate (executes immediately) - returns raw Response. */ + Response pauseSubscriptionRaw(String subscriptionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/pause_subscription_estimate", + "subscription-id", + subscriptionId); + + return post(path, null); + } + + /** + * pauseSubscription a estimate using immutable params (executes immediately) - returns raw + * Response. + */ + Response pauseSubscriptionRaw(String subscriptionId, EstimatePauseSubscriptionParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/pause_subscription_estimate", + "subscription-id", + subscriptionId); + return post(path, params.toFormData()); + } + + /** + * pauseSubscription a estimate using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response pauseSubscriptionRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/pause_subscription_estimate", + "subscription-id", + subscriptionId); + return postJson(path, jsonPayload); + } + + public EstimatePauseSubscriptionResponse pauseSubscription( + String subscriptionId, EstimatePauseSubscriptionParams params) throws ChargebeeException { + Response response = pauseSubscriptionRaw(subscriptionId, params); + return EstimatePauseSubscriptionResponse.fromJson(response.getBodyAsString(), response); + } + + /** advanceInvoiceEstimate a estimate (executes immediately) - returns raw Response. */ + Response advanceInvoiceEstimateRaw(String subscriptionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/advance_invoice_estimate", + "subscription-id", + subscriptionId); + + return post(path, null); + } + + /** + * advanceInvoiceEstimate a estimate using immutable params (executes immediately) - returns raw + * Response. + */ + Response advanceInvoiceEstimateRaw(String subscriptionId, AdvanceInvoiceEstimateParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/advance_invoice_estimate", + "subscription-id", + subscriptionId); + return post(path, params.toFormData()); + } + + /** + * advanceInvoiceEstimate a estimate using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response advanceInvoiceEstimateRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/advance_invoice_estimate", + "subscription-id", + subscriptionId); + return postJson(path, jsonPayload); + } + + public AdvanceInvoiceEstimateResponse advanceInvoiceEstimate( + String subscriptionId, AdvanceInvoiceEstimateParams params) throws ChargebeeException { + Response response = advanceInvoiceEstimateRaw(subscriptionId, params); + return AdvanceInvoiceEstimateResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * updateSubscription a estimate using immutable params (executes immediately) - returns raw + * Response. + */ + Response updateSubscriptionRaw(EstimateUpdateSubscriptionParams params) + throws ChargebeeException { + + return post("/estimates/update_subscription", params != null ? params.toFormData() : null); + } + + /** + * updateSubscription a estimate using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response updateSubscriptionRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/estimates/update_subscription", jsonPayload); + } + + public EstimateUpdateSubscriptionResponse updateSubscription( + EstimateUpdateSubscriptionParams params) throws ChargebeeException { + Response response = updateSubscriptionRaw(params); + + return EstimateUpdateSubscriptionResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * giftSubscription a estimate using immutable params (executes immediately) - returns raw + * Response. + */ + Response giftSubscriptionRaw(EstimateGiftSubscriptionParams params) throws ChargebeeException { + + return post("/estimates/gift_subscription", params != null ? params.toFormData() : null); + } + + /** + * giftSubscription a estimate using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response giftSubscriptionRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/estimates/gift_subscription", jsonPayload); + } + + public EstimateGiftSubscriptionResponse giftSubscription(EstimateGiftSubscriptionParams params) + throws ChargebeeException { + Response response = giftSubscriptionRaw(params); + + return EstimateGiftSubscriptionResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createSubscriptionForCustomerEstimate a estimate (executes immediately) - returns raw Response. + */ + Response createSubscriptionForCustomerEstimateRaw(String customerId) throws ChargebeeException { + String path = + buildPathWithParams( + "/customers/{customer-id}/create_subscription_estimate", "customer-id", customerId); + + return get(path, null); + } + + /** + * createSubscriptionForCustomerEstimate a estimate using immutable params (executes immediately) + * - returns raw Response. + */ + Response createSubscriptionForCustomerEstimateRaw( + String customerId, CreateSubscriptionForCustomerEstimateParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/customers/{customer-id}/create_subscription_estimate", "customer-id", customerId); + return get(path, params != null ? params.toQueryParams() : null); + } + + public CreateSubscriptionForCustomerEstimateResponse createSubscriptionForCustomerEstimate( + String customerId, CreateSubscriptionForCustomerEstimateParams params) + throws ChargebeeException { + Response response = createSubscriptionForCustomerEstimateRaw(customerId, params); + return CreateSubscriptionForCustomerEstimateResponse.fromJson( + response.getBodyAsString(), response); + } + + public CreateSubscriptionForCustomerEstimateResponse createSubscriptionForCustomerEstimate( + String customerId) throws ChargebeeException { + Response response = createSubscriptionForCustomerEstimateRaw(customerId); + return CreateSubscriptionForCustomerEstimateResponse.fromJson( + response.getBodyAsString(), response); + } + + /** + * createSubscription a estimate using immutable params (executes immediately) - returns raw + * Response. + */ + Response createSubscriptionRaw(EstimateCreateSubscriptionParams params) + throws ChargebeeException { + + return post("/estimates/create_subscription", params != null ? params.toFormData() : null); + } + + /** + * createSubscription a estimate using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response createSubscriptionRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/estimates/create_subscription", jsonPayload); + } + + public EstimateCreateSubscriptionResponse createSubscription( + EstimateCreateSubscriptionParams params) throws ChargebeeException { + Response response = createSubscriptionRaw(params); + + return EstimateCreateSubscriptionResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createInvoice a estimate using immutable params (executes immediately) - returns raw Response. + */ + Response createInvoiceRaw(EstimateCreateInvoiceParams params) throws ChargebeeException { + + return post("/estimates/create_invoice", params != null ? params.toFormData() : null); + } + + /** + * createInvoice a estimate using raw JSON payload (executes immediately) - returns raw Response. + */ + Response createInvoiceRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/estimates/create_invoice", jsonPayload); + } + + public EstimateCreateInvoiceResponse createInvoice(EstimateCreateInvoiceParams params) + throws ChargebeeException { + Response response = createInvoiceRaw(params); + + return EstimateCreateInvoiceResponse.fromJson(response.getBodyAsString(), response); + } + + /** cancelSubscription a estimate (executes immediately) - returns raw Response. */ + Response cancelSubscriptionRaw(String subscriptionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/cancel_subscription_estimate", + "subscription-id", + subscriptionId); + + return post(path, null); + } + + /** + * cancelSubscription a estimate using immutable params (executes immediately) - returns raw + * Response. + */ + Response cancelSubscriptionRaw(String subscriptionId, EstimateCancelSubscriptionParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/cancel_subscription_estimate", + "subscription-id", + subscriptionId); + return post(path, params.toFormData()); + } + + /** + * cancelSubscription a estimate using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response cancelSubscriptionRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/cancel_subscription_estimate", + "subscription-id", + subscriptionId); + return postJson(path, jsonPayload); + } + + public EstimateCancelSubscriptionResponse cancelSubscription( + String subscriptionId, EstimateCancelSubscriptionParams params) throws ChargebeeException { + Response response = cancelSubscriptionRaw(subscriptionId, params); + return EstimateCancelSubscriptionResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/EventService.java b/src/main/java/com/chargebee/v4/services/EventService.java similarity index 75% rename from src/main/java/com/chargebee/v4/core/services/EventService.java rename to src/main/java/com/chargebee/v4/services/EventService.java index c3739100..e8617dcc 100644 --- a/src/main/java/com/chargebee/v4/core/services/EventService.java +++ b/src/main/java/com/chargebee/v4/services/EventService.java @@ -5,17 +5,18 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.event.params.EventListParams; +import com.chargebee.v4.models.event.params.EventListParams; -import com.chargebee.v4.core.responses.event.EventListResponse; +import com.chargebee.v4.models.event.responses.EventListResponse; -import com.chargebee.v4.core.responses.event.EventRetrieveResponse; +import com.chargebee.v4.models.event.responses.EventRetrieveResponse; public final class EventService extends BaseService { @@ -52,42 +53,42 @@ public EventService withOptions(RequestOptions options) { // === Operations === /** list a event using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(EventListParams params) throws Exception { + Response listRaw(EventListParams params) throws ChargebeeException { return get("/events", params != null ? params.toQueryParams() : null); } /** list a event without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/events", null); } /** list a event using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public EventListResponse list(EventListParams params) throws Exception { + public EventListResponse list(EventListParams params) throws ChargebeeException { Response response = listRaw(params); return EventListResponse.fromJson(response.getBodyAsString(), this, params, response); } - public EventListResponse list() throws Exception { + public EventListResponse list() throws ChargebeeException { Response response = listRaw(); return EventListResponse.fromJson(response.getBodyAsString(), this, null, response); } /** retrieve a event (executes immediately) - returns raw Response. */ - Response retrieveRaw(String eventId) throws Exception { + Response retrieveRaw(String eventId) throws ChargebeeException { String path = buildPathWithParams("/events/{event-id}", "event-id", eventId); return get(path, null); } - public EventRetrieveResponse retrieve(String eventId) throws Exception { + public EventRetrieveResponse retrieve(String eventId) throws ChargebeeException { Response response = retrieveRaw(eventId); return EventRetrieveResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/services/ExportService.java b/src/main/java/com/chargebee/v4/services/ExportService.java new file mode 100644 index 00000000..0d981839 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/ExportService.java @@ -0,0 +1,474 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.export.params.ExportCustomersParams; + +import com.chargebee.v4.models.export.params.ExportAttachedItemsParams; + +import com.chargebee.v4.models.export.params.ExportTransactionsParams; + +import com.chargebee.v4.models.export.params.ExportDifferentialPricesParams; + +import com.chargebee.v4.models.export.params.ExportItemFamiliesParams; + +import com.chargebee.v4.models.export.params.ExportInvoicesParams; + +import com.chargebee.v4.models.export.params.ExportPriceVariantsParams; + +import com.chargebee.v4.models.export.params.ExportItemsParams; + +import com.chargebee.v4.models.export.params.ExportDeferredRevenueParams; + +import com.chargebee.v4.models.export.params.ExportRevenueRecognitionParams; + +import com.chargebee.v4.models.export.params.ExportCreditNotesParams; + +import com.chargebee.v4.models.export.params.ExportCouponsParams; + +import com.chargebee.v4.models.export.params.ExportOrdersParams; + +import com.chargebee.v4.models.export.params.ExportItemPricesParams; + +import com.chargebee.v4.models.export.params.ExportSubscriptionsParams; + +import com.chargebee.v4.models.export.params.ExportAddonsParams; + +import com.chargebee.v4.models.export.params.ExportPlansParams; + +import com.chargebee.v4.models.export.responses.ExportCustomersResponse; + +import com.chargebee.v4.models.export.responses.ExportAttachedItemsResponse; + +import com.chargebee.v4.models.export.responses.ExportTransactionsResponse; + +import com.chargebee.v4.models.export.responses.ExportDifferentialPricesResponse; + +import com.chargebee.v4.models.export.responses.ExportItemFamiliesResponse; + +import com.chargebee.v4.models.export.responses.ExportInvoicesResponse; + +import com.chargebee.v4.models.export.responses.ExportRetrieveResponse; + +import com.chargebee.v4.models.export.responses.ExportPriceVariantsResponse; + +import com.chargebee.v4.models.export.responses.ExportItemsResponse; + +import com.chargebee.v4.models.export.responses.ExportDeferredRevenueResponse; + +import com.chargebee.v4.models.export.responses.ExportRevenueRecognitionResponse; + +import com.chargebee.v4.models.export.responses.ExportCreditNotesResponse; + +import com.chargebee.v4.models.export.responses.ExportCouponsResponse; + +import com.chargebee.v4.models.export.responses.ExportOrdersResponse; + +import com.chargebee.v4.models.export.responses.ExportItemPricesResponse; + +import com.chargebee.v4.models.export.responses.ExportSubscriptionsResponse; + +import com.chargebee.v4.models.export.responses.ExportAddonsResponse; + +import com.chargebee.v4.models.export.responses.ExportPlansResponse; + +public final class ExportService extends BaseService { + + private final ServiceConfig config; + + public ExportService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private ExportService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private ExportService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + ExportService with(RequestOptions newOptions) { + return new ExportService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public ExportService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** customers a export using immutable params (executes immediately) - returns raw Response. */ + Response customersRaw(ExportCustomersParams params) throws ChargebeeException { + + return post("/exports/customers", params != null ? params.toFormData() : null); + } + + /** customers a export using raw JSON payload (executes immediately) - returns raw Response. */ + Response customersRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/customers", jsonPayload); + } + + public ExportCustomersResponse customers(ExportCustomersParams params) throws ChargebeeException { + Response response = customersRaw(params); + + return ExportCustomersResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * attachedItems a export using immutable params (executes immediately) - returns raw Response. + */ + Response attachedItemsRaw(ExportAttachedItemsParams params) throws ChargebeeException { + + return post("/exports/attached_items", params != null ? params.toFormData() : null); + } + + /** + * attachedItems a export using raw JSON payload (executes immediately) - returns raw Response. + */ + Response attachedItemsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/attached_items", jsonPayload); + } + + public ExportAttachedItemsResponse attachedItems(ExportAttachedItemsParams params) + throws ChargebeeException { + Response response = attachedItemsRaw(params); + + return ExportAttachedItemsResponse.fromJson(response.getBodyAsString(), response); + } + + /** transactions a export using immutable params (executes immediately) - returns raw Response. */ + Response transactionsRaw(ExportTransactionsParams params) throws ChargebeeException { + + return post("/exports/transactions", params != null ? params.toFormData() : null); + } + + /** transactions a export using raw JSON payload (executes immediately) - returns raw Response. */ + Response transactionsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/transactions", jsonPayload); + } + + public ExportTransactionsResponse transactions(ExportTransactionsParams params) + throws ChargebeeException { + Response response = transactionsRaw(params); + + return ExportTransactionsResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * differentialPrices a export using immutable params (executes immediately) - returns raw + * Response. + */ + Response differentialPricesRaw(ExportDifferentialPricesParams params) throws ChargebeeException { + + return post("/exports/differential_prices", params != null ? params.toFormData() : null); + } + + /** + * differentialPrices a export using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response differentialPricesRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/differential_prices", jsonPayload); + } + + public ExportDifferentialPricesResponse differentialPrices(ExportDifferentialPricesParams params) + throws ChargebeeException { + Response response = differentialPricesRaw(params); + + return ExportDifferentialPricesResponse.fromJson(response.getBodyAsString(), response); + } + + /** itemFamilies a export using immutable params (executes immediately) - returns raw Response. */ + Response itemFamiliesRaw(ExportItemFamiliesParams params) throws ChargebeeException { + + return post("/exports/item_families", params != null ? params.toFormData() : null); + } + + /** itemFamilies a export using raw JSON payload (executes immediately) - returns raw Response. */ + Response itemFamiliesRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/item_families", jsonPayload); + } + + public ExportItemFamiliesResponse itemFamilies(ExportItemFamiliesParams params) + throws ChargebeeException { + Response response = itemFamiliesRaw(params); + + return ExportItemFamiliesResponse.fromJson(response.getBodyAsString(), response); + } + + /** invoices a export using immutable params (executes immediately) - returns raw Response. */ + Response invoicesRaw(ExportInvoicesParams params) throws ChargebeeException { + + return post("/exports/invoices", params != null ? params.toFormData() : null); + } + + /** invoices a export using raw JSON payload (executes immediately) - returns raw Response. */ + Response invoicesRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/invoices", jsonPayload); + } + + public ExportInvoicesResponse invoices(ExportInvoicesParams params) throws ChargebeeException { + Response response = invoicesRaw(params); + + return ExportInvoicesResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a export (executes immediately) - returns raw Response. */ + Response retrieveRaw(String exportId) throws ChargebeeException { + String path = buildPathWithParams("/exports/{export-id}", "export-id", exportId); + + return get(path, null); + } + + public ExportRetrieveResponse retrieve(String exportId) throws ChargebeeException { + Response response = retrieveRaw(exportId); + return ExportRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * priceVariants a export using immutable params (executes immediately) - returns raw Response. + */ + Response priceVariantsRaw(ExportPriceVariantsParams params) throws ChargebeeException { + + return post("/exports/price_variants", params != null ? params.toFormData() : null); + } + + /** + * priceVariants a export using raw JSON payload (executes immediately) - returns raw Response. + */ + Response priceVariantsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/price_variants", jsonPayload); + } + + public ExportPriceVariantsResponse priceVariants(ExportPriceVariantsParams params) + throws ChargebeeException { + Response response = priceVariantsRaw(params); + + return ExportPriceVariantsResponse.fromJson(response.getBodyAsString(), response); + } + + /** items a export using immutable params (executes immediately) - returns raw Response. */ + Response itemsRaw(ExportItemsParams params) throws ChargebeeException { + + return post("/exports/items", params != null ? params.toFormData() : null); + } + + /** items a export using raw JSON payload (executes immediately) - returns raw Response. */ + Response itemsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/items", jsonPayload); + } + + public ExportItemsResponse items(ExportItemsParams params) throws ChargebeeException { + Response response = itemsRaw(params); + + return ExportItemsResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * deferredRevenue a export using immutable params (executes immediately) - returns raw Response. + */ + Response deferredRevenueRaw(ExportDeferredRevenueParams params) throws ChargebeeException { + + return post("/exports/deferred_revenue", params != null ? params.toFormData() : null); + } + + /** + * deferredRevenue a export using raw JSON payload (executes immediately) - returns raw Response. + */ + Response deferredRevenueRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/deferred_revenue", jsonPayload); + } + + public ExportDeferredRevenueResponse deferredRevenue(ExportDeferredRevenueParams params) + throws ChargebeeException { + Response response = deferredRevenueRaw(params); + + return ExportDeferredRevenueResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * revenueRecognition a export using immutable params (executes immediately) - returns raw + * Response. + */ + Response revenueRecognitionRaw(ExportRevenueRecognitionParams params) throws ChargebeeException { + + return post("/exports/revenue_recognition", params != null ? params.toFormData() : null); + } + + /** + * revenueRecognition a export using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response revenueRecognitionRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/revenue_recognition", jsonPayload); + } + + public ExportRevenueRecognitionResponse revenueRecognition(ExportRevenueRecognitionParams params) + throws ChargebeeException { + Response response = revenueRecognitionRaw(params); + + return ExportRevenueRecognitionResponse.fromJson(response.getBodyAsString(), response); + } + + /** creditNotes a export using immutable params (executes immediately) - returns raw Response. */ + Response creditNotesRaw(ExportCreditNotesParams params) throws ChargebeeException { + + return post("/exports/credit_notes", params != null ? params.toFormData() : null); + } + + /** creditNotes a export using raw JSON payload (executes immediately) - returns raw Response. */ + Response creditNotesRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/credit_notes", jsonPayload); + } + + public ExportCreditNotesResponse creditNotes(ExportCreditNotesParams params) + throws ChargebeeException { + Response response = creditNotesRaw(params); + + return ExportCreditNotesResponse.fromJson(response.getBodyAsString(), response); + } + + /** coupons a export using immutable params (executes immediately) - returns raw Response. */ + Response couponsRaw(ExportCouponsParams params) throws ChargebeeException { + + return post("/exports/coupons", params != null ? params.toFormData() : null); + } + + /** coupons a export using raw JSON payload (executes immediately) - returns raw Response. */ + Response couponsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/coupons", jsonPayload); + } + + public ExportCouponsResponse coupons(ExportCouponsParams params) throws ChargebeeException { + Response response = couponsRaw(params); + + return ExportCouponsResponse.fromJson(response.getBodyAsString(), response); + } + + /** orders a export using immutable params (executes immediately) - returns raw Response. */ + Response ordersRaw(ExportOrdersParams params) throws ChargebeeException { + + return post("/exports/orders", params != null ? params.toFormData() : null); + } + + /** orders a export using raw JSON payload (executes immediately) - returns raw Response. */ + Response ordersRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/orders", jsonPayload); + } + + public ExportOrdersResponse orders(ExportOrdersParams params) throws ChargebeeException { + Response response = ordersRaw(params); + + return ExportOrdersResponse.fromJson(response.getBodyAsString(), response); + } + + /** itemPrices a export using immutable params (executes immediately) - returns raw Response. */ + Response itemPricesRaw(ExportItemPricesParams params) throws ChargebeeException { + + return post("/exports/item_prices", params != null ? params.toFormData() : null); + } + + /** itemPrices a export using raw JSON payload (executes immediately) - returns raw Response. */ + Response itemPricesRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/item_prices", jsonPayload); + } + + public ExportItemPricesResponse itemPrices(ExportItemPricesParams params) + throws ChargebeeException { + Response response = itemPricesRaw(params); + + return ExportItemPricesResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * subscriptions a export using immutable params (executes immediately) - returns raw Response. + */ + Response subscriptionsRaw(ExportSubscriptionsParams params) throws ChargebeeException { + + return post("/exports/subscriptions", params != null ? params.toFormData() : null); + } + + /** + * subscriptions a export using raw JSON payload (executes immediately) - returns raw Response. + */ + Response subscriptionsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/subscriptions", jsonPayload); + } + + public ExportSubscriptionsResponse subscriptions(ExportSubscriptionsParams params) + throws ChargebeeException { + Response response = subscriptionsRaw(params); + + return ExportSubscriptionsResponse.fromJson(response.getBodyAsString(), response); + } + + /** addons a export using immutable params (executes immediately) - returns raw Response. */ + Response addonsRaw(ExportAddonsParams params) throws ChargebeeException { + + return post("/exports/addons", params != null ? params.toFormData() : null); + } + + /** addons a export using raw JSON payload (executes immediately) - returns raw Response. */ + Response addonsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/addons", jsonPayload); + } + + public ExportAddonsResponse addons(ExportAddonsParams params) throws ChargebeeException { + Response response = addonsRaw(params); + + return ExportAddonsResponse.fromJson(response.getBodyAsString(), response); + } + + /** plans a export using immutable params (executes immediately) - returns raw Response. */ + Response plansRaw(ExportPlansParams params) throws ChargebeeException { + + return post("/exports/plans", params != null ? params.toFormData() : null); + } + + /** plans a export using raw JSON payload (executes immediately) - returns raw Response. */ + Response plansRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/exports/plans", jsonPayload); + } + + public ExportPlansResponse plans(ExportPlansParams params) throws ChargebeeException { + Response response = plansRaw(params); + + return ExportPlansResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/services/FeatureService.java b/src/main/java/com/chargebee/v4/services/FeatureService.java new file mode 100644 index 00000000..3f3856f4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/FeatureService.java @@ -0,0 +1,205 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.feature.params.FeatureListParams; + +import com.chargebee.v4.models.feature.params.FeatureCreateParams; + +import com.chargebee.v4.models.feature.params.FeatureUpdateParams; + +import com.chargebee.v4.models.feature.responses.FeatureListResponse; + +import com.chargebee.v4.models.feature.responses.FeatureCreateResponse; + +import com.chargebee.v4.models.feature.responses.FeatureDeleteResponse; + +import com.chargebee.v4.models.feature.responses.FeatureRetrieveResponse; + +import com.chargebee.v4.models.feature.responses.FeatureUpdateResponse; + +import com.chargebee.v4.models.feature.responses.FeatureArchiveResponse; + +import com.chargebee.v4.models.feature.responses.FeatureActivateResponse; + +import com.chargebee.v4.models.feature.responses.FeatureReactivateResponse; + +public final class FeatureService extends BaseService { + + private final ServiceConfig config; + + public FeatureService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private FeatureService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private FeatureService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + FeatureService with(RequestOptions newOptions) { + return new FeatureService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public FeatureService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** list a feature using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(FeatureListParams params) throws ChargebeeException { + + return get("/features", params != null ? params.toQueryParams() : null); + } + + /** list a feature without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/features", null); + } + + /** list a feature using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public FeatureListResponse list(FeatureListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return FeatureListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public FeatureListResponse list() throws ChargebeeException { + Response response = listRaw(); + return FeatureListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** create a feature using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(FeatureCreateParams params) throws ChargebeeException { + + return post("/features", params != null ? params.toFormData() : null); + } + + /** create a feature using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/features", jsonPayload); + } + + public FeatureCreateResponse create(FeatureCreateParams params) throws ChargebeeException { + Response response = createRaw(params); + + return FeatureCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** delete a feature (executes immediately) - returns raw Response. */ + Response deleteRaw(String featureId) throws ChargebeeException { + String path = buildPathWithParams("/features/{feature-id}/delete", "feature-id", featureId); + + return post(path, null); + } + + public FeatureDeleteResponse delete(String featureId) throws ChargebeeException { + Response response = deleteRaw(featureId); + return FeatureDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a feature (executes immediately) - returns raw Response. */ + Response retrieveRaw(String featureId) throws ChargebeeException { + String path = buildPathWithParams("/features/{feature-id}", "feature-id", featureId); + + return get(path, null); + } + + public FeatureRetrieveResponse retrieve(String featureId) throws ChargebeeException { + Response response = retrieveRaw(featureId); + return FeatureRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** update a feature (executes immediately) - returns raw Response. */ + Response updateRaw(String featureId) throws ChargebeeException { + String path = buildPathWithParams("/features/{feature-id}", "feature-id", featureId); + + return post(path, null); + } + + /** update a feature using immutable params (executes immediately) - returns raw Response. */ + Response updateRaw(String featureId, FeatureUpdateParams params) throws ChargebeeException { + String path = buildPathWithParams("/features/{feature-id}", "feature-id", featureId); + return post(path, params.toFormData()); + } + + /** update a feature using raw JSON payload (executes immediately) - returns raw Response. */ + Response updateRaw(String featureId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/features/{feature-id}", "feature-id", featureId); + return postJson(path, jsonPayload); + } + + public FeatureUpdateResponse update(String featureId, FeatureUpdateParams params) + throws ChargebeeException { + Response response = updateRaw(featureId, params); + return FeatureUpdateResponse.fromJson(response.getBodyAsString(), response); + } + + /** archive a feature (executes immediately) - returns raw Response. */ + Response archiveRaw(String featureId) throws ChargebeeException { + String path = + buildPathWithParams("/features/{feature-id}/archive_command", "feature-id", featureId); + + return post(path, null); + } + + public FeatureArchiveResponse archive(String featureId) throws ChargebeeException { + Response response = archiveRaw(featureId); + return FeatureArchiveResponse.fromJson(response.getBodyAsString(), response); + } + + /** activate a feature (executes immediately) - returns raw Response. */ + Response activateRaw(String featureId) throws ChargebeeException { + String path = + buildPathWithParams("/features/{feature-id}/activate_command", "feature-id", featureId); + + return post(path, null); + } + + public FeatureActivateResponse activate(String featureId) throws ChargebeeException { + Response response = activateRaw(featureId); + return FeatureActivateResponse.fromJson(response.getBodyAsString(), response); + } + + /** reactivate a feature (executes immediately) - returns raw Response. */ + Response reactivateRaw(String featureId) throws ChargebeeException { + String path = + buildPathWithParams("/features/{feature-id}/reactivate_command", "feature-id", featureId); + + return post(path, null); + } + + public FeatureReactivateResponse reactivate(String featureId) throws ChargebeeException { + Response response = reactivateRaw(featureId); + return FeatureReactivateResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/FullExportService.java b/src/main/java/com/chargebee/v4/services/FullExportService.java similarity index 81% rename from src/main/java/com/chargebee/v4/core/services/FullExportService.java rename to src/main/java/com/chargebee/v4/services/FullExportService.java index 7ae91ba0..9ec7159f 100644 --- a/src/main/java/com/chargebee/v4/core/services/FullExportService.java +++ b/src/main/java/com/chargebee/v4/services/FullExportService.java @@ -5,15 +5,16 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.fullExport.params.FullExportStatusParams; +import com.chargebee.v4.models.fullExport.params.FullExportStatusParams; -import com.chargebee.v4.core.responses.fullExport.FullExportStatusResponse; +import com.chargebee.v4.models.fullExport.responses.FullExportStatusResponse; public final class FullExportService extends BaseService { @@ -50,18 +51,18 @@ public FullExportService withOptions(RequestOptions options) { // === Operations === /** status a fullExport using immutable params (executes immediately) - returns raw Response. */ - Response statusRaw(FullExportStatusParams params) throws Exception { + Response statusRaw(FullExportStatusParams params) throws ChargebeeException { return get("/full_exports/status", params != null ? params.toQueryParams() : null); } /** status a fullExport using raw JSON payload (executes immediately) - returns raw Response. */ - Response statusRaw(String jsonPayload) throws Exception { + Response statusRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public FullExportStatusResponse status(FullExportStatusParams params) throws Exception { + public FullExportStatusResponse status(FullExportStatusParams params) throws ChargebeeException { Response response = statusRaw(params); return FullExportStatusResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/services/GiftService.java b/src/main/java/com/chargebee/v4/services/GiftService.java new file mode 100644 index 00000000..17fec704 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/GiftService.java @@ -0,0 +1,197 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.gift.params.GiftCreateForItemsParams; + +import com.chargebee.v4.models.gift.params.UpdateGiftParams; + +import com.chargebee.v4.models.gift.params.GiftListParams; + +import com.chargebee.v4.models.gift.params.GiftCreateParams; + +import com.chargebee.v4.models.gift.responses.GiftCreateForItemsResponse; + +import com.chargebee.v4.models.gift.responses.GiftCancelResponse; + +import com.chargebee.v4.models.gift.responses.UpdateGiftResponse; + +import com.chargebee.v4.models.gift.responses.GiftListResponse; + +import com.chargebee.v4.models.gift.responses.GiftCreateResponse; + +import com.chargebee.v4.models.gift.responses.GiftRetrieveResponse; + +import com.chargebee.v4.models.gift.responses.GiftClaimResponse; + +public final class GiftService extends BaseService { + + private final ServiceConfig config; + + public GiftService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private GiftService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private GiftService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + GiftService with(RequestOptions newOptions) { + return new GiftService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public GiftService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** createForItems a gift using immutable params (executes immediately) - returns raw Response. */ + Response createForItemsRaw(GiftCreateForItemsParams params) throws ChargebeeException { + + return post("/gifts/create_for_items", params != null ? params.toFormData() : null); + } + + /** createForItems a gift using raw JSON payload (executes immediately) - returns raw Response. */ + Response createForItemsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/gifts/create_for_items", jsonPayload); + } + + public GiftCreateForItemsResponse createForItems(GiftCreateForItemsParams params) + throws ChargebeeException { + Response response = createForItemsRaw(params); + + return GiftCreateForItemsResponse.fromJson(response.getBodyAsString(), response); + } + + /** cancel a gift (executes immediately) - returns raw Response. */ + Response cancelRaw(String giftId) throws ChargebeeException { + String path = buildPathWithParams("/gifts/{gift-id}/cancel", "gift-id", giftId); + + return post(path, null); + } + + public GiftCancelResponse cancel(String giftId) throws ChargebeeException { + Response response = cancelRaw(giftId); + return GiftCancelResponse.fromJson(response.getBodyAsString(), response); + } + + /** updateGift a gift (executes immediately) - returns raw Response. */ + Response updateGiftRaw(String giftId) throws ChargebeeException { + String path = buildPathWithParams("/gifts/{gift-id}/update_gift", "gift-id", giftId); + + return post(path, null); + } + + /** updateGift a gift using immutable params (executes immediately) - returns raw Response. */ + Response updateGiftRaw(String giftId, UpdateGiftParams params) throws ChargebeeException { + String path = buildPathWithParams("/gifts/{gift-id}/update_gift", "gift-id", giftId); + return post(path, params.toFormData()); + } + + /** updateGift a gift using raw JSON payload (executes immediately) - returns raw Response. */ + Response updateGiftRaw(String giftId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/gifts/{gift-id}/update_gift", "gift-id", giftId); + return postJson(path, jsonPayload); + } + + public UpdateGiftResponse updateGift(String giftId, UpdateGiftParams params) + throws ChargebeeException { + Response response = updateGiftRaw(giftId, params); + return UpdateGiftResponse.fromJson(response.getBodyAsString(), response); + } + + /** list a gift using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(GiftListParams params) throws ChargebeeException { + + return get("/gifts", params != null ? params.toQueryParams() : null); + } + + /** list a gift without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/gifts", null); + } + + /** list a gift using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public GiftListResponse list(GiftListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return GiftListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public GiftListResponse list() throws ChargebeeException { + Response response = listRaw(); + return GiftListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** create a gift using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(GiftCreateParams params) throws ChargebeeException { + + return post("/gifts", params != null ? params.toFormData() : null); + } + + /** create a gift using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/gifts", jsonPayload); + } + + public GiftCreateResponse create(GiftCreateParams params) throws ChargebeeException { + Response response = createRaw(params); + + return GiftCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a gift (executes immediately) - returns raw Response. */ + Response retrieveRaw(String giftId) throws ChargebeeException { + String path = buildPathWithParams("/gifts/{gift-id}", "gift-id", giftId); + + return get(path, null); + } + + public GiftRetrieveResponse retrieve(String giftId) throws ChargebeeException { + Response response = retrieveRaw(giftId); + return GiftRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** claim a gift (executes immediately) - returns raw Response. */ + Response claimRaw(String giftId) throws ChargebeeException { + String path = buildPathWithParams("/gifts/{gift-id}/claim", "gift-id", giftId); + + return post(path, null); + } + + public GiftClaimResponse claim(String giftId) throws ChargebeeException { + Response response = claimRaw(giftId); + return GiftClaimResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/services/HostedPageService.java b/src/main/java/com/chargebee/v4/services/HostedPageService.java new file mode 100644 index 00000000..dec4970c --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/HostedPageService.java @@ -0,0 +1,655 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.hostedPage.params.HostedPageCheckoutOneTimeForItemsParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageUpdatePaymentMethodParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageUpdateCardParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageExtendSubscriptionParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageEventsParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageCheckoutGiftForItemsParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageListParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageViewVoucherParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageCollectNowParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageAcceptQuoteParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageCheckoutNewForItemsParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageClaimGiftParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageCheckoutExistingForItemsParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPagePreCancelParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageRetrieveAgreementPdfParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageManagePaymentSourcesParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageCheckoutOneTimeParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageCheckoutNewParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageCheckoutGiftParams; + +import com.chargebee.v4.models.hostedPage.params.HostedPageCheckoutExistingParams; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageCheckoutOneTimeForItemsResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageUpdatePaymentMethodResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageUpdateCardResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageExtendSubscriptionResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageEventsResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageCheckoutGiftForItemsResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageListResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageViewVoucherResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageCollectNowResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageAcceptQuoteResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageCheckoutNewForItemsResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageClaimGiftResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageCheckoutExistingForItemsResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPagePreCancelResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageAcknowledgeResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageRetrieveAgreementPdfResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageRetrieveResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageManagePaymentSourcesResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageCheckoutOneTimeResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageCheckoutNewResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageCheckoutGiftResponse; + +import com.chargebee.v4.models.hostedPage.responses.HostedPageCheckoutExistingResponse; + +public final class HostedPageService extends BaseService { + + private final ServiceConfig config; + + public HostedPageService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private HostedPageService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private HostedPageService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + HostedPageService with(RequestOptions newOptions) { + return new HostedPageService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public HostedPageService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * checkoutOneTimeForItems a hostedPage using immutable params (executes immediately) - returns + * raw Response. + */ + Response checkoutOneTimeForItemsRaw(HostedPageCheckoutOneTimeForItemsParams params) + throws ChargebeeException { + + return post( + "/hosted_pages/checkout_one_time_for_items", params != null ? params.toFormData() : null); + } + + /** + * checkoutOneTimeForItems a hostedPage using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response checkoutOneTimeForItemsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/checkout_one_time_for_items", jsonPayload); + } + + public HostedPageCheckoutOneTimeForItemsResponse checkoutOneTimeForItems( + HostedPageCheckoutOneTimeForItemsParams params) throws ChargebeeException { + Response response = checkoutOneTimeForItemsRaw(params); + + return HostedPageCheckoutOneTimeForItemsResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * updatePaymentMethod a hostedPage using immutable params (executes immediately) - returns raw + * Response. + */ + Response updatePaymentMethodRaw(HostedPageUpdatePaymentMethodParams params) + throws ChargebeeException { + + return post("/hosted_pages/update_payment_method", params != null ? params.toFormData() : null); + } + + /** + * updatePaymentMethod a hostedPage using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response updatePaymentMethodRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/update_payment_method", jsonPayload); + } + + public HostedPageUpdatePaymentMethodResponse updatePaymentMethod( + HostedPageUpdatePaymentMethodParams params) throws ChargebeeException { + Response response = updatePaymentMethodRaw(params); + + return HostedPageUpdatePaymentMethodResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * updateCard a hostedPage using immutable params (executes immediately) - returns raw Response. + */ + Response updateCardRaw(HostedPageUpdateCardParams params) throws ChargebeeException { + + return post("/hosted_pages/update_card", params != null ? params.toFormData() : null); + } + + /** + * updateCard a hostedPage using raw JSON payload (executes immediately) - returns raw Response. + */ + Response updateCardRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/update_card", jsonPayload); + } + + public HostedPageUpdateCardResponse updateCard(HostedPageUpdateCardParams params) + throws ChargebeeException { + Response response = updateCardRaw(params); + + return HostedPageUpdateCardResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * extendSubscription a hostedPage using immutable params (executes immediately) - returns raw + * Response. + */ + Response extendSubscriptionRaw(HostedPageExtendSubscriptionParams params) + throws ChargebeeException { + + return post("/hosted_pages/extend_subscription", params != null ? params.toFormData() : null); + } + + /** + * extendSubscription a hostedPage using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response extendSubscriptionRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/extend_subscription", jsonPayload); + } + + public HostedPageExtendSubscriptionResponse extendSubscription( + HostedPageExtendSubscriptionParams params) throws ChargebeeException { + Response response = extendSubscriptionRaw(params); + + return HostedPageExtendSubscriptionResponse.fromJson(response.getBodyAsString(), response); + } + + /** events a hostedPage using immutable params (executes immediately) - returns raw Response. */ + Response eventsRaw(HostedPageEventsParams params) throws ChargebeeException { + + return post("/hosted_pages/events", params != null ? params.toFormData() : null); + } + + /** events a hostedPage using raw JSON payload (executes immediately) - returns raw Response. */ + Response eventsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/events", jsonPayload); + } + + public HostedPageEventsResponse events(HostedPageEventsParams params) throws ChargebeeException { + Response response = eventsRaw(params); + + return HostedPageEventsResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * checkoutGiftForItems a hostedPage using immutable params (executes immediately) - returns raw + * Response. + */ + Response checkoutGiftForItemsRaw(HostedPageCheckoutGiftForItemsParams params) + throws ChargebeeException { + + return post( + "/hosted_pages/checkout_gift_for_items", params != null ? params.toFormData() : null); + } + + /** + * checkoutGiftForItems a hostedPage using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response checkoutGiftForItemsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/checkout_gift_for_items", jsonPayload); + } + + public HostedPageCheckoutGiftForItemsResponse checkoutGiftForItems( + HostedPageCheckoutGiftForItemsParams params) throws ChargebeeException { + Response response = checkoutGiftForItemsRaw(params); + + return HostedPageCheckoutGiftForItemsResponse.fromJson(response.getBodyAsString(), response); + } + + /** list a hostedPage using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(HostedPageListParams params) throws ChargebeeException { + + return get("/hosted_pages", params != null ? params.toQueryParams() : null); + } + + /** list a hostedPage without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/hosted_pages", null); + } + + /** list a hostedPage using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public HostedPageListResponse list(HostedPageListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return HostedPageListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public HostedPageListResponse list() throws ChargebeeException { + Response response = listRaw(); + return HostedPageListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** + * viewVoucher a hostedPage using immutable params (executes immediately) - returns raw Response. + */ + Response viewVoucherRaw(HostedPageViewVoucherParams params) throws ChargebeeException { + + return post("/hosted_pages/view_voucher", params != null ? params.toFormData() : null); + } + + /** + * viewVoucher a hostedPage using raw JSON payload (executes immediately) - returns raw Response. + */ + Response viewVoucherRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/view_voucher", jsonPayload); + } + + public HostedPageViewVoucherResponse viewVoucher(HostedPageViewVoucherParams params) + throws ChargebeeException { + Response response = viewVoucherRaw(params); + + return HostedPageViewVoucherResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * collectNow a hostedPage using immutable params (executes immediately) - returns raw Response. + */ + Response collectNowRaw(HostedPageCollectNowParams params) throws ChargebeeException { + + return post("/hosted_pages/collect_now", params != null ? params.toFormData() : null); + } + + /** + * collectNow a hostedPage using raw JSON payload (executes immediately) - returns raw Response. + */ + Response collectNowRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/collect_now", jsonPayload); + } + + public HostedPageCollectNowResponse collectNow(HostedPageCollectNowParams params) + throws ChargebeeException { + Response response = collectNowRaw(params); + + return HostedPageCollectNowResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * acceptQuote a hostedPage using immutable params (executes immediately) - returns raw Response. + */ + Response acceptQuoteRaw(HostedPageAcceptQuoteParams params) throws ChargebeeException { + + return post("/hosted_pages/accept_quote", params != null ? params.toFormData() : null); + } + + /** + * acceptQuote a hostedPage using raw JSON payload (executes immediately) - returns raw Response. + */ + Response acceptQuoteRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/accept_quote", jsonPayload); + } + + public HostedPageAcceptQuoteResponse acceptQuote(HostedPageAcceptQuoteParams params) + throws ChargebeeException { + Response response = acceptQuoteRaw(params); + + return HostedPageAcceptQuoteResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * checkoutNewForItems a hostedPage using immutable params (executes immediately) - returns raw + * Response. + */ + Response checkoutNewForItemsRaw(HostedPageCheckoutNewForItemsParams params) + throws ChargebeeException { + + return post( + "/hosted_pages/checkout_new_for_items", params != null ? params.toFormData() : null); + } + + /** + * checkoutNewForItems a hostedPage using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response checkoutNewForItemsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/checkout_new_for_items", jsonPayload); + } + + public HostedPageCheckoutNewForItemsResponse checkoutNewForItems( + HostedPageCheckoutNewForItemsParams params) throws ChargebeeException { + Response response = checkoutNewForItemsRaw(params); + + return HostedPageCheckoutNewForItemsResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * claimGift a hostedPage using immutable params (executes immediately) - returns raw Response. + */ + Response claimGiftRaw(HostedPageClaimGiftParams params) throws ChargebeeException { + + return post("/hosted_pages/claim_gift", params != null ? params.toFormData() : null); + } + + /** + * claimGift a hostedPage using raw JSON payload (executes immediately) - returns raw Response. + */ + Response claimGiftRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/claim_gift", jsonPayload); + } + + public HostedPageClaimGiftResponse claimGift(HostedPageClaimGiftParams params) + throws ChargebeeException { + Response response = claimGiftRaw(params); + + return HostedPageClaimGiftResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * checkoutExistingForItems a hostedPage using immutable params (executes immediately) - returns + * raw Response. + */ + Response checkoutExistingForItemsRaw(HostedPageCheckoutExistingForItemsParams params) + throws ChargebeeException { + + return post( + "/hosted_pages/checkout_existing_for_items", params != null ? params.toFormData() : null); + } + + /** + * checkoutExistingForItems a hostedPage using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response checkoutExistingForItemsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/checkout_existing_for_items", jsonPayload); + } + + public HostedPageCheckoutExistingForItemsResponse checkoutExistingForItems( + HostedPageCheckoutExistingForItemsParams params) throws ChargebeeException { + Response response = checkoutExistingForItemsRaw(params); + + return HostedPageCheckoutExistingForItemsResponse.fromJson( + response.getBodyAsString(), response); + } + + /** + * preCancel a hostedPage using immutable params (executes immediately) - returns raw Response. + */ + Response preCancelRaw(HostedPagePreCancelParams params) throws ChargebeeException { + + return post("/hosted_pages/pre_cancel", params != null ? params.toFormData() : null); + } + + /** + * preCancel a hostedPage using raw JSON payload (executes immediately) - returns raw Response. + */ + Response preCancelRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/pre_cancel", jsonPayload); + } + + public HostedPagePreCancelResponse preCancel(HostedPagePreCancelParams params) + throws ChargebeeException { + Response response = preCancelRaw(params); + + return HostedPagePreCancelResponse.fromJson(response.getBodyAsString(), response); + } + + /** acknowledge a hostedPage (executes immediately) - returns raw Response. */ + Response acknowledgeRaw(String hostedPageId) throws ChargebeeException { + String path = + buildPathWithParams( + "/hosted_pages/{hosted-page-id}/acknowledge", "hosted-page-id", hostedPageId); + + return post(path, null); + } + + public HostedPageAcknowledgeResponse acknowledge(String hostedPageId) throws ChargebeeException { + Response response = acknowledgeRaw(hostedPageId); + return HostedPageAcknowledgeResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * retrieveAgreementPdf a hostedPage using immutable params (executes immediately) - returns raw + * Response. + */ + Response retrieveAgreementPdfRaw(HostedPageRetrieveAgreementPdfParams params) + throws ChargebeeException { + + return post( + "/hosted_pages/retrieve_agreement_pdf", params != null ? params.toFormData() : null); + } + + /** + * retrieveAgreementPdf a hostedPage using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response retrieveAgreementPdfRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/retrieve_agreement_pdf", jsonPayload); + } + + public HostedPageRetrieveAgreementPdfResponse retrieveAgreementPdf( + HostedPageRetrieveAgreementPdfParams params) throws ChargebeeException { + Response response = retrieveAgreementPdfRaw(params); + + return HostedPageRetrieveAgreementPdfResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a hostedPage (executes immediately) - returns raw Response. */ + Response retrieveRaw(String hostedPageId) throws ChargebeeException { + String path = + buildPathWithParams("/hosted_pages/{hosted-page-id}", "hosted-page-id", hostedPageId); + + return get(path, null); + } + + public HostedPageRetrieveResponse retrieve(String hostedPageId) throws ChargebeeException { + Response response = retrieveRaw(hostedPageId); + return HostedPageRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * managePaymentSources a hostedPage using immutable params (executes immediately) - returns raw + * Response. + */ + Response managePaymentSourcesRaw(HostedPageManagePaymentSourcesParams params) + throws ChargebeeException { + + return post( + "/hosted_pages/manage_payment_sources", params != null ? params.toFormData() : null); + } + + /** + * managePaymentSources a hostedPage using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response managePaymentSourcesRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/manage_payment_sources", jsonPayload); + } + + public HostedPageManagePaymentSourcesResponse managePaymentSources( + HostedPageManagePaymentSourcesParams params) throws ChargebeeException { + Response response = managePaymentSourcesRaw(params); + + return HostedPageManagePaymentSourcesResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * checkoutOneTime a hostedPage using immutable params (executes immediately) - returns raw + * Response. + */ + Response checkoutOneTimeRaw(HostedPageCheckoutOneTimeParams params) throws ChargebeeException { + + return post("/hosted_pages/checkout_one_time", params != null ? params.toFormData() : null); + } + + /** + * checkoutOneTime a hostedPage using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response checkoutOneTimeRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/checkout_one_time", jsonPayload); + } + + public HostedPageCheckoutOneTimeResponse checkoutOneTime(HostedPageCheckoutOneTimeParams params) + throws ChargebeeException { + Response response = checkoutOneTimeRaw(params); + + return HostedPageCheckoutOneTimeResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * checkoutNew a hostedPage using immutable params (executes immediately) - returns raw Response. + */ + Response checkoutNewRaw(HostedPageCheckoutNewParams params) throws ChargebeeException { + + return post("/hosted_pages/checkout_new", params != null ? params.toFormData() : null); + } + + /** + * checkoutNew a hostedPage using raw JSON payload (executes immediately) - returns raw Response. + */ + Response checkoutNewRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/checkout_new", jsonPayload); + } + + public HostedPageCheckoutNewResponse checkoutNew(HostedPageCheckoutNewParams params) + throws ChargebeeException { + Response response = checkoutNewRaw(params); + + return HostedPageCheckoutNewResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * checkoutGift a hostedPage using immutable params (executes immediately) - returns raw Response. + */ + Response checkoutGiftRaw(HostedPageCheckoutGiftParams params) throws ChargebeeException { + + return post("/hosted_pages/checkout_gift", params != null ? params.toFormData() : null); + } + + /** + * checkoutGift a hostedPage using raw JSON payload (executes immediately) - returns raw Response. + */ + Response checkoutGiftRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/checkout_gift", jsonPayload); + } + + public HostedPageCheckoutGiftResponse checkoutGift(HostedPageCheckoutGiftParams params) + throws ChargebeeException { + Response response = checkoutGiftRaw(params); + + return HostedPageCheckoutGiftResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * checkoutExisting a hostedPage using immutable params (executes immediately) - returns raw + * Response. + */ + Response checkoutExistingRaw(HostedPageCheckoutExistingParams params) throws ChargebeeException { + + return post("/hosted_pages/checkout_existing", params != null ? params.toFormData() : null); + } + + /** + * checkoutExisting a hostedPage using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response checkoutExistingRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/hosted_pages/checkout_existing", jsonPayload); + } + + public HostedPageCheckoutExistingResponse checkoutExisting( + HostedPageCheckoutExistingParams params) throws ChargebeeException { + Response response = checkoutExistingRaw(params); + + return HostedPageCheckoutExistingResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/InAppSubscriptionService.java b/src/main/java/com/chargebee/v4/services/InAppSubscriptionService.java similarity index 75% rename from src/main/java/com/chargebee/v4/core/services/InAppSubscriptionService.java rename to src/main/java/com/chargebee/v4/services/InAppSubscriptionService.java index 7bf40968..874e0c33 100644 --- a/src/main/java/com/chargebee/v4/core/services/InAppSubscriptionService.java +++ b/src/main/java/com/chargebee/v4/services/InAppSubscriptionService.java @@ -5,27 +5,28 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.inAppSubscription.params.InAppSubscriptionRetrieveStoreSubsParams; +import com.chargebee.v4.models.inAppSubscription.params.InAppSubscriptionRetrieveStoreSubscriptionsParams; -import com.chargebee.v4.core.models.inAppSubscription.params.InAppSubscriptionImportReceiptParams; +import com.chargebee.v4.models.inAppSubscription.params.InAppSubscriptionImportReceiptParams; -import com.chargebee.v4.core.models.inAppSubscription.params.InAppSubscriptionImportSubscriptionParams; +import com.chargebee.v4.models.inAppSubscription.params.InAppSubscriptionImportSubscriptionParams; -import com.chargebee.v4.core.models.inAppSubscription.params.InAppSubscriptionProcessReceiptParams; +import com.chargebee.v4.models.inAppSubscription.params.InAppSubscriptionProcessReceiptParams; -import com.chargebee.v4.core.responses.inAppSubscription.InAppSubscriptionRetrieveStoreSubsResponse; +import com.chargebee.v4.models.inAppSubscription.responses.InAppSubscriptionRetrieveStoreSubscriptionsResponse; -import com.chargebee.v4.core.responses.inAppSubscription.InAppSubscriptionImportReceiptResponse; +import com.chargebee.v4.models.inAppSubscription.responses.InAppSubscriptionImportReceiptResponse; -import com.chargebee.v4.core.responses.inAppSubscription.InAppSubscriptionImportSubscriptionResponse; +import com.chargebee.v4.models.inAppSubscription.responses.InAppSubscriptionImportSubscriptionResponse; -import com.chargebee.v4.core.responses.inAppSubscription.InAppSubscriptionProcessReceiptResponse; +import com.chargebee.v4.models.inAppSubscription.responses.InAppSubscriptionProcessReceiptResponse; public final class InAppSubscriptionService extends BaseService { @@ -62,8 +63,10 @@ public InAppSubscriptionService withOptions(RequestOptions options) { // === Operations === - /** retrieveStoreSubs a inAppSubscription (executes immediately) - returns raw Response. */ - Response retrieveStoreSubsRaw(String inAppSubscriptionAppId) throws Exception { + /** + * retrieveStoreSubscriptions a inAppSubscription (executes immediately) - returns raw Response. + */ + Response retrieveStoreSubscriptionsRaw(String inAppSubscriptionAppId) throws ChargebeeException { String path = buildPathWithParams( "/in_app_subscriptions/{in-app-subscription-app-id}/retrieve", @@ -74,12 +77,12 @@ Response retrieveStoreSubsRaw(String inAppSubscriptionAppId) throws Exception { } /** - * retrieveStoreSubs a inAppSubscription using immutable params (executes immediately) - returns - * raw Response. + * retrieveStoreSubscriptions a inAppSubscription using immutable params (executes immediately) - + * returns raw Response. */ - Response retrieveStoreSubsRaw( - String inAppSubscriptionAppId, InAppSubscriptionRetrieveStoreSubsParams params) - throws Exception { + Response retrieveStoreSubscriptionsRaw( + String inAppSubscriptionAppId, InAppSubscriptionRetrieveStoreSubscriptionsParams params) + throws ChargebeeException { String path = buildPathWithParams( "/in_app_subscriptions/{in-app-subscription-app-id}/retrieve", @@ -89,11 +92,11 @@ Response retrieveStoreSubsRaw( } /** - * retrieveStoreSubs a inAppSubscription using raw JSON payload (executes immediately) - returns - * raw Response. + * retrieveStoreSubscriptions a inAppSubscription using raw JSON payload (executes immediately) - + * returns raw Response. */ - Response retrieveStoreSubsRaw(String inAppSubscriptionAppId, String jsonPayload) - throws Exception { + Response retrieveStoreSubscriptionsRaw(String inAppSubscriptionAppId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/in_app_subscriptions/{in-app-subscription-app-id}/retrieve", @@ -102,16 +105,16 @@ Response retrieveStoreSubsRaw(String inAppSubscriptionAppId, String jsonPayload) return postJson(path, jsonPayload); } - public InAppSubscriptionRetrieveStoreSubsResponse retrieveStoreSubs( - String inAppSubscriptionAppId, InAppSubscriptionRetrieveStoreSubsParams params) - throws Exception { - Response response = retrieveStoreSubsRaw(inAppSubscriptionAppId, params); - return InAppSubscriptionRetrieveStoreSubsResponse.fromJson( + public InAppSubscriptionRetrieveStoreSubscriptionsResponse retrieveStoreSubscriptions( + String inAppSubscriptionAppId, InAppSubscriptionRetrieveStoreSubscriptionsParams params) + throws ChargebeeException { + Response response = retrieveStoreSubscriptionsRaw(inAppSubscriptionAppId, params); + return InAppSubscriptionRetrieveStoreSubscriptionsResponse.fromJson( response.getBodyAsString(), response); } /** importReceipt a inAppSubscription (executes immediately) - returns raw Response. */ - Response importReceiptRaw(String inAppSubscriptionAppId) throws Exception { + Response importReceiptRaw(String inAppSubscriptionAppId) throws ChargebeeException { String path = buildPathWithParams( "/in_app_subscriptions/{in-app-subscription-app-id}/import_receipt", @@ -126,7 +129,8 @@ Response importReceiptRaw(String inAppSubscriptionAppId) throws Exception { * Response. */ Response importReceiptRaw( - String inAppSubscriptionAppId, InAppSubscriptionImportReceiptParams params) throws Exception { + String inAppSubscriptionAppId, InAppSubscriptionImportReceiptParams params) + throws ChargebeeException { String path = buildPathWithParams( "/in_app_subscriptions/{in-app-subscription-app-id}/import_receipt", @@ -139,7 +143,8 @@ Response importReceiptRaw( * importReceipt a inAppSubscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response importReceiptRaw(String inAppSubscriptionAppId, String jsonPayload) throws Exception { + Response importReceiptRaw(String inAppSubscriptionAppId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/in_app_subscriptions/{in-app-subscription-app-id}/import_receipt", @@ -149,13 +154,14 @@ Response importReceiptRaw(String inAppSubscriptionAppId, String jsonPayload) thr } public InAppSubscriptionImportReceiptResponse importReceipt( - String inAppSubscriptionAppId, InAppSubscriptionImportReceiptParams params) throws Exception { + String inAppSubscriptionAppId, InAppSubscriptionImportReceiptParams params) + throws ChargebeeException { Response response = importReceiptRaw(inAppSubscriptionAppId, params); return InAppSubscriptionImportReceiptResponse.fromJson(response.getBodyAsString(), response); } /** importSubscription a inAppSubscription (executes immediately) - returns raw Response. */ - Response importSubscriptionRaw(String inAppSubscriptionAppId) throws Exception { + Response importSubscriptionRaw(String inAppSubscriptionAppId) throws ChargebeeException { String path = buildPathWithParams( "/in_app_subscriptions/{in-app-subscription-app-id}/import_subscription", @@ -171,7 +177,7 @@ Response importSubscriptionRaw(String inAppSubscriptionAppId) throws Exception { */ Response importSubscriptionRaw( String inAppSubscriptionAppId, InAppSubscriptionImportSubscriptionParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/in_app_subscriptions/{in-app-subscription-app-id}/import_subscription", @@ -185,7 +191,7 @@ Response importSubscriptionRaw( * raw Response. */ Response importSubscriptionRaw(String inAppSubscriptionAppId, String jsonPayload) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/in_app_subscriptions/{in-app-subscription-app-id}/import_subscription", @@ -196,14 +202,14 @@ Response importSubscriptionRaw(String inAppSubscriptionAppId, String jsonPayload public InAppSubscriptionImportSubscriptionResponse importSubscription( String inAppSubscriptionAppId, InAppSubscriptionImportSubscriptionParams params) - throws Exception { + throws ChargebeeException { Response response = importSubscriptionRaw(inAppSubscriptionAppId, params); return InAppSubscriptionImportSubscriptionResponse.fromJson( response.getBodyAsString(), response); } /** processReceipt a inAppSubscription (executes immediately) - returns raw Response. */ - Response processReceiptRaw(String inAppSubscriptionAppId) throws Exception { + Response processReceiptRaw(String inAppSubscriptionAppId) throws ChargebeeException { String path = buildPathWithParams( "/in_app_subscriptions/{in-app-subscription-app-id}/process_purchase_command", @@ -219,7 +225,7 @@ Response processReceiptRaw(String inAppSubscriptionAppId) throws Exception { */ Response processReceiptRaw( String inAppSubscriptionAppId, InAppSubscriptionProcessReceiptParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/in_app_subscriptions/{in-app-subscription-app-id}/process_purchase_command", @@ -232,7 +238,8 @@ Response processReceiptRaw( * processReceipt a inAppSubscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response processReceiptRaw(String inAppSubscriptionAppId, String jsonPayload) throws Exception { + Response processReceiptRaw(String inAppSubscriptionAppId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/in_app_subscriptions/{in-app-subscription-app-id}/process_purchase_command", @@ -243,7 +250,7 @@ Response processReceiptRaw(String inAppSubscriptionAppId, String jsonPayload) th public InAppSubscriptionProcessReceiptResponse processReceipt( String inAppSubscriptionAppId, InAppSubscriptionProcessReceiptParams params) - throws Exception { + throws ChargebeeException { Response response = processReceiptRaw(inAppSubscriptionAppId, params); return InAppSubscriptionProcessReceiptResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/services/InvoiceService.java b/src/main/java/com/chargebee/v4/services/InvoiceService.java new file mode 100644 index 00000000..ad4d2284 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/InvoiceService.java @@ -0,0 +1,1364 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.invoice.params.InvoiceDeleteLineItemsParams; + +import com.chargebee.v4.models.invoice.params.InvoiceRemoveCreditNoteParams; + +import com.chargebee.v4.models.invoice.params.InvoiceRemovePaymentParams; + +import com.chargebee.v4.models.invoice.params.InvoiceStopDunningParams; + +import com.chargebee.v4.models.invoice.params.InvoiceApplyPaymentsParams; + +import com.chargebee.v4.models.invoice.params.InvoiceApplyPaymentScheduleSchemeParams; + +import com.chargebee.v4.models.invoice.params.VoidInvoiceParams; + +import com.chargebee.v4.models.invoice.params.InvoiceAddChargeParams; + +import com.chargebee.v4.models.invoice.params.InvoiceWriteOffParams; + +import com.chargebee.v4.models.invoice.params.InvoiceAddChargeItemParams; + +import com.chargebee.v4.models.invoice.params.InvoicePauseDunningParams; + +import com.chargebee.v4.models.invoice.params.InvoiceListParams; + +import com.chargebee.v4.models.invoice.params.InvoiceCreateParams; + +import com.chargebee.v4.models.invoice.params.InvoiceCloseParams; + +import com.chargebee.v4.models.invoice.params.InvoiceApplyCreditsParams; + +import com.chargebee.v4.models.invoice.params.InvoiceRetrieveParams; + +import com.chargebee.v4.models.invoice.params.InvoiceCreateForChargeItemParams; + +import com.chargebee.v4.models.invoice.params.InvoiceCreateForChargeItemsAndChargesParams; + +import com.chargebee.v4.models.invoice.params.InvoiceDeleteImportedParams; + +import com.chargebee.v4.models.invoice.params.InvoiceUpdateDetailsParams; + +import com.chargebee.v4.models.invoice.params.InvoicesForCustomerParams; + +import com.chargebee.v4.models.invoice.params.InvoiceRecordPaymentParams; + +import com.chargebee.v4.models.invoice.params.InvoiceDeleteParams; + +import com.chargebee.v4.models.invoice.params.ImportInvoiceParams; + +import com.chargebee.v4.models.invoice.params.InvoiceResumeDunningParams; + +import com.chargebee.v4.models.invoice.params.InvoiceRecordTaxWithheldParams; + +import com.chargebee.v4.models.invoice.params.InvoiceRemoveTaxWithheldParams; + +import com.chargebee.v4.models.invoice.params.InvoiceListPaymentReferenceNumbersParams; + +import com.chargebee.v4.models.invoice.params.InvoiceCollectPaymentParams; + +import com.chargebee.v4.models.invoice.params.InvoiceRefundParams; + +import com.chargebee.v4.models.invoice.params.InvoiceRecordRefundParams; + +import com.chargebee.v4.models.invoice.params.InvoicePdfParams; + +import com.chargebee.v4.models.invoice.params.InvoicesForSubscriptionParams; + +import com.chargebee.v4.models.invoice.params.InvoiceChargeAddonParams; + +import com.chargebee.v4.models.invoice.params.InvoiceAddAddonChargeParams; + +import com.chargebee.v4.models.invoice.params.InvoiceChargeParams; + +import com.chargebee.v4.models.invoice.responses.InvoiceDeleteLineItemsResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceRemoveCreditNoteResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceRemovePaymentResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceStopDunningResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceApplyPaymentsResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceApplyPaymentScheduleSchemeResponse; + +import com.chargebee.v4.models.invoice.responses.VoidInvoiceResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceAddChargeResponse; + +import com.chargebee.v4.models.invoice.responses.SendEinvoiceResponse; + +import com.chargebee.v4.models.invoice.responses.InvoicePaymentSchedulesResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceWriteOffResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceAddChargeItemResponse; + +import com.chargebee.v4.models.invoice.responses.InvoicePauseDunningResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceListResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceCreateResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceCloseResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceApplyCreditsResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceRetrieveResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceCreateForChargeItemResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceCreateForChargeItemsAndChargesResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceDeleteImportedResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceUpdateDetailsResponse; + +import com.chargebee.v4.models.invoice.responses.InvoicesForCustomerResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceRecordPaymentResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceDeleteResponse; + +import com.chargebee.v4.models.invoice.responses.ImportInvoiceResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceResumeDunningResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceRecordTaxWithheldResponse; + +import com.chargebee.v4.models.invoice.responses.ResendEinvoiceResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceRemoveTaxWithheldResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceListPaymentReferenceNumbersResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceCollectPaymentResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceSyncUsagesResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceRefundResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceRecordRefundResponse; + +import com.chargebee.v4.models.invoice.responses.InvoicePdfResponse; + +import com.chargebee.v4.models.invoice.responses.InvoicesForSubscriptionResponse; + +import com.chargebee.v4.models.invoice.responses.DownloadEinvoiceResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceChargeAddonResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceAddAddonChargeResponse; + +import com.chargebee.v4.models.invoice.responses.InvoiceChargeResponse; + +public final class InvoiceService extends BaseService { + + private final ServiceConfig config; + + public InvoiceService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private InvoiceService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private InvoiceService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + InvoiceService with(RequestOptions newOptions) { + return new InvoiceService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public InvoiceService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** deleteLineItems a invoice (executes immediately) - returns raw Response. */ + Response deleteLineItemsRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/delete_line_items", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * deleteLineItems a invoice using immutable params (executes immediately) - returns raw Response. + */ + Response deleteLineItemsRaw(String invoiceId, InvoiceDeleteLineItemsParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/delete_line_items", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * deleteLineItems a invoice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response deleteLineItemsRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/delete_line_items", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceDeleteLineItemsResponse deleteLineItems( + String invoiceId, InvoiceDeleteLineItemsParams params) throws ChargebeeException { + Response response = deleteLineItemsRaw(invoiceId, params); + return InvoiceDeleteLineItemsResponse.fromJson(response.getBodyAsString(), response); + } + + /** removeCreditNote a invoice (executes immediately) - returns raw Response. */ + Response removeCreditNoteRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/remove_credit_note", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * removeCreditNote a invoice using immutable params (executes immediately) - returns raw + * Response. + */ + Response removeCreditNoteRaw(String invoiceId, InvoiceRemoveCreditNoteParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/remove_credit_note", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * removeCreditNote a invoice using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response removeCreditNoteRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/remove_credit_note", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceRemoveCreditNoteResponse removeCreditNote( + String invoiceId, InvoiceRemoveCreditNoteParams params) throws ChargebeeException { + Response response = removeCreditNoteRaw(invoiceId, params); + return InvoiceRemoveCreditNoteResponse.fromJson(response.getBodyAsString(), response); + } + + /** removePayment a invoice (executes immediately) - returns raw Response. */ + Response removePaymentRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/remove_payment", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * removePayment a invoice using immutable params (executes immediately) - returns raw Response. + */ + Response removePaymentRaw(String invoiceId, InvoiceRemovePaymentParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/remove_payment", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * removePayment a invoice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response removePaymentRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/remove_payment", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceRemovePaymentResponse removePayment( + String invoiceId, InvoiceRemovePaymentParams params) throws ChargebeeException { + Response response = removePaymentRaw(invoiceId, params); + return InvoiceRemovePaymentResponse.fromJson(response.getBodyAsString(), response); + } + + /** stopDunning a invoice (executes immediately) - returns raw Response. */ + Response stopDunningRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/stop_dunning", "invoice-id", invoiceId); + + return post(path, null); + } + + /** stopDunning a invoice using immutable params (executes immediately) - returns raw Response. */ + Response stopDunningRaw(String invoiceId, InvoiceStopDunningParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/stop_dunning", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** stopDunning a invoice using raw JSON payload (executes immediately) - returns raw Response. */ + Response stopDunningRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/stop_dunning", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceStopDunningResponse stopDunning(String invoiceId, InvoiceStopDunningParams params) + throws ChargebeeException { + Response response = stopDunningRaw(invoiceId, params); + return InvoiceStopDunningResponse.fromJson(response.getBodyAsString(), response); + } + + /** applyPayments a invoice (executes immediately) - returns raw Response. */ + Response applyPaymentsRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/apply_payments", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * applyPayments a invoice using immutable params (executes immediately) - returns raw Response. + */ + Response applyPaymentsRaw(String invoiceId, InvoiceApplyPaymentsParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/apply_payments", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * applyPayments a invoice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response applyPaymentsRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/apply_payments", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceApplyPaymentsResponse applyPayments( + String invoiceId, InvoiceApplyPaymentsParams params) throws ChargebeeException { + Response response = applyPaymentsRaw(invoiceId, params); + return InvoiceApplyPaymentsResponse.fromJson(response.getBodyAsString(), response); + } + + /** applyPaymentScheduleScheme a invoice (executes immediately) - returns raw Response. */ + Response applyPaymentScheduleSchemeRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/invoices/{invoice-id}/apply_payment_schedule_scheme", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * applyPaymentScheduleScheme a invoice using immutable params (executes immediately) - returns + * raw Response. + */ + Response applyPaymentScheduleSchemeRaw( + String invoiceId, InvoiceApplyPaymentScheduleSchemeParams params) throws ChargebeeException { + String path = + buildPathWithParams( + "/invoices/{invoice-id}/apply_payment_schedule_scheme", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * applyPaymentScheduleScheme a invoice using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response applyPaymentScheduleSchemeRaw(String invoiceId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/invoices/{invoice-id}/apply_payment_schedule_scheme", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceApplyPaymentScheduleSchemeResponse applyPaymentScheduleScheme( + String invoiceId, InvoiceApplyPaymentScheduleSchemeParams params) throws ChargebeeException { + Response response = applyPaymentScheduleSchemeRaw(invoiceId, params); + return InvoiceApplyPaymentScheduleSchemeResponse.fromJson(response.getBodyAsString(), response); + } + + /** voidInvoice a invoice (executes immediately) - returns raw Response. */ + Response voidInvoiceRaw(String invoiceId) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/void", "invoice-id", invoiceId); + + return post(path, null); + } + + /** voidInvoice a invoice using immutable params (executes immediately) - returns raw Response. */ + Response voidInvoiceRaw(String invoiceId, VoidInvoiceParams params) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/void", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** voidInvoice a invoice using raw JSON payload (executes immediately) - returns raw Response. */ + Response voidInvoiceRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/void", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public VoidInvoiceResponse voidInvoice(String invoiceId, VoidInvoiceParams params) + throws ChargebeeException { + Response response = voidInvoiceRaw(invoiceId, params); + return VoidInvoiceResponse.fromJson(response.getBodyAsString(), response); + } + + /** addCharge a invoice (executes immediately) - returns raw Response. */ + Response addChargeRaw(String invoiceId) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/add_charge", "invoice-id", invoiceId); + + return post(path, null); + } + + /** addCharge a invoice using immutable params (executes immediately) - returns raw Response. */ + Response addChargeRaw(String invoiceId, InvoiceAddChargeParams params) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/add_charge", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** addCharge a invoice using raw JSON payload (executes immediately) - returns raw Response. */ + Response addChargeRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/add_charge", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceAddChargeResponse addCharge(String invoiceId, InvoiceAddChargeParams params) + throws ChargebeeException { + Response response = addChargeRaw(invoiceId, params); + return InvoiceAddChargeResponse.fromJson(response.getBodyAsString(), response); + } + + /** sendEinvoice a invoice (executes immediately) - returns raw Response. */ + Response sendEinvoiceRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/send_einvoice", "invoice-id", invoiceId); + + return post(path, null); + } + + public SendEinvoiceResponse sendEinvoice(String invoiceId) throws ChargebeeException { + Response response = sendEinvoiceRaw(invoiceId); + return SendEinvoiceResponse.fromJson(response.getBodyAsString(), response); + } + + /** paymentSchedules a invoice (executes immediately) - returns raw Response. */ + Response paymentSchedulesRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/payment_schedules", "invoice-id", invoiceId); + + return get(path, null); + } + + public InvoicePaymentSchedulesResponse paymentSchedules(String invoiceId) + throws ChargebeeException { + Response response = paymentSchedulesRaw(invoiceId); + return InvoicePaymentSchedulesResponse.fromJson(response.getBodyAsString(), response); + } + + /** writeOff a invoice (executes immediately) - returns raw Response. */ + Response writeOffRaw(String invoiceId) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/write_off", "invoice-id", invoiceId); + + return post(path, null); + } + + /** writeOff a invoice using immutable params (executes immediately) - returns raw Response. */ + Response writeOffRaw(String invoiceId, InvoiceWriteOffParams params) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/write_off", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** writeOff a invoice using raw JSON payload (executes immediately) - returns raw Response. */ + Response writeOffRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/write_off", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceWriteOffResponse writeOff(String invoiceId, InvoiceWriteOffParams params) + throws ChargebeeException { + Response response = writeOffRaw(invoiceId, params); + return InvoiceWriteOffResponse.fromJson(response.getBodyAsString(), response); + } + + /** addChargeItem a invoice (executes immediately) - returns raw Response. */ + Response addChargeItemRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/add_charge_item", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * addChargeItem a invoice using immutable params (executes immediately) - returns raw Response. + */ + Response addChargeItemRaw(String invoiceId, InvoiceAddChargeItemParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/add_charge_item", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * addChargeItem a invoice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response addChargeItemRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/add_charge_item", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceAddChargeItemResponse addChargeItem( + String invoiceId, InvoiceAddChargeItemParams params) throws ChargebeeException { + Response response = addChargeItemRaw(invoiceId, params); + return InvoiceAddChargeItemResponse.fromJson(response.getBodyAsString(), response); + } + + /** pauseDunning a invoice (executes immediately) - returns raw Response. */ + Response pauseDunningRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/pause_dunning", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * pauseDunning a invoice using immutable params (executes immediately) - returns raw Response. + */ + Response pauseDunningRaw(String invoiceId, InvoicePauseDunningParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/pause_dunning", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * pauseDunning a invoice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response pauseDunningRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/pause_dunning", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoicePauseDunningResponse pauseDunning( + String invoiceId, InvoicePauseDunningParams params) throws ChargebeeException { + Response response = pauseDunningRaw(invoiceId, params); + return InvoicePauseDunningResponse.fromJson(response.getBodyAsString(), response); + } + + /** list a invoice using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(InvoiceListParams params) throws ChargebeeException { + + return get("/invoices", params != null ? params.toQueryParams() : null); + } + + /** list a invoice without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/invoices", null); + } + + /** list a invoice using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public InvoiceListResponse list(InvoiceListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return InvoiceListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public InvoiceListResponse list() throws ChargebeeException { + Response response = listRaw(); + return InvoiceListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** create a invoice using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(InvoiceCreateParams params) throws ChargebeeException { + + return post("/invoices", params != null ? params.toFormData() : null); + } + + /** create a invoice using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/invoices", jsonPayload); + } + + public InvoiceCreateResponse create(InvoiceCreateParams params) throws ChargebeeException { + Response response = createRaw(params); + + return InvoiceCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** close a invoice (executes immediately) - returns raw Response. */ + Response closeRaw(String invoiceId) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/close", "invoice-id", invoiceId); + + return post(path, null); + } + + /** close a invoice using immutable params (executes immediately) - returns raw Response. */ + Response closeRaw(String invoiceId, InvoiceCloseParams params) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/close", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** close a invoice using raw JSON payload (executes immediately) - returns raw Response. */ + Response closeRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/close", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceCloseResponse close(String invoiceId, InvoiceCloseParams params) + throws ChargebeeException { + Response response = closeRaw(invoiceId, params); + return InvoiceCloseResponse.fromJson(response.getBodyAsString(), response); + } + + /** applyCredits a invoice (executes immediately) - returns raw Response. */ + Response applyCreditsRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/apply_credits", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * applyCredits a invoice using immutable params (executes immediately) - returns raw Response. + */ + Response applyCreditsRaw(String invoiceId, InvoiceApplyCreditsParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/apply_credits", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * applyCredits a invoice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response applyCreditsRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/apply_credits", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceApplyCreditsResponse applyCredits( + String invoiceId, InvoiceApplyCreditsParams params) throws ChargebeeException { + Response response = applyCreditsRaw(invoiceId, params); + return InvoiceApplyCreditsResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a invoice (executes immediately) - returns raw Response. */ + Response retrieveRaw(String invoiceId) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}", "invoice-id", invoiceId); + + return get(path, null); + } + + /** retrieve a invoice using immutable params (executes immediately) - returns raw Response. */ + Response retrieveRaw(String invoiceId, InvoiceRetrieveParams params) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}", "invoice-id", invoiceId); + return get(path, params != null ? params.toQueryParams() : null); + } + + public InvoiceRetrieveResponse retrieve(String invoiceId, InvoiceRetrieveParams params) + throws ChargebeeException { + Response response = retrieveRaw(invoiceId, params); + return InvoiceRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + public InvoiceRetrieveResponse retrieve(String invoiceId) throws ChargebeeException { + Response response = retrieveRaw(invoiceId); + return InvoiceRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createForChargeItem a invoice using immutable params (executes immediately) - returns raw + * Response. + */ + Response createForChargeItemRaw(InvoiceCreateForChargeItemParams params) + throws ChargebeeException { + + return post("/invoices/create_for_charge_item", params != null ? params.toFormData() : null); + } + + /** + * createForChargeItem a invoice using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response createForChargeItemRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/invoices/create_for_charge_item", jsonPayload); + } + + public InvoiceCreateForChargeItemResponse createForChargeItem( + InvoiceCreateForChargeItemParams params) throws ChargebeeException { + Response response = createForChargeItemRaw(params); + + return InvoiceCreateForChargeItemResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createForChargeItemsAndCharges a invoice using immutable params (executes immediately) - + * returns raw Response. + */ + Response createForChargeItemsAndChargesRaw(InvoiceCreateForChargeItemsAndChargesParams params) + throws ChargebeeException { + + return post( + "/invoices/create_for_charge_items_and_charges", + params != null ? params.toFormData() : null); + } + + /** + * createForChargeItemsAndCharges a invoice using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response createForChargeItemsAndChargesRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/invoices/create_for_charge_items_and_charges", jsonPayload); + } + + public InvoiceCreateForChargeItemsAndChargesResponse createForChargeItemsAndCharges( + InvoiceCreateForChargeItemsAndChargesParams params) throws ChargebeeException { + Response response = createForChargeItemsAndChargesRaw(params); + + return InvoiceCreateForChargeItemsAndChargesResponse.fromJson( + response.getBodyAsString(), response); + } + + /** deleteImported a invoice (executes immediately) - returns raw Response. */ + Response deleteImportedRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/delete_imported", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * deleteImported a invoice using immutable params (executes immediately) - returns raw Response. + */ + Response deleteImportedRaw(String invoiceId, InvoiceDeleteImportedParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/delete_imported", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * deleteImported a invoice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response deleteImportedRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/delete_imported", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceDeleteImportedResponse deleteImported( + String invoiceId, InvoiceDeleteImportedParams params) throws ChargebeeException { + Response response = deleteImportedRaw(invoiceId, params); + return InvoiceDeleteImportedResponse.fromJson(response.getBodyAsString(), response); + } + + /** updateDetails a invoice (executes immediately) - returns raw Response. */ + Response updateDetailsRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/update_details", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * updateDetails a invoice using immutable params (executes immediately) - returns raw Response. + */ + Response updateDetailsRaw(String invoiceId, InvoiceUpdateDetailsParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/update_details", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * updateDetails a invoice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response updateDetailsRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/update_details", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceUpdateDetailsResponse updateDetails( + String invoiceId, InvoiceUpdateDetailsParams params) throws ChargebeeException { + Response response = updateDetailsRaw(invoiceId, params); + return InvoiceUpdateDetailsResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * invoicesForCustomer a invoice using immutable params (executes immediately) - returns raw + * Response. + */ + Response invoicesForCustomerRaw(String customerId, InvoicesForCustomerParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/invoices", "customer-id", customerId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** invoicesForCustomer a invoice without params (executes immediately) - returns raw Response. */ + Response invoicesForCustomerRaw(String customerId) throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/invoices", "customer-id", customerId); + return get(path, null); + } + + /** + * invoicesForCustomer a invoice using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response invoicesForCustomerRaw(String customerId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/invoices", "customer-id", customerId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public InvoicesForCustomerResponse invoicesForCustomer( + String customerId, InvoicesForCustomerParams params) throws ChargebeeException { + Response response = invoicesForCustomerRaw(customerId, params); + return InvoicesForCustomerResponse.fromJson( + response.getBodyAsString(), this, params, customerId, response); + } + + public InvoicesForCustomerResponse invoicesForCustomer(String customerId) + throws ChargebeeException { + Response response = invoicesForCustomerRaw(customerId); + return InvoicesForCustomerResponse.fromJson( + response.getBodyAsString(), this, null, customerId, response); + } + + /** recordPayment a invoice (executes immediately) - returns raw Response. */ + Response recordPaymentRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/record_payment", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * recordPayment a invoice using immutable params (executes immediately) - returns raw Response. + */ + Response recordPaymentRaw(String invoiceId, InvoiceRecordPaymentParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/record_payment", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * recordPayment a invoice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response recordPaymentRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/record_payment", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceRecordPaymentResponse recordPayment( + String invoiceId, InvoiceRecordPaymentParams params) throws ChargebeeException { + Response response = recordPaymentRaw(invoiceId, params); + return InvoiceRecordPaymentResponse.fromJson(response.getBodyAsString(), response); + } + + /** delete a invoice (executes immediately) - returns raw Response. */ + Response deleteRaw(String invoiceId) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/delete", "invoice-id", invoiceId); + + return post(path, null); + } + + /** delete a invoice using immutable params (executes immediately) - returns raw Response. */ + Response deleteRaw(String invoiceId, InvoiceDeleteParams params) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/delete", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** delete a invoice using raw JSON payload (executes immediately) - returns raw Response. */ + Response deleteRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/delete", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceDeleteResponse delete(String invoiceId, InvoiceDeleteParams params) + throws ChargebeeException { + Response response = deleteRaw(invoiceId, params); + return InvoiceDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * importInvoice a invoice using immutable params (executes immediately) - returns raw Response. + */ + Response importInvoiceRaw(ImportInvoiceParams params) throws ChargebeeException { + + return post("/invoices/import_invoice", params != null ? params.toFormData() : null); + } + + /** + * importInvoice a invoice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response importInvoiceRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/invoices/import_invoice", jsonPayload); + } + + public ImportInvoiceResponse importInvoice(ImportInvoiceParams params) throws ChargebeeException { + Response response = importInvoiceRaw(params); + + return ImportInvoiceResponse.fromJson(response.getBodyAsString(), response); + } + + /** resumeDunning a invoice (executes immediately) - returns raw Response. */ + Response resumeDunningRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/resume_dunning", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * resumeDunning a invoice using immutable params (executes immediately) - returns raw Response. + */ + Response resumeDunningRaw(String invoiceId, InvoiceResumeDunningParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/resume_dunning", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * resumeDunning a invoice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response resumeDunningRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/resume_dunning", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceResumeDunningResponse resumeDunning( + String invoiceId, InvoiceResumeDunningParams params) throws ChargebeeException { + Response response = resumeDunningRaw(invoiceId, params); + return InvoiceResumeDunningResponse.fromJson(response.getBodyAsString(), response); + } + + /** recordTaxWithheld a invoice (executes immediately) - returns raw Response. */ + Response recordTaxWithheldRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/record_tax_withheld", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * recordTaxWithheld a invoice using immutable params (executes immediately) - returns raw + * Response. + */ + Response recordTaxWithheldRaw(String invoiceId, InvoiceRecordTaxWithheldParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/record_tax_withheld", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * recordTaxWithheld a invoice using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response recordTaxWithheldRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/record_tax_withheld", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceRecordTaxWithheldResponse recordTaxWithheld( + String invoiceId, InvoiceRecordTaxWithheldParams params) throws ChargebeeException { + Response response = recordTaxWithheldRaw(invoiceId, params); + return InvoiceRecordTaxWithheldResponse.fromJson(response.getBodyAsString(), response); + } + + /** resendEinvoice a invoice (executes immediately) - returns raw Response. */ + Response resendEinvoiceRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/resend_einvoice", "invoice-id", invoiceId); + + return post(path, null); + } + + public ResendEinvoiceResponse resendEinvoice(String invoiceId) throws ChargebeeException { + Response response = resendEinvoiceRaw(invoiceId); + return ResendEinvoiceResponse.fromJson(response.getBodyAsString(), response); + } + + /** removeTaxWithheld a invoice (executes immediately) - returns raw Response. */ + Response removeTaxWithheldRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/remove_tax_withheld", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * removeTaxWithheld a invoice using immutable params (executes immediately) - returns raw + * Response. + */ + Response removeTaxWithheldRaw(String invoiceId, InvoiceRemoveTaxWithheldParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/remove_tax_withheld", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * removeTaxWithheld a invoice using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response removeTaxWithheldRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/remove_tax_withheld", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceRemoveTaxWithheldResponse removeTaxWithheld( + String invoiceId, InvoiceRemoveTaxWithheldParams params) throws ChargebeeException { + Response response = removeTaxWithheldRaw(invoiceId, params); + return InvoiceRemoveTaxWithheldResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * listPaymentReferenceNumbers a invoice using immutable params (executes immediately) - returns + * raw Response. + */ + Response listPaymentReferenceNumbersRaw(InvoiceListPaymentReferenceNumbersParams params) + throws ChargebeeException { + + return get( + "/invoices/payment_reference_numbers", params != null ? params.toQueryParams() : null); + } + + /** + * listPaymentReferenceNumbers a invoice without params (executes immediately) - returns raw + * Response. + */ + Response listPaymentReferenceNumbersRaw() throws ChargebeeException { + + return get("/invoices/payment_reference_numbers", null); + } + + /** + * listPaymentReferenceNumbers a invoice using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response listPaymentReferenceNumbersRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public InvoiceListPaymentReferenceNumbersResponse listPaymentReferenceNumbers( + InvoiceListPaymentReferenceNumbersParams params) throws ChargebeeException { + Response response = listPaymentReferenceNumbersRaw(params); + + return InvoiceListPaymentReferenceNumbersResponse.fromJson( + response.getBodyAsString(), this, params, response); + } + + public InvoiceListPaymentReferenceNumbersResponse listPaymentReferenceNumbers() + throws ChargebeeException { + Response response = listPaymentReferenceNumbersRaw(); + return InvoiceListPaymentReferenceNumbersResponse.fromJson( + response.getBodyAsString(), this, null, response); + } + + /** collectPayment a invoice (executes immediately) - returns raw Response. */ + Response collectPaymentRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/collect_payment", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * collectPayment a invoice using immutable params (executes immediately) - returns raw Response. + */ + Response collectPaymentRaw(String invoiceId, InvoiceCollectPaymentParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/collect_payment", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * collectPayment a invoice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response collectPaymentRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/collect_payment", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceCollectPaymentResponse collectPayment( + String invoiceId, InvoiceCollectPaymentParams params) throws ChargebeeException { + Response response = collectPaymentRaw(invoiceId, params); + return InvoiceCollectPaymentResponse.fromJson(response.getBodyAsString(), response); + } + + /** syncUsages a invoice (executes immediately) - returns raw Response. */ + Response syncUsagesRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/sync_usages", "invoice-id", invoiceId); + + return post(path, null); + } + + public InvoiceSyncUsagesResponse syncUsages(String invoiceId) throws ChargebeeException { + Response response = syncUsagesRaw(invoiceId); + return InvoiceSyncUsagesResponse.fromJson(response.getBodyAsString(), response); + } + + /** refund a invoice (executes immediately) - returns raw Response. */ + Response refundRaw(String invoiceId) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/refund", "invoice-id", invoiceId); + + return post(path, null); + } + + /** refund a invoice using immutable params (executes immediately) - returns raw Response. */ + Response refundRaw(String invoiceId, InvoiceRefundParams params) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/refund", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** refund a invoice using raw JSON payload (executes immediately) - returns raw Response. */ + Response refundRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/refund", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceRefundResponse refund(String invoiceId, InvoiceRefundParams params) + throws ChargebeeException { + Response response = refundRaw(invoiceId, params); + return InvoiceRefundResponse.fromJson(response.getBodyAsString(), response); + } + + /** recordRefund a invoice (executes immediately) - returns raw Response. */ + Response recordRefundRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/record_refund", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * recordRefund a invoice using immutable params (executes immediately) - returns raw Response. + */ + Response recordRefundRaw(String invoiceId, InvoiceRecordRefundParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/record_refund", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * recordRefund a invoice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response recordRefundRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/record_refund", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceRecordRefundResponse recordRefund( + String invoiceId, InvoiceRecordRefundParams params) throws ChargebeeException { + Response response = recordRefundRaw(invoiceId, params); + return InvoiceRecordRefundResponse.fromJson(response.getBodyAsString(), response); + } + + /** pdf a invoice (executes immediately) - returns raw Response. */ + Response pdfRaw(String invoiceId) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/pdf", "invoice-id", invoiceId); + + return post(path, null); + } + + /** pdf a invoice using immutable params (executes immediately) - returns raw Response. */ + Response pdfRaw(String invoiceId, InvoicePdfParams params) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/pdf", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** pdf a invoice using raw JSON payload (executes immediately) - returns raw Response. */ + Response pdfRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/pdf", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoicePdfResponse pdf(String invoiceId, InvoicePdfParams params) + throws ChargebeeException { + Response response = pdfRaw(invoiceId, params); + return InvoicePdfResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * invoicesForSubscription a invoice using immutable params (executes immediately) - returns raw + * Response. + */ + Response invoicesForSubscriptionRaw(String subscriptionId, InvoicesForSubscriptionParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/invoices", "subscription-id", subscriptionId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * invoicesForSubscription a invoice without params (executes immediately) - returns raw Response. + */ + Response invoicesForSubscriptionRaw(String subscriptionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/invoices", "subscription-id", subscriptionId); + return get(path, null); + } + + /** + * invoicesForSubscription a invoice using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response invoicesForSubscriptionRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/invoices", "subscription-id", subscriptionId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public InvoicesForSubscriptionResponse invoicesForSubscription( + String subscriptionId, InvoicesForSubscriptionParams params) throws ChargebeeException { + Response response = invoicesForSubscriptionRaw(subscriptionId, params); + return InvoicesForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, params, subscriptionId, response); + } + + public InvoicesForSubscriptionResponse invoicesForSubscription(String subscriptionId) + throws ChargebeeException { + Response response = invoicesForSubscriptionRaw(subscriptionId); + return InvoicesForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, null, subscriptionId, response); + } + + /** downloadEinvoice a invoice (executes immediately) - returns raw Response. */ + Response downloadEinvoiceRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/download_einvoice", "invoice-id", invoiceId); + + return get(path, null); + } + + public DownloadEinvoiceResponse downloadEinvoice(String invoiceId) throws ChargebeeException { + Response response = downloadEinvoiceRaw(invoiceId); + return DownloadEinvoiceResponse.fromJson(response.getBodyAsString(), response); + } + + /** chargeAddon a invoice using immutable params (executes immediately) - returns raw Response. */ + Response chargeAddonRaw(InvoiceChargeAddonParams params) throws ChargebeeException { + + return post("/invoices/charge_addon", params != null ? params.toFormData() : null); + } + + /** chargeAddon a invoice using raw JSON payload (executes immediately) - returns raw Response. */ + Response chargeAddonRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/invoices/charge_addon", jsonPayload); + } + + public InvoiceChargeAddonResponse chargeAddon(InvoiceChargeAddonParams params) + throws ChargebeeException { + Response response = chargeAddonRaw(params); + + return InvoiceChargeAddonResponse.fromJson(response.getBodyAsString(), response); + } + + /** addAddonCharge a invoice (executes immediately) - returns raw Response. */ + Response addAddonChargeRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/add_addon_charge", "invoice-id", invoiceId); + + return post(path, null); + } + + /** + * addAddonCharge a invoice using immutable params (executes immediately) - returns raw Response. + */ + Response addAddonChargeRaw(String invoiceId, InvoiceAddAddonChargeParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/add_addon_charge", "invoice-id", invoiceId); + return post(path, params.toFormData()); + } + + /** + * addAddonCharge a invoice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response addAddonChargeRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/add_addon_charge", "invoice-id", invoiceId); + return postJson(path, jsonPayload); + } + + public InvoiceAddAddonChargeResponse addAddonCharge( + String invoiceId, InvoiceAddAddonChargeParams params) throws ChargebeeException { + Response response = addAddonChargeRaw(invoiceId, params); + return InvoiceAddAddonChargeResponse.fromJson(response.getBodyAsString(), response); + } + + /** charge a invoice using immutable params (executes immediately) - returns raw Response. */ + Response chargeRaw(InvoiceChargeParams params) throws ChargebeeException { + + return post("/invoices/charge", params != null ? params.toFormData() : null); + } + + /** charge a invoice using raw JSON payload (executes immediately) - returns raw Response. */ + Response chargeRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/invoices/charge", jsonPayload); + } + + public InvoiceChargeResponse charge(InvoiceChargeParams params) throws ChargebeeException { + Response response = chargeRaw(params); + + return InvoiceChargeResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/services/ItemEntitlementService.java b/src/main/java/com/chargebee/v4/services/ItemEntitlementService.java new file mode 100644 index 00000000..c832d093 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/ItemEntitlementService.java @@ -0,0 +1,225 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.itemEntitlement.params.ItemEntitlementsForFeatureParams; + +import com.chargebee.v4.models.itemEntitlement.params.AddItemEntitlementsParams; + +import com.chargebee.v4.models.itemEntitlement.params.ItemEntitlementsForItemParams; + +import com.chargebee.v4.models.itemEntitlement.params.UpsertOrRemoveItemEntitlementsForItemParams; + +import com.chargebee.v4.models.itemEntitlement.responses.ItemEntitlementsForFeatureResponse; + +import com.chargebee.v4.models.itemEntitlement.responses.AddItemEntitlementsResponse; + +import com.chargebee.v4.models.itemEntitlement.responses.ItemEntitlementsForItemResponse; + +import com.chargebee.v4.models.itemEntitlement.responses.UpsertOrRemoveItemEntitlementsForItemResponse; + +public final class ItemEntitlementService extends BaseService { + + private final ServiceConfig config; + + public ItemEntitlementService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private ItemEntitlementService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private ItemEntitlementService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + ItemEntitlementService with(RequestOptions newOptions) { + return new ItemEntitlementService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public ItemEntitlementService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * itemEntitlementsForFeature a itemEntitlement using immutable params (executes immediately) - + * returns raw Response. + */ + Response itemEntitlementsForFeatureRaw(String featureId, ItemEntitlementsForFeatureParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/features/{feature-id}/item_entitlements", "feature-id", featureId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * itemEntitlementsForFeature a itemEntitlement without params (executes immediately) - returns + * raw Response. + */ + Response itemEntitlementsForFeatureRaw(String featureId) throws ChargebeeException { + String path = + buildPathWithParams("/features/{feature-id}/item_entitlements", "feature-id", featureId); + return get(path, null); + } + + /** + * itemEntitlementsForFeature a itemEntitlement using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response itemEntitlementsForFeatureRaw(String featureId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams("/features/{feature-id}/item_entitlements", "feature-id", featureId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ItemEntitlementsForFeatureResponse itemEntitlementsForFeature( + String featureId, ItemEntitlementsForFeatureParams params) throws ChargebeeException { + Response response = itemEntitlementsForFeatureRaw(featureId, params); + return ItemEntitlementsForFeatureResponse.fromJson( + response.getBodyAsString(), this, params, featureId, response); + } + + public ItemEntitlementsForFeatureResponse itemEntitlementsForFeature(String featureId) + throws ChargebeeException { + Response response = itemEntitlementsForFeatureRaw(featureId); + return ItemEntitlementsForFeatureResponse.fromJson( + response.getBodyAsString(), this, null, featureId, response); + } + + /** addItemEntitlements a itemEntitlement (executes immediately) - returns raw Response. */ + Response addItemEntitlementsRaw(String featureId) throws ChargebeeException { + String path = + buildPathWithParams("/features/{feature-id}/item_entitlements", "feature-id", featureId); + + return post(path, null); + } + + /** + * addItemEntitlements a itemEntitlement using immutable params (executes immediately) - returns + * raw Response. + */ + Response addItemEntitlementsRaw(String featureId, AddItemEntitlementsParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/features/{feature-id}/item_entitlements", "feature-id", featureId); + return post(path, params.toFormData()); + } + + /** + * addItemEntitlements a itemEntitlement using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response addItemEntitlementsRaw(String featureId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/features/{feature-id}/item_entitlements", "feature-id", featureId); + return postJson(path, jsonPayload); + } + + public AddItemEntitlementsResponse addItemEntitlements( + String featureId, AddItemEntitlementsParams params) throws ChargebeeException { + Response response = addItemEntitlementsRaw(featureId, params); + return AddItemEntitlementsResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * itemEntitlementsForItem a itemEntitlement using immutable params (executes immediately) - + * returns raw Response. + */ + Response itemEntitlementsForItemRaw(String itemId, ItemEntitlementsForItemParams params) + throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/item_entitlements", "item-id", itemId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * itemEntitlementsForItem a itemEntitlement without params (executes immediately) - returns raw + * Response. + */ + Response itemEntitlementsForItemRaw(String itemId) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/item_entitlements", "item-id", itemId); + return get(path, null); + } + + /** + * itemEntitlementsForItem a itemEntitlement using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response itemEntitlementsForItemRaw(String itemId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/item_entitlements", "item-id", itemId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ItemEntitlementsForItemResponse itemEntitlementsForItem( + String itemId, ItemEntitlementsForItemParams params) throws ChargebeeException { + Response response = itemEntitlementsForItemRaw(itemId, params); + return ItemEntitlementsForItemResponse.fromJson( + response.getBodyAsString(), this, params, itemId, response); + } + + public ItemEntitlementsForItemResponse itemEntitlementsForItem(String itemId) + throws ChargebeeException { + Response response = itemEntitlementsForItemRaw(itemId); + return ItemEntitlementsForItemResponse.fromJson( + response.getBodyAsString(), this, null, itemId, response); + } + + /** + * upsertOrRemoveItemEntitlementsForItem a itemEntitlement (executes immediately) - returns raw + * Response. + */ + Response upsertOrRemoveItemEntitlementsForItemRaw(String itemId) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/item_entitlements", "item-id", itemId); + + return post(path, null); + } + + /** + * upsertOrRemoveItemEntitlementsForItem a itemEntitlement using immutable params (executes + * immediately) - returns raw Response. + */ + Response upsertOrRemoveItemEntitlementsForItemRaw( + String itemId, UpsertOrRemoveItemEntitlementsForItemParams params) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/item_entitlements", "item-id", itemId); + return post(path, params.toFormData()); + } + + /** + * upsertOrRemoveItemEntitlementsForItem a itemEntitlement using raw JSON payload (executes + * immediately) - returns raw Response. + */ + Response upsertOrRemoveItemEntitlementsForItemRaw(String itemId, String jsonPayload) + throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/item_entitlements", "item-id", itemId); + return postJson(path, jsonPayload); + } + + public UpsertOrRemoveItemEntitlementsForItemResponse upsertOrRemoveItemEntitlementsForItem( + String itemId, UpsertOrRemoveItemEntitlementsForItemParams params) throws ChargebeeException { + Response response = upsertOrRemoveItemEntitlementsForItemRaw(itemId, params); + return UpsertOrRemoveItemEntitlementsForItemResponse.fromJson( + response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/ItemFamilyService.java b/src/main/java/com/chargebee/v4/services/ItemFamilyService.java similarity index 75% rename from src/main/java/com/chargebee/v4/core/services/ItemFamilyService.java rename to src/main/java/com/chargebee/v4/services/ItemFamilyService.java index 4b07467d..2cce05e9 100644 --- a/src/main/java/com/chargebee/v4/core/services/ItemFamilyService.java +++ b/src/main/java/com/chargebee/v4/services/ItemFamilyService.java @@ -5,27 +5,28 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.itemFamily.params.ItemFamilyListParams; +import com.chargebee.v4.models.itemFamily.params.ItemFamilyListParams; -import com.chargebee.v4.core.models.itemFamily.params.ItemFamilyCreateParams; +import com.chargebee.v4.models.itemFamily.params.ItemFamilyCreateParams; -import com.chargebee.v4.core.models.itemFamily.params.ItemFamilyUpdateParams; +import com.chargebee.v4.models.itemFamily.params.ItemFamilyUpdateParams; -import com.chargebee.v4.core.responses.itemFamily.ItemFamilyDeleteResponse; +import com.chargebee.v4.models.itemFamily.responses.ItemFamilyDeleteResponse; -import com.chargebee.v4.core.responses.itemFamily.ItemFamilyListResponse; +import com.chargebee.v4.models.itemFamily.responses.ItemFamilyListResponse; -import com.chargebee.v4.core.responses.itemFamily.ItemFamilyCreateResponse; +import com.chargebee.v4.models.itemFamily.responses.ItemFamilyCreateResponse; -import com.chargebee.v4.core.responses.itemFamily.ItemFamilyRetrieveResponse; +import com.chargebee.v4.models.itemFamily.responses.ItemFamilyRetrieveResponse; -import com.chargebee.v4.core.responses.itemFamily.ItemFamilyUpdateResponse; +import com.chargebee.v4.models.itemFamily.responses.ItemFamilyUpdateResponse; public final class ItemFamilyService extends BaseService { @@ -62,7 +63,7 @@ public ItemFamilyService withOptions(RequestOptions options) { // === Operations === /** delete a itemFamily (executes immediately) - returns raw Response. */ - Response deleteRaw(String itemFamilyId) throws Exception { + Response deleteRaw(String itemFamilyId) throws ChargebeeException { String path = buildPathWithParams( "/item_families/{item-family-id}/delete", "item-family-id", itemFamilyId); @@ -70,73 +71,73 @@ Response deleteRaw(String itemFamilyId) throws Exception { return post(path, null); } - public ItemFamilyDeleteResponse delete(String itemFamilyId) throws Exception { + public ItemFamilyDeleteResponse delete(String itemFamilyId) throws ChargebeeException { Response response = deleteRaw(itemFamilyId); return ItemFamilyDeleteResponse.fromJson(response.getBodyAsString(), response); } /** list a itemFamily using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(ItemFamilyListParams params) throws Exception { + Response listRaw(ItemFamilyListParams params) throws ChargebeeException { return get("/item_families", params != null ? params.toQueryParams() : null); } /** list a itemFamily without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/item_families", null); } /** list a itemFamily using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public ItemFamilyListResponse list(ItemFamilyListParams params) throws Exception { + public ItemFamilyListResponse list(ItemFamilyListParams params) throws ChargebeeException { Response response = listRaw(params); return ItemFamilyListResponse.fromJson(response.getBodyAsString(), this, params, response); } - public ItemFamilyListResponse list() throws Exception { + public ItemFamilyListResponse list() throws ChargebeeException { Response response = listRaw(); return ItemFamilyListResponse.fromJson(response.getBodyAsString(), this, null, response); } /** create a itemFamily using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(ItemFamilyCreateParams params) throws Exception { + Response createRaw(ItemFamilyCreateParams params) throws ChargebeeException { return post("/item_families", params != null ? params.toFormData() : null); } /** create a itemFamily using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/item_families", jsonPayload); } - public ItemFamilyCreateResponse create(ItemFamilyCreateParams params) throws Exception { + public ItemFamilyCreateResponse create(ItemFamilyCreateParams params) throws ChargebeeException { Response response = createRaw(params); return ItemFamilyCreateResponse.fromJson(response.getBodyAsString(), response); } /** retrieve a itemFamily (executes immediately) - returns raw Response. */ - Response retrieveRaw(String itemFamilyId) throws Exception { + Response retrieveRaw(String itemFamilyId) throws ChargebeeException { String path = buildPathWithParams("/item_families/{item-family-id}", "item-family-id", itemFamilyId); return get(path, null); } - public ItemFamilyRetrieveResponse retrieve(String itemFamilyId) throws Exception { + public ItemFamilyRetrieveResponse retrieve(String itemFamilyId) throws ChargebeeException { Response response = retrieveRaw(itemFamilyId); return ItemFamilyRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** update a itemFamily (executes immediately) - returns raw Response. */ - Response updateRaw(String itemFamilyId) throws Exception { + Response updateRaw(String itemFamilyId) throws ChargebeeException { String path = buildPathWithParams("/item_families/{item-family-id}", "item-family-id", itemFamilyId); @@ -144,21 +145,21 @@ Response updateRaw(String itemFamilyId) throws Exception { } /** update a itemFamily using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String itemFamilyId, ItemFamilyUpdateParams params) throws Exception { + Response updateRaw(String itemFamilyId, ItemFamilyUpdateParams params) throws ChargebeeException { String path = buildPathWithParams("/item_families/{item-family-id}", "item-family-id", itemFamilyId); return post(path, params.toFormData()); } /** update a itemFamily using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String itemFamilyId, String jsonPayload) throws Exception { + Response updateRaw(String itemFamilyId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/item_families/{item-family-id}", "item-family-id", itemFamilyId); return postJson(path, jsonPayload); } public ItemFamilyUpdateResponse update(String itemFamilyId, ItemFamilyUpdateParams params) - throws Exception { + throws ChargebeeException { Response response = updateRaw(itemFamilyId, params); return ItemFamilyUpdateResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/services/ItemPriceService.java b/src/main/java/com/chargebee/v4/services/ItemPriceService.java new file mode 100644 index 00000000..079b59a0 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/ItemPriceService.java @@ -0,0 +1,303 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.itemPrice.params.ItemPriceFindApplicableItemsParams; + +import com.chargebee.v4.models.itemPrice.params.MoveItemPriceParams; + +import com.chargebee.v4.models.itemPrice.params.ItemPriceUpdateParams; + +import com.chargebee.v4.models.itemPrice.params.FindApplicableItemPricesParams; + +import com.chargebee.v4.models.itemPrice.params.ItemPriceListParams; + +import com.chargebee.v4.models.itemPrice.params.ItemPriceCreateParams; + +import com.chargebee.v4.models.itemPrice.responses.ItemPriceFindApplicableItemsResponse; + +import com.chargebee.v4.models.itemPrice.responses.MoveItemPriceResponse; + +import com.chargebee.v4.models.itemPrice.responses.ItemPriceRetrieveResponse; + +import com.chargebee.v4.models.itemPrice.responses.ItemPriceUpdateResponse; + +import com.chargebee.v4.models.itemPrice.responses.ItemPriceDeleteResponse; + +import com.chargebee.v4.models.itemPrice.responses.FindApplicableItemPricesResponse; + +import com.chargebee.v4.models.itemPrice.responses.ItemPriceListResponse; + +import com.chargebee.v4.models.itemPrice.responses.ItemPriceCreateResponse; + +public final class ItemPriceService extends BaseService { + + private final ServiceConfig config; + + public ItemPriceService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private ItemPriceService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private ItemPriceService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + ItemPriceService with(RequestOptions newOptions) { + return new ItemPriceService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public ItemPriceService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * findApplicableItems a itemPrice using immutable params (executes immediately) - returns raw + * Response. + */ + Response findApplicableItemsRaw(String itemPriceId, ItemPriceFindApplicableItemsParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/item_prices/{item-price-id}/applicable_items", "item-price-id", itemPriceId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * findApplicableItems a itemPrice without params (executes immediately) - returns raw Response. + */ + Response findApplicableItemsRaw(String itemPriceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/item_prices/{item-price-id}/applicable_items", "item-price-id", itemPriceId); + return get(path, null); + } + + /** + * findApplicableItems a itemPrice using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response findApplicableItemsRaw(String itemPriceId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/item_prices/{item-price-id}/applicable_items", "item-price-id", itemPriceId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ItemPriceFindApplicableItemsResponse findApplicableItems( + String itemPriceId, ItemPriceFindApplicableItemsParams params) throws ChargebeeException { + Response response = findApplicableItemsRaw(itemPriceId, params); + return ItemPriceFindApplicableItemsResponse.fromJson( + response.getBodyAsString(), this, params, itemPriceId, response); + } + + public ItemPriceFindApplicableItemsResponse findApplicableItems(String itemPriceId) + throws ChargebeeException { + Response response = findApplicableItemsRaw(itemPriceId); + return ItemPriceFindApplicableItemsResponse.fromJson( + response.getBodyAsString(), this, null, itemPriceId, response); + } + + /** moveItemPrice a itemPrice (executes immediately) - returns raw Response. */ + Response moveItemPriceRaw(String itemPriceId) throws ChargebeeException { + String path = + buildPathWithParams("/item_prices/{item-price-id}/move", "item-price-id", itemPriceId); + + return post(path, null); + } + + /** + * moveItemPrice a itemPrice using immutable params (executes immediately) - returns raw Response. + */ + Response moveItemPriceRaw(String itemPriceId, MoveItemPriceParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/item_prices/{item-price-id}/move", "item-price-id", itemPriceId); + return post(path, params.toFormData()); + } + + /** + * moveItemPrice a itemPrice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response moveItemPriceRaw(String itemPriceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/item_prices/{item-price-id}/move", "item-price-id", itemPriceId); + return postJson(path, jsonPayload); + } + + public MoveItemPriceResponse moveItemPrice(String itemPriceId, MoveItemPriceParams params) + throws ChargebeeException { + Response response = moveItemPriceRaw(itemPriceId, params); + return MoveItemPriceResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a itemPrice (executes immediately) - returns raw Response. */ + Response retrieveRaw(String itemPriceId) throws ChargebeeException { + String path = buildPathWithParams("/item_prices/{item-price-id}", "item-price-id", itemPriceId); + + return get(path, null); + } + + public ItemPriceRetrieveResponse retrieve(String itemPriceId) throws ChargebeeException { + Response response = retrieveRaw(itemPriceId); + return ItemPriceRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** update a itemPrice (executes immediately) - returns raw Response. */ + Response updateRaw(String itemPriceId) throws ChargebeeException { + String path = buildPathWithParams("/item_prices/{item-price-id}", "item-price-id", itemPriceId); + + return post(path, null); + } + + /** update a itemPrice using immutable params (executes immediately) - returns raw Response. */ + Response updateRaw(String itemPriceId, ItemPriceUpdateParams params) throws ChargebeeException { + String path = buildPathWithParams("/item_prices/{item-price-id}", "item-price-id", itemPriceId); + return post(path, params.toFormData()); + } + + /** update a itemPrice using raw JSON payload (executes immediately) - returns raw Response. */ + Response updateRaw(String itemPriceId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/item_prices/{item-price-id}", "item-price-id", itemPriceId); + return postJson(path, jsonPayload); + } + + public ItemPriceUpdateResponse update(String itemPriceId, ItemPriceUpdateParams params) + throws ChargebeeException { + Response response = updateRaw(itemPriceId, params); + return ItemPriceUpdateResponse.fromJson(response.getBodyAsString(), response); + } + + /** delete a itemPrice (executes immediately) - returns raw Response. */ + Response deleteRaw(String itemPriceId) throws ChargebeeException { + String path = + buildPathWithParams("/item_prices/{item-price-id}/delete", "item-price-id", itemPriceId); + + return post(path, null); + } + + public ItemPriceDeleteResponse delete(String itemPriceId) throws ChargebeeException { + Response response = deleteRaw(itemPriceId); + return ItemPriceDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * findApplicableItemPrices a itemPrice using immutable params (executes immediately) - returns + * raw Response. + */ + Response findApplicableItemPricesRaw(String itemPriceId, FindApplicableItemPricesParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/item_prices/{item-price-id}/applicable_item_prices", "item-price-id", itemPriceId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * findApplicableItemPrices a itemPrice without params (executes immediately) - returns raw + * Response. + */ + Response findApplicableItemPricesRaw(String itemPriceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/item_prices/{item-price-id}/applicable_item_prices", "item-price-id", itemPriceId); + return get(path, null); + } + + /** + * findApplicableItemPrices a itemPrice using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response findApplicableItemPricesRaw(String itemPriceId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/item_prices/{item-price-id}/applicable_item_prices", "item-price-id", itemPriceId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public FindApplicableItemPricesResponse findApplicableItemPrices( + String itemPriceId, FindApplicableItemPricesParams params) throws ChargebeeException { + Response response = findApplicableItemPricesRaw(itemPriceId, params); + return FindApplicableItemPricesResponse.fromJson( + response.getBodyAsString(), this, params, itemPriceId, response); + } + + public FindApplicableItemPricesResponse findApplicableItemPrices(String itemPriceId) + throws ChargebeeException { + Response response = findApplicableItemPricesRaw(itemPriceId); + return FindApplicableItemPricesResponse.fromJson( + response.getBodyAsString(), this, null, itemPriceId, response); + } + + /** list a itemPrice using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(ItemPriceListParams params) throws ChargebeeException { + + return get("/item_prices", params != null ? params.toQueryParams() : null); + } + + /** list a itemPrice without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/item_prices", null); + } + + /** list a itemPrice using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ItemPriceListResponse list(ItemPriceListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return ItemPriceListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public ItemPriceListResponse list() throws ChargebeeException { + Response response = listRaw(); + return ItemPriceListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** create a itemPrice using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(ItemPriceCreateParams params) throws ChargebeeException { + + return post("/item_prices", params != null ? params.toFormData() : null); + } + + /** create a itemPrice using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/item_prices", jsonPayload); + } + + public ItemPriceCreateResponse create(ItemPriceCreateParams params) throws ChargebeeException { + Response response = createRaw(params); + + return ItemPriceCreateResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/services/ItemService.java b/src/main/java/com/chargebee/v4/services/ItemService.java new file mode 100644 index 00000000..3ee5fee7 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/ItemService.java @@ -0,0 +1,160 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.item.params.ItemListParams; + +import com.chargebee.v4.models.item.params.ItemCreateParams; + +import com.chargebee.v4.models.item.params.ItemUpdateParams; + +import com.chargebee.v4.models.item.responses.ItemListResponse; + +import com.chargebee.v4.models.item.responses.ItemCreateResponse; + +import com.chargebee.v4.models.item.responses.ItemDeleteResponse; + +import com.chargebee.v4.models.item.responses.ItemRetrieveResponse; + +import com.chargebee.v4.models.item.responses.ItemUpdateResponse; + +public final class ItemService extends BaseService { + + private final ServiceConfig config; + + public ItemService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private ItemService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private ItemService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + ItemService with(RequestOptions newOptions) { + return new ItemService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public ItemService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** list a item using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(ItemListParams params) throws ChargebeeException { + + return get("/items", params != null ? params.toQueryParams() : null); + } + + /** list a item without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/items", null); + } + + /** list a item using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ItemListResponse list(ItemListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return ItemListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public ItemListResponse list() throws ChargebeeException { + Response response = listRaw(); + return ItemListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** create a item using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(ItemCreateParams params) throws ChargebeeException { + + return post("/items", params != null ? params.toFormData() : null); + } + + /** create a item using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/items", jsonPayload); + } + + public ItemCreateResponse create(ItemCreateParams params) throws ChargebeeException { + Response response = createRaw(params); + + return ItemCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** delete a item (executes immediately) - returns raw Response. */ + Response deleteRaw(String itemId) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/delete", "item-id", itemId); + + return post(path, null); + } + + public ItemDeleteResponse delete(String itemId) throws ChargebeeException { + Response response = deleteRaw(itemId); + return ItemDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a item (executes immediately) - returns raw Response. */ + Response retrieveRaw(String itemId) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}", "item-id", itemId); + + return get(path, null); + } + + public ItemRetrieveResponse retrieve(String itemId) throws ChargebeeException { + Response response = retrieveRaw(itemId); + return ItemRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** update a item (executes immediately) - returns raw Response. */ + Response updateRaw(String itemId) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}", "item-id", itemId); + + return post(path, null); + } + + /** update a item using immutable params (executes immediately) - returns raw Response. */ + Response updateRaw(String itemId, ItemUpdateParams params) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}", "item-id", itemId); + return post(path, params.toFormData()); + } + + /** update a item using raw JSON payload (executes immediately) - returns raw Response. */ + Response updateRaw(String itemId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}", "item-id", itemId); + return postJson(path, jsonPayload); + } + + public ItemUpdateResponse update(String itemId, ItemUpdateParams params) + throws ChargebeeException { + Response response = updateRaw(itemId, params); + return ItemUpdateResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/services/MediaService.java b/src/main/java/com/chargebee/v4/services/MediaService.java new file mode 100644 index 00000000..f990ff60 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/MediaService.java @@ -0,0 +1,85 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.media.params.CreateMediaAndAttachToItemParams; + +import com.chargebee.v4.models.media.responses.CreateMediaAndAttachToItemResponse; + +public final class MediaService extends BaseService { + + private final ServiceConfig config; + + public MediaService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private MediaService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private MediaService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + MediaService with(RequestOptions newOptions) { + return new MediaService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public MediaService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** createMediaAndAttachToItem a media (executes immediately) - returns raw Response. */ + Response createMediaAndAttachToItemRaw(String itemId) throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/media", "item-id", itemId); + + return post(path, null); + } + + /** + * createMediaAndAttachToItem a media using immutable params (executes immediately) - returns raw + * Response. + */ + Response createMediaAndAttachToItemRaw(String itemId, CreateMediaAndAttachToItemParams params) + throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/media", "item-id", itemId); + return post(path, params.toFormData()); + } + + /** + * createMediaAndAttachToItem a media using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response createMediaAndAttachToItemRaw(String itemId, String jsonPayload) + throws ChargebeeException { + String path = buildPathWithParams("/items/{item-id}/media", "item-id", itemId); + return postJson(path, jsonPayload); + } + + public CreateMediaAndAttachToItemResponse createMediaAndAttachToItem( + String itemId, CreateMediaAndAttachToItemParams params) throws ChargebeeException { + Response response = createMediaAndAttachToItemRaw(itemId, params); + return CreateMediaAndAttachToItemResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/NonSubscriptionService.java b/src/main/java/com/chargebee/v4/services/NonSubscriptionService.java similarity index 86% rename from src/main/java/com/chargebee/v4/core/services/NonSubscriptionService.java rename to src/main/java/com/chargebee/v4/services/NonSubscriptionService.java index 1ee102da..693e9454 100644 --- a/src/main/java/com/chargebee/v4/core/services/NonSubscriptionService.java +++ b/src/main/java/com/chargebee/v4/services/NonSubscriptionService.java @@ -5,15 +5,16 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.nonSubscription.params.NonSubscriptionProcessReceiptParams; +import com.chargebee.v4.models.nonSubscription.params.NonSubscriptionProcessReceiptParams; -import com.chargebee.v4.core.responses.nonSubscription.NonSubscriptionProcessReceiptResponse; +import com.chargebee.v4.models.nonSubscription.responses.NonSubscriptionProcessReceiptResponse; public final class NonSubscriptionService extends BaseService { @@ -51,7 +52,7 @@ public NonSubscriptionService withOptions(RequestOptions options) { // === Operations === /** processReceipt a nonSubscription (executes immediately) - returns raw Response. */ - Response processReceiptRaw(String nonSubscriptionAppId) throws Exception { + Response processReceiptRaw(String nonSubscriptionAppId) throws ChargebeeException { String path = buildPathWithParams( "/non_subscriptions/{non-subscription-app-id}/one_time_purchase", @@ -66,7 +67,8 @@ Response processReceiptRaw(String nonSubscriptionAppId) throws Exception { * Response. */ Response processReceiptRaw( - String nonSubscriptionAppId, NonSubscriptionProcessReceiptParams params) throws Exception { + String nonSubscriptionAppId, NonSubscriptionProcessReceiptParams params) + throws ChargebeeException { String path = buildPathWithParams( "/non_subscriptions/{non-subscription-app-id}/one_time_purchase", @@ -79,7 +81,8 @@ Response processReceiptRaw( * processReceipt a nonSubscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response processReceiptRaw(String nonSubscriptionAppId, String jsonPayload) throws Exception { + Response processReceiptRaw(String nonSubscriptionAppId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/non_subscriptions/{non-subscription-app-id}/one_time_purchase", @@ -89,7 +92,8 @@ Response processReceiptRaw(String nonSubscriptionAppId, String jsonPayload) thro } public NonSubscriptionProcessReceiptResponse processReceipt( - String nonSubscriptionAppId, NonSubscriptionProcessReceiptParams params) throws Exception { + String nonSubscriptionAppId, NonSubscriptionProcessReceiptParams params) + throws ChargebeeException { Response response = processReceiptRaw(nonSubscriptionAppId, params); return NonSubscriptionProcessReceiptResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/core/services/OfferEventService.java b/src/main/java/com/chargebee/v4/services/OfferEventService.java similarity index 75% rename from src/main/java/com/chargebee/v4/core/services/OfferEventService.java rename to src/main/java/com/chargebee/v4/services/OfferEventService.java index cb4cb9ee..7bcd66e3 100644 --- a/src/main/java/com/chargebee/v4/core/services/OfferEventService.java +++ b/src/main/java/com/chargebee/v4/services/OfferEventService.java @@ -5,15 +5,16 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.offerEvent.params.OfferEventOfferEventsParams; +import com.chargebee.v4.models.offerEvent.params.OfferEventsParams; -import com.chargebee.v4.core.responses.offerEvent.OfferEventOfferEventsResponse; +import com.chargebee.v4.models.offerEvent.responses.OfferEventsResponse; public final class OfferEventService extends BaseService { @@ -52,7 +53,7 @@ public OfferEventService withOptions(RequestOptions options) { /** * offerEvents a offerEvent using immutable params (executes immediately) - returns raw Response. */ - Response offerEventsRaw(OfferEventOfferEventsParams params) throws Exception { + Response offerEventsRaw(OfferEventsParams params) throws ChargebeeException { return post("/offer_events", params != null ? params.toFormData() : null); } @@ -60,15 +61,14 @@ Response offerEventsRaw(OfferEventOfferEventsParams params) throws Exception { /** * offerEvents a offerEvent using raw JSON payload (executes immediately) - returns raw Response. */ - Response offerEventsRaw(String jsonPayload) throws Exception { + Response offerEventsRaw(String jsonPayload) throws ChargebeeException { return postJson("/offer_events", jsonPayload); } - public OfferEventOfferEventsResponse offerEvents(OfferEventOfferEventsParams params) - throws Exception { + public OfferEventsResponse offerEvents(OfferEventsParams params) throws ChargebeeException { Response response = offerEventsRaw(params); - return OfferEventOfferEventsResponse.fromJson(response.getBodyAsString(), response); + return OfferEventsResponse.fromJson(response.getBodyAsString(), response); } } diff --git a/src/main/java/com/chargebee/v4/services/OfferFulfillmentService.java b/src/main/java/com/chargebee/v4/services/OfferFulfillmentService.java new file mode 100644 index 00000000..1b294ee3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/OfferFulfillmentService.java @@ -0,0 +1,146 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.offerFulfillment.params.OfferFulfillmentsParams; + +import com.chargebee.v4.models.offerFulfillment.params.OfferFulfillmentsUpdateParams; + +import com.chargebee.v4.models.offerFulfillment.responses.OfferFulfillmentsResponse; + +import com.chargebee.v4.models.offerFulfillment.responses.OfferFulfillmentsGetResponse; + +import com.chargebee.v4.models.offerFulfillment.responses.OfferFulfillmentsUpdateResponse; + +public final class OfferFulfillmentService extends BaseService { + + private final ServiceConfig config; + + public OfferFulfillmentService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private OfferFulfillmentService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private OfferFulfillmentService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + OfferFulfillmentService with(RequestOptions newOptions) { + return new OfferFulfillmentService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public OfferFulfillmentService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * offerFulfillments a offerFulfillment using immutable params (executes immediately) - returns + * raw Response. + */ + Response offerFulfillmentsRaw(OfferFulfillmentsParams params) throws ChargebeeException { + + return post("/offer_fulfillments", params != null ? params.toFormData() : null); + } + + /** + * offerFulfillments a offerFulfillment using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response offerFulfillmentsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/offer_fulfillments", jsonPayload); + } + + public OfferFulfillmentsResponse offerFulfillments(OfferFulfillmentsParams params) + throws ChargebeeException { + Response response = offerFulfillmentsRaw(params); + + return OfferFulfillmentsResponse.fromJson(response.getBodyAsString(), response); + } + + /** offerFulfillmentsGet a offerFulfillment (executes immediately) - returns raw Response. */ + Response offerFulfillmentsGetRaw(String offerFulfillmentId) throws ChargebeeException { + String path = + buildPathWithParams( + "/offer_fulfillments/{offer-fulfillment-id}", + "offer-fulfillment-id", + offerFulfillmentId); + + return get(path, null); + } + + public OfferFulfillmentsGetResponse offerFulfillmentsGet(String offerFulfillmentId) + throws ChargebeeException { + Response response = offerFulfillmentsGetRaw(offerFulfillmentId); + return OfferFulfillmentsGetResponse.fromJson(response.getBodyAsString(), response); + } + + /** offerFulfillmentsUpdate a offerFulfillment (executes immediately) - returns raw Response. */ + Response offerFulfillmentsUpdateRaw(String offerFulfillmentId) throws ChargebeeException { + String path = + buildPathWithParams( + "/offer_fulfillments/{offer-fulfillment-id}", + "offer-fulfillment-id", + offerFulfillmentId); + + return post(path, null); + } + + /** + * offerFulfillmentsUpdate a offerFulfillment using immutable params (executes immediately) - + * returns raw Response. + */ + Response offerFulfillmentsUpdateRaw( + String offerFulfillmentId, OfferFulfillmentsUpdateParams params) throws ChargebeeException { + String path = + buildPathWithParams( + "/offer_fulfillments/{offer-fulfillment-id}", + "offer-fulfillment-id", + offerFulfillmentId); + return post(path, params.toFormData()); + } + + /** + * offerFulfillmentsUpdate a offerFulfillment using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response offerFulfillmentsUpdateRaw(String offerFulfillmentId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/offer_fulfillments/{offer-fulfillment-id}", + "offer-fulfillment-id", + offerFulfillmentId); + return postJson(path, jsonPayload); + } + + public OfferFulfillmentsUpdateResponse offerFulfillmentsUpdate( + String offerFulfillmentId, OfferFulfillmentsUpdateParams params) throws ChargebeeException { + Response response = offerFulfillmentsUpdateRaw(offerFulfillmentId, params); + return OfferFulfillmentsUpdateResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/OmnichannelOneTimeOrderService.java b/src/main/java/com/chargebee/v4/services/OmnichannelOneTimeOrderService.java similarity index 81% rename from src/main/java/com/chargebee/v4/core/services/OmnichannelOneTimeOrderService.java rename to src/main/java/com/chargebee/v4/services/OmnichannelOneTimeOrderService.java index 0288bf8a..8709ffba 100644 --- a/src/main/java/com/chargebee/v4/core/services/OmnichannelOneTimeOrderService.java +++ b/src/main/java/com/chargebee/v4/services/OmnichannelOneTimeOrderService.java @@ -5,17 +5,18 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.omnichannelOneTimeOrder.params.OmnichannelOneTimeOrderListParams; +import com.chargebee.v4.models.omnichannelOneTimeOrder.params.OmnichannelOneTimeOrderListParams; -import com.chargebee.v4.core.responses.omnichannelOneTimeOrder.OmnichannelOneTimeOrderListResponse; +import com.chargebee.v4.models.omnichannelOneTimeOrder.responses.OmnichannelOneTimeOrderListResponse; -import com.chargebee.v4.core.responses.omnichannelOneTimeOrder.OmnichannelOneTimeOrderRetrieveResponse; +import com.chargebee.v4.models.omnichannelOneTimeOrder.responses.OmnichannelOneTimeOrderRetrieveResponse; public final class OmnichannelOneTimeOrderService extends BaseService { @@ -57,7 +58,7 @@ public OmnichannelOneTimeOrderService withOptions(RequestOptions options) { * list a omnichannelOneTimeOrder using immutable params (executes immediately) - returns raw * Response. */ - Response listRaw(OmnichannelOneTimeOrderListParams params) throws Exception { + Response listRaw(OmnichannelOneTimeOrderListParams params) throws ChargebeeException { return get("/omnichannel_one_time_orders", params != null ? params.toQueryParams() : null); } @@ -65,7 +66,7 @@ Response listRaw(OmnichannelOneTimeOrderListParams params) throws Exception { /** * list a omnichannelOneTimeOrder without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/omnichannel_one_time_orders", null); } @@ -74,27 +75,27 @@ Response listRaw() throws Exception { * list a omnichannelOneTimeOrder using raw JSON payload (executes immediately) - returns raw * Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public OmnichannelOneTimeOrderListResponse list(OmnichannelOneTimeOrderListParams params) - throws Exception { + throws ChargebeeException { Response response = listRaw(params); return OmnichannelOneTimeOrderListResponse.fromJson( response.getBodyAsString(), this, params, response); } - public OmnichannelOneTimeOrderListResponse list() throws Exception { + public OmnichannelOneTimeOrderListResponse list() throws ChargebeeException { Response response = listRaw(); return OmnichannelOneTimeOrderListResponse.fromJson( response.getBodyAsString(), this, null, response); } /** retrieve a omnichannelOneTimeOrder (executes immediately) - returns raw Response. */ - Response retrieveRaw(String omnichannelOneTimeOrderId) throws Exception { + Response retrieveRaw(String omnichannelOneTimeOrderId) throws ChargebeeException { String path = buildPathWithParams( "/omnichannel_one_time_orders/{omnichannel-one-time-order-id}", @@ -105,7 +106,7 @@ Response retrieveRaw(String omnichannelOneTimeOrderId) throws Exception { } public OmnichannelOneTimeOrderRetrieveResponse retrieve(String omnichannelOneTimeOrderId) - throws Exception { + throws ChargebeeException { Response response = retrieveRaw(omnichannelOneTimeOrderId); return OmnichannelOneTimeOrderRetrieveResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/services/OmnichannelSubscriptionItemService.java b/src/main/java/com/chargebee/v4/services/OmnichannelSubscriptionItemService.java new file mode 100644 index 00000000..3b5d9929 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/OmnichannelSubscriptionItemService.java @@ -0,0 +1,117 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.omnichannelSubscriptionItem.params.OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams; + +import com.chargebee.v4.models.omnichannelSubscriptionItem.responses.OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse; + +public final class OmnichannelSubscriptionItemService + extends BaseService { + + private final ServiceConfig config; + + public OmnichannelSubscriptionItemService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private OmnichannelSubscriptionItemService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private OmnichannelSubscriptionItemService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + OmnichannelSubscriptionItemService with(RequestOptions newOptions) { + return new OmnichannelSubscriptionItemService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public OmnichannelSubscriptionItemService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * listOmniSubscriptionItemScheduleChanges a omnichannelSubscriptionItem using immutable params + * (executes immediately) - returns raw Response. + */ + Response listOmniSubscriptionItemScheduleChangesRaw( + String omnichannelSubscriptionItemId, + OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/omnichannel_subscription_items/{omnichannel-subscription-item-id}/scheduled_changes", + "omnichannel-subscription-item-id", + omnichannelSubscriptionItemId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * listOmniSubscriptionItemScheduleChanges a omnichannelSubscriptionItem without params (executes + * immediately) - returns raw Response. + */ + Response listOmniSubscriptionItemScheduleChangesRaw(String omnichannelSubscriptionItemId) + throws ChargebeeException { + String path = + buildPathWithParams( + "/omnichannel_subscription_items/{omnichannel-subscription-item-id}/scheduled_changes", + "omnichannel-subscription-item-id", + omnichannelSubscriptionItemId); + return get(path, null); + } + + /** + * listOmniSubscriptionItemScheduleChanges a omnichannelSubscriptionItem using raw JSON payload + * (executes immediately) - returns raw Response. + */ + Response listOmniSubscriptionItemScheduleChangesRaw( + String omnichannelSubscriptionItemId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/omnichannel_subscription_items/{omnichannel-subscription-item-id}/scheduled_changes", + "omnichannel-subscription-item-id", + omnichannelSubscriptionItemId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse + listOmniSubscriptionItemScheduleChanges( + String omnichannelSubscriptionItemId, + OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesParams params) + throws ChargebeeException { + Response response = + listOmniSubscriptionItemScheduleChangesRaw(omnichannelSubscriptionItemId, params); + return OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse.fromJson( + response.getBodyAsString(), this, params, omnichannelSubscriptionItemId, response); + } + + public OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse + listOmniSubscriptionItemScheduleChanges(String omnichannelSubscriptionItemId) + throws ChargebeeException { + Response response = listOmniSubscriptionItemScheduleChangesRaw(omnichannelSubscriptionItemId); + return OmnichannelSubscriptionItemListOmniSubscriptionItemScheduleChangesResponse.fromJson( + response.getBodyAsString(), this, null, omnichannelSubscriptionItemId, response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/OmnichannelSubscriptionService.java b/src/main/java/com/chargebee/v4/services/OmnichannelSubscriptionService.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/services/OmnichannelSubscriptionService.java rename to src/main/java/com/chargebee/v4/services/OmnichannelSubscriptionService.java index 8626576c..533f68bd 100644 --- a/src/main/java/com/chargebee/v4/core/services/OmnichannelSubscriptionService.java +++ b/src/main/java/com/chargebee/v4/services/OmnichannelSubscriptionService.java @@ -5,25 +5,26 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.omnichannelSubscription.params.OmnichannelSubscriptionMoveParams; +import com.chargebee.v4.models.omnichannelSubscription.params.OmnichannelSubscriptionMoveParams; -import com.chargebee.v4.core.models.omnichannelSubscription.params.OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams; +import com.chargebee.v4.models.omnichannelSubscription.params.OmnichannelTransactionsForOmnichannelSubscriptionParams; -import com.chargebee.v4.core.models.omnichannelSubscription.params.OmnichannelSubscriptionListParams; +import com.chargebee.v4.models.omnichannelSubscription.params.OmnichannelSubscriptionListParams; -import com.chargebee.v4.core.responses.omnichannelSubscription.OmnichannelSubscriptionMoveResponse; +import com.chargebee.v4.models.omnichannelSubscription.responses.OmnichannelSubscriptionMoveResponse; -import com.chargebee.v4.core.responses.omnichannelSubscription.OmnichannelSubscriptionRetrieveResponse; +import com.chargebee.v4.models.omnichannelSubscription.responses.OmnichannelSubscriptionRetrieveResponse; -import com.chargebee.v4.core.responses.omnichannelSubscription.OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse; +import com.chargebee.v4.models.omnichannelSubscription.responses.OmnichannelTransactionsForOmnichannelSubscriptionResponse; -import com.chargebee.v4.core.responses.omnichannelSubscription.OmnichannelSubscriptionListResponse; +import com.chargebee.v4.models.omnichannelSubscription.responses.OmnichannelSubscriptionListResponse; public final class OmnichannelSubscriptionService extends BaseService { @@ -62,7 +63,7 @@ public OmnichannelSubscriptionService withOptions(RequestOptions options) { // === Operations === /** move a omnichannelSubscription (executes immediately) - returns raw Response. */ - Response moveRaw(String omnichannelSubscriptionId) throws Exception { + Response moveRaw(String omnichannelSubscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/omnichannel_subscriptions/{omnichannel-subscription-id}/move", @@ -77,7 +78,7 @@ Response moveRaw(String omnichannelSubscriptionId) throws Exception { * Response. */ Response moveRaw(String omnichannelSubscriptionId, OmnichannelSubscriptionMoveParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/omnichannel_subscriptions/{omnichannel-subscription-id}/move", @@ -90,7 +91,7 @@ Response moveRaw(String omnichannelSubscriptionId, OmnichannelSubscriptionMovePa * move a omnichannelSubscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response moveRaw(String omnichannelSubscriptionId, String jsonPayload) throws Exception { + Response moveRaw(String omnichannelSubscriptionId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/omnichannel_subscriptions/{omnichannel-subscription-id}/move", @@ -100,13 +101,14 @@ Response moveRaw(String omnichannelSubscriptionId, String jsonPayload) throws Ex } public OmnichannelSubscriptionMoveResponse move( - String omnichannelSubscriptionId, OmnichannelSubscriptionMoveParams params) throws Exception { + String omnichannelSubscriptionId, OmnichannelSubscriptionMoveParams params) + throws ChargebeeException { Response response = moveRaw(omnichannelSubscriptionId, params); return OmnichannelSubscriptionMoveResponse.fromJson(response.getBodyAsString(), response); } /** retrieve a omnichannelSubscription (executes immediately) - returns raw Response. */ - Response retrieveRaw(String omnichannelSubscriptionId) throws Exception { + Response retrieveRaw(String omnichannelSubscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/omnichannel_subscriptions/{omnichannel-subscription-id}", @@ -117,7 +119,7 @@ Response retrieveRaw(String omnichannelSubscriptionId) throws Exception { } public OmnichannelSubscriptionRetrieveResponse retrieve(String omnichannelSubscriptionId) - throws Exception { + throws ChargebeeException { Response response = retrieveRaw(omnichannelSubscriptionId); return OmnichannelSubscriptionRetrieveResponse.fromJson(response.getBodyAsString(), response); } @@ -128,8 +130,8 @@ public OmnichannelSubscriptionRetrieveResponse retrieve(String omnichannelSubscr */ Response omnichannelTransactionsForOmnichannelSubscriptionRaw( String omnichannelSubscriptionId, - OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams params) - throws Exception { + OmnichannelTransactionsForOmnichannelSubscriptionParams params) + throws ChargebeeException { String path = buildPathWithParams( "/omnichannel_subscriptions/{omnichannel-subscription-id}/omnichannel_transactions", @@ -143,7 +145,7 @@ Response omnichannelTransactionsForOmnichannelSubscriptionRaw( * (executes immediately) - returns raw Response. */ Response omnichannelTransactionsForOmnichannelSubscriptionRaw(String omnichannelSubscriptionId) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/omnichannel_subscriptions/{omnichannel-subscription-id}/omnichannel_transactions", @@ -157,7 +159,7 @@ Response omnichannelTransactionsForOmnichannelSubscriptionRaw(String omnichannel * payload (executes immediately) - returns raw Response. */ Response omnichannelTransactionsForOmnichannelSubscriptionRaw( - String omnichannelSubscriptionId, String jsonPayload) throws Exception { + String omnichannelSubscriptionId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/omnichannel_subscriptions/{omnichannel-subscription-id}/omnichannel_transactions", @@ -166,31 +168,31 @@ Response omnichannelTransactionsForOmnichannelSubscriptionRaw( throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse + public OmnichannelTransactionsForOmnichannelSubscriptionResponse omnichannelTransactionsForOmnichannelSubscription( String omnichannelSubscriptionId, - OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionParams params) - throws Exception { + OmnichannelTransactionsForOmnichannelSubscriptionParams params) + throws ChargebeeException { Response response = omnichannelTransactionsForOmnichannelSubscriptionRaw(omnichannelSubscriptionId, params); - return OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse - .fromJson(response.getBodyAsString(), this, params, omnichannelSubscriptionId, response); + return OmnichannelTransactionsForOmnichannelSubscriptionResponse.fromJson( + response.getBodyAsString(), this, params, omnichannelSubscriptionId, response); } - public OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse + public OmnichannelTransactionsForOmnichannelSubscriptionResponse omnichannelTransactionsForOmnichannelSubscription(String omnichannelSubscriptionId) - throws Exception { + throws ChargebeeException { Response response = omnichannelTransactionsForOmnichannelSubscriptionRaw(omnichannelSubscriptionId); - return OmnichannelSubscriptionOmnichannelTransactionsForOmnichannelSubscriptionResponse - .fromJson(response.getBodyAsString(), this, null, omnichannelSubscriptionId, response); + return OmnichannelTransactionsForOmnichannelSubscriptionResponse.fromJson( + response.getBodyAsString(), this, null, omnichannelSubscriptionId, response); } /** * list a omnichannelSubscription using immutable params (executes immediately) - returns raw * Response. */ - Response listRaw(OmnichannelSubscriptionListParams params) throws Exception { + Response listRaw(OmnichannelSubscriptionListParams params) throws ChargebeeException { return get("/omnichannel_subscriptions", params != null ? params.toQueryParams() : null); } @@ -198,7 +200,7 @@ Response listRaw(OmnichannelSubscriptionListParams params) throws Exception { /** * list a omnichannelSubscription without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/omnichannel_subscriptions", null); } @@ -207,20 +209,20 @@ Response listRaw() throws Exception { * list a omnichannelSubscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public OmnichannelSubscriptionListResponse list(OmnichannelSubscriptionListParams params) - throws Exception { + throws ChargebeeException { Response response = listRaw(params); return OmnichannelSubscriptionListResponse.fromJson( response.getBodyAsString(), this, params, response); } - public OmnichannelSubscriptionListResponse list() throws Exception { + public OmnichannelSubscriptionListResponse list() throws ChargebeeException { Response response = listRaw(); return OmnichannelSubscriptionListResponse.fromJson( response.getBodyAsString(), this, null, response); diff --git a/src/main/java/com/chargebee/v4/services/OrderService.java b/src/main/java/com/chargebee/v4/services/OrderService.java new file mode 100644 index 00000000..03ea47e2 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/OrderService.java @@ -0,0 +1,367 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.order.params.OrderListParams; + +import com.chargebee.v4.models.order.params.OrderCreateParams; + +import com.chargebee.v4.models.order.params.ImportOrderParams; + +import com.chargebee.v4.models.order.params.OrderResendParams; + +import com.chargebee.v4.models.order.params.OrderReopenParams; + +import com.chargebee.v4.models.order.params.OrdersForInvoiceParams; + +import com.chargebee.v4.models.order.params.OrderCancelParams; + +import com.chargebee.v4.models.order.params.OrderUpdateParams; + +import com.chargebee.v4.models.order.params.OrderCreateRefundableCreditNoteParams; + +import com.chargebee.v4.models.order.responses.OrderListResponse; + +import com.chargebee.v4.models.order.responses.OrderCreateResponse; + +import com.chargebee.v4.models.order.responses.ImportOrderResponse; + +import com.chargebee.v4.models.order.responses.AssignOrderNumberResponse; + +import com.chargebee.v4.models.order.responses.OrderResendResponse; + +import com.chargebee.v4.models.order.responses.OrderReopenResponse; + +import com.chargebee.v4.models.order.responses.OrdersForInvoiceResponse; + +import com.chargebee.v4.models.order.responses.OrderCancelResponse; + +import com.chargebee.v4.models.order.responses.OrderRetrieveResponse; + +import com.chargebee.v4.models.order.responses.OrderUpdateResponse; + +import com.chargebee.v4.models.order.responses.OrderDeleteResponse; + +import com.chargebee.v4.models.order.responses.OrderCreateRefundableCreditNoteResponse; + +public final class OrderService extends BaseService { + + private final ServiceConfig config; + + public OrderService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private OrderService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private OrderService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + OrderService with(RequestOptions newOptions) { + return new OrderService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public OrderService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** list a order using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(OrderListParams params) throws ChargebeeException { + + return get("/orders", params != null ? params.toQueryParams() : null); + } + + /** list a order without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/orders", null); + } + + /** list a order using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public OrderListResponse list(OrderListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return OrderListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public OrderListResponse list() throws ChargebeeException { + Response response = listRaw(); + return OrderListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** create a order using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(OrderCreateParams params) throws ChargebeeException { + + return post("/orders", params != null ? params.toFormData() : null); + } + + /** create a order using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/orders", jsonPayload); + } + + public OrderCreateResponse create(OrderCreateParams params) throws ChargebeeException { + Response response = createRaw(params); + + return OrderCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** importOrder a order using immutable params (executes immediately) - returns raw Response. */ + Response importOrderRaw(ImportOrderParams params) throws ChargebeeException { + + return post("/orders/import_order", params != null ? params.toFormData() : null); + } + + /** importOrder a order using raw JSON payload (executes immediately) - returns raw Response. */ + Response importOrderRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/orders/import_order", jsonPayload); + } + + public ImportOrderResponse importOrder(ImportOrderParams params) throws ChargebeeException { + Response response = importOrderRaw(params); + + return ImportOrderResponse.fromJson(response.getBodyAsString(), response); + } + + /** assignOrderNumber a order (executes immediately) - returns raw Response. */ + Response assignOrderNumberRaw(String orderId) throws ChargebeeException { + String path = + buildPathWithParams("/orders/{order-id}/assign_order_number", "order-id", orderId); + + return post(path, null); + } + + public AssignOrderNumberResponse assignOrderNumber(String orderId) throws ChargebeeException { + Response response = assignOrderNumberRaw(orderId); + return AssignOrderNumberResponse.fromJson(response.getBodyAsString(), response); + } + + /** resend a order (executes immediately) - returns raw Response. */ + Response resendRaw(String orderId) throws ChargebeeException { + String path = buildPathWithParams("/orders/{order-id}/resend", "order-id", orderId); + + return post(path, null); + } + + /** resend a order using immutable params (executes immediately) - returns raw Response. */ + Response resendRaw(String orderId, OrderResendParams params) throws ChargebeeException { + String path = buildPathWithParams("/orders/{order-id}/resend", "order-id", orderId); + return post(path, params.toFormData()); + } + + /** resend a order using raw JSON payload (executes immediately) - returns raw Response. */ + Response resendRaw(String orderId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/orders/{order-id}/resend", "order-id", orderId); + return postJson(path, jsonPayload); + } + + public OrderResendResponse resend(String orderId, OrderResendParams params) + throws ChargebeeException { + Response response = resendRaw(orderId, params); + return OrderResendResponse.fromJson(response.getBodyAsString(), response); + } + + /** reopen a order (executes immediately) - returns raw Response. */ + Response reopenRaw(String orderId) throws ChargebeeException { + String path = buildPathWithParams("/orders/{order-id}/reopen", "order-id", orderId); + + return post(path, null); + } + + /** reopen a order using immutable params (executes immediately) - returns raw Response. */ + Response reopenRaw(String orderId, OrderReopenParams params) throws ChargebeeException { + String path = buildPathWithParams("/orders/{order-id}/reopen", "order-id", orderId); + return post(path, params.toFormData()); + } + + /** reopen a order using raw JSON payload (executes immediately) - returns raw Response. */ + Response reopenRaw(String orderId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/orders/{order-id}/reopen", "order-id", orderId); + return postJson(path, jsonPayload); + } + + public OrderReopenResponse reopen(String orderId, OrderReopenParams params) + throws ChargebeeException { + Response response = reopenRaw(orderId, params); + return OrderReopenResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * ordersForInvoice a order using immutable params (executes immediately) - returns raw Response. + */ + Response ordersForInvoiceRaw(String invoiceId, OrdersForInvoiceParams params) + throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/orders", "invoice-id", invoiceId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** ordersForInvoice a order without params (executes immediately) - returns raw Response. */ + Response ordersForInvoiceRaw(String invoiceId) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/orders", "invoice-id", invoiceId); + return get(path, null); + } + + /** + * ordersForInvoice a order using raw JSON payload (executes immediately) - returns raw Response. + */ + Response ordersForInvoiceRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/orders", "invoice-id", invoiceId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public OrdersForInvoiceResponse ordersForInvoice(String invoiceId, OrdersForInvoiceParams params) + throws ChargebeeException { + Response response = ordersForInvoiceRaw(invoiceId, params); + return OrdersForInvoiceResponse.fromJson( + response.getBodyAsString(), this, params, invoiceId, response); + } + + public OrdersForInvoiceResponse ordersForInvoice(String invoiceId) throws ChargebeeException { + Response response = ordersForInvoiceRaw(invoiceId); + return OrdersForInvoiceResponse.fromJson( + response.getBodyAsString(), this, null, invoiceId, response); + } + + /** cancel a order (executes immediately) - returns raw Response. */ + Response cancelRaw(String orderId) throws ChargebeeException { + String path = buildPathWithParams("/orders/{order-id}/cancel", "order-id", orderId); + + return post(path, null); + } + + /** cancel a order using immutable params (executes immediately) - returns raw Response. */ + Response cancelRaw(String orderId, OrderCancelParams params) throws ChargebeeException { + String path = buildPathWithParams("/orders/{order-id}/cancel", "order-id", orderId); + return post(path, params.toFormData()); + } + + /** cancel a order using raw JSON payload (executes immediately) - returns raw Response. */ + Response cancelRaw(String orderId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/orders/{order-id}/cancel", "order-id", orderId); + return postJson(path, jsonPayload); + } + + public OrderCancelResponse cancel(String orderId, OrderCancelParams params) + throws ChargebeeException { + Response response = cancelRaw(orderId, params); + return OrderCancelResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a order (executes immediately) - returns raw Response. */ + Response retrieveRaw(String orderId) throws ChargebeeException { + String path = buildPathWithParams("/orders/{order-id}", "order-id", orderId); + + return get(path, null); + } + + public OrderRetrieveResponse retrieve(String orderId) throws ChargebeeException { + Response response = retrieveRaw(orderId); + return OrderRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** update a order (executes immediately) - returns raw Response. */ + Response updateRaw(String orderId) throws ChargebeeException { + String path = buildPathWithParams("/orders/{order-id}", "order-id", orderId); + + return post(path, null); + } + + /** update a order using immutable params (executes immediately) - returns raw Response. */ + Response updateRaw(String orderId, OrderUpdateParams params) throws ChargebeeException { + String path = buildPathWithParams("/orders/{order-id}", "order-id", orderId); + return post(path, params.toFormData()); + } + + /** update a order using raw JSON payload (executes immediately) - returns raw Response. */ + Response updateRaw(String orderId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/orders/{order-id}", "order-id", orderId); + return postJson(path, jsonPayload); + } + + public OrderUpdateResponse update(String orderId, OrderUpdateParams params) + throws ChargebeeException { + Response response = updateRaw(orderId, params); + return OrderUpdateResponse.fromJson(response.getBodyAsString(), response); + } + + /** delete a order (executes immediately) - returns raw Response. */ + Response deleteRaw(String orderId) throws ChargebeeException { + String path = buildPathWithParams("/orders/{order-id}/delete", "order-id", orderId); + + return post(path, null); + } + + public OrderDeleteResponse delete(String orderId) throws ChargebeeException { + Response response = deleteRaw(orderId); + return OrderDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** createRefundableCreditNote a order (executes immediately) - returns raw Response. */ + Response createRefundableCreditNoteRaw(String orderId) throws ChargebeeException { + String path = + buildPathWithParams( + "/orders/{order-id}/create_refundable_credit_note", "order-id", orderId); + + return post(path, null); + } + + /** + * createRefundableCreditNote a order using immutable params (executes immediately) - returns raw + * Response. + */ + Response createRefundableCreditNoteRaw( + String orderId, OrderCreateRefundableCreditNoteParams params) throws ChargebeeException { + String path = + buildPathWithParams( + "/orders/{order-id}/create_refundable_credit_note", "order-id", orderId); + return post(path, params.toFormData()); + } + + /** + * createRefundableCreditNote a order using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response createRefundableCreditNoteRaw(String orderId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/orders/{order-id}/create_refundable_credit_note", "order-id", orderId); + return postJson(path, jsonPayload); + } + + public OrderCreateRefundableCreditNoteResponse createRefundableCreditNote( + String orderId, OrderCreateRefundableCreditNoteParams params) throws ChargebeeException { + Response response = createRefundableCreditNoteRaw(orderId, params); + return OrderCreateRefundableCreditNoteResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/PaymentIntentService.java b/src/main/java/com/chargebee/v4/services/PaymentIntentService.java similarity index 78% rename from src/main/java/com/chargebee/v4/core/services/PaymentIntentService.java rename to src/main/java/com/chargebee/v4/services/PaymentIntentService.java index fce57217..ebbe8a0b 100644 --- a/src/main/java/com/chargebee/v4/core/services/PaymentIntentService.java +++ b/src/main/java/com/chargebee/v4/services/PaymentIntentService.java @@ -5,21 +5,22 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.paymentIntent.params.PaymentIntentUpdateParams; +import com.chargebee.v4.models.paymentIntent.params.PaymentIntentUpdateParams; -import com.chargebee.v4.core.models.paymentIntent.params.PaymentIntentCreateParams; +import com.chargebee.v4.models.paymentIntent.params.PaymentIntentCreateParams; -import com.chargebee.v4.core.responses.paymentIntent.PaymentIntentRetrieveResponse; +import com.chargebee.v4.models.paymentIntent.responses.PaymentIntentRetrieveResponse; -import com.chargebee.v4.core.responses.paymentIntent.PaymentIntentUpdateResponse; +import com.chargebee.v4.models.paymentIntent.responses.PaymentIntentUpdateResponse; -import com.chargebee.v4.core.responses.paymentIntent.PaymentIntentCreateResponse; +import com.chargebee.v4.models.paymentIntent.responses.PaymentIntentCreateResponse; public final class PaymentIntentService extends BaseService { @@ -57,7 +58,7 @@ public PaymentIntentService withOptions(RequestOptions options) { // === Operations === /** retrieve a paymentIntent (executes immediately) - returns raw Response. */ - Response retrieveRaw(String paymentIntentId) throws Exception { + Response retrieveRaw(String paymentIntentId) throws ChargebeeException { String path = buildPathWithParams( "/payment_intents/{payment-intent-id}", "payment-intent-id", paymentIntentId); @@ -65,13 +66,13 @@ Response retrieveRaw(String paymentIntentId) throws Exception { return get(path, null); } - public PaymentIntentRetrieveResponse retrieve(String paymentIntentId) throws Exception { + public PaymentIntentRetrieveResponse retrieve(String paymentIntentId) throws ChargebeeException { Response response = retrieveRaw(paymentIntentId); return PaymentIntentRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** update a paymentIntent (executes immediately) - returns raw Response. */ - Response updateRaw(String paymentIntentId) throws Exception { + Response updateRaw(String paymentIntentId) throws ChargebeeException { String path = buildPathWithParams( "/payment_intents/{payment-intent-id}", "payment-intent-id", paymentIntentId); @@ -82,7 +83,8 @@ Response updateRaw(String paymentIntentId) throws Exception { /** * update a paymentIntent using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String paymentIntentId, PaymentIntentUpdateParams params) throws Exception { + Response updateRaw(String paymentIntentId, PaymentIntentUpdateParams params) + throws ChargebeeException { String path = buildPathWithParams( "/payment_intents/{payment-intent-id}", "payment-intent-id", paymentIntentId); @@ -92,7 +94,7 @@ Response updateRaw(String paymentIntentId, PaymentIntentUpdateParams params) thr /** * update a paymentIntent using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String paymentIntentId, String jsonPayload) throws Exception { + Response updateRaw(String paymentIntentId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/payment_intents/{payment-intent-id}", "payment-intent-id", paymentIntentId); @@ -100,7 +102,7 @@ Response updateRaw(String paymentIntentId, String jsonPayload) throws Exception } public PaymentIntentUpdateResponse update( - String paymentIntentId, PaymentIntentUpdateParams params) throws Exception { + String paymentIntentId, PaymentIntentUpdateParams params) throws ChargebeeException { Response response = updateRaw(paymentIntentId, params); return PaymentIntentUpdateResponse.fromJson(response.getBodyAsString(), response); } @@ -108,7 +110,7 @@ public PaymentIntentUpdateResponse update( /** * create a paymentIntent using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(PaymentIntentCreateParams params) throws Exception { + Response createRaw(PaymentIntentCreateParams params) throws ChargebeeException { return post("/payment_intents", params != null ? params.toFormData() : null); } @@ -116,12 +118,13 @@ Response createRaw(PaymentIntentCreateParams params) throws Exception { /** * create a paymentIntent using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/payment_intents", jsonPayload); } - public PaymentIntentCreateResponse create(PaymentIntentCreateParams params) throws Exception { + public PaymentIntentCreateResponse create(PaymentIntentCreateParams params) + throws ChargebeeException { Response response = createRaw(params); return PaymentIntentCreateResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/core/services/PaymentScheduleSchemeService.java b/src/main/java/com/chargebee/v4/services/PaymentScheduleSchemeService.java similarity index 79% rename from src/main/java/com/chargebee/v4/core/services/PaymentScheduleSchemeService.java rename to src/main/java/com/chargebee/v4/services/PaymentScheduleSchemeService.java index b935db38..a69eea11 100644 --- a/src/main/java/com/chargebee/v4/core/services/PaymentScheduleSchemeService.java +++ b/src/main/java/com/chargebee/v4/services/PaymentScheduleSchemeService.java @@ -5,19 +5,20 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.paymentScheduleScheme.params.PaymentScheduleSchemeCreateParams; +import com.chargebee.v4.models.paymentScheduleScheme.params.PaymentScheduleSchemeCreateParams; -import com.chargebee.v4.core.responses.paymentScheduleScheme.PaymentScheduleSchemeRetrieveResponse; +import com.chargebee.v4.models.paymentScheduleScheme.responses.PaymentScheduleSchemeRetrieveResponse; -import com.chargebee.v4.core.responses.paymentScheduleScheme.PaymentScheduleSchemeCreateResponse; +import com.chargebee.v4.models.paymentScheduleScheme.responses.PaymentScheduleSchemeCreateResponse; -import com.chargebee.v4.core.responses.paymentScheduleScheme.PaymentScheduleSchemeDeleteResponse; +import com.chargebee.v4.models.paymentScheduleScheme.responses.PaymentScheduleSchemeDeleteResponse; public final class PaymentScheduleSchemeService extends BaseService { @@ -55,7 +56,7 @@ public PaymentScheduleSchemeService withOptions(RequestOptions options) { // === Operations === /** retrieve a paymentScheduleScheme (executes immediately) - returns raw Response. */ - Response retrieveRaw(String paymentScheduleSchemeId) throws Exception { + Response retrieveRaw(String paymentScheduleSchemeId) throws ChargebeeException { String path = buildPathWithParams( "/payment_schedule_schemes/{payment-schedule-scheme-id}", @@ -66,7 +67,7 @@ Response retrieveRaw(String paymentScheduleSchemeId) throws Exception { } public PaymentScheduleSchemeRetrieveResponse retrieve(String paymentScheduleSchemeId) - throws Exception { + throws ChargebeeException { Response response = retrieveRaw(paymentScheduleSchemeId); return PaymentScheduleSchemeRetrieveResponse.fromJson(response.getBodyAsString(), response); } @@ -75,7 +76,7 @@ public PaymentScheduleSchemeRetrieveResponse retrieve(String paymentScheduleSche * create a paymentScheduleScheme using immutable params (executes immediately) - returns raw * Response. */ - Response createRaw(PaymentScheduleSchemeCreateParams params) throws Exception { + Response createRaw(PaymentScheduleSchemeCreateParams params) throws ChargebeeException { return post("/payment_schedule_schemes", params != null ? params.toFormData() : null); } @@ -84,20 +85,20 @@ Response createRaw(PaymentScheduleSchemeCreateParams params) throws Exception { * create a paymentScheduleScheme using raw JSON payload (executes immediately) - returns raw * Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/payment_schedule_schemes", jsonPayload); } public PaymentScheduleSchemeCreateResponse create(PaymentScheduleSchemeCreateParams params) - throws Exception { + throws ChargebeeException { Response response = createRaw(params); return PaymentScheduleSchemeCreateResponse.fromJson(response.getBodyAsString(), response); } /** delete a paymentScheduleScheme (executes immediately) - returns raw Response. */ - Response deleteRaw(String paymentScheduleSchemeId) throws Exception { + Response deleteRaw(String paymentScheduleSchemeId) throws ChargebeeException { String path = buildPathWithParams( "/payment_schedule_schemes/{payment-schedule-scheme-id}/delete", @@ -108,7 +109,7 @@ Response deleteRaw(String paymentScheduleSchemeId) throws Exception { } public PaymentScheduleSchemeDeleteResponse delete(String paymentScheduleSchemeId) - throws Exception { + throws ChargebeeException { Response response = deleteRaw(paymentScheduleSchemeId); return PaymentScheduleSchemeDeleteResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/services/PaymentSourceService.java b/src/main/java/com/chargebee/v4/services/PaymentSourceService.java new file mode 100644 index 00000000..463e1eeb --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/PaymentSourceService.java @@ -0,0 +1,626 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.paymentSource.params.PaymentSourceCreateUsingPermanentTokenParams; + +import com.chargebee.v4.models.paymentSource.params.PaymentSourceCreateCardParams; + +import com.chargebee.v4.models.paymentSource.params.PaymentSourceVerifyBankAccountParams; + +import com.chargebee.v4.models.paymentSource.params.PaymentSourceListParams; + +import com.chargebee.v4.models.paymentSource.params.ExportPaymentSourceParams; + +import com.chargebee.v4.models.paymentSource.params.PaymentSourceCreateUsingPaymentIntentParams; + +import com.chargebee.v4.models.paymentSource.params.CreateVoucherPaymentSourceParams; + +import com.chargebee.v4.models.paymentSource.params.PaymentSourceCreateUsingTempTokenParams; + +import com.chargebee.v4.models.paymentSource.params.PaymentSourceUpdateCardParams; + +import com.chargebee.v4.models.paymentSource.params.PaymentSourceSwitchGatewayAccountParams; + +import com.chargebee.v4.models.paymentSource.params.PaymentSourceCreateUsingTokenParams; + +import com.chargebee.v4.models.paymentSource.params.PaymentSourceCreateBankAccountParams; + +import com.chargebee.v4.models.paymentSource.params.PaymentSourceUpdateBankAccountParams; + +import com.chargebee.v4.models.paymentSource.responses.PaymentSourceCreateUsingPermanentTokenResponse; + +import com.chargebee.v4.models.paymentSource.responses.PaymentSourceDeleteResponse; + +import com.chargebee.v4.models.paymentSource.responses.PaymentSourceCreateCardResponse; + +import com.chargebee.v4.models.paymentSource.responses.PaymentSourceVerifyBankAccountResponse; + +import com.chargebee.v4.models.paymentSource.responses.PaymentSourceListResponse; + +import com.chargebee.v4.models.paymentSource.responses.ExportPaymentSourceResponse; + +import com.chargebee.v4.models.paymentSource.responses.PaymentSourceCreateUsingPaymentIntentResponse; + +import com.chargebee.v4.models.paymentSource.responses.PaymentSourceAgreementPdfResponse; + +import com.chargebee.v4.models.paymentSource.responses.PaymentSourceRetrieveResponse; + +import com.chargebee.v4.models.paymentSource.responses.CreateVoucherPaymentSourceResponse; + +import com.chargebee.v4.models.paymentSource.responses.PaymentSourceCreateUsingTempTokenResponse; + +import com.chargebee.v4.models.paymentSource.responses.PaymentSourceUpdateCardResponse; + +import com.chargebee.v4.models.paymentSource.responses.PaymentSourceSwitchGatewayAccountResponse; + +import com.chargebee.v4.models.paymentSource.responses.PaymentSourceCreateUsingTokenResponse; + +import com.chargebee.v4.models.paymentSource.responses.PaymentSourceDeleteLocalResponse; + +import com.chargebee.v4.models.paymentSource.responses.PaymentSourceCreateBankAccountResponse; + +import com.chargebee.v4.models.paymentSource.responses.PaymentSourceUpdateBankAccountResponse; + +public final class PaymentSourceService extends BaseService { + + private final ServiceConfig config; + + public PaymentSourceService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private PaymentSourceService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private PaymentSourceService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + PaymentSourceService with(RequestOptions newOptions) { + return new PaymentSourceService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public PaymentSourceService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * createUsingPermanentToken a paymentSource using immutable params (executes immediately) - + * returns raw Response. + */ + Response createUsingPermanentTokenRaw(PaymentSourceCreateUsingPermanentTokenParams params) + throws ChargebeeException { + + return post( + "/payment_sources/create_using_permanent_token", + params != null ? params.toFormData() : null); + } + + /** + * createUsingPermanentToken a paymentSource using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response createUsingPermanentTokenRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/payment_sources/create_using_permanent_token", jsonPayload); + } + + public PaymentSourceCreateUsingPermanentTokenResponse createUsingPermanentToken( + PaymentSourceCreateUsingPermanentTokenParams params) throws ChargebeeException { + Response response = createUsingPermanentTokenRaw(params); + + return PaymentSourceCreateUsingPermanentTokenResponse.fromJson( + response.getBodyAsString(), response); + } + + /** delete a paymentSource (executes immediately) - returns raw Response. */ + Response deleteRaw(String custPaymentSourceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/delete", + "cust-payment-source-id", + custPaymentSourceId); + + return post(path, null); + } + + public PaymentSourceDeleteResponse delete(String custPaymentSourceId) throws ChargebeeException { + Response response = deleteRaw(custPaymentSourceId); + return PaymentSourceDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createCard a paymentSource using immutable params (executes immediately) - returns raw + * Response. + */ + Response createCardRaw(PaymentSourceCreateCardParams params) throws ChargebeeException { + + return post("/payment_sources/create_card", params != null ? params.toFormData() : null); + } + + /** + * createCard a paymentSource using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response createCardRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/payment_sources/create_card", jsonPayload); + } + + public PaymentSourceCreateCardResponse createCard(PaymentSourceCreateCardParams params) + throws ChargebeeException { + Response response = createCardRaw(params); + + return PaymentSourceCreateCardResponse.fromJson(response.getBodyAsString(), response); + } + + /** verifyBankAccount a paymentSource (executes immediately) - returns raw Response. */ + Response verifyBankAccountRaw(String custPaymentSourceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/verify_bank_account", + "cust-payment-source-id", + custPaymentSourceId); + + return post(path, null); + } + + /** + * verifyBankAccount a paymentSource using immutable params (executes immediately) - returns raw + * Response. + */ + Response verifyBankAccountRaw( + String custPaymentSourceId, PaymentSourceVerifyBankAccountParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/verify_bank_account", + "cust-payment-source-id", + custPaymentSourceId); + return post(path, params.toFormData()); + } + + /** + * verifyBankAccount a paymentSource using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response verifyBankAccountRaw(String custPaymentSourceId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/verify_bank_account", + "cust-payment-source-id", + custPaymentSourceId); + return postJson(path, jsonPayload); + } + + public PaymentSourceVerifyBankAccountResponse verifyBankAccount( + String custPaymentSourceId, PaymentSourceVerifyBankAccountParams params) + throws ChargebeeException { + Response response = verifyBankAccountRaw(custPaymentSourceId, params); + return PaymentSourceVerifyBankAccountResponse.fromJson(response.getBodyAsString(), response); + } + + /** list a paymentSource using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(PaymentSourceListParams params) throws ChargebeeException { + + return get("/payment_sources", params != null ? params.toQueryParams() : null); + } + + /** list a paymentSource without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/payment_sources", null); + } + + /** list a paymentSource using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public PaymentSourceListResponse list(PaymentSourceListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return PaymentSourceListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public PaymentSourceListResponse list() throws ChargebeeException { + Response response = listRaw(); + return PaymentSourceListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** exportPaymentSource a paymentSource (executes immediately) - returns raw Response. */ + Response exportPaymentSourceRaw(String custPaymentSourceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/export_payment_source", + "cust-payment-source-id", + custPaymentSourceId); + + return post(path, null); + } + + /** + * exportPaymentSource a paymentSource using immutable params (executes immediately) - returns raw + * Response. + */ + Response exportPaymentSourceRaw(String custPaymentSourceId, ExportPaymentSourceParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/export_payment_source", + "cust-payment-source-id", + custPaymentSourceId); + return post(path, params.toFormData()); + } + + /** + * exportPaymentSource a paymentSource using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response exportPaymentSourceRaw(String custPaymentSourceId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/export_payment_source", + "cust-payment-source-id", + custPaymentSourceId); + return postJson(path, jsonPayload); + } + + public ExportPaymentSourceResponse exportPaymentSource( + String custPaymentSourceId, ExportPaymentSourceParams params) throws ChargebeeException { + Response response = exportPaymentSourceRaw(custPaymentSourceId, params); + return ExportPaymentSourceResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createUsingPaymentIntent a paymentSource using immutable params (executes immediately) - + * returns raw Response. + */ + Response createUsingPaymentIntentRaw(PaymentSourceCreateUsingPaymentIntentParams params) + throws ChargebeeException { + + return post( + "/payment_sources/create_using_payment_intent", + params != null ? params.toFormData() : null); + } + + /** + * createUsingPaymentIntent a paymentSource using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response createUsingPaymentIntentRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/payment_sources/create_using_payment_intent", jsonPayload); + } + + public PaymentSourceCreateUsingPaymentIntentResponse createUsingPaymentIntent( + PaymentSourceCreateUsingPaymentIntentParams params) throws ChargebeeException { + Response response = createUsingPaymentIntentRaw(params); + + return PaymentSourceCreateUsingPaymentIntentResponse.fromJson( + response.getBodyAsString(), response); + } + + /** agreementPdf a paymentSource (executes immediately) - returns raw Response. */ + Response agreementPdfRaw(String custPaymentSourceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/agreement_pdf", + "cust-payment-source-id", + custPaymentSourceId); + + return post(path, null); + } + + public PaymentSourceAgreementPdfResponse agreementPdf(String custPaymentSourceId) + throws ChargebeeException { + Response response = agreementPdfRaw(custPaymentSourceId); + return PaymentSourceAgreementPdfResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a paymentSource (executes immediately) - returns raw Response. */ + Response retrieveRaw(String custPaymentSourceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}", + "cust-payment-source-id", + custPaymentSourceId); + + return get(path, null); + } + + public PaymentSourceRetrieveResponse retrieve(String custPaymentSourceId) + throws ChargebeeException { + Response response = retrieveRaw(custPaymentSourceId); + return PaymentSourceRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createVoucherPaymentSource a paymentSource using immutable params (executes immediately) - + * returns raw Response. + */ + Response createVoucherPaymentSourceRaw(CreateVoucherPaymentSourceParams params) + throws ChargebeeException { + + return post( + "/payment_sources/create_voucher_payment_source", + params != null ? params.toFormData() : null); + } + + /** + * createVoucherPaymentSource a paymentSource using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response createVoucherPaymentSourceRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/payment_sources/create_voucher_payment_source", jsonPayload); + } + + public CreateVoucherPaymentSourceResponse createVoucherPaymentSource( + CreateVoucherPaymentSourceParams params) throws ChargebeeException { + Response response = createVoucherPaymentSourceRaw(params); + + return CreateVoucherPaymentSourceResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createUsingTempToken a paymentSource using immutable params (executes immediately) - returns + * raw Response. + */ + Response createUsingTempTokenRaw(PaymentSourceCreateUsingTempTokenParams params) + throws ChargebeeException { + + return post( + "/payment_sources/create_using_temp_token", params != null ? params.toFormData() : null); + } + + /** + * createUsingTempToken a paymentSource using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response createUsingTempTokenRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/payment_sources/create_using_temp_token", jsonPayload); + } + + public PaymentSourceCreateUsingTempTokenResponse createUsingTempToken( + PaymentSourceCreateUsingTempTokenParams params) throws ChargebeeException { + Response response = createUsingTempTokenRaw(params); + + return PaymentSourceCreateUsingTempTokenResponse.fromJson(response.getBodyAsString(), response); + } + + /** updateCard a paymentSource (executes immediately) - returns raw Response. */ + Response updateCardRaw(String custPaymentSourceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/update_card", + "cust-payment-source-id", + custPaymentSourceId); + + return post(path, null); + } + + /** + * updateCard a paymentSource using immutable params (executes immediately) - returns raw + * Response. + */ + Response updateCardRaw(String custPaymentSourceId, PaymentSourceUpdateCardParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/update_card", + "cust-payment-source-id", + custPaymentSourceId); + return post(path, params.toFormData()); + } + + /** + * updateCard a paymentSource using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response updateCardRaw(String custPaymentSourceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/update_card", + "cust-payment-source-id", + custPaymentSourceId); + return postJson(path, jsonPayload); + } + + public PaymentSourceUpdateCardResponse updateCard( + String custPaymentSourceId, PaymentSourceUpdateCardParams params) throws ChargebeeException { + Response response = updateCardRaw(custPaymentSourceId, params); + return PaymentSourceUpdateCardResponse.fromJson(response.getBodyAsString(), response); + } + + /** switchGatewayAccount a paymentSource (executes immediately) - returns raw Response. */ + Response switchGatewayAccountRaw(String custPaymentSourceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/switch_gateway_account", + "cust-payment-source-id", + custPaymentSourceId); + + return post(path, null); + } + + /** + * switchGatewayAccount a paymentSource using immutable params (executes immediately) - returns + * raw Response. + */ + Response switchGatewayAccountRaw( + String custPaymentSourceId, PaymentSourceSwitchGatewayAccountParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/switch_gateway_account", + "cust-payment-source-id", + custPaymentSourceId); + return post(path, params.toFormData()); + } + + /** + * switchGatewayAccount a paymentSource using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response switchGatewayAccountRaw(String custPaymentSourceId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/switch_gateway_account", + "cust-payment-source-id", + custPaymentSourceId); + return postJson(path, jsonPayload); + } + + public PaymentSourceSwitchGatewayAccountResponse switchGatewayAccount( + String custPaymentSourceId, PaymentSourceSwitchGatewayAccountParams params) + throws ChargebeeException { + Response response = switchGatewayAccountRaw(custPaymentSourceId, params); + return PaymentSourceSwitchGatewayAccountResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createUsingToken a paymentSource using immutable params (executes immediately) - returns raw + * Response. + */ + Response createUsingTokenRaw(PaymentSourceCreateUsingTokenParams params) + throws ChargebeeException { + + return post("/payment_sources/create_using_token", params != null ? params.toFormData() : null); + } + + /** + * createUsingToken a paymentSource using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response createUsingTokenRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/payment_sources/create_using_token", jsonPayload); + } + + public PaymentSourceCreateUsingTokenResponse createUsingToken( + PaymentSourceCreateUsingTokenParams params) throws ChargebeeException { + Response response = createUsingTokenRaw(params); + + return PaymentSourceCreateUsingTokenResponse.fromJson(response.getBodyAsString(), response); + } + + /** deleteLocal a paymentSource (executes immediately) - returns raw Response. */ + Response deleteLocalRaw(String custPaymentSourceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/delete_local", + "cust-payment-source-id", + custPaymentSourceId); + + return post(path, null); + } + + public PaymentSourceDeleteLocalResponse deleteLocal(String custPaymentSourceId) + throws ChargebeeException { + Response response = deleteLocalRaw(custPaymentSourceId); + return PaymentSourceDeleteLocalResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createBankAccount a paymentSource using immutable params (executes immediately) - returns raw + * Response. + */ + Response createBankAccountRaw(PaymentSourceCreateBankAccountParams params) + throws ChargebeeException { + + return post( + "/payment_sources/create_bank_account", params != null ? params.toFormData() : null); + } + + /** + * createBankAccount a paymentSource using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response createBankAccountRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/payment_sources/create_bank_account", jsonPayload); + } + + public PaymentSourceCreateBankAccountResponse createBankAccount( + PaymentSourceCreateBankAccountParams params) throws ChargebeeException { + Response response = createBankAccountRaw(params); + + return PaymentSourceCreateBankAccountResponse.fromJson(response.getBodyAsString(), response); + } + + /** updateBankAccount a paymentSource (executes immediately) - returns raw Response. */ + Response updateBankAccountRaw(String custPaymentSourceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/update_bank_account", + "cust-payment-source-id", + custPaymentSourceId); + + return post(path, null); + } + + /** + * updateBankAccount a paymentSource using immutable params (executes immediately) - returns raw + * Response. + */ + Response updateBankAccountRaw( + String custPaymentSourceId, PaymentSourceUpdateBankAccountParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/update_bank_account", + "cust-payment-source-id", + custPaymentSourceId); + return post(path, params.toFormData()); + } + + /** + * updateBankAccount a paymentSource using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response updateBankAccountRaw(String custPaymentSourceId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/update_bank_account", + "cust-payment-source-id", + custPaymentSourceId); + return postJson(path, jsonPayload); + } + + public PaymentSourceUpdateBankAccountResponse updateBankAccount( + String custPaymentSourceId, PaymentSourceUpdateBankAccountParams params) + throws ChargebeeException { + Response response = updateBankAccountRaw(custPaymentSourceId, params); + return PaymentSourceUpdateBankAccountResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/services/PaymentVoucherService.java b/src/main/java/com/chargebee/v4/services/PaymentVoucherService.java new file mode 100644 index 00000000..066c3287 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/PaymentVoucherService.java @@ -0,0 +1,193 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.paymentVoucher.params.PaymentVouchersForCustomerParams; + +import com.chargebee.v4.models.paymentVoucher.params.PaymentVouchersForInvoiceParams; + +import com.chargebee.v4.models.paymentVoucher.params.PaymentVoucherCreateParams; + +import com.chargebee.v4.models.paymentVoucher.responses.PaymentVouchersForCustomerResponse; + +import com.chargebee.v4.models.paymentVoucher.responses.PaymentVouchersForInvoiceResponse; + +import com.chargebee.v4.models.paymentVoucher.responses.PaymentVoucherRetrieveResponse; + +import com.chargebee.v4.models.paymentVoucher.responses.PaymentVoucherCreateResponse; + +public final class PaymentVoucherService extends BaseService { + + private final ServiceConfig config; + + public PaymentVoucherService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private PaymentVoucherService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private PaymentVoucherService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + PaymentVoucherService with(RequestOptions newOptions) { + return new PaymentVoucherService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public PaymentVoucherService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * paymentVouchersForCustomer a paymentVoucher using immutable params (executes immediately) - + * returns raw Response. + */ + Response paymentVouchersForCustomerRaw(String customerId, PaymentVouchersForCustomerParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/payment_vouchers", "customer-id", customerId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * paymentVouchersForCustomer a paymentVoucher without params (executes immediately) - returns raw + * Response. + */ + Response paymentVouchersForCustomerRaw(String customerId) throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/payment_vouchers", "customer-id", customerId); + return get(path, null); + } + + /** + * paymentVouchersForCustomer a paymentVoucher using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response paymentVouchersForCustomerRaw(String customerId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/payment_vouchers", "customer-id", customerId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public PaymentVouchersForCustomerResponse paymentVouchersForCustomer( + String customerId, PaymentVouchersForCustomerParams params) throws ChargebeeException { + Response response = paymentVouchersForCustomerRaw(customerId, params); + return PaymentVouchersForCustomerResponse.fromJson( + response.getBodyAsString(), this, params, customerId, response); + } + + public PaymentVouchersForCustomerResponse paymentVouchersForCustomer(String customerId) + throws ChargebeeException { + Response response = paymentVouchersForCustomerRaw(customerId); + return PaymentVouchersForCustomerResponse.fromJson( + response.getBodyAsString(), this, null, customerId, response); + } + + /** + * paymentVouchersForInvoice a paymentVoucher using immutable params (executes immediately) - + * returns raw Response. + */ + Response paymentVouchersForInvoiceRaw(String invoiceId, PaymentVouchersForInvoiceParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/payment_vouchers", "invoice-id", invoiceId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * paymentVouchersForInvoice a paymentVoucher without params (executes immediately) - returns raw + * Response. + */ + Response paymentVouchersForInvoiceRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/payment_vouchers", "invoice-id", invoiceId); + return get(path, null); + } + + /** + * paymentVouchersForInvoice a paymentVoucher using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response paymentVouchersForInvoiceRaw(String invoiceId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/payment_vouchers", "invoice-id", invoiceId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public PaymentVouchersForInvoiceResponse paymentVouchersForInvoice( + String invoiceId, PaymentVouchersForInvoiceParams params) throws ChargebeeException { + Response response = paymentVouchersForInvoiceRaw(invoiceId, params); + return PaymentVouchersForInvoiceResponse.fromJson( + response.getBodyAsString(), this, params, invoiceId, response); + } + + public PaymentVouchersForInvoiceResponse paymentVouchersForInvoice(String invoiceId) + throws ChargebeeException { + Response response = paymentVouchersForInvoiceRaw(invoiceId); + return PaymentVouchersForInvoiceResponse.fromJson( + response.getBodyAsString(), this, null, invoiceId, response); + } + + /** retrieve a paymentVoucher (executes immediately) - returns raw Response. */ + Response retrieveRaw(String paymentVoucherId) throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_vouchers/{payment-voucher-id}", "payment-voucher-id", paymentVoucherId); + + return get(path, null); + } + + public PaymentVoucherRetrieveResponse retrieve(String paymentVoucherId) + throws ChargebeeException { + Response response = retrieveRaw(paymentVoucherId); + return PaymentVoucherRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * create a paymentVoucher using immutable params (executes immediately) - returns raw Response. + */ + Response createRaw(PaymentVoucherCreateParams params) throws ChargebeeException { + + return post("/payment_vouchers", params != null ? params.toFormData() : null); + } + + /** + * create a paymentVoucher using raw JSON payload (executes immediately) - returns raw Response. + */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/payment_vouchers", jsonPayload); + } + + public PaymentVoucherCreateResponse create(PaymentVoucherCreateParams params) + throws ChargebeeException { + Response response = createRaw(params); + + return PaymentVoucherCreateResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/Pc2MigrationItemFamilyService.java b/src/main/java/com/chargebee/v4/services/Pc2MigrationItemFamilyService.java similarity index 77% rename from src/main/java/com/chargebee/v4/core/services/Pc2MigrationItemFamilyService.java rename to src/main/java/com/chargebee/v4/services/Pc2MigrationItemFamilyService.java index a752c2bb..91b4f87f 100644 --- a/src/main/java/com/chargebee/v4/core/services/Pc2MigrationItemFamilyService.java +++ b/src/main/java/com/chargebee/v4/services/Pc2MigrationItemFamilyService.java @@ -5,27 +5,28 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.pc2MigrationItemFamily.params.Pc2MigrationItemFamilyUpdateParams; +import com.chargebee.v4.models.pc2MigrationItemFamily.params.Pc2MigrationItemFamilyUpdateParams; -import com.chargebee.v4.core.models.pc2MigrationItemFamily.params.Pc2MigrationItemFamilyListParams; +import com.chargebee.v4.models.pc2MigrationItemFamily.params.Pc2MigrationItemFamilyListParams; -import com.chargebee.v4.core.models.pc2MigrationItemFamily.params.Pc2MigrationItemFamilyCreateParams; +import com.chargebee.v4.models.pc2MigrationItemFamily.params.Pc2MigrationItemFamilyCreateParams; -import com.chargebee.v4.core.responses.pc2MigrationItemFamily.Pc2MigrationItemFamilyDeleteResponse; +import com.chargebee.v4.models.pc2MigrationItemFamily.responses.Pc2MigrationItemFamilyDeleteResponse; -import com.chargebee.v4.core.responses.pc2MigrationItemFamily.Pc2MigrationItemFamilyRetrieveResponse; +import com.chargebee.v4.models.pc2MigrationItemFamily.responses.Pc2MigrationItemFamilyRetrieveResponse; -import com.chargebee.v4.core.responses.pc2MigrationItemFamily.Pc2MigrationItemFamilyUpdateResponse; +import com.chargebee.v4.models.pc2MigrationItemFamily.responses.Pc2MigrationItemFamilyUpdateResponse; -import com.chargebee.v4.core.responses.pc2MigrationItemFamily.Pc2MigrationItemFamilyListResponse; +import com.chargebee.v4.models.pc2MigrationItemFamily.responses.Pc2MigrationItemFamilyListResponse; -import com.chargebee.v4.core.responses.pc2MigrationItemFamily.Pc2MigrationItemFamilyCreateResponse; +import com.chargebee.v4.models.pc2MigrationItemFamily.responses.Pc2MigrationItemFamilyCreateResponse; public final class Pc2MigrationItemFamilyService extends BaseService { @@ -64,7 +65,7 @@ public Pc2MigrationItemFamilyService withOptions(RequestOptions options) { // === Operations === /** delete a pc2MigrationItemFamily (executes immediately) - returns raw Response. */ - Response deleteRaw(String pc2MigrationItemFamilyId) throws Exception { + Response deleteRaw(String pc2MigrationItemFamilyId) throws ChargebeeException { String path = buildPathWithParams( "/pc2_migration_item_families/{pc2-migration-item-family-id}/delete", @@ -75,13 +76,13 @@ Response deleteRaw(String pc2MigrationItemFamilyId) throws Exception { } public Pc2MigrationItemFamilyDeleteResponse delete(String pc2MigrationItemFamilyId) - throws Exception { + throws ChargebeeException { Response response = deleteRaw(pc2MigrationItemFamilyId); return Pc2MigrationItemFamilyDeleteResponse.fromJson(response.getBodyAsString(), response); } /** retrieve a pc2MigrationItemFamily (executes immediately) - returns raw Response. */ - Response retrieveRaw(String pc2MigrationItemFamilyId) throws Exception { + Response retrieveRaw(String pc2MigrationItemFamilyId) throws ChargebeeException { String path = buildPathWithParams( "/pc2_migration_item_families/{pc2-migration-item-family-id}", @@ -92,13 +93,13 @@ Response retrieveRaw(String pc2MigrationItemFamilyId) throws Exception { } public Pc2MigrationItemFamilyRetrieveResponse retrieve(String pc2MigrationItemFamilyId) - throws Exception { + throws ChargebeeException { Response response = retrieveRaw(pc2MigrationItemFamilyId); return Pc2MigrationItemFamilyRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** update a pc2MigrationItemFamily (executes immediately) - returns raw Response. */ - Response updateRaw(String pc2MigrationItemFamilyId) throws Exception { + Response updateRaw(String pc2MigrationItemFamilyId) throws ChargebeeException { String path = buildPathWithParams( "/pc2_migration_item_families/{pc2-migration-item-family-id}", @@ -113,7 +114,7 @@ Response updateRaw(String pc2MigrationItemFamilyId) throws Exception { * Response. */ Response updateRaw(String pc2MigrationItemFamilyId, Pc2MigrationItemFamilyUpdateParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/pc2_migration_item_families/{pc2-migration-item-family-id}", @@ -126,7 +127,8 @@ Response updateRaw(String pc2MigrationItemFamilyId, Pc2MigrationItemFamilyUpdate * update a pc2MigrationItemFamily using raw JSON payload (executes immediately) - returns raw * Response. */ - Response updateRaw(String pc2MigrationItemFamilyId, String jsonPayload) throws Exception { + Response updateRaw(String pc2MigrationItemFamilyId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/pc2_migration_item_families/{pc2-migration-item-family-id}", @@ -136,7 +138,8 @@ Response updateRaw(String pc2MigrationItemFamilyId, String jsonPayload) throws E } public Pc2MigrationItemFamilyUpdateResponse update( - String pc2MigrationItemFamilyId, Pc2MigrationItemFamilyUpdateParams params) throws Exception { + String pc2MigrationItemFamilyId, Pc2MigrationItemFamilyUpdateParams params) + throws ChargebeeException { Response response = updateRaw(pc2MigrationItemFamilyId, params); return Pc2MigrationItemFamilyUpdateResponse.fromJson(response.getBodyAsString(), response); } @@ -145,13 +148,13 @@ public Pc2MigrationItemFamilyUpdateResponse update( * list a pc2MigrationItemFamily using immutable params (executes immediately) - returns raw * Response. */ - Response listRaw(Pc2MigrationItemFamilyListParams params) throws Exception { + Response listRaw(Pc2MigrationItemFamilyListParams params) throws ChargebeeException { return get("/pc2_migration_item_families", params != null ? params.toQueryParams() : null); } /** list a pc2MigrationItemFamily without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/pc2_migration_item_families", null); } @@ -160,20 +163,20 @@ Response listRaw() throws Exception { * list a pc2MigrationItemFamily using raw JSON payload (executes immediately) - returns raw * Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public Pc2MigrationItemFamilyListResponse list(Pc2MigrationItemFamilyListParams params) - throws Exception { + throws ChargebeeException { Response response = listRaw(params); return Pc2MigrationItemFamilyListResponse.fromJson( response.getBodyAsString(), this, params, response); } - public Pc2MigrationItemFamilyListResponse list() throws Exception { + public Pc2MigrationItemFamilyListResponse list() throws ChargebeeException { Response response = listRaw(); return Pc2MigrationItemFamilyListResponse.fromJson( response.getBodyAsString(), this, null, response); @@ -183,7 +186,7 @@ public Pc2MigrationItemFamilyListResponse list() throws Exception { * create a pc2MigrationItemFamily using immutable params (executes immediately) - returns raw * Response. */ - Response createRaw(Pc2MigrationItemFamilyCreateParams params) throws Exception { + Response createRaw(Pc2MigrationItemFamilyCreateParams params) throws ChargebeeException { return post("/pc2_migration_item_families", params != null ? params.toFormData() : null); } @@ -192,13 +195,13 @@ Response createRaw(Pc2MigrationItemFamilyCreateParams params) throws Exception { * create a pc2MigrationItemFamily using raw JSON payload (executes immediately) - returns raw * Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/pc2_migration_item_families", jsonPayload); } public Pc2MigrationItemFamilyCreateResponse create(Pc2MigrationItemFamilyCreateParams params) - throws Exception { + throws ChargebeeException { Response response = createRaw(params); return Pc2MigrationItemFamilyCreateResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/core/services/Pc2MigrationItemPriceService.java b/src/main/java/com/chargebee/v4/services/Pc2MigrationItemPriceService.java similarity index 79% rename from src/main/java/com/chargebee/v4/core/services/Pc2MigrationItemPriceService.java rename to src/main/java/com/chargebee/v4/services/Pc2MigrationItemPriceService.java index bf765515..1b3ede9f 100644 --- a/src/main/java/com/chargebee/v4/core/services/Pc2MigrationItemPriceService.java +++ b/src/main/java/com/chargebee/v4/services/Pc2MigrationItemPriceService.java @@ -5,23 +5,24 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.pc2MigrationItemPrice.params.Pc2MigrationItemPriceListParams; +import com.chargebee.v4.models.pc2MigrationItemPrice.params.Pc2MigrationItemPriceListParams; -import com.chargebee.v4.core.models.pc2MigrationItemPrice.params.Pc2MigrationItemPriceUpdateParams; +import com.chargebee.v4.models.pc2MigrationItemPrice.params.Pc2MigrationItemPriceUpdateParams; -import com.chargebee.v4.core.responses.pc2MigrationItemPrice.Pc2MigrationItemPriceListResponse; +import com.chargebee.v4.models.pc2MigrationItemPrice.responses.Pc2MigrationItemPriceListResponse; -import com.chargebee.v4.core.responses.pc2MigrationItemPrice.Pc2MigrationItemPriceDeleteResponse; +import com.chargebee.v4.models.pc2MigrationItemPrice.responses.Pc2MigrationItemPriceDeleteResponse; -import com.chargebee.v4.core.responses.pc2MigrationItemPrice.Pc2MigrationItemPriceRetrieveResponse; +import com.chargebee.v4.models.pc2MigrationItemPrice.responses.Pc2MigrationItemPriceRetrieveResponse; -import com.chargebee.v4.core.responses.pc2MigrationItemPrice.Pc2MigrationItemPriceUpdateResponse; +import com.chargebee.v4.models.pc2MigrationItemPrice.responses.Pc2MigrationItemPriceUpdateResponse; public final class Pc2MigrationItemPriceService extends BaseService { @@ -62,13 +63,13 @@ public Pc2MigrationItemPriceService withOptions(RequestOptions options) { * list a pc2MigrationItemPrice using immutable params (executes immediately) - returns raw * Response. */ - Response listRaw(Pc2MigrationItemPriceListParams params) throws Exception { + Response listRaw(Pc2MigrationItemPriceListParams params) throws ChargebeeException { return get("/pc2_migration_item_prices", params != null ? params.toQueryParams() : null); } /** list a pc2MigrationItemPrice without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/pc2_migration_item_prices", null); } @@ -77,27 +78,27 @@ Response listRaw() throws Exception { * list a pc2MigrationItemPrice using raw JSON payload (executes immediately) - returns raw * Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public Pc2MigrationItemPriceListResponse list(Pc2MigrationItemPriceListParams params) - throws Exception { + throws ChargebeeException { Response response = listRaw(params); return Pc2MigrationItemPriceListResponse.fromJson( response.getBodyAsString(), this, params, response); } - public Pc2MigrationItemPriceListResponse list() throws Exception { + public Pc2MigrationItemPriceListResponse list() throws ChargebeeException { Response response = listRaw(); return Pc2MigrationItemPriceListResponse.fromJson( response.getBodyAsString(), this, null, response); } /** delete a pc2MigrationItemPrice (executes immediately) - returns raw Response. */ - Response deleteRaw(String pc2MigrationItemPriceId) throws Exception { + Response deleteRaw(String pc2MigrationItemPriceId) throws ChargebeeException { String path = buildPathWithParams( "/pc2_migration_item_prices/{pc2-migration-item-price-id}/delete", @@ -108,13 +109,13 @@ Response deleteRaw(String pc2MigrationItemPriceId) throws Exception { } public Pc2MigrationItemPriceDeleteResponse delete(String pc2MigrationItemPriceId) - throws Exception { + throws ChargebeeException { Response response = deleteRaw(pc2MigrationItemPriceId); return Pc2MigrationItemPriceDeleteResponse.fromJson(response.getBodyAsString(), response); } /** retrieve a pc2MigrationItemPrice (executes immediately) - returns raw Response. */ - Response retrieveRaw(String pc2MigrationItemPriceId) throws Exception { + Response retrieveRaw(String pc2MigrationItemPriceId) throws ChargebeeException { String path = buildPathWithParams( "/pc2_migration_item_prices/{pc2-migration-item-price-id}", @@ -125,13 +126,13 @@ Response retrieveRaw(String pc2MigrationItemPriceId) throws Exception { } public Pc2MigrationItemPriceRetrieveResponse retrieve(String pc2MigrationItemPriceId) - throws Exception { + throws ChargebeeException { Response response = retrieveRaw(pc2MigrationItemPriceId); return Pc2MigrationItemPriceRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** update a pc2MigrationItemPrice (executes immediately) - returns raw Response. */ - Response updateRaw(String pc2MigrationItemPriceId) throws Exception { + Response updateRaw(String pc2MigrationItemPriceId) throws ChargebeeException { String path = buildPathWithParams( "/pc2_migration_item_prices/{pc2-migration-item-price-id}", @@ -146,7 +147,7 @@ Response updateRaw(String pc2MigrationItemPriceId) throws Exception { * Response. */ Response updateRaw(String pc2MigrationItemPriceId, Pc2MigrationItemPriceUpdateParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/pc2_migration_item_prices/{pc2-migration-item-price-id}", @@ -159,7 +160,7 @@ Response updateRaw(String pc2MigrationItemPriceId, Pc2MigrationItemPriceUpdatePa * update a pc2MigrationItemPrice using raw JSON payload (executes immediately) - returns raw * Response. */ - Response updateRaw(String pc2MigrationItemPriceId, String jsonPayload) throws Exception { + Response updateRaw(String pc2MigrationItemPriceId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/pc2_migration_item_prices/{pc2-migration-item-price-id}", @@ -169,7 +170,8 @@ Response updateRaw(String pc2MigrationItemPriceId, String jsonPayload) throws Ex } public Pc2MigrationItemPriceUpdateResponse update( - String pc2MigrationItemPriceId, Pc2MigrationItemPriceUpdateParams params) throws Exception { + String pc2MigrationItemPriceId, Pc2MigrationItemPriceUpdateParams params) + throws ChargebeeException { Response response = updateRaw(pc2MigrationItemPriceId, params); return Pc2MigrationItemPriceUpdateResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/core/services/Pc2MigrationItemService.java b/src/main/java/com/chargebee/v4/services/Pc2MigrationItemService.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/services/Pc2MigrationItemService.java rename to src/main/java/com/chargebee/v4/services/Pc2MigrationItemService.java index 5d3be31c..2da39717 100644 --- a/src/main/java/com/chargebee/v4/core/services/Pc2MigrationItemService.java +++ b/src/main/java/com/chargebee/v4/services/Pc2MigrationItemService.java @@ -5,31 +5,32 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.pc2MigrationItem.params.Pc2MigrationItemUpdateParams; +import com.chargebee.v4.models.pc2MigrationItem.params.Pc2MigrationItemUpdateParams; -import com.chargebee.v4.core.models.pc2MigrationItem.params.Pc2MigrationItemListParams; +import com.chargebee.v4.models.pc2MigrationItem.params.Pc2MigrationItemListParams; -import com.chargebee.v4.core.models.pc2MigrationItem.params.Pc2MigrationItemCreateParams; +import com.chargebee.v4.models.pc2MigrationItem.params.Pc2MigrationItemCreateParams; -import com.chargebee.v4.core.models.pc2MigrationItem.params.Pc2MigrationItemListApplicableAddonsParams; +import com.chargebee.v4.models.pc2MigrationItem.params.Pc2MigrationItemListApplicableAddonsParams; -import com.chargebee.v4.core.responses.pc2MigrationItem.Pc2MigrationItemRetrieveResponse; +import com.chargebee.v4.models.pc2MigrationItem.responses.Pc2MigrationItemRetrieveResponse; -import com.chargebee.v4.core.responses.pc2MigrationItem.Pc2MigrationItemUpdateResponse; +import com.chargebee.v4.models.pc2MigrationItem.responses.Pc2MigrationItemUpdateResponse; -import com.chargebee.v4.core.responses.pc2MigrationItem.Pc2MigrationItemDeleteResponse; +import com.chargebee.v4.models.pc2MigrationItem.responses.Pc2MigrationItemDeleteResponse; -import com.chargebee.v4.core.responses.pc2MigrationItem.Pc2MigrationItemListResponse; +import com.chargebee.v4.models.pc2MigrationItem.responses.Pc2MigrationItemListResponse; -import com.chargebee.v4.core.responses.pc2MigrationItem.Pc2MigrationItemCreateResponse; +import com.chargebee.v4.models.pc2MigrationItem.responses.Pc2MigrationItemCreateResponse; -import com.chargebee.v4.core.responses.pc2MigrationItem.Pc2MigrationItemListApplicableAddonsResponse; +import com.chargebee.v4.models.pc2MigrationItem.responses.Pc2MigrationItemListApplicableAddonsResponse; public final class Pc2MigrationItemService extends BaseService { @@ -67,7 +68,7 @@ public Pc2MigrationItemService withOptions(RequestOptions options) { // === Operations === /** retrieve a pc2MigrationItem (executes immediately) - returns raw Response. */ - Response retrieveRaw(String pc2MigrationItemId) throws Exception { + Response retrieveRaw(String pc2MigrationItemId) throws ChargebeeException { String path = buildPathWithParams( "/pc2_migration_items/{pc2-migration-item-id}", @@ -77,13 +78,14 @@ Response retrieveRaw(String pc2MigrationItemId) throws Exception { return get(path, null); } - public Pc2MigrationItemRetrieveResponse retrieve(String pc2MigrationItemId) throws Exception { + public Pc2MigrationItemRetrieveResponse retrieve(String pc2MigrationItemId) + throws ChargebeeException { Response response = retrieveRaw(pc2MigrationItemId); return Pc2MigrationItemRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** update a pc2MigrationItem (executes immediately) - returns raw Response. */ - Response updateRaw(String pc2MigrationItemId) throws Exception { + Response updateRaw(String pc2MigrationItemId) throws ChargebeeException { String path = buildPathWithParams( "/pc2_migration_items/{pc2-migration-item-id}", @@ -97,7 +99,7 @@ Response updateRaw(String pc2MigrationItemId) throws Exception { * update a pc2MigrationItem using immutable params (executes immediately) - returns raw Response. */ Response updateRaw(String pc2MigrationItemId, Pc2MigrationItemUpdateParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/pc2_migration_items/{pc2-migration-item-id}", @@ -109,7 +111,7 @@ Response updateRaw(String pc2MigrationItemId, Pc2MigrationItemUpdateParams param /** * update a pc2MigrationItem using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String pc2MigrationItemId, String jsonPayload) throws Exception { + Response updateRaw(String pc2MigrationItemId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/pc2_migration_items/{pc2-migration-item-id}", @@ -119,13 +121,13 @@ Response updateRaw(String pc2MigrationItemId, String jsonPayload) throws Excepti } public Pc2MigrationItemUpdateResponse update( - String pc2MigrationItemId, Pc2MigrationItemUpdateParams params) throws Exception { + String pc2MigrationItemId, Pc2MigrationItemUpdateParams params) throws ChargebeeException { Response response = updateRaw(pc2MigrationItemId, params); return Pc2MigrationItemUpdateResponse.fromJson(response.getBodyAsString(), response); } /** delete a pc2MigrationItem (executes immediately) - returns raw Response. */ - Response deleteRaw(String pc2MigrationItemId) throws Exception { + Response deleteRaw(String pc2MigrationItemId) throws ChargebeeException { String path = buildPathWithParams( "/pc2_migration_items/{pc2-migration-item-id}/delete", @@ -135,7 +137,8 @@ Response deleteRaw(String pc2MigrationItemId) throws Exception { return post(path, null); } - public Pc2MigrationItemDeleteResponse delete(String pc2MigrationItemId) throws Exception { + public Pc2MigrationItemDeleteResponse delete(String pc2MigrationItemId) + throws ChargebeeException { Response response = deleteRaw(pc2MigrationItemId); return Pc2MigrationItemDeleteResponse.fromJson(response.getBodyAsString(), response); } @@ -143,13 +146,13 @@ public Pc2MigrationItemDeleteResponse delete(String pc2MigrationItemId) throws E /** * list a pc2MigrationItem using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(Pc2MigrationItemListParams params) throws Exception { + Response listRaw(Pc2MigrationItemListParams params) throws ChargebeeException { return get("/pc2_migration_items", params != null ? params.toQueryParams() : null); } /** list a pc2MigrationItem without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/pc2_migration_items", null); } @@ -157,19 +160,20 @@ Response listRaw() throws Exception { /** * list a pc2MigrationItem using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public Pc2MigrationItemListResponse list(Pc2MigrationItemListParams params) throws Exception { + public Pc2MigrationItemListResponse list(Pc2MigrationItemListParams params) + throws ChargebeeException { Response response = listRaw(params); return Pc2MigrationItemListResponse.fromJson( response.getBodyAsString(), this, params, response); } - public Pc2MigrationItemListResponse list() throws Exception { + public Pc2MigrationItemListResponse list() throws ChargebeeException { Response response = listRaw(); return Pc2MigrationItemListResponse.fromJson(response.getBodyAsString(), this, null, response); } @@ -177,7 +181,7 @@ public Pc2MigrationItemListResponse list() throws Exception { /** * create a pc2MigrationItem using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(Pc2MigrationItemCreateParams params) throws Exception { + Response createRaw(Pc2MigrationItemCreateParams params) throws ChargebeeException { return post("/pc2_migration_items", params != null ? params.toFormData() : null); } @@ -185,13 +189,13 @@ Response createRaw(Pc2MigrationItemCreateParams params) throws Exception { /** * create a pc2MigrationItem using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/pc2_migration_items", jsonPayload); } public Pc2MigrationItemCreateResponse create(Pc2MigrationItemCreateParams params) - throws Exception { + throws ChargebeeException { Response response = createRaw(params); return Pc2MigrationItemCreateResponse.fromJson(response.getBodyAsString(), response); @@ -202,7 +206,7 @@ public Pc2MigrationItemCreateResponse create(Pc2MigrationItemCreateParams params * raw Response. */ Response listApplicableAddonsRaw(Pc2MigrationItemListApplicableAddonsParams params) - throws Exception { + throws ChargebeeException { return get( "/pc2_migration_items/applicable_items", params != null ? params.toQueryParams() : null); @@ -212,7 +216,7 @@ Response listApplicableAddonsRaw(Pc2MigrationItemListApplicableAddonsParams para * listApplicableAddons a pc2MigrationItem without params (executes immediately) - returns raw * Response. */ - Response listApplicableAddonsRaw() throws Exception { + Response listApplicableAddonsRaw() throws ChargebeeException { return get("/pc2_migration_items/applicable_items", null); } @@ -221,20 +225,21 @@ Response listApplicableAddonsRaw() throws Exception { * listApplicableAddons a pc2MigrationItem using raw JSON payload (executes immediately) - returns * raw Response. */ - Response listApplicableAddonsRaw(String jsonPayload) throws Exception { + Response listApplicableAddonsRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public Pc2MigrationItemListApplicableAddonsResponse listApplicableAddons( - Pc2MigrationItemListApplicableAddonsParams params) throws Exception { + Pc2MigrationItemListApplicableAddonsParams params) throws ChargebeeException { Response response = listApplicableAddonsRaw(params); return Pc2MigrationItemListApplicableAddonsResponse.fromJson( response.getBodyAsString(), this, params, response); } - public Pc2MigrationItemListApplicableAddonsResponse listApplicableAddons() throws Exception { + public Pc2MigrationItemListApplicableAddonsResponse listApplicableAddons() + throws ChargebeeException { Response response = listApplicableAddonsRaw(); return Pc2MigrationItemListApplicableAddonsResponse.fromJson( response.getBodyAsString(), this, null, response); diff --git a/src/main/java/com/chargebee/v4/core/services/Pc2MigrationService.java b/src/main/java/com/chargebee/v4/services/Pc2MigrationService.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/services/Pc2MigrationService.java rename to src/main/java/com/chargebee/v4/services/Pc2MigrationService.java index 2f2eb328..55c58f7e 100644 --- a/src/main/java/com/chargebee/v4/core/services/Pc2MigrationService.java +++ b/src/main/java/com/chargebee/v4/services/Pc2MigrationService.java @@ -5,21 +5,22 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.pc2Migration.params.Pc2MigrationCreateParams; +import com.chargebee.v4.models.pc2Migration.params.Pc2MigrationCreateParams; -import com.chargebee.v4.core.responses.pc2Migration.Pc2MigrationContactSupportResponse; +import com.chargebee.v4.models.pc2Migration.responses.Pc2MigrationContactSupportResponse; -import com.chargebee.v4.core.responses.pc2Migration.Pc2MigrationRetrieveResponse; +import com.chargebee.v4.models.pc2Migration.responses.Pc2MigrationRetrieveResponse; -import com.chargebee.v4.core.responses.pc2Migration.Pc2MigrationCreateResponse; +import com.chargebee.v4.models.pc2Migration.responses.Pc2MigrationCreateResponse; -import com.chargebee.v4.core.responses.pc2Migration.Pc2MigrationInitiateResponse; +import com.chargebee.v4.models.pc2Migration.responses.Pc2MigrationInitiateResponse; public final class Pc2MigrationService extends BaseService { @@ -57,7 +58,7 @@ public Pc2MigrationService withOptions(RequestOptions options) { // === Operations === /** contactSupport a pc2Migration (executes immediately) - returns raw Response. */ - Response contactSupportRaw(String pc2MigrationId) throws Exception { + Response contactSupportRaw(String pc2MigrationId) throws ChargebeeException { String path = buildPathWithParams( "/pc2_migrations/{pc2-migration-id}/contact_support", @@ -67,13 +68,14 @@ Response contactSupportRaw(String pc2MigrationId) throws Exception { return post(path, null); } - public Pc2MigrationContactSupportResponse contactSupport(String pc2MigrationId) throws Exception { + public Pc2MigrationContactSupportResponse contactSupport(String pc2MigrationId) + throws ChargebeeException { Response response = contactSupportRaw(pc2MigrationId); return Pc2MigrationContactSupportResponse.fromJson(response.getBodyAsString(), response); } /** retrieve a pc2Migration (executes immediately) - returns raw Response. */ - Response retrieveRaw(String pc2MigrationId) throws Exception { + Response retrieveRaw(String pc2MigrationId) throws ChargebeeException { String path = buildPathWithParams( "/pc2_migrations/{pc2-migration-id}", "pc2-migration-id", pc2MigrationId); @@ -81,31 +83,32 @@ Response retrieveRaw(String pc2MigrationId) throws Exception { return get(path, null); } - public Pc2MigrationRetrieveResponse retrieve(String pc2MigrationId) throws Exception { + public Pc2MigrationRetrieveResponse retrieve(String pc2MigrationId) throws ChargebeeException { Response response = retrieveRaw(pc2MigrationId); return Pc2MigrationRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** create a pc2Migration using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(Pc2MigrationCreateParams params) throws Exception { + Response createRaw(Pc2MigrationCreateParams params) throws ChargebeeException { return post("/pc2_migrations", params != null ? params.toFormData() : null); } /** create a pc2Migration using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/pc2_migrations", jsonPayload); } - public Pc2MigrationCreateResponse create(Pc2MigrationCreateParams params) throws Exception { + public Pc2MigrationCreateResponse create(Pc2MigrationCreateParams params) + throws ChargebeeException { Response response = createRaw(params); return Pc2MigrationCreateResponse.fromJson(response.getBodyAsString(), response); } /** initiate a pc2Migration (executes immediately) - returns raw Response. */ - Response initiateRaw(String pc2MigrationId) throws Exception { + Response initiateRaw(String pc2MigrationId) throws ChargebeeException { String path = buildPathWithParams( "/pc2_migrations/{pc2-migration-id}/initiate", "pc2-migration-id", pc2MigrationId); @@ -113,7 +116,7 @@ Response initiateRaw(String pc2MigrationId) throws Exception { return post(path, null); } - public Pc2MigrationInitiateResponse initiate(String pc2MigrationId) throws Exception { + public Pc2MigrationInitiateResponse initiate(String pc2MigrationId) throws ChargebeeException { Response response = initiateRaw(pc2MigrationId); return Pc2MigrationInitiateResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/services/PersonalizedOfferService.java b/src/main/java/com/chargebee/v4/services/PersonalizedOfferService.java new file mode 100644 index 00000000..489f72fa --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/PersonalizedOfferService.java @@ -0,0 +1,78 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.personalizedOffer.params.PersonalizedOffersParams; + +import com.chargebee.v4.models.personalizedOffer.responses.PersonalizedOffersResponse; + +public final class PersonalizedOfferService extends BaseService { + + private final ServiceConfig config; + + public PersonalizedOfferService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private PersonalizedOfferService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private PersonalizedOfferService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + PersonalizedOfferService with(RequestOptions newOptions) { + return new PersonalizedOfferService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public PersonalizedOfferService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * personalizedOffers a personalizedOffer using immutable params (executes immediately) - returns + * raw Response. + */ + Response personalizedOffersRaw(PersonalizedOffersParams params) throws ChargebeeException { + + return post("/personalized_offers", params != null ? params.toFormData() : null); + } + + /** + * personalizedOffers a personalizedOffer using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response personalizedOffersRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/personalized_offers", jsonPayload); + } + + public PersonalizedOffersResponse personalizedOffers(PersonalizedOffersParams params) + throws ChargebeeException { + Response response = personalizedOffersRaw(params); + + return PersonalizedOffersResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/services/PlanService.java b/src/main/java/com/chargebee/v4/services/PlanService.java new file mode 100644 index 00000000..3566cd75 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/PlanService.java @@ -0,0 +1,196 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.plan.params.PlanCopyParams; + +import com.chargebee.v4.models.plan.params.PlanListParams; + +import com.chargebee.v4.models.plan.params.PlanCreateParams; + +import com.chargebee.v4.models.plan.params.PlanUpdateParams; + +import com.chargebee.v4.models.plan.responses.PlanUnarchiveResponse; + +import com.chargebee.v4.models.plan.responses.PlanDeleteResponse; + +import com.chargebee.v4.models.plan.responses.PlanCopyResponse; + +import com.chargebee.v4.models.plan.responses.PlanListResponse; + +import com.chargebee.v4.models.plan.responses.PlanCreateResponse; + +import com.chargebee.v4.models.plan.responses.PlanRetrieveResponse; + +import com.chargebee.v4.models.plan.responses.PlanUpdateResponse; + +public final class PlanService extends BaseService { + + private final ServiceConfig config; + + public PlanService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private PlanService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private PlanService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + PlanService with(RequestOptions newOptions) { + return new PlanService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public PlanService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** unarchive a plan (executes immediately) - returns raw Response. */ + Response unarchiveRaw(String planId) throws ChargebeeException { + String path = buildPathWithParams("/plans/{plan-id}/unarchive", "plan-id", planId); + + return post(path, null); + } + + public PlanUnarchiveResponse unarchive(String planId) throws ChargebeeException { + Response response = unarchiveRaw(planId); + return PlanUnarchiveResponse.fromJson(response.getBodyAsString(), response); + } + + /** delete a plan (executes immediately) - returns raw Response. */ + Response deleteRaw(String planId) throws ChargebeeException { + String path = buildPathWithParams("/plans/{plan-id}/delete", "plan-id", planId); + + return post(path, null); + } + + public PlanDeleteResponse delete(String planId) throws ChargebeeException { + Response response = deleteRaw(planId); + return PlanDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** copy a plan using immutable params (executes immediately) - returns raw Response. */ + Response copyRaw(PlanCopyParams params) throws ChargebeeException { + + return post("/plans/copy", params != null ? params.toFormData() : null); + } + + /** copy a plan using raw JSON payload (executes immediately) - returns raw Response. */ + Response copyRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/plans/copy", jsonPayload); + } + + public PlanCopyResponse copy(PlanCopyParams params) throws ChargebeeException { + Response response = copyRaw(params); + + return PlanCopyResponse.fromJson(response.getBodyAsString(), response); + } + + /** list a plan using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(PlanListParams params) throws ChargebeeException { + + return get("/plans", params != null ? params.toQueryParams() : null); + } + + /** list a plan without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/plans", null); + } + + /** list a plan using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public PlanListResponse list(PlanListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return PlanListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public PlanListResponse list() throws ChargebeeException { + Response response = listRaw(); + return PlanListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** create a plan using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(PlanCreateParams params) throws ChargebeeException { + + return post("/plans", params != null ? params.toFormData() : null); + } + + /** create a plan using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/plans", jsonPayload); + } + + public PlanCreateResponse create(PlanCreateParams params) throws ChargebeeException { + Response response = createRaw(params); + + return PlanCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a plan (executes immediately) - returns raw Response. */ + Response retrieveRaw(String planId) throws ChargebeeException { + String path = buildPathWithParams("/plans/{plan-id}", "plan-id", planId); + + return get(path, null); + } + + public PlanRetrieveResponse retrieve(String planId) throws ChargebeeException { + Response response = retrieveRaw(planId); + return PlanRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** update a plan (executes immediately) - returns raw Response. */ + Response updateRaw(String planId) throws ChargebeeException { + String path = buildPathWithParams("/plans/{plan-id}", "plan-id", planId); + + return post(path, null); + } + + /** update a plan using immutable params (executes immediately) - returns raw Response. */ + Response updateRaw(String planId, PlanUpdateParams params) throws ChargebeeException { + String path = buildPathWithParams("/plans/{plan-id}", "plan-id", planId); + return post(path, params.toFormData()); + } + + /** update a plan using raw JSON payload (executes immediately) - returns raw Response. */ + Response updateRaw(String planId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/plans/{plan-id}", "plan-id", planId); + return postJson(path, jsonPayload); + } + + public PlanUpdateResponse update(String planId, PlanUpdateParams params) + throws ChargebeeException { + Response response = updateRaw(planId, params); + return PlanUpdateResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/PortalSessionService.java b/src/main/java/com/chargebee/v4/services/PortalSessionService.java similarity index 77% rename from src/main/java/com/chargebee/v4/core/services/PortalSessionService.java rename to src/main/java/com/chargebee/v4/services/PortalSessionService.java index 828a6341..9e928f65 100644 --- a/src/main/java/com/chargebee/v4/core/services/PortalSessionService.java +++ b/src/main/java/com/chargebee/v4/services/PortalSessionService.java @@ -5,23 +5,24 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.portalSession.params.PortalSessionCreateParams; +import com.chargebee.v4.models.portalSession.params.PortalSessionCreateParams; -import com.chargebee.v4.core.models.portalSession.params.PortalSessionActivateParams; +import com.chargebee.v4.models.portalSession.params.PortalSessionActivateParams; -import com.chargebee.v4.core.responses.portalSession.PortalSessionCreateResponse; +import com.chargebee.v4.models.portalSession.responses.PortalSessionCreateResponse; -import com.chargebee.v4.core.responses.portalSession.PortalSessionActivateResponse; +import com.chargebee.v4.models.portalSession.responses.PortalSessionActivateResponse; -import com.chargebee.v4.core.responses.portalSession.PortalSessionLogoutResponse; +import com.chargebee.v4.models.portalSession.responses.PortalSessionLogoutResponse; -import com.chargebee.v4.core.responses.portalSession.PortalSessionRetrieveResponse; +import com.chargebee.v4.models.portalSession.responses.PortalSessionRetrieveResponse; public final class PortalSessionService extends BaseService { @@ -61,7 +62,7 @@ public PortalSessionService withOptions(RequestOptions options) { /** * create a portalSession using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(PortalSessionCreateParams params) throws Exception { + Response createRaw(PortalSessionCreateParams params) throws ChargebeeException { return post("/portal_sessions", params != null ? params.toFormData() : null); } @@ -69,19 +70,20 @@ Response createRaw(PortalSessionCreateParams params) throws Exception { /** * create a portalSession using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/portal_sessions", jsonPayload); } - public PortalSessionCreateResponse create(PortalSessionCreateParams params) throws Exception { + public PortalSessionCreateResponse create(PortalSessionCreateParams params) + throws ChargebeeException { Response response = createRaw(params); return PortalSessionCreateResponse.fromJson(response.getBodyAsString(), response); } /** activate a portalSession (executes immediately) - returns raw Response. */ - Response activateRaw(String portalSessionId) throws Exception { + Response activateRaw(String portalSessionId) throws ChargebeeException { String path = buildPathWithParams( "/portal_sessions/{portal-session-id}/activate", "portal-session-id", portalSessionId); @@ -93,7 +95,7 @@ Response activateRaw(String portalSessionId) throws Exception { * activate a portalSession using immutable params (executes immediately) - returns raw Response. */ Response activateRaw(String portalSessionId, PortalSessionActivateParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/portal_sessions/{portal-session-id}/activate", "portal-session-id", portalSessionId); @@ -103,7 +105,7 @@ Response activateRaw(String portalSessionId, PortalSessionActivateParams params) /** * activate a portalSession using raw JSON payload (executes immediately) - returns raw Response. */ - Response activateRaw(String portalSessionId, String jsonPayload) throws Exception { + Response activateRaw(String portalSessionId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/portal_sessions/{portal-session-id}/activate", "portal-session-id", portalSessionId); @@ -111,13 +113,13 @@ Response activateRaw(String portalSessionId, String jsonPayload) throws Exceptio } public PortalSessionActivateResponse activate( - String portalSessionId, PortalSessionActivateParams params) throws Exception { + String portalSessionId, PortalSessionActivateParams params) throws ChargebeeException { Response response = activateRaw(portalSessionId, params); return PortalSessionActivateResponse.fromJson(response.getBodyAsString(), response); } /** logout a portalSession (executes immediately) - returns raw Response. */ - Response logoutRaw(String portalSessionId) throws Exception { + Response logoutRaw(String portalSessionId) throws ChargebeeException { String path = buildPathWithParams( "/portal_sessions/{portal-session-id}/logout", "portal-session-id", portalSessionId); @@ -125,13 +127,13 @@ Response logoutRaw(String portalSessionId) throws Exception { return post(path, null); } - public PortalSessionLogoutResponse logout(String portalSessionId) throws Exception { + public PortalSessionLogoutResponse logout(String portalSessionId) throws ChargebeeException { Response response = logoutRaw(portalSessionId); return PortalSessionLogoutResponse.fromJson(response.getBodyAsString(), response); } /** retrieve a portalSession (executes immediately) - returns raw Response. */ - Response retrieveRaw(String portalSessionId) throws Exception { + Response retrieveRaw(String portalSessionId) throws ChargebeeException { String path = buildPathWithParams( "/portal_sessions/{portal-session-id}", "portal-session-id", portalSessionId); @@ -139,7 +141,7 @@ Response retrieveRaw(String portalSessionId) throws Exception { return get(path, null); } - public PortalSessionRetrieveResponse retrieve(String portalSessionId) throws Exception { + public PortalSessionRetrieveResponse retrieve(String portalSessionId) throws ChargebeeException { Response response = retrieveRaw(portalSessionId); return PortalSessionRetrieveResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/core/services/PriceVariantService.java b/src/main/java/com/chargebee/v4/services/PriceVariantService.java similarity index 75% rename from src/main/java/com/chargebee/v4/core/services/PriceVariantService.java rename to src/main/java/com/chargebee/v4/services/PriceVariantService.java index a2f0649e..d1884b26 100644 --- a/src/main/java/com/chargebee/v4/core/services/PriceVariantService.java +++ b/src/main/java/com/chargebee/v4/services/PriceVariantService.java @@ -5,27 +5,28 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.priceVariant.params.PriceVariantListParams; +import com.chargebee.v4.models.priceVariant.params.PriceVariantListParams; -import com.chargebee.v4.core.models.priceVariant.params.PriceVariantCreateParams; +import com.chargebee.v4.models.priceVariant.params.PriceVariantCreateParams; -import com.chargebee.v4.core.models.priceVariant.params.PriceVariantUpdateParams; +import com.chargebee.v4.models.priceVariant.params.PriceVariantUpdateParams; -import com.chargebee.v4.core.responses.priceVariant.PriceVariantDeleteResponse; +import com.chargebee.v4.models.priceVariant.responses.PriceVariantDeleteResponse; -import com.chargebee.v4.core.responses.priceVariant.PriceVariantListResponse; +import com.chargebee.v4.models.priceVariant.responses.PriceVariantListResponse; -import com.chargebee.v4.core.responses.priceVariant.PriceVariantCreateResponse; +import com.chargebee.v4.models.priceVariant.responses.PriceVariantCreateResponse; -import com.chargebee.v4.core.responses.priceVariant.PriceVariantRetrieveResponse; +import com.chargebee.v4.models.priceVariant.responses.PriceVariantRetrieveResponse; -import com.chargebee.v4.core.responses.priceVariant.PriceVariantUpdateResponse; +import com.chargebee.v4.models.priceVariant.responses.PriceVariantUpdateResponse; public final class PriceVariantService extends BaseService { @@ -63,7 +64,7 @@ public PriceVariantService withOptions(RequestOptions options) { // === Operations === /** delete a priceVariant (executes immediately) - returns raw Response. */ - Response deleteRaw(String priceVariantId) throws Exception { + Response deleteRaw(String priceVariantId) throws ChargebeeException { String path = buildPathWithParams( "/price_variants/{price-variant-id}/delete", "price-variant-id", priceVariantId); @@ -71,60 +72,61 @@ Response deleteRaw(String priceVariantId) throws Exception { return post(path, null); } - public PriceVariantDeleteResponse delete(String priceVariantId) throws Exception { + public PriceVariantDeleteResponse delete(String priceVariantId) throws ChargebeeException { Response response = deleteRaw(priceVariantId); return PriceVariantDeleteResponse.fromJson(response.getBodyAsString(), response); } /** list a priceVariant using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(PriceVariantListParams params) throws Exception { + Response listRaw(PriceVariantListParams params) throws ChargebeeException { return get("/price_variants", params != null ? params.toQueryParams() : null); } /** list a priceVariant without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/price_variants", null); } /** list a priceVariant using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public PriceVariantListResponse list(PriceVariantListParams params) throws Exception { + public PriceVariantListResponse list(PriceVariantListParams params) throws ChargebeeException { Response response = listRaw(params); return PriceVariantListResponse.fromJson(response.getBodyAsString(), this, params, response); } - public PriceVariantListResponse list() throws Exception { + public PriceVariantListResponse list() throws ChargebeeException { Response response = listRaw(); return PriceVariantListResponse.fromJson(response.getBodyAsString(), this, null, response); } /** create a priceVariant using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(PriceVariantCreateParams params) throws Exception { + Response createRaw(PriceVariantCreateParams params) throws ChargebeeException { return post("/price_variants", params != null ? params.toFormData() : null); } /** create a priceVariant using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/price_variants", jsonPayload); } - public PriceVariantCreateResponse create(PriceVariantCreateParams params) throws Exception { + public PriceVariantCreateResponse create(PriceVariantCreateParams params) + throws ChargebeeException { Response response = createRaw(params); return PriceVariantCreateResponse.fromJson(response.getBodyAsString(), response); } /** retrieve a priceVariant (executes immediately) - returns raw Response. */ - Response retrieveRaw(String priceVariantId) throws Exception { + Response retrieveRaw(String priceVariantId) throws ChargebeeException { String path = buildPathWithParams( "/price_variants/{price-variant-id}", "price-variant-id", priceVariantId); @@ -132,13 +134,13 @@ Response retrieveRaw(String priceVariantId) throws Exception { return get(path, null); } - public PriceVariantRetrieveResponse retrieve(String priceVariantId) throws Exception { + public PriceVariantRetrieveResponse retrieve(String priceVariantId) throws ChargebeeException { Response response = retrieveRaw(priceVariantId); return PriceVariantRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** update a priceVariant (executes immediately) - returns raw Response. */ - Response updateRaw(String priceVariantId) throws Exception { + Response updateRaw(String priceVariantId) throws ChargebeeException { String path = buildPathWithParams( "/price_variants/{price-variant-id}", "price-variant-id", priceVariantId); @@ -147,7 +149,8 @@ Response updateRaw(String priceVariantId) throws Exception { } /** update a priceVariant using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String priceVariantId, PriceVariantUpdateParams params) throws Exception { + Response updateRaw(String priceVariantId, PriceVariantUpdateParams params) + throws ChargebeeException { String path = buildPathWithParams( "/price_variants/{price-variant-id}", "price-variant-id", priceVariantId); @@ -155,7 +158,7 @@ Response updateRaw(String priceVariantId, PriceVariantUpdateParams params) throw } /** update a priceVariant using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String priceVariantId, String jsonPayload) throws Exception { + Response updateRaw(String priceVariantId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/price_variants/{price-variant-id}", "price-variant-id", priceVariantId); @@ -163,7 +166,7 @@ Response updateRaw(String priceVariantId, String jsonPayload) throws Exception { } public PriceVariantUpdateResponse update(String priceVariantId, PriceVariantUpdateParams params) - throws Exception { + throws ChargebeeException { Response response = updateRaw(priceVariantId, params); return PriceVariantUpdateResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/core/services/PricingPageSessionService.java b/src/main/java/com/chargebee/v4/services/PricingPageSessionService.java similarity index 82% rename from src/main/java/com/chargebee/v4/core/services/PricingPageSessionService.java rename to src/main/java/com/chargebee/v4/services/PricingPageSessionService.java index dcebb6ee..763de0cf 100644 --- a/src/main/java/com/chargebee/v4/core/services/PricingPageSessionService.java +++ b/src/main/java/com/chargebee/v4/services/PricingPageSessionService.java @@ -5,19 +5,20 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.pricingPageSession.params.PricingPageSessionCreateForExistingSubscriptionParams; +import com.chargebee.v4.models.pricingPageSession.params.PricingPageSessionCreateForExistingSubscriptionParams; -import com.chargebee.v4.core.models.pricingPageSession.params.PricingPageSessionCreateForNewSubscriptionParams; +import com.chargebee.v4.models.pricingPageSession.params.PricingPageSessionCreateForNewSubscriptionParams; -import com.chargebee.v4.core.responses.pricingPageSession.PricingPageSessionCreateForExistingSubscriptionResponse; +import com.chargebee.v4.models.pricingPageSession.responses.PricingPageSessionCreateForExistingSubscriptionResponse; -import com.chargebee.v4.core.responses.pricingPageSession.PricingPageSessionCreateForNewSubscriptionResponse; +import com.chargebee.v4.models.pricingPageSession.responses.PricingPageSessionCreateForNewSubscriptionResponse; public final class PricingPageSessionService extends BaseService { @@ -59,7 +60,7 @@ public PricingPageSessionService withOptions(RequestOptions options) { * immediately) - returns raw Response. */ Response createForExistingSubscriptionRaw( - PricingPageSessionCreateForExistingSubscriptionParams params) throws Exception { + PricingPageSessionCreateForExistingSubscriptionParams params) throws ChargebeeException { return post( "/pricing_page_sessions/create_for_existing_subscription", @@ -70,13 +71,13 @@ Response createForExistingSubscriptionRaw( * createForExistingSubscription a pricingPageSession using raw JSON payload (executes * immediately) - returns raw Response. */ - Response createForExistingSubscriptionRaw(String jsonPayload) throws Exception { + Response createForExistingSubscriptionRaw(String jsonPayload) throws ChargebeeException { return postJson("/pricing_page_sessions/create_for_existing_subscription", jsonPayload); } public PricingPageSessionCreateForExistingSubscriptionResponse createForExistingSubscription( - PricingPageSessionCreateForExistingSubscriptionParams params) throws Exception { + PricingPageSessionCreateForExistingSubscriptionParams params) throws ChargebeeException { Response response = createForExistingSubscriptionRaw(params); return PricingPageSessionCreateForExistingSubscriptionResponse.fromJson( @@ -88,7 +89,7 @@ public PricingPageSessionCreateForExistingSubscriptionResponse createForExisting * returns raw Response. */ Response createForNewSubscriptionRaw(PricingPageSessionCreateForNewSubscriptionParams params) - throws Exception { + throws ChargebeeException { return post( "/pricing_page_sessions/create_for_new_subscription", @@ -99,13 +100,13 @@ Response createForNewSubscriptionRaw(PricingPageSessionCreateForNewSubscriptionP * createForNewSubscription a pricingPageSession using raw JSON payload (executes immediately) - * returns raw Response. */ - Response createForNewSubscriptionRaw(String jsonPayload) throws Exception { + Response createForNewSubscriptionRaw(String jsonPayload) throws ChargebeeException { return postJson("/pricing_page_sessions/create_for_new_subscription", jsonPayload); } public PricingPageSessionCreateForNewSubscriptionResponse createForNewSubscription( - PricingPageSessionCreateForNewSubscriptionParams params) throws Exception { + PricingPageSessionCreateForNewSubscriptionParams params) throws ChargebeeException { Response response = createForNewSubscriptionRaw(params); return PricingPageSessionCreateForNewSubscriptionResponse.fromJson( diff --git a/src/main/java/com/chargebee/v4/core/services/ProductService.java b/src/main/java/com/chargebee/v4/services/ProductService.java similarity index 75% rename from src/main/java/com/chargebee/v4/core/services/ProductService.java rename to src/main/java/com/chargebee/v4/services/ProductService.java index a06852a6..1e6e0270 100644 --- a/src/main/java/com/chargebee/v4/core/services/ProductService.java +++ b/src/main/java/com/chargebee/v4/services/ProductService.java @@ -5,31 +5,32 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.product.params.ProductUpdateParams; +import com.chargebee.v4.models.product.params.ProductUpdateParams; -import com.chargebee.v4.core.models.product.params.ProductUpdateOptionsParams; +import com.chargebee.v4.models.product.params.ProductUpdateOptionsParams; -import com.chargebee.v4.core.models.product.params.ProductListParams; +import com.chargebee.v4.models.product.params.ProductListParams; -import com.chargebee.v4.core.models.product.params.ProductCreateParams; +import com.chargebee.v4.models.product.params.ProductCreateParams; -import com.chargebee.v4.core.responses.product.ProductRetrieveResponse; +import com.chargebee.v4.models.product.responses.ProductRetrieveResponse; -import com.chargebee.v4.core.responses.product.ProductUpdateResponse; +import com.chargebee.v4.models.product.responses.ProductUpdateResponse; -import com.chargebee.v4.core.responses.product.ProductDeleteResponse; +import com.chargebee.v4.models.product.responses.ProductDeleteResponse; -import com.chargebee.v4.core.responses.product.ProductUpdateOptionsResponse; +import com.chargebee.v4.models.product.responses.ProductUpdateOptionsResponse; -import com.chargebee.v4.core.responses.product.ProductListResponse; +import com.chargebee.v4.models.product.responses.ProductListResponse; -import com.chargebee.v4.core.responses.product.ProductCreateResponse; +import com.chargebee.v4.models.product.responses.ProductCreateResponse; public final class ProductService extends BaseService { @@ -66,56 +67,56 @@ public ProductService withOptions(RequestOptions options) { // === Operations === /** retrieve a product (executes immediately) - returns raw Response. */ - Response retrieveRaw(String productId) throws Exception { + Response retrieveRaw(String productId) throws ChargebeeException { String path = buildPathWithParams("/products/{product-id}", "product-id", productId); return get(path, null); } - public ProductRetrieveResponse retrieve(String productId) throws Exception { + public ProductRetrieveResponse retrieve(String productId) throws ChargebeeException { Response response = retrieveRaw(productId); return ProductRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** update a product (executes immediately) - returns raw Response. */ - Response updateRaw(String productId) throws Exception { + Response updateRaw(String productId) throws ChargebeeException { String path = buildPathWithParams("/products/{product-id}", "product-id", productId); return post(path, null); } /** update a product using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String productId, ProductUpdateParams params) throws Exception { + Response updateRaw(String productId, ProductUpdateParams params) throws ChargebeeException { String path = buildPathWithParams("/products/{product-id}", "product-id", productId); return post(path, params.toFormData()); } /** update a product using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String productId, String jsonPayload) throws Exception { + Response updateRaw(String productId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/products/{product-id}", "product-id", productId); return postJson(path, jsonPayload); } public ProductUpdateResponse update(String productId, ProductUpdateParams params) - throws Exception { + throws ChargebeeException { Response response = updateRaw(productId, params); return ProductUpdateResponse.fromJson(response.getBodyAsString(), response); } /** delete a product (executes immediately) - returns raw Response. */ - Response deleteRaw(String productId) throws Exception { + Response deleteRaw(String productId) throws ChargebeeException { String path = buildPathWithParams("/products/{product-id}/delete", "product-id", productId); return post(path, null); } - public ProductDeleteResponse delete(String productId) throws Exception { + public ProductDeleteResponse delete(String productId) throws ChargebeeException { Response response = deleteRaw(productId); return ProductDeleteResponse.fromJson(response.getBodyAsString(), response); } /** updateOptions a product (executes immediately) - returns raw Response. */ - Response updateOptionsRaw(String productId) throws Exception { + Response updateOptionsRaw(String productId) throws ChargebeeException { String path = buildPathWithParams("/products/{product-id}/update_options", "product-id", productId); @@ -125,7 +126,8 @@ Response updateOptionsRaw(String productId) throws Exception { /** * updateOptions a product using immutable params (executes immediately) - returns raw Response. */ - Response updateOptionsRaw(String productId, ProductUpdateOptionsParams params) throws Exception { + Response updateOptionsRaw(String productId, ProductUpdateOptionsParams params) + throws ChargebeeException { String path = buildPathWithParams("/products/{product-id}/update_options", "product-id", productId); return post(path, params.toFormData()); @@ -134,60 +136,60 @@ Response updateOptionsRaw(String productId, ProductUpdateOptionsParams params) t /** * updateOptions a product using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateOptionsRaw(String productId, String jsonPayload) throws Exception { + Response updateOptionsRaw(String productId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/products/{product-id}/update_options", "product-id", productId); return postJson(path, jsonPayload); } public ProductUpdateOptionsResponse updateOptions( - String productId, ProductUpdateOptionsParams params) throws Exception { + String productId, ProductUpdateOptionsParams params) throws ChargebeeException { Response response = updateOptionsRaw(productId, params); return ProductUpdateOptionsResponse.fromJson(response.getBodyAsString(), response); } /** list a product using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(ProductListParams params) throws Exception { + Response listRaw(ProductListParams params) throws ChargebeeException { return get("/products", params != null ? params.toQueryParams() : null); } /** list a product without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/products", null); } /** list a product using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public ProductListResponse list(ProductListParams params) throws Exception { + public ProductListResponse list(ProductListParams params) throws ChargebeeException { Response response = listRaw(params); return ProductListResponse.fromJson(response.getBodyAsString(), this, params, response); } - public ProductListResponse list() throws Exception { + public ProductListResponse list() throws ChargebeeException { Response response = listRaw(); return ProductListResponse.fromJson(response.getBodyAsString(), this, null, response); } /** create a product using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(ProductCreateParams params) throws Exception { + Response createRaw(ProductCreateParams params) throws ChargebeeException { return post("/products", params != null ? params.toFormData() : null); } /** create a product using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/products", jsonPayload); } - public ProductCreateResponse create(ProductCreateParams params) throws Exception { + public ProductCreateResponse create(ProductCreateParams params) throws ChargebeeException { Response response = createRaw(params); return ProductCreateResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/services/PromotionalCreditService.java b/src/main/java/com/chargebee/v4/services/PromotionalCreditService.java new file mode 100644 index 00000000..85626f87 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/PromotionalCreditService.java @@ -0,0 +1,188 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.promotionalCredit.params.PromotionalCreditListParams; + +import com.chargebee.v4.models.promotionalCredit.params.PromotionalCreditDeductParams; + +import com.chargebee.v4.models.promotionalCredit.params.PromotionalCreditSetParams; + +import com.chargebee.v4.models.promotionalCredit.params.PromotionalCreditAddParams; + +import com.chargebee.v4.models.promotionalCredit.responses.PromotionalCreditRetrieveResponse; + +import com.chargebee.v4.models.promotionalCredit.responses.PromotionalCreditListResponse; + +import com.chargebee.v4.models.promotionalCredit.responses.PromotionalCreditDeductResponse; + +import com.chargebee.v4.models.promotionalCredit.responses.PromotionalCreditSetResponse; + +import com.chargebee.v4.models.promotionalCredit.responses.PromotionalCreditAddResponse; + +public final class PromotionalCreditService extends BaseService { + + private final ServiceConfig config; + + public PromotionalCreditService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private PromotionalCreditService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private PromotionalCreditService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + PromotionalCreditService with(RequestOptions newOptions) { + return new PromotionalCreditService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public PromotionalCreditService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** retrieve a promotionalCredit (executes immediately) - returns raw Response. */ + Response retrieveRaw(String accountCreditId) throws ChargebeeException { + String path = + buildPathWithParams( + "/promotional_credits/{account-credit-id}", "account-credit-id", accountCreditId); + + return get(path, null); + } + + public PromotionalCreditRetrieveResponse retrieve(String accountCreditId) + throws ChargebeeException { + Response response = retrieveRaw(accountCreditId); + return PromotionalCreditRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * list a promotionalCredit using immutable params (executes immediately) - returns raw Response. + */ + Response listRaw(PromotionalCreditListParams params) throws ChargebeeException { + + return get("/promotional_credits", params != null ? params.toQueryParams() : null); + } + + /** list a promotionalCredit without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/promotional_credits", null); + } + + /** + * list a promotionalCredit using raw JSON payload (executes immediately) - returns raw Response. + */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public PromotionalCreditListResponse list(PromotionalCreditListParams params) + throws ChargebeeException { + Response response = listRaw(params); + + return PromotionalCreditListResponse.fromJson( + response.getBodyAsString(), this, params, response); + } + + public PromotionalCreditListResponse list() throws ChargebeeException { + Response response = listRaw(); + return PromotionalCreditListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** + * deduct a promotionalCredit using immutable params (executes immediately) - returns raw + * Response. + */ + Response deductRaw(PromotionalCreditDeductParams params) throws ChargebeeException { + + return post("/promotional_credits/deduct", params != null ? params.toFormData() : null); + } + + /** + * deduct a promotionalCredit using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response deductRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/promotional_credits/deduct", jsonPayload); + } + + public PromotionalCreditDeductResponse deduct(PromotionalCreditDeductParams params) + throws ChargebeeException { + Response response = deductRaw(params); + + return PromotionalCreditDeductResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * set a promotionalCredit using immutable params (executes immediately) - returns raw Response. + */ + Response setRaw(PromotionalCreditSetParams params) throws ChargebeeException { + + return post("/promotional_credits/set", params != null ? params.toFormData() : null); + } + + /** + * set a promotionalCredit using raw JSON payload (executes immediately) - returns raw Response. + */ + Response setRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/promotional_credits/set", jsonPayload); + } + + public PromotionalCreditSetResponse set(PromotionalCreditSetParams params) + throws ChargebeeException { + Response response = setRaw(params); + + return PromotionalCreditSetResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * add a promotionalCredit using immutable params (executes immediately) - returns raw Response. + */ + Response addRaw(PromotionalCreditAddParams params) throws ChargebeeException { + + return post("/promotional_credits/add", params != null ? params.toFormData() : null); + } + + /** + * add a promotionalCredit using raw JSON payload (executes immediately) - returns raw Response. + */ + Response addRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/promotional_credits/add", jsonPayload); + } + + public PromotionalCreditAddResponse add(PromotionalCreditAddParams params) + throws ChargebeeException { + Response response = addRaw(params); + + return PromotionalCreditAddResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/PurchaseService.java b/src/main/java/com/chargebee/v4/services/PurchaseService.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/services/PurchaseService.java rename to src/main/java/com/chargebee/v4/services/PurchaseService.java index 6d2409a8..c40269f4 100644 --- a/src/main/java/com/chargebee/v4/core/services/PurchaseService.java +++ b/src/main/java/com/chargebee/v4/services/PurchaseService.java @@ -5,19 +5,20 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.purchase.params.PurchaseCreateParams; +import com.chargebee.v4.models.purchase.params.PurchaseCreateParams; -import com.chargebee.v4.core.models.purchase.params.PurchaseEstimateParams; +import com.chargebee.v4.models.purchase.params.PurchaseEstimateParams; -import com.chargebee.v4.core.responses.purchase.PurchaseCreateResponse; +import com.chargebee.v4.models.purchase.responses.PurchaseCreateResponse; -import com.chargebee.v4.core.responses.purchase.PurchaseEstimateResponse; +import com.chargebee.v4.models.purchase.responses.PurchaseEstimateResponse; public final class PurchaseService extends BaseService { @@ -54,36 +55,37 @@ public PurchaseService withOptions(RequestOptions options) { // === Operations === /** create a purchase using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(PurchaseCreateParams params) throws Exception { + Response createRaw(PurchaseCreateParams params) throws ChargebeeException { return post("/purchases", params != null ? params.toFormData() : null); } /** create a purchase using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/purchases", jsonPayload); } - public PurchaseCreateResponse create(PurchaseCreateParams params) throws Exception { + public PurchaseCreateResponse create(PurchaseCreateParams params) throws ChargebeeException { Response response = createRaw(params); return PurchaseCreateResponse.fromJson(response.getBodyAsString(), response); } /** estimate a purchase using immutable params (executes immediately) - returns raw Response. */ - Response estimateRaw(PurchaseEstimateParams params) throws Exception { + Response estimateRaw(PurchaseEstimateParams params) throws ChargebeeException { return post("/purchases/estimate", params != null ? params.toFormData() : null); } /** estimate a purchase using raw JSON payload (executes immediately) - returns raw Response. */ - Response estimateRaw(String jsonPayload) throws Exception { + Response estimateRaw(String jsonPayload) throws ChargebeeException { return postJson("/purchases/estimate", jsonPayload); } - public PurchaseEstimateResponse estimate(PurchaseEstimateParams params) throws Exception { + public PurchaseEstimateResponse estimate(PurchaseEstimateParams params) + throws ChargebeeException { Response response = estimateRaw(params); return PurchaseEstimateResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/services/QuoteService.java b/src/main/java/com/chargebee/v4/services/QuoteService.java new file mode 100644 index 00000000..55676ec8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/QuoteService.java @@ -0,0 +1,780 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.quote.params.CreateSubscriptionItemsForCustomerQuoteParams; + +import com.chargebee.v4.models.quote.params.EditCreateSubscriptionCustomerQuoteForItemsParams; + +import com.chargebee.v4.models.quote.params.QuoteUpdateStatusParams; + +import com.chargebee.v4.models.quote.params.UpdateSubscriptionQuoteForItemsParams; + +import com.chargebee.v4.models.quote.params.QuoteLineGroupsForQuoteParams; + +import com.chargebee.v4.models.quote.params.QuoteExtendExpiryDateParams; + +import com.chargebee.v4.models.quote.params.QuoteEditForChargeItemsAndChargesParams; + +import com.chargebee.v4.models.quote.params.EditUpdateSubscriptionQuoteForItemsParams; + +import com.chargebee.v4.models.quote.params.QuoteListParams; + +import com.chargebee.v4.models.quote.params.QuotePdfParams; + +import com.chargebee.v4.models.quote.params.QuoteConvertParams; + +import com.chargebee.v4.models.quote.params.QuoteCreateForChargeItemsAndChargesParams; + +import com.chargebee.v4.models.quote.params.QuoteDeleteParams; + +import com.chargebee.v4.models.quote.params.EditOneTimeQuoteParams; + +import com.chargebee.v4.models.quote.params.UpdateSubscriptionQuoteParams; + +import com.chargebee.v4.models.quote.params.QuoteCreateForOnetimeChargesParams; + +import com.chargebee.v4.models.quote.params.CreateSubscriptionForCustomerQuoteParams; + +import com.chargebee.v4.models.quote.params.EditUpdateSubscriptionQuoteParams; + +import com.chargebee.v4.models.quote.params.EditCreateSubscriptionForCustomerQuoteParams; + +import com.chargebee.v4.models.quote.responses.CreateSubscriptionItemsForCustomerQuoteResponse; + +import com.chargebee.v4.models.quote.responses.QuoteRetrieveResponse; + +import com.chargebee.v4.models.quote.responses.EditCreateSubscriptionCustomerQuoteForItemsResponse; + +import com.chargebee.v4.models.quote.responses.QuoteUpdateStatusResponse; + +import com.chargebee.v4.models.quote.responses.UpdateSubscriptionQuoteForItemsResponse; + +import com.chargebee.v4.models.quote.responses.QuoteLineGroupsForQuoteResponse; + +import com.chargebee.v4.models.quote.responses.QuoteExtendExpiryDateResponse; + +import com.chargebee.v4.models.quote.responses.QuoteEditForChargeItemsAndChargesResponse; + +import com.chargebee.v4.models.quote.responses.EditUpdateSubscriptionQuoteForItemsResponse; + +import com.chargebee.v4.models.quote.responses.QuoteListResponse; + +import com.chargebee.v4.models.quote.responses.QuotePdfResponse; + +import com.chargebee.v4.models.quote.responses.QuoteConvertResponse; + +import com.chargebee.v4.models.quote.responses.QuoteCreateForChargeItemsAndChargesResponse; + +import com.chargebee.v4.models.quote.responses.QuoteDeleteResponse; + +import com.chargebee.v4.models.quote.responses.EditOneTimeQuoteResponse; + +import com.chargebee.v4.models.quote.responses.UpdateSubscriptionQuoteResponse; + +import com.chargebee.v4.models.quote.responses.QuoteCreateForOnetimeChargesResponse; + +import com.chargebee.v4.models.quote.responses.CreateSubscriptionForCustomerQuoteResponse; + +import com.chargebee.v4.models.quote.responses.EditUpdateSubscriptionQuoteResponse; + +import com.chargebee.v4.models.quote.responses.EditCreateSubscriptionForCustomerQuoteResponse; + +public final class QuoteService extends BaseService { + + private final ServiceConfig config; + + public QuoteService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private QuoteService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private QuoteService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + QuoteService with(RequestOptions newOptions) { + return new QuoteService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public QuoteService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * createSubscriptionItemsForCustomerQuote a quote (executes immediately) - returns raw Response. + */ + Response createSubscriptionItemsForCustomerQuoteRaw(String customerId) throws ChargebeeException { + String path = + buildPathWithParams( + "/customers/{customer-id}/create_subscription_quote_for_items", + "customer-id", + customerId); + + return post(path, null); + } + + /** + * createSubscriptionItemsForCustomerQuote a quote using immutable params (executes immediately) - + * returns raw Response. + */ + Response createSubscriptionItemsForCustomerQuoteRaw( + String customerId, CreateSubscriptionItemsForCustomerQuoteParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/customers/{customer-id}/create_subscription_quote_for_items", + "customer-id", + customerId); + return post(path, params.toFormData()); + } + + /** + * createSubscriptionItemsForCustomerQuote a quote using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response createSubscriptionItemsForCustomerQuoteRaw(String customerId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/customers/{customer-id}/create_subscription_quote_for_items", + "customer-id", + customerId); + return postJson(path, jsonPayload); + } + + public CreateSubscriptionItemsForCustomerQuoteResponse createSubscriptionItemsForCustomerQuote( + String customerId, CreateSubscriptionItemsForCustomerQuoteParams params) + throws ChargebeeException { + Response response = createSubscriptionItemsForCustomerQuoteRaw(customerId, params); + return CreateSubscriptionItemsForCustomerQuoteResponse.fromJson( + response.getBodyAsString(), response); + } + + /** retrieve a quote (executes immediately) - returns raw Response. */ + Response retrieveRaw(String quoteId) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}", "quote-id", quoteId); + + return get(path, null); + } + + public QuoteRetrieveResponse retrieve(String quoteId) throws ChargebeeException { + Response response = retrieveRaw(quoteId); + return QuoteRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * editCreateSubscriptionCustomerQuoteForItems a quote (executes immediately) - returns raw + * Response. + */ + Response editCreateSubscriptionCustomerQuoteForItemsRaw(String quoteId) + throws ChargebeeException { + String path = + buildPathWithParams( + "/quotes/{quote-id}/edit_create_subscription_quote_for_items", "quote-id", quoteId); + + return post(path, null); + } + + /** + * editCreateSubscriptionCustomerQuoteForItems a quote using immutable params (executes + * immediately) - returns raw Response. + */ + Response editCreateSubscriptionCustomerQuoteForItemsRaw( + String quoteId, EditCreateSubscriptionCustomerQuoteForItemsParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/quotes/{quote-id}/edit_create_subscription_quote_for_items", "quote-id", quoteId); + return post(path, params.toFormData()); + } + + /** + * editCreateSubscriptionCustomerQuoteForItems a quote using raw JSON payload (executes + * immediately) - returns raw Response. + */ + Response editCreateSubscriptionCustomerQuoteForItemsRaw(String quoteId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/quotes/{quote-id}/edit_create_subscription_quote_for_items", "quote-id", quoteId); + return postJson(path, jsonPayload); + } + + public EditCreateSubscriptionCustomerQuoteForItemsResponse + editCreateSubscriptionCustomerQuoteForItems( + String quoteId, EditCreateSubscriptionCustomerQuoteForItemsParams params) + throws ChargebeeException { + Response response = editCreateSubscriptionCustomerQuoteForItemsRaw(quoteId, params); + return EditCreateSubscriptionCustomerQuoteForItemsResponse.fromJson( + response.getBodyAsString(), response); + } + + /** updateStatus a quote (executes immediately) - returns raw Response. */ + Response updateStatusRaw(String quoteId) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/update_status", "quote-id", quoteId); + + return post(path, null); + } + + /** updateStatus a quote using immutable params (executes immediately) - returns raw Response. */ + Response updateStatusRaw(String quoteId, QuoteUpdateStatusParams params) + throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/update_status", "quote-id", quoteId); + return post(path, params.toFormData()); + } + + /** updateStatus a quote using raw JSON payload (executes immediately) - returns raw Response. */ + Response updateStatusRaw(String quoteId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/update_status", "quote-id", quoteId); + return postJson(path, jsonPayload); + } + + public QuoteUpdateStatusResponse updateStatus(String quoteId, QuoteUpdateStatusParams params) + throws ChargebeeException { + Response response = updateStatusRaw(quoteId, params); + return QuoteUpdateStatusResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * updateSubscriptionQuoteForItems a quote using immutable params (executes immediately) - returns + * raw Response. + */ + Response updateSubscriptionQuoteForItemsRaw(UpdateSubscriptionQuoteForItemsParams params) + throws ChargebeeException { + + return post( + "/quotes/update_subscription_quote_for_items", params != null ? params.toFormData() : null); + } + + /** + * updateSubscriptionQuoteForItems a quote using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response updateSubscriptionQuoteForItemsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/quotes/update_subscription_quote_for_items", jsonPayload); + } + + public UpdateSubscriptionQuoteForItemsResponse updateSubscriptionQuoteForItems( + UpdateSubscriptionQuoteForItemsParams params) throws ChargebeeException { + Response response = updateSubscriptionQuoteForItemsRaw(params); + + return UpdateSubscriptionQuoteForItemsResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * quoteLineGroupsForQuote a quote using immutable params (executes immediately) - returns raw + * Response. + */ + Response quoteLineGroupsForQuoteRaw(String quoteId, QuoteLineGroupsForQuoteParams params) + throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/quote_line_groups", "quote-id", quoteId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * quoteLineGroupsForQuote a quote without params (executes immediately) - returns raw Response. + */ + Response quoteLineGroupsForQuoteRaw(String quoteId) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/quote_line_groups", "quote-id", quoteId); + return get(path, null); + } + + /** + * quoteLineGroupsForQuote a quote using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response quoteLineGroupsForQuoteRaw(String quoteId, String jsonPayload) + throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/quote_line_groups", "quote-id", quoteId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public QuoteLineGroupsForQuoteResponse quoteLineGroupsForQuote( + String quoteId, QuoteLineGroupsForQuoteParams params) throws ChargebeeException { + Response response = quoteLineGroupsForQuoteRaw(quoteId, params); + return QuoteLineGroupsForQuoteResponse.fromJson( + response.getBodyAsString(), this, params, quoteId, response); + } + + public QuoteLineGroupsForQuoteResponse quoteLineGroupsForQuote(String quoteId) + throws ChargebeeException { + Response response = quoteLineGroupsForQuoteRaw(quoteId); + return QuoteLineGroupsForQuoteResponse.fromJson( + response.getBodyAsString(), this, null, quoteId, response); + } + + /** extendExpiryDate a quote (executes immediately) - returns raw Response. */ + Response extendExpiryDateRaw(String quoteId) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/extend_expiry_date", "quote-id", quoteId); + + return post(path, null); + } + + /** + * extendExpiryDate a quote using immutable params (executes immediately) - returns raw Response. + */ + Response extendExpiryDateRaw(String quoteId, QuoteExtendExpiryDateParams params) + throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/extend_expiry_date", "quote-id", quoteId); + return post(path, params.toFormData()); + } + + /** + * extendExpiryDate a quote using raw JSON payload (executes immediately) - returns raw Response. + */ + Response extendExpiryDateRaw(String quoteId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/extend_expiry_date", "quote-id", quoteId); + return postJson(path, jsonPayload); + } + + public QuoteExtendExpiryDateResponse extendExpiryDate( + String quoteId, QuoteExtendExpiryDateParams params) throws ChargebeeException { + Response response = extendExpiryDateRaw(quoteId, params); + return QuoteExtendExpiryDateResponse.fromJson(response.getBodyAsString(), response); + } + + /** editForChargeItemsAndCharges a quote (executes immediately) - returns raw Response. */ + Response editForChargeItemsAndChargesRaw(String quoteId) throws ChargebeeException { + String path = + buildPathWithParams( + "/quotes/{quote-id}/edit_for_charge_items_and_charges", "quote-id", quoteId); + + return post(path, null); + } + + /** + * editForChargeItemsAndCharges a quote using immutable params (executes immediately) - returns + * raw Response. + */ + Response editForChargeItemsAndChargesRaw( + String quoteId, QuoteEditForChargeItemsAndChargesParams params) throws ChargebeeException { + String path = + buildPathWithParams( + "/quotes/{quote-id}/edit_for_charge_items_and_charges", "quote-id", quoteId); + return post(path, params.toFormData()); + } + + /** + * editForChargeItemsAndCharges a quote using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response editForChargeItemsAndChargesRaw(String quoteId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/quotes/{quote-id}/edit_for_charge_items_and_charges", "quote-id", quoteId); + return postJson(path, jsonPayload); + } + + public QuoteEditForChargeItemsAndChargesResponse editForChargeItemsAndCharges( + String quoteId, QuoteEditForChargeItemsAndChargesParams params) throws ChargebeeException { + Response response = editForChargeItemsAndChargesRaw(quoteId, params); + return QuoteEditForChargeItemsAndChargesResponse.fromJson(response.getBodyAsString(), response); + } + + /** editUpdateSubscriptionQuoteForItems a quote (executes immediately) - returns raw Response. */ + Response editUpdateSubscriptionQuoteForItemsRaw(String quoteId) throws ChargebeeException { + String path = + buildPathWithParams( + "/quotes/{quote-id}/edit_update_subscription_quote_for_items", "quote-id", quoteId); + + return post(path, null); + } + + /** + * editUpdateSubscriptionQuoteForItems a quote using immutable params (executes immediately) - + * returns raw Response. + */ + Response editUpdateSubscriptionQuoteForItemsRaw( + String quoteId, EditUpdateSubscriptionQuoteForItemsParams params) throws ChargebeeException { + String path = + buildPathWithParams( + "/quotes/{quote-id}/edit_update_subscription_quote_for_items", "quote-id", quoteId); + return post(path, params.toFormData()); + } + + /** + * editUpdateSubscriptionQuoteForItems a quote using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response editUpdateSubscriptionQuoteForItemsRaw(String quoteId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/quotes/{quote-id}/edit_update_subscription_quote_for_items", "quote-id", quoteId); + return postJson(path, jsonPayload); + } + + public EditUpdateSubscriptionQuoteForItemsResponse editUpdateSubscriptionQuoteForItems( + String quoteId, EditUpdateSubscriptionQuoteForItemsParams params) throws ChargebeeException { + Response response = editUpdateSubscriptionQuoteForItemsRaw(quoteId, params); + return EditUpdateSubscriptionQuoteForItemsResponse.fromJson( + response.getBodyAsString(), response); + } + + /** list a quote using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(QuoteListParams params) throws ChargebeeException { + + return get("/quotes", params != null ? params.toQueryParams() : null); + } + + /** list a quote without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/quotes", null); + } + + /** list a quote using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public QuoteListResponse list(QuoteListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return QuoteListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public QuoteListResponse list() throws ChargebeeException { + Response response = listRaw(); + return QuoteListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** pdf a quote (executes immediately) - returns raw Response. */ + Response pdfRaw(String quoteId) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/pdf", "quote-id", quoteId); + + return post(path, null); + } + + /** pdf a quote using immutable params (executes immediately) - returns raw Response. */ + Response pdfRaw(String quoteId, QuotePdfParams params) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/pdf", "quote-id", quoteId); + return post(path, params.toFormData()); + } + + /** pdf a quote using raw JSON payload (executes immediately) - returns raw Response. */ + Response pdfRaw(String quoteId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/pdf", "quote-id", quoteId); + return postJson(path, jsonPayload); + } + + public QuotePdfResponse pdf(String quoteId, QuotePdfParams params) throws ChargebeeException { + Response response = pdfRaw(quoteId, params); + return QuotePdfResponse.fromJson(response.getBodyAsString(), response); + } + + /** convert a quote (executes immediately) - returns raw Response. */ + Response convertRaw(String quoteId) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/convert", "quote-id", quoteId); + + return post(path, null); + } + + /** convert a quote using immutable params (executes immediately) - returns raw Response. */ + Response convertRaw(String quoteId, QuoteConvertParams params) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/convert", "quote-id", quoteId); + return post(path, params.toFormData()); + } + + /** convert a quote using raw JSON payload (executes immediately) - returns raw Response. */ + Response convertRaw(String quoteId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/convert", "quote-id", quoteId); + return postJson(path, jsonPayload); + } + + public QuoteConvertResponse convert(String quoteId, QuoteConvertParams params) + throws ChargebeeException { + Response response = convertRaw(quoteId, params); + return QuoteConvertResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createForChargeItemsAndCharges a quote using immutable params (executes immediately) - returns + * raw Response. + */ + Response createForChargeItemsAndChargesRaw(QuoteCreateForChargeItemsAndChargesParams params) + throws ChargebeeException { + + return post( + "/quotes/create_for_charge_items_and_charges", params != null ? params.toFormData() : null); + } + + /** + * createForChargeItemsAndCharges a quote using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response createForChargeItemsAndChargesRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/quotes/create_for_charge_items_and_charges", jsonPayload); + } + + public QuoteCreateForChargeItemsAndChargesResponse createForChargeItemsAndCharges( + QuoteCreateForChargeItemsAndChargesParams params) throws ChargebeeException { + Response response = createForChargeItemsAndChargesRaw(params); + + return QuoteCreateForChargeItemsAndChargesResponse.fromJson( + response.getBodyAsString(), response); + } + + /** delete a quote (executes immediately) - returns raw Response. */ + Response deleteRaw(String quoteId) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/delete", "quote-id", quoteId); + + return post(path, null); + } + + /** delete a quote using immutable params (executes immediately) - returns raw Response. */ + Response deleteRaw(String quoteId, QuoteDeleteParams params) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/delete", "quote-id", quoteId); + return post(path, params.toFormData()); + } + + /** delete a quote using raw JSON payload (executes immediately) - returns raw Response. */ + Response deleteRaw(String quoteId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/delete", "quote-id", quoteId); + return postJson(path, jsonPayload); + } + + public QuoteDeleteResponse delete(String quoteId, QuoteDeleteParams params) + throws ChargebeeException { + Response response = deleteRaw(quoteId, params); + return QuoteDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** editOneTimeQuote a quote (executes immediately) - returns raw Response. */ + Response editOneTimeQuoteRaw(String quoteId) throws ChargebeeException { + String path = + buildPathWithParams("/quotes/{quote-id}/edit_one_time_quote", "quote-id", quoteId); + + return post(path, null); + } + + /** + * editOneTimeQuote a quote using immutable params (executes immediately) - returns raw Response. + */ + Response editOneTimeQuoteRaw(String quoteId, EditOneTimeQuoteParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/quotes/{quote-id}/edit_one_time_quote", "quote-id", quoteId); + return post(path, params.toFormData()); + } + + /** + * editOneTimeQuote a quote using raw JSON payload (executes immediately) - returns raw Response. + */ + Response editOneTimeQuoteRaw(String quoteId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/quotes/{quote-id}/edit_one_time_quote", "quote-id", quoteId); + return postJson(path, jsonPayload); + } + + public EditOneTimeQuoteResponse editOneTimeQuote(String quoteId, EditOneTimeQuoteParams params) + throws ChargebeeException { + Response response = editOneTimeQuoteRaw(quoteId, params); + return EditOneTimeQuoteResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * updateSubscriptionQuote a quote using immutable params (executes immediately) - returns raw + * Response. + */ + Response updateSubscriptionQuoteRaw(UpdateSubscriptionQuoteParams params) + throws ChargebeeException { + + return post("/quotes/update_subscription_quote", params != null ? params.toFormData() : null); + } + + /** + * updateSubscriptionQuote a quote using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response updateSubscriptionQuoteRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/quotes/update_subscription_quote", jsonPayload); + } + + public UpdateSubscriptionQuoteResponse updateSubscriptionQuote( + UpdateSubscriptionQuoteParams params) throws ChargebeeException { + Response response = updateSubscriptionQuoteRaw(params); + + return UpdateSubscriptionQuoteResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createForOnetimeCharges a quote using immutable params (executes immediately) - returns raw + * Response. + */ + Response createForOnetimeChargesRaw(QuoteCreateForOnetimeChargesParams params) + throws ChargebeeException { + + return post("/quotes/create_for_onetime_charges", params != null ? params.toFormData() : null); + } + + /** + * createForOnetimeCharges a quote using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response createForOnetimeChargesRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/quotes/create_for_onetime_charges", jsonPayload); + } + + public QuoteCreateForOnetimeChargesResponse createForOnetimeCharges( + QuoteCreateForOnetimeChargesParams params) throws ChargebeeException { + Response response = createForOnetimeChargesRaw(params); + + return QuoteCreateForOnetimeChargesResponse.fromJson(response.getBodyAsString(), response); + } + + /** createSubscriptionForCustomerQuote a quote (executes immediately) - returns raw Response. */ + Response createSubscriptionForCustomerQuoteRaw(String customerId) throws ChargebeeException { + String path = + buildPathWithParams( + "/customers/{customer-id}/create_subscription_quote", "customer-id", customerId); + + return post(path, null); + } + + /** + * createSubscriptionForCustomerQuote a quote using immutable params (executes immediately) - + * returns raw Response. + */ + Response createSubscriptionForCustomerQuoteRaw( + String customerId, CreateSubscriptionForCustomerQuoteParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/customers/{customer-id}/create_subscription_quote", "customer-id", customerId); + return post(path, params.toFormData()); + } + + /** + * createSubscriptionForCustomerQuote a quote using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response createSubscriptionForCustomerQuoteRaw(String customerId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/customers/{customer-id}/create_subscription_quote", "customer-id", customerId); + return postJson(path, jsonPayload); + } + + public CreateSubscriptionForCustomerQuoteResponse createSubscriptionForCustomerQuote( + String customerId, CreateSubscriptionForCustomerQuoteParams params) + throws ChargebeeException { + Response response = createSubscriptionForCustomerQuoteRaw(customerId, params); + return CreateSubscriptionForCustomerQuoteResponse.fromJson( + response.getBodyAsString(), response); + } + + /** editUpdateSubscriptionQuote a quote (executes immediately) - returns raw Response. */ + Response editUpdateSubscriptionQuoteRaw(String quoteId) throws ChargebeeException { + String path = + buildPathWithParams( + "/quotes/{quote-id}/edit_update_subscription_quote", "quote-id", quoteId); + + return post(path, null); + } + + /** + * editUpdateSubscriptionQuote a quote using immutable params (executes immediately) - returns raw + * Response. + */ + Response editUpdateSubscriptionQuoteRaw(String quoteId, EditUpdateSubscriptionQuoteParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/quotes/{quote-id}/edit_update_subscription_quote", "quote-id", quoteId); + return post(path, params.toFormData()); + } + + /** + * editUpdateSubscriptionQuote a quote using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response editUpdateSubscriptionQuoteRaw(String quoteId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/quotes/{quote-id}/edit_update_subscription_quote", "quote-id", quoteId); + return postJson(path, jsonPayload); + } + + public EditUpdateSubscriptionQuoteResponse editUpdateSubscriptionQuote( + String quoteId, EditUpdateSubscriptionQuoteParams params) throws ChargebeeException { + Response response = editUpdateSubscriptionQuoteRaw(quoteId, params); + return EditUpdateSubscriptionQuoteResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * editCreateSubscriptionForCustomerQuote a quote (executes immediately) - returns raw Response. + */ + Response editCreateSubscriptionForCustomerQuoteRaw(String quoteId) throws ChargebeeException { + String path = + buildPathWithParams( + "/quotes/{quote-id}/edit_create_subscription_quote", "quote-id", quoteId); + + return post(path, null); + } + + /** + * editCreateSubscriptionForCustomerQuote a quote using immutable params (executes immediately) - + * returns raw Response. + */ + Response editCreateSubscriptionForCustomerQuoteRaw( + String quoteId, EditCreateSubscriptionForCustomerQuoteParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/quotes/{quote-id}/edit_create_subscription_quote", "quote-id", quoteId); + return post(path, params.toFormData()); + } + + /** + * editCreateSubscriptionForCustomerQuote a quote using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response editCreateSubscriptionForCustomerQuoteRaw(String quoteId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/quotes/{quote-id}/edit_create_subscription_quote", "quote-id", quoteId); + return postJson(path, jsonPayload); + } + + public EditCreateSubscriptionForCustomerQuoteResponse editCreateSubscriptionForCustomerQuote( + String quoteId, EditCreateSubscriptionForCustomerQuoteParams params) + throws ChargebeeException { + Response response = editCreateSubscriptionForCustomerQuoteRaw(quoteId, params); + return EditCreateSubscriptionForCustomerQuoteResponse.fromJson( + response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/RampService.java b/src/main/java/com/chargebee/v4/services/RampService.java similarity index 75% rename from src/main/java/com/chargebee/v4/core/services/RampService.java rename to src/main/java/com/chargebee/v4/services/RampService.java index 0f4b85d2..cf98a6f6 100644 --- a/src/main/java/com/chargebee/v4/core/services/RampService.java +++ b/src/main/java/com/chargebee/v4/services/RampService.java @@ -5,27 +5,28 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.ramp.params.RampCreateForSubscriptionParams; +import com.chargebee.v4.models.ramp.params.RampCreateForSubscriptionParams; -import com.chargebee.v4.core.models.ramp.params.RampListParams; +import com.chargebee.v4.models.ramp.params.RampListParams; -import com.chargebee.v4.core.models.ramp.params.RampUpdateParams; +import com.chargebee.v4.models.ramp.params.RampUpdateParams; -import com.chargebee.v4.core.responses.ramp.RampRetrieveResponse; +import com.chargebee.v4.models.ramp.responses.RampRetrieveResponse; -import com.chargebee.v4.core.responses.ramp.RampCreateForSubscriptionResponse; +import com.chargebee.v4.models.ramp.responses.RampCreateForSubscriptionResponse; -import com.chargebee.v4.core.responses.ramp.RampListResponse; +import com.chargebee.v4.models.ramp.responses.RampListResponse; -import com.chargebee.v4.core.responses.ramp.RampUpdateResponse; +import com.chargebee.v4.models.ramp.responses.RampUpdateResponse; -import com.chargebee.v4.core.responses.ramp.RampDeleteResponse; +import com.chargebee.v4.models.ramp.responses.RampDeleteResponse; public final class RampService extends BaseService { @@ -62,19 +63,19 @@ public RampService withOptions(RequestOptions options) { // === Operations === /** retrieve a ramp (executes immediately) - returns raw Response. */ - Response retrieveRaw(String rampId) throws Exception { + Response retrieveRaw(String rampId) throws ChargebeeException { String path = buildPathWithParams("/ramps/{ramp-id}", "ramp-id", rampId); return get(path, null); } - public RampRetrieveResponse retrieve(String rampId) throws Exception { + public RampRetrieveResponse retrieve(String rampId) throws ChargebeeException { Response response = retrieveRaw(rampId); return RampRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** createForSubscription a ramp (executes immediately) - returns raw Response. */ - Response createForSubscriptionRaw(String subscriptionId) throws Exception { + Response createForSubscriptionRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/create_ramp", "subscription-id", subscriptionId); @@ -87,7 +88,7 @@ Response createForSubscriptionRaw(String subscriptionId) throws Exception { * Response. */ Response createForSubscriptionRaw(String subscriptionId, RampCreateForSubscriptionParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/create_ramp", "subscription-id", subscriptionId); @@ -98,7 +99,8 @@ Response createForSubscriptionRaw(String subscriptionId, RampCreateForSubscripti * createForSubscription a ramp using raw JSON payload (executes immediately) - returns raw * Response. */ - Response createForSubscriptionRaw(String subscriptionId, String jsonPayload) throws Exception { + Response createForSubscriptionRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/create_ramp", "subscription-id", subscriptionId); @@ -106,72 +108,73 @@ Response createForSubscriptionRaw(String subscriptionId, String jsonPayload) thr } public RampCreateForSubscriptionResponse createForSubscription( - String subscriptionId, RampCreateForSubscriptionParams params) throws Exception { + String subscriptionId, RampCreateForSubscriptionParams params) throws ChargebeeException { Response response = createForSubscriptionRaw(subscriptionId, params); return RampCreateForSubscriptionResponse.fromJson(response.getBodyAsString(), response); } /** list a ramp using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(RampListParams params) throws Exception { + Response listRaw(RampListParams params) throws ChargebeeException { return get("/ramps", params != null ? params.toQueryParams() : null); } /** list a ramp without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/ramps", null); } /** list a ramp using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public RampListResponse list(RampListParams params) throws Exception { + public RampListResponse list(RampListParams params) throws ChargebeeException { Response response = listRaw(params); return RampListResponse.fromJson(response.getBodyAsString(), this, params, response); } - public RampListResponse list() throws Exception { + public RampListResponse list() throws ChargebeeException { Response response = listRaw(); return RampListResponse.fromJson(response.getBodyAsString(), this, null, response); } /** update a ramp (executes immediately) - returns raw Response. */ - Response updateRaw(String rampId) throws Exception { + Response updateRaw(String rampId) throws ChargebeeException { String path = buildPathWithParams("/ramps/{ramp-id}/update", "ramp-id", rampId); return post(path, null); } /** update a ramp using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String rampId, RampUpdateParams params) throws Exception { + Response updateRaw(String rampId, RampUpdateParams params) throws ChargebeeException { String path = buildPathWithParams("/ramps/{ramp-id}/update", "ramp-id", rampId); return post(path, params.toFormData()); } /** update a ramp using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String rampId, String jsonPayload) throws Exception { + Response updateRaw(String rampId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/ramps/{ramp-id}/update", "ramp-id", rampId); return postJson(path, jsonPayload); } - public RampUpdateResponse update(String rampId, RampUpdateParams params) throws Exception { + public RampUpdateResponse update(String rampId, RampUpdateParams params) + throws ChargebeeException { Response response = updateRaw(rampId, params); return RampUpdateResponse.fromJson(response.getBodyAsString(), response); } /** delete a ramp (executes immediately) - returns raw Response. */ - Response deleteRaw(String rampId) throws Exception { + Response deleteRaw(String rampId) throws ChargebeeException { String path = buildPathWithParams("/ramps/{ramp-id}/delete", "ramp-id", rampId); return post(path, null); } - public RampDeleteResponse delete(String rampId) throws Exception { + public RampDeleteResponse delete(String rampId) throws ChargebeeException { Response response = deleteRaw(rampId); return RampDeleteResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/core/services/RecordedPurchaseService.java b/src/main/java/com/chargebee/v4/services/RecordedPurchaseService.java similarity index 81% rename from src/main/java/com/chargebee/v4/core/services/RecordedPurchaseService.java rename to src/main/java/com/chargebee/v4/services/RecordedPurchaseService.java index 32492369..67b65fe9 100644 --- a/src/main/java/com/chargebee/v4/core/services/RecordedPurchaseService.java +++ b/src/main/java/com/chargebee/v4/services/RecordedPurchaseService.java @@ -5,17 +5,18 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.recordedPurchase.params.RecordedPurchaseCreateParams; +import com.chargebee.v4.models.recordedPurchase.params.RecordedPurchaseCreateParams; -import com.chargebee.v4.core.responses.recordedPurchase.RecordedPurchaseRetrieveResponse; +import com.chargebee.v4.models.recordedPurchase.responses.RecordedPurchaseRetrieveResponse; -import com.chargebee.v4.core.responses.recordedPurchase.RecordedPurchaseCreateResponse; +import com.chargebee.v4.models.recordedPurchase.responses.RecordedPurchaseCreateResponse; public final class RecordedPurchaseService extends BaseService { @@ -53,7 +54,7 @@ public RecordedPurchaseService withOptions(RequestOptions options) { // === Operations === /** retrieve a recordedPurchase (executes immediately) - returns raw Response. */ - Response retrieveRaw(String recordedPurchaseId) throws Exception { + Response retrieveRaw(String recordedPurchaseId) throws ChargebeeException { String path = buildPathWithParams( "/recorded_purchases/{recorded-purchase-id}", @@ -63,7 +64,8 @@ Response retrieveRaw(String recordedPurchaseId) throws Exception { return get(path, null); } - public RecordedPurchaseRetrieveResponse retrieve(String recordedPurchaseId) throws Exception { + public RecordedPurchaseRetrieveResponse retrieve(String recordedPurchaseId) + throws ChargebeeException { Response response = retrieveRaw(recordedPurchaseId); return RecordedPurchaseRetrieveResponse.fromJson(response.getBodyAsString(), response); } @@ -71,7 +73,7 @@ public RecordedPurchaseRetrieveResponse retrieve(String recordedPurchaseId) thro /** * create a recordedPurchase using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(RecordedPurchaseCreateParams params) throws Exception { + Response createRaw(RecordedPurchaseCreateParams params) throws ChargebeeException { return post("/recorded_purchases", params != null ? params.toFormData() : null); } @@ -79,13 +81,13 @@ Response createRaw(RecordedPurchaseCreateParams params) throws Exception { /** * create a recordedPurchase using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/recorded_purchases", jsonPayload); } public RecordedPurchaseCreateResponse create(RecordedPurchaseCreateParams params) - throws Exception { + throws ChargebeeException { Response response = createRaw(params); return RecordedPurchaseCreateResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/core/services/ResourceMigrationService.java b/src/main/java/com/chargebee/v4/services/ResourceMigrationService.java similarity index 81% rename from src/main/java/com/chargebee/v4/core/services/ResourceMigrationService.java rename to src/main/java/com/chargebee/v4/services/ResourceMigrationService.java index e7072926..19a552d5 100644 --- a/src/main/java/com/chargebee/v4/core/services/ResourceMigrationService.java +++ b/src/main/java/com/chargebee/v4/services/ResourceMigrationService.java @@ -5,15 +5,16 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.resourceMigration.params.ResourceMigrationRetrieveLatestParams; +import com.chargebee.v4.models.resourceMigration.params.ResourceMigrationRetrieveLatestParams; -import com.chargebee.v4.core.responses.resourceMigration.ResourceMigrationRetrieveLatestResponse; +import com.chargebee.v4.models.resourceMigration.responses.ResourceMigrationRetrieveLatestResponse; public final class ResourceMigrationService extends BaseService { @@ -54,7 +55,8 @@ public ResourceMigrationService withOptions(RequestOptions options) { * retrieveLatest a resourceMigration using immutable params (executes immediately) - returns raw * Response. */ - Response retrieveLatestRaw(ResourceMigrationRetrieveLatestParams params) throws Exception { + Response retrieveLatestRaw(ResourceMigrationRetrieveLatestParams params) + throws ChargebeeException { return get( "/resource_migrations/retrieve_latest", params != null ? params.toQueryParams() : null); @@ -64,13 +66,13 @@ Response retrieveLatestRaw(ResourceMigrationRetrieveLatestParams params) throws * retrieveLatest a resourceMigration using raw JSON payload (executes immediately) - returns raw * Response. */ - Response retrieveLatestRaw(String jsonPayload) throws Exception { + Response retrieveLatestRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public ResourceMigrationRetrieveLatestResponse retrieveLatest( - ResourceMigrationRetrieveLatestParams params) throws Exception { + ResourceMigrationRetrieveLatestParams params) throws ChargebeeException { Response response = retrieveLatestRaw(params); return ResourceMigrationRetrieveLatestResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/core/services/RuleService.java b/src/main/java/com/chargebee/v4/services/RuleService.java similarity index 83% rename from src/main/java/com/chargebee/v4/core/services/RuleService.java rename to src/main/java/com/chargebee/v4/services/RuleService.java index b155ed87..3b774961 100644 --- a/src/main/java/com/chargebee/v4/core/services/RuleService.java +++ b/src/main/java/com/chargebee/v4/services/RuleService.java @@ -5,13 +5,14 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.responses.rule.RuleRetrieveResponse; +import com.chargebee.v4.models.rule.responses.RuleRetrieveResponse; public final class RuleService extends BaseService { @@ -48,13 +49,13 @@ public RuleService withOptions(RequestOptions options) { // === Operations === /** retrieve a rule (executes immediately) - returns raw Response. */ - Response retrieveRaw(String ruleId) throws Exception { + Response retrieveRaw(String ruleId) throws ChargebeeException { String path = buildPathWithParams("/rules/{rule-id}", "rule-id", ruleId); return get(path, null); } - public RuleRetrieveResponse retrieve(String ruleId) throws Exception { + public RuleRetrieveResponse retrieve(String ruleId) throws ChargebeeException { Response response = retrieveRaw(ruleId); return RuleRetrieveResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/core/services/ServiceConfig.java b/src/main/java/com/chargebee/v4/services/ServiceConfig.java similarity index 97% rename from src/main/java/com/chargebee/v4/core/services/ServiceConfig.java rename to src/main/java/com/chargebee/v4/services/ServiceConfig.java index 8701800c..cb643790 100644 --- a/src/main/java/com/chargebee/v4/core/services/ServiceConfig.java +++ b/src/main/java/com/chargebee/v4/services/ServiceConfig.java @@ -1,4 +1,4 @@ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; /** * Configuration object for service behavior options. diff --git a/src/main/java/com/chargebee/v4/core/services/SiteMigrationDetailService.java b/src/main/java/com/chargebee/v4/services/SiteMigrationDetailService.java similarity index 83% rename from src/main/java/com/chargebee/v4/core/services/SiteMigrationDetailService.java rename to src/main/java/com/chargebee/v4/services/SiteMigrationDetailService.java index 4e1659c5..01f25bf1 100644 --- a/src/main/java/com/chargebee/v4/core/services/SiteMigrationDetailService.java +++ b/src/main/java/com/chargebee/v4/services/SiteMigrationDetailService.java @@ -5,15 +5,16 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.siteMigrationDetail.params.SiteMigrationDetailListParams; +import com.chargebee.v4.models.siteMigrationDetail.params.SiteMigrationDetailListParams; -import com.chargebee.v4.core.responses.siteMigrationDetail.SiteMigrationDetailListResponse; +import com.chargebee.v4.models.siteMigrationDetail.responses.SiteMigrationDetailListResponse; public final class SiteMigrationDetailService extends BaseService { @@ -54,13 +55,13 @@ public SiteMigrationDetailService withOptions(RequestOptions options) { * list a siteMigrationDetail using immutable params (executes immediately) - returns raw * Response. */ - Response listRaw(SiteMigrationDetailListParams params) throws Exception { + Response listRaw(SiteMigrationDetailListParams params) throws ChargebeeException { return get("/site_migration_details", params != null ? params.toQueryParams() : null); } /** list a siteMigrationDetail without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/site_migration_details", null); } @@ -69,20 +70,20 @@ Response listRaw() throws Exception { * list a siteMigrationDetail using raw JSON payload (executes immediately) - returns raw * Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public SiteMigrationDetailListResponse list(SiteMigrationDetailListParams params) - throws Exception { + throws ChargebeeException { Response response = listRaw(params); return SiteMigrationDetailListResponse.fromJson( response.getBodyAsString(), this, params, response); } - public SiteMigrationDetailListResponse list() throws Exception { + public SiteMigrationDetailListResponse list() throws ChargebeeException { Response response = listRaw(); return SiteMigrationDetailListResponse.fromJson( response.getBodyAsString(), this, null, response); diff --git a/src/main/java/com/chargebee/v4/services/SubscriptionEntitlementService.java b/src/main/java/com/chargebee/v4/services/SubscriptionEntitlementService.java new file mode 100644 index 00000000..ef765657 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/SubscriptionEntitlementService.java @@ -0,0 +1,168 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.subscriptionEntitlement.params.SetSubscriptionEntitlementAvailabilityParams; + +import com.chargebee.v4.models.subscriptionEntitlement.params.SubscriptionEntitlementsForSubscriptionParams; + +import com.chargebee.v4.models.subscriptionEntitlement.responses.SetSubscriptionEntitlementAvailabilityResponse; + +import com.chargebee.v4.models.subscriptionEntitlement.responses.SubscriptionEntitlementsForSubscriptionResponse; + +public final class SubscriptionEntitlementService + extends BaseService { + + private final ServiceConfig config; + + public SubscriptionEntitlementService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private SubscriptionEntitlementService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private SubscriptionEntitlementService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + SubscriptionEntitlementService with(RequestOptions newOptions) { + return new SubscriptionEntitlementService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public SubscriptionEntitlementService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * setSubscriptionEntitlementAvailability a subscriptionEntitlement (executes immediately) - + * returns raw Response. + */ + Response setSubscriptionEntitlementAvailabilityRaw(String subscriptionId) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/subscription_entitlements/set_availability", + "subscription-id", + subscriptionId); + + return post(path, null); + } + + /** + * setSubscriptionEntitlementAvailability a subscriptionEntitlement using immutable params + * (executes immediately) - returns raw Response. + */ + Response setSubscriptionEntitlementAvailabilityRaw( + String subscriptionId, SetSubscriptionEntitlementAvailabilityParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/subscription_entitlements/set_availability", + "subscription-id", + subscriptionId); + return post(path, params.toFormData()); + } + + /** + * setSubscriptionEntitlementAvailability a subscriptionEntitlement using raw JSON payload + * (executes immediately) - returns raw Response. + */ + Response setSubscriptionEntitlementAvailabilityRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/subscription_entitlements/set_availability", + "subscription-id", + subscriptionId); + return postJson(path, jsonPayload); + } + + public SetSubscriptionEntitlementAvailabilityResponse setSubscriptionEntitlementAvailability( + String subscriptionId, SetSubscriptionEntitlementAvailabilityParams params) + throws ChargebeeException { + Response response = setSubscriptionEntitlementAvailabilityRaw(subscriptionId, params); + return SetSubscriptionEntitlementAvailabilityResponse.fromJson( + response.getBodyAsString(), response); + } + + /** + * subscriptionEntitlementsForSubscription a subscriptionEntitlement using immutable params + * (executes immediately) - returns raw Response. + */ + Response subscriptionEntitlementsForSubscriptionRaw( + String subscriptionId, SubscriptionEntitlementsForSubscriptionParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/subscription_entitlements", + "subscription-id", + subscriptionId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * subscriptionEntitlementsForSubscription a subscriptionEntitlement without params (executes + * immediately) - returns raw Response. + */ + Response subscriptionEntitlementsForSubscriptionRaw(String subscriptionId) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/subscription_entitlements", + "subscription-id", + subscriptionId); + return get(path, null); + } + + /** + * subscriptionEntitlementsForSubscription a subscriptionEntitlement using raw JSON payload + * (executes immediately) - returns raw Response. + */ + Response subscriptionEntitlementsForSubscriptionRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/subscription_entitlements", + "subscription-id", + subscriptionId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public SubscriptionEntitlementsForSubscriptionResponse subscriptionEntitlementsForSubscription( + String subscriptionId, SubscriptionEntitlementsForSubscriptionParams params) + throws ChargebeeException { + Response response = subscriptionEntitlementsForSubscriptionRaw(subscriptionId, params); + return SubscriptionEntitlementsForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, params, subscriptionId, response); + } + + public SubscriptionEntitlementsForSubscriptionResponse subscriptionEntitlementsForSubscription( + String subscriptionId) throws ChargebeeException { + Response response = subscriptionEntitlementsForSubscriptionRaw(subscriptionId); + return SubscriptionEntitlementsForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, null, subscriptionId, response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/SubscriptionService.java b/src/main/java/com/chargebee/v4/services/SubscriptionService.java similarity index 77% rename from src/main/java/com/chargebee/v4/core/services/SubscriptionService.java rename to src/main/java/com/chargebee/v4/services/SubscriptionService.java index e6153b6c..3d0b726b 100644 --- a/src/main/java/com/chargebee/v4/core/services/SubscriptionService.java +++ b/src/main/java/com/chargebee/v4/services/SubscriptionService.java @@ -5,145 +5,146 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.subscription.params.SubscriptionRemoveAdvanceInvoiceScheduleParams; +import com.chargebee.v4.models.subscription.params.SubscriptionRemoveAdvanceInvoiceScheduleParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionUpdateForItemsParams; +import com.chargebee.v4.models.subscription.params.SubscriptionUpdateForItemsParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionRemoveCouponsParams; +import com.chargebee.v4.models.subscription.params.SubscriptionRemoveCouponsParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionResumeParams; +import com.chargebee.v4.models.subscription.params.SubscriptionResumeParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionCancelForItemsParams; +import com.chargebee.v4.models.subscription.params.SubscriptionCancelForItemsParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionRegenerateInvoiceParams; +import com.chargebee.v4.models.subscription.params.SubscriptionRegenerateInvoiceParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionListParams; +import com.chargebee.v4.models.subscription.params.SubscriptionListParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionCreateParams; +import com.chargebee.v4.models.subscription.params.SubscriptionCreateParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionMoveParams; +import com.chargebee.v4.models.subscription.params.SubscriptionMoveParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionSubscriptionsForCustomerParams; +import com.chargebee.v4.models.subscription.params.SubscriptionsForCustomerParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionCreateForCustomerParams; +import com.chargebee.v4.models.subscription.params.SubscriptionCreateForCustomerParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionImportForItemsParams; +import com.chargebee.v4.models.subscription.params.SubscriptionImportForItemsParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionRemoveScheduledCancellationParams; +import com.chargebee.v4.models.subscription.params.SubscriptionRemoveScheduledCancellationParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionReactivateParams; +import com.chargebee.v4.models.subscription.params.SubscriptionReactivateParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionChargeFutureRenewalsParams; +import com.chargebee.v4.models.subscription.params.SubscriptionChargeFutureRenewalsParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionAddChargeAtTermEndParams; +import com.chargebee.v4.models.subscription.params.SubscriptionAddChargeAtTermEndParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionChangeTermEndParams; +import com.chargebee.v4.models.subscription.params.SubscriptionChangeTermEndParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionCreateWithItemsParams; +import com.chargebee.v4.models.subscription.params.SubscriptionCreateWithItemsParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionImportUnbilledChargesParams; +import com.chargebee.v4.models.subscription.params.SubscriptionImportUnbilledChargesParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionUpdateParams; +import com.chargebee.v4.models.subscription.params.SubscriptionUpdateParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionImportContractTermParams; +import com.chargebee.v4.models.subscription.params.SubscriptionImportContractTermParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionOverrideBillingProfileParams; +import com.chargebee.v4.models.subscription.params.SubscriptionOverrideBillingProfileParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionEditAdvanceInvoiceScheduleParams; +import com.chargebee.v4.models.subscription.params.SubscriptionEditAdvanceInvoiceScheduleParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionListDiscountsParams; +import com.chargebee.v4.models.subscription.params.SubscriptionListDiscountsParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionContractTermsForSubscriptionParams; +import com.chargebee.v4.models.subscription.params.ContractTermsForSubscriptionParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionPauseParams; +import com.chargebee.v4.models.subscription.params.SubscriptionPauseParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionImportForCustomerParams; +import com.chargebee.v4.models.subscription.params.SubscriptionImportForCustomerParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionImportSubscriptionParams; +import com.chargebee.v4.models.subscription.params.ImportSubscriptionParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionCancelParams; +import com.chargebee.v4.models.subscription.params.SubscriptionCancelParams; -import com.chargebee.v4.core.models.subscription.params.SubscriptionChargeAddonAtTermEndParams; +import com.chargebee.v4.models.subscription.params.SubscriptionChargeAddonAtTermEndParams; -import com.chargebee.v4.core.responses.subscription.SubscriptionRemoveAdvanceInvoiceScheduleResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionRemoveAdvanceInvoiceScheduleResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionUpdateForItemsResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionUpdateForItemsResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionRemoveCouponsResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionRemoveCouponsResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionResumeResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionResumeResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionCancelForItemsResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionCancelForItemsResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionRegenerateInvoiceResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionRegenerateInvoiceResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionListResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionListResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionCreateResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionCreateResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionMoveResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionMoveResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionSubscriptionsForCustomerResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionsForCustomerResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionCreateForCustomerResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionCreateForCustomerResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionImportForItemsResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionImportForItemsResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionRetrieveAdvanceInvoiceScheduleResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionRetrieveAdvanceInvoiceScheduleResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionRemoveScheduledCancellationResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionRemoveScheduledCancellationResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionRetrieveWithScheduledChangesResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionRetrieveWithScheduledChangesResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionReactivateResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionReactivateResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionChargeFutureRenewalsResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionChargeFutureRenewalsResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionAddChargeAtTermEndResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionAddChargeAtTermEndResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionRemoveScheduledChangesResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionRemoveScheduledChangesResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionChangeTermEndResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionChangeTermEndResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionDeleteResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionDeleteResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionCreateWithItemsResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionCreateWithItemsResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionImportUnbilledChargesResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionImportUnbilledChargesResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionRemoveScheduledResumptionResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionRemoveScheduledResumptionResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionRetrieveResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionRetrieveResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionUpdateResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionUpdateResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionImportContractTermResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionImportContractTermResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionOverrideBillingProfileResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionOverrideBillingProfileResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionRemoveScheduledPauseResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionRemoveScheduledPauseResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionEditAdvanceInvoiceScheduleResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionEditAdvanceInvoiceScheduleResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionListDiscountsResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionListDiscountsResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionContractTermsForSubscriptionResponse; +import com.chargebee.v4.models.subscription.responses.ContractTermsForSubscriptionResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionPauseResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionPauseResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionImportForCustomerResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionImportForCustomerResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionImportSubscriptionResponse; +import com.chargebee.v4.models.subscription.responses.ImportSubscriptionResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionCancelResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionCancelResponse; -import com.chargebee.v4.core.responses.subscription.SubscriptionChargeAddonAtTermEndResponse; +import com.chargebee.v4.models.subscription.responses.SubscriptionChargeAddonAtTermEndResponse; public final class SubscriptionService extends BaseService { @@ -181,7 +182,7 @@ public SubscriptionService withOptions(RequestOptions options) { // === Operations === /** removeAdvanceInvoiceSchedule a subscription (executes immediately) - returns raw Response. */ - Response removeAdvanceInvoiceScheduleRaw(String subscriptionId) throws Exception { + Response removeAdvanceInvoiceScheduleRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/remove_advance_invoice_schedule", @@ -197,7 +198,7 @@ Response removeAdvanceInvoiceScheduleRaw(String subscriptionId) throws Exception */ Response removeAdvanceInvoiceScheduleRaw( String subscriptionId, SubscriptionRemoveAdvanceInvoiceScheduleParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/remove_advance_invoice_schedule", @@ -211,7 +212,7 @@ Response removeAdvanceInvoiceScheduleRaw( * returns raw Response. */ Response removeAdvanceInvoiceScheduleRaw(String subscriptionId, String jsonPayload) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/remove_advance_invoice_schedule", @@ -222,14 +223,14 @@ Response removeAdvanceInvoiceScheduleRaw(String subscriptionId, String jsonPaylo public SubscriptionRemoveAdvanceInvoiceScheduleResponse removeAdvanceInvoiceSchedule( String subscriptionId, SubscriptionRemoveAdvanceInvoiceScheduleParams params) - throws Exception { + throws ChargebeeException { Response response = removeAdvanceInvoiceScheduleRaw(subscriptionId, params); return SubscriptionRemoveAdvanceInvoiceScheduleResponse.fromJson( response.getBodyAsString(), response); } /** updateForItems a subscription (executes immediately) - returns raw Response. */ - Response updateForItemsRaw(String subscriptionId) throws Exception { + Response updateForItemsRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/update_for_items", "subscription-id", subscriptionId); @@ -242,7 +243,7 @@ Response updateForItemsRaw(String subscriptionId) throws Exception { * Response. */ Response updateForItemsRaw(String subscriptionId, SubscriptionUpdateForItemsParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/update_for_items", "subscription-id", subscriptionId); @@ -253,7 +254,7 @@ Response updateForItemsRaw(String subscriptionId, SubscriptionUpdateForItemsPara * updateForItems a subscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response updateForItemsRaw(String subscriptionId, String jsonPayload) throws Exception { + Response updateForItemsRaw(String subscriptionId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/update_for_items", "subscription-id", subscriptionId); @@ -261,13 +262,13 @@ Response updateForItemsRaw(String subscriptionId, String jsonPayload) throws Exc } public SubscriptionUpdateForItemsResponse updateForItems( - String subscriptionId, SubscriptionUpdateForItemsParams params) throws Exception { + String subscriptionId, SubscriptionUpdateForItemsParams params) throws ChargebeeException { Response response = updateForItemsRaw(subscriptionId, params); return SubscriptionUpdateForItemsResponse.fromJson(response.getBodyAsString(), response); } /** removeCoupons a subscription (executes immediately) - returns raw Response. */ - Response removeCouponsRaw(String subscriptionId) throws Exception { + Response removeCouponsRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/remove_coupons", "subscription-id", subscriptionId); @@ -280,7 +281,7 @@ Response removeCouponsRaw(String subscriptionId) throws Exception { * Response. */ Response removeCouponsRaw(String subscriptionId, SubscriptionRemoveCouponsParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/remove_coupons", "subscription-id", subscriptionId); @@ -291,7 +292,7 @@ Response removeCouponsRaw(String subscriptionId, SubscriptionRemoveCouponsParams * removeCoupons a subscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response removeCouponsRaw(String subscriptionId, String jsonPayload) throws Exception { + Response removeCouponsRaw(String subscriptionId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/remove_coupons", "subscription-id", subscriptionId); @@ -299,13 +300,13 @@ Response removeCouponsRaw(String subscriptionId, String jsonPayload) throws Exce } public SubscriptionRemoveCouponsResponse removeCoupons( - String subscriptionId, SubscriptionRemoveCouponsParams params) throws Exception { + String subscriptionId, SubscriptionRemoveCouponsParams params) throws ChargebeeException { Response response = removeCouponsRaw(subscriptionId, params); return SubscriptionRemoveCouponsResponse.fromJson(response.getBodyAsString(), response); } /** resume a subscription (executes immediately) - returns raw Response. */ - Response resumeRaw(String subscriptionId) throws Exception { + Response resumeRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/resume", "subscription-id", subscriptionId); @@ -314,7 +315,8 @@ Response resumeRaw(String subscriptionId) throws Exception { } /** resume a subscription using immutable params (executes immediately) - returns raw Response. */ - Response resumeRaw(String subscriptionId, SubscriptionResumeParams params) throws Exception { + Response resumeRaw(String subscriptionId, SubscriptionResumeParams params) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/resume", "subscription-id", subscriptionId); @@ -322,7 +324,7 @@ Response resumeRaw(String subscriptionId, SubscriptionResumeParams params) throw } /** resume a subscription using raw JSON payload (executes immediately) - returns raw Response. */ - Response resumeRaw(String subscriptionId, String jsonPayload) throws Exception { + Response resumeRaw(String subscriptionId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/resume", "subscription-id", subscriptionId); @@ -330,13 +332,13 @@ Response resumeRaw(String subscriptionId, String jsonPayload) throws Exception { } public SubscriptionResumeResponse resume(String subscriptionId, SubscriptionResumeParams params) - throws Exception { + throws ChargebeeException { Response response = resumeRaw(subscriptionId, params); return SubscriptionResumeResponse.fromJson(response.getBodyAsString(), response); } /** cancelForItems a subscription (executes immediately) - returns raw Response. */ - Response cancelForItemsRaw(String subscriptionId) throws Exception { + Response cancelForItemsRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/cancel_for_items", "subscription-id", subscriptionId); @@ -349,7 +351,7 @@ Response cancelForItemsRaw(String subscriptionId) throws Exception { * Response. */ Response cancelForItemsRaw(String subscriptionId, SubscriptionCancelForItemsParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/cancel_for_items", "subscription-id", subscriptionId); @@ -360,7 +362,7 @@ Response cancelForItemsRaw(String subscriptionId, SubscriptionCancelForItemsPara * cancelForItems a subscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response cancelForItemsRaw(String subscriptionId, String jsonPayload) throws Exception { + Response cancelForItemsRaw(String subscriptionId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/cancel_for_items", "subscription-id", subscriptionId); @@ -368,13 +370,13 @@ Response cancelForItemsRaw(String subscriptionId, String jsonPayload) throws Exc } public SubscriptionCancelForItemsResponse cancelForItems( - String subscriptionId, SubscriptionCancelForItemsParams params) throws Exception { + String subscriptionId, SubscriptionCancelForItemsParams params) throws ChargebeeException { Response response = cancelForItemsRaw(subscriptionId, params); return SubscriptionCancelForItemsResponse.fromJson(response.getBodyAsString(), response); } /** regenerateInvoice a subscription (executes immediately) - returns raw Response. */ - Response regenerateInvoiceRaw(String subscriptionId) throws Exception { + Response regenerateInvoiceRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/regenerate_invoice", @@ -389,7 +391,7 @@ Response regenerateInvoiceRaw(String subscriptionId) throws Exception { * Response. */ Response regenerateInvoiceRaw(String subscriptionId, SubscriptionRegenerateInvoiceParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/regenerate_invoice", @@ -402,7 +404,8 @@ Response regenerateInvoiceRaw(String subscriptionId, SubscriptionRegenerateInvoi * regenerateInvoice a subscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response regenerateInvoiceRaw(String subscriptionId, String jsonPayload) throws Exception { + Response regenerateInvoiceRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/regenerate_invoice", @@ -412,60 +415,61 @@ Response regenerateInvoiceRaw(String subscriptionId, String jsonPayload) throws } public SubscriptionRegenerateInvoiceResponse regenerateInvoice( - String subscriptionId, SubscriptionRegenerateInvoiceParams params) throws Exception { + String subscriptionId, SubscriptionRegenerateInvoiceParams params) throws ChargebeeException { Response response = regenerateInvoiceRaw(subscriptionId, params); return SubscriptionRegenerateInvoiceResponse.fromJson(response.getBodyAsString(), response); } /** list a subscription using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(SubscriptionListParams params) throws Exception { + Response listRaw(SubscriptionListParams params) throws ChargebeeException { return get("/subscriptions", params != null ? params.toQueryParams() : null); } /** list a subscription without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/subscriptions", null); } /** list a subscription using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public SubscriptionListResponse list(SubscriptionListParams params) throws Exception { + public SubscriptionListResponse list(SubscriptionListParams params) throws ChargebeeException { Response response = listRaw(params); return SubscriptionListResponse.fromJson(response.getBodyAsString(), this, params, response); } - public SubscriptionListResponse list() throws Exception { + public SubscriptionListResponse list() throws ChargebeeException { Response response = listRaw(); return SubscriptionListResponse.fromJson(response.getBodyAsString(), this, null, response); } /** create a subscription using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(SubscriptionCreateParams params) throws Exception { + Response createRaw(SubscriptionCreateParams params) throws ChargebeeException { return post("/subscriptions", params != null ? params.toFormData() : null); } /** create a subscription using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/subscriptions", jsonPayload); } - public SubscriptionCreateResponse create(SubscriptionCreateParams params) throws Exception { + public SubscriptionCreateResponse create(SubscriptionCreateParams params) + throws ChargebeeException { Response response = createRaw(params); return SubscriptionCreateResponse.fromJson(response.getBodyAsString(), response); } /** move a subscription (executes immediately) - returns raw Response. */ - Response moveRaw(String subscriptionId) throws Exception { + Response moveRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/move", "subscription-id", subscriptionId); @@ -474,7 +478,7 @@ Response moveRaw(String subscriptionId) throws Exception { } /** move a subscription using immutable params (executes immediately) - returns raw Response. */ - Response moveRaw(String subscriptionId, SubscriptionMoveParams params) throws Exception { + Response moveRaw(String subscriptionId, SubscriptionMoveParams params) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/move", "subscription-id", subscriptionId); @@ -482,7 +486,7 @@ Response moveRaw(String subscriptionId, SubscriptionMoveParams params) throws Ex } /** move a subscription using raw JSON payload (executes immediately) - returns raw Response. */ - Response moveRaw(String subscriptionId, String jsonPayload) throws Exception { + Response moveRaw(String subscriptionId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/move", "subscription-id", subscriptionId); @@ -490,7 +494,7 @@ Response moveRaw(String subscriptionId, String jsonPayload) throws Exception { } public SubscriptionMoveResponse move(String subscriptionId, SubscriptionMoveParams params) - throws Exception { + throws ChargebeeException { Response response = moveRaw(subscriptionId, params); return SubscriptionMoveResponse.fromJson(response.getBodyAsString(), response); } @@ -499,8 +503,8 @@ public SubscriptionMoveResponse move(String subscriptionId, SubscriptionMovePara * subscriptionsForCustomer a subscription using immutable params (executes immediately) - returns * raw Response. */ - Response subscriptionsForCustomerRaw( - String customerId, SubscriptionSubscriptionsForCustomerParams params) throws Exception { + Response subscriptionsForCustomerRaw(String customerId, SubscriptionsForCustomerParams params) + throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/subscriptions", "customer-id", customerId); return get(path, params != null ? params.toQueryParams() : null); @@ -510,7 +514,7 @@ Response subscriptionsForCustomerRaw( * subscriptionsForCustomer a subscription without params (executes immediately) - returns raw * Response. */ - Response subscriptionsForCustomerRaw(String customerId) throws Exception { + Response subscriptionsForCustomerRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/subscriptions", "customer-id", customerId); return get(path, null); @@ -520,28 +524,29 @@ Response subscriptionsForCustomerRaw(String customerId) throws Exception { * subscriptionsForCustomer a subscription using raw JSON payload (executes immediately) - returns * raw Response. */ - Response subscriptionsForCustomerRaw(String customerId, String jsonPayload) throws Exception { + Response subscriptionsForCustomerRaw(String customerId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/subscriptions", "customer-id", customerId); throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public SubscriptionSubscriptionsForCustomerResponse subscriptionsForCustomer( - String customerId, SubscriptionSubscriptionsForCustomerParams params) throws Exception { + public SubscriptionsForCustomerResponse subscriptionsForCustomer( + String customerId, SubscriptionsForCustomerParams params) throws ChargebeeException { Response response = subscriptionsForCustomerRaw(customerId, params); - return SubscriptionSubscriptionsForCustomerResponse.fromJson( + return SubscriptionsForCustomerResponse.fromJson( response.getBodyAsString(), this, params, customerId, response); } - public SubscriptionSubscriptionsForCustomerResponse subscriptionsForCustomer(String customerId) - throws Exception { + public SubscriptionsForCustomerResponse subscriptionsForCustomer(String customerId) + throws ChargebeeException { Response response = subscriptionsForCustomerRaw(customerId); - return SubscriptionSubscriptionsForCustomerResponse.fromJson( + return SubscriptionsForCustomerResponse.fromJson( response.getBodyAsString(), this, null, customerId, response); } /** createForCustomer a subscription (executes immediately) - returns raw Response. */ - Response createForCustomerRaw(String customerId) throws Exception { + Response createForCustomerRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/subscriptions", "customer-id", customerId); @@ -553,7 +558,7 @@ Response createForCustomerRaw(String customerId) throws Exception { * Response. */ Response createForCustomerRaw(String customerId, SubscriptionCreateForCustomerParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/subscriptions", "customer-id", customerId); return post(path, params.toFormData()); @@ -563,20 +568,20 @@ Response createForCustomerRaw(String customerId, SubscriptionCreateForCustomerPa * createForCustomer a subscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response createForCustomerRaw(String customerId, String jsonPayload) throws Exception { + Response createForCustomerRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/subscriptions", "customer-id", customerId); return postJson(path, jsonPayload); } public SubscriptionCreateForCustomerResponse createForCustomer( - String customerId, SubscriptionCreateForCustomerParams params) throws Exception { + String customerId, SubscriptionCreateForCustomerParams params) throws ChargebeeException { Response response = createForCustomerRaw(customerId, params); return SubscriptionCreateForCustomerResponse.fromJson(response.getBodyAsString(), response); } /** importForItems a subscription (executes immediately) - returns raw Response. */ - Response importForItemsRaw(String customerId) throws Exception { + Response importForItemsRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/import_for_items", "customer-id", customerId); @@ -588,7 +593,7 @@ Response importForItemsRaw(String customerId) throws Exception { * Response. */ Response importForItemsRaw(String customerId, SubscriptionImportForItemsParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/import_for_items", "customer-id", customerId); return post(path, params.toFormData()); @@ -598,14 +603,14 @@ Response importForItemsRaw(String customerId, SubscriptionImportForItemsParams p * importForItems a subscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response importForItemsRaw(String customerId, String jsonPayload) throws Exception { + Response importForItemsRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/customers/{customer-id}/import_for_items", "customer-id", customerId); return postJson(path, jsonPayload); } public SubscriptionImportForItemsResponse importForItems( - String customerId, SubscriptionImportForItemsParams params) throws Exception { + String customerId, SubscriptionImportForItemsParams params) throws ChargebeeException { Response response = importForItemsRaw(customerId, params); return SubscriptionImportForItemsResponse.fromJson(response.getBodyAsString(), response); } @@ -613,7 +618,7 @@ public SubscriptionImportForItemsResponse importForItems( /** * retrieveAdvanceInvoiceSchedule a subscription (executes immediately) - returns raw Response. */ - Response retrieveAdvanceInvoiceScheduleRaw(String subscriptionId) throws Exception { + Response retrieveAdvanceInvoiceScheduleRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/retrieve_advance_invoice_schedule", @@ -624,14 +629,14 @@ Response retrieveAdvanceInvoiceScheduleRaw(String subscriptionId) throws Excepti } public SubscriptionRetrieveAdvanceInvoiceScheduleResponse retrieveAdvanceInvoiceSchedule( - String subscriptionId) throws Exception { + String subscriptionId) throws ChargebeeException { Response response = retrieveAdvanceInvoiceScheduleRaw(subscriptionId); return SubscriptionRetrieveAdvanceInvoiceScheduleResponse.fromJson( response.getBodyAsString(), response); } /** removeScheduledCancellation a subscription (executes immediately) - returns raw Response. */ - Response removeScheduledCancellationRaw(String subscriptionId) throws Exception { + Response removeScheduledCancellationRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/remove_scheduled_cancellation", @@ -647,7 +652,7 @@ Response removeScheduledCancellationRaw(String subscriptionId) throws Exception */ Response removeScheduledCancellationRaw( String subscriptionId, SubscriptionRemoveScheduledCancellationParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/remove_scheduled_cancellation", @@ -661,7 +666,7 @@ Response removeScheduledCancellationRaw( * returns raw Response. */ Response removeScheduledCancellationRaw(String subscriptionId, String jsonPayload) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/remove_scheduled_cancellation", @@ -672,14 +677,14 @@ Response removeScheduledCancellationRaw(String subscriptionId, String jsonPayloa public SubscriptionRemoveScheduledCancellationResponse removeScheduledCancellation( String subscriptionId, SubscriptionRemoveScheduledCancellationParams params) - throws Exception { + throws ChargebeeException { Response response = removeScheduledCancellationRaw(subscriptionId, params); return SubscriptionRemoveScheduledCancellationResponse.fromJson( response.getBodyAsString(), response); } /** retrieveWithScheduledChanges a subscription (executes immediately) - returns raw Response. */ - Response retrieveWithScheduledChangesRaw(String subscriptionId) throws Exception { + Response retrieveWithScheduledChangesRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/retrieve_with_scheduled_changes", @@ -690,14 +695,14 @@ Response retrieveWithScheduledChangesRaw(String subscriptionId) throws Exception } public SubscriptionRetrieveWithScheduledChangesResponse retrieveWithScheduledChanges( - String subscriptionId) throws Exception { + String subscriptionId) throws ChargebeeException { Response response = retrieveWithScheduledChangesRaw(subscriptionId); return SubscriptionRetrieveWithScheduledChangesResponse.fromJson( response.getBodyAsString(), response); } /** reactivate a subscription (executes immediately) - returns raw Response. */ - Response reactivateRaw(String subscriptionId) throws Exception { + Response reactivateRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/reactivate", "subscription-id", subscriptionId); @@ -709,7 +714,7 @@ Response reactivateRaw(String subscriptionId) throws Exception { * reactivate a subscription using immutable params (executes immediately) - returns raw Response. */ Response reactivateRaw(String subscriptionId, SubscriptionReactivateParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/reactivate", "subscription-id", subscriptionId); @@ -719,7 +724,7 @@ Response reactivateRaw(String subscriptionId, SubscriptionReactivateParams param /** * reactivate a subscription using raw JSON payload (executes immediately) - returns raw Response. */ - Response reactivateRaw(String subscriptionId, String jsonPayload) throws Exception { + Response reactivateRaw(String subscriptionId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/reactivate", "subscription-id", subscriptionId); @@ -727,13 +732,13 @@ Response reactivateRaw(String subscriptionId, String jsonPayload) throws Excepti } public SubscriptionReactivateResponse reactivate( - String subscriptionId, SubscriptionReactivateParams params) throws Exception { + String subscriptionId, SubscriptionReactivateParams params) throws ChargebeeException { Response response = reactivateRaw(subscriptionId, params); return SubscriptionReactivateResponse.fromJson(response.getBodyAsString(), response); } /** chargeFutureRenewals a subscription (executes immediately) - returns raw Response. */ - Response chargeFutureRenewalsRaw(String subscriptionId) throws Exception { + Response chargeFutureRenewalsRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/charge_future_renewals", @@ -748,7 +753,8 @@ Response chargeFutureRenewalsRaw(String subscriptionId) throws Exception { * Response. */ Response chargeFutureRenewalsRaw( - String subscriptionId, SubscriptionChargeFutureRenewalsParams params) throws Exception { + String subscriptionId, SubscriptionChargeFutureRenewalsParams params) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/charge_future_renewals", @@ -761,7 +767,8 @@ Response chargeFutureRenewalsRaw( * chargeFutureRenewals a subscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response chargeFutureRenewalsRaw(String subscriptionId, String jsonPayload) throws Exception { + Response chargeFutureRenewalsRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/charge_future_renewals", @@ -771,13 +778,14 @@ Response chargeFutureRenewalsRaw(String subscriptionId, String jsonPayload) thro } public SubscriptionChargeFutureRenewalsResponse chargeFutureRenewals( - String subscriptionId, SubscriptionChargeFutureRenewalsParams params) throws Exception { + String subscriptionId, SubscriptionChargeFutureRenewalsParams params) + throws ChargebeeException { Response response = chargeFutureRenewalsRaw(subscriptionId, params); return SubscriptionChargeFutureRenewalsResponse.fromJson(response.getBodyAsString(), response); } /** addChargeAtTermEnd a subscription (executes immediately) - returns raw Response. */ - Response addChargeAtTermEndRaw(String subscriptionId) throws Exception { + Response addChargeAtTermEndRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/add_charge_at_term_end", @@ -792,7 +800,7 @@ Response addChargeAtTermEndRaw(String subscriptionId) throws Exception { * Response. */ Response addChargeAtTermEndRaw(String subscriptionId, SubscriptionAddChargeAtTermEndParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/add_charge_at_term_end", @@ -805,7 +813,8 @@ Response addChargeAtTermEndRaw(String subscriptionId, SubscriptionAddChargeAtTer * addChargeAtTermEnd a subscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response addChargeAtTermEndRaw(String subscriptionId, String jsonPayload) throws Exception { + Response addChargeAtTermEndRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/add_charge_at_term_end", @@ -815,13 +824,14 @@ Response addChargeAtTermEndRaw(String subscriptionId, String jsonPayload) throws } public SubscriptionAddChargeAtTermEndResponse addChargeAtTermEnd( - String subscriptionId, SubscriptionAddChargeAtTermEndParams params) throws Exception { + String subscriptionId, SubscriptionAddChargeAtTermEndParams params) + throws ChargebeeException { Response response = addChargeAtTermEndRaw(subscriptionId, params); return SubscriptionAddChargeAtTermEndResponse.fromJson(response.getBodyAsString(), response); } /** removeScheduledChanges a subscription (executes immediately) - returns raw Response. */ - Response removeScheduledChangesRaw(String subscriptionId) throws Exception { + Response removeScheduledChangesRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/remove_scheduled_changes", @@ -832,14 +842,14 @@ Response removeScheduledChangesRaw(String subscriptionId) throws Exception { } public SubscriptionRemoveScheduledChangesResponse removeScheduledChanges(String subscriptionId) - throws Exception { + throws ChargebeeException { Response response = removeScheduledChangesRaw(subscriptionId); return SubscriptionRemoveScheduledChangesResponse.fromJson( response.getBodyAsString(), response); } /** changeTermEnd a subscription (executes immediately) - returns raw Response. */ - Response changeTermEndRaw(String subscriptionId) throws Exception { + Response changeTermEndRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/change_term_end", "subscription-id", subscriptionId); @@ -852,7 +862,7 @@ Response changeTermEndRaw(String subscriptionId) throws Exception { * Response. */ Response changeTermEndRaw(String subscriptionId, SubscriptionChangeTermEndParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/change_term_end", "subscription-id", subscriptionId); @@ -863,7 +873,7 @@ Response changeTermEndRaw(String subscriptionId, SubscriptionChangeTermEndParams * changeTermEnd a subscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response changeTermEndRaw(String subscriptionId, String jsonPayload) throws Exception { + Response changeTermEndRaw(String subscriptionId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/change_term_end", "subscription-id", subscriptionId); @@ -871,13 +881,13 @@ Response changeTermEndRaw(String subscriptionId, String jsonPayload) throws Exce } public SubscriptionChangeTermEndResponse changeTermEnd( - String subscriptionId, SubscriptionChangeTermEndParams params) throws Exception { + String subscriptionId, SubscriptionChangeTermEndParams params) throws ChargebeeException { Response response = changeTermEndRaw(subscriptionId, params); return SubscriptionChangeTermEndResponse.fromJson(response.getBodyAsString(), response); } /** delete a subscription (executes immediately) - returns raw Response. */ - Response deleteRaw(String subscriptionId) throws Exception { + Response deleteRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/delete", "subscription-id", subscriptionId); @@ -885,13 +895,13 @@ Response deleteRaw(String subscriptionId) throws Exception { return post(path, null); } - public SubscriptionDeleteResponse delete(String subscriptionId) throws Exception { + public SubscriptionDeleteResponse delete(String subscriptionId) throws ChargebeeException { Response response = deleteRaw(subscriptionId); return SubscriptionDeleteResponse.fromJson(response.getBodyAsString(), response); } /** createWithItems a subscription (executes immediately) - returns raw Response. */ - Response createWithItemsRaw(String customerId) throws Exception { + Response createWithItemsRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/subscription_for_items", "customer-id", customerId); @@ -904,7 +914,7 @@ Response createWithItemsRaw(String customerId) throws Exception { * Response. */ Response createWithItemsRaw(String customerId, SubscriptionCreateWithItemsParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/subscription_for_items", "customer-id", customerId); @@ -915,7 +925,7 @@ Response createWithItemsRaw(String customerId, SubscriptionCreateWithItemsParams * createWithItems a subscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response createWithItemsRaw(String customerId, String jsonPayload) throws Exception { + Response createWithItemsRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/subscription_for_items", "customer-id", customerId); @@ -923,13 +933,13 @@ Response createWithItemsRaw(String customerId, String jsonPayload) throws Except } public SubscriptionCreateWithItemsResponse createWithItems( - String customerId, SubscriptionCreateWithItemsParams params) throws Exception { + String customerId, SubscriptionCreateWithItemsParams params) throws ChargebeeException { Response response = createWithItemsRaw(customerId, params); return SubscriptionCreateWithItemsResponse.fromJson(response.getBodyAsString(), response); } /** importUnbilledCharges a subscription (executes immediately) - returns raw Response. */ - Response importUnbilledChargesRaw(String subscriptionId) throws Exception { + Response importUnbilledChargesRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/import_unbilled_charges", @@ -944,7 +954,8 @@ Response importUnbilledChargesRaw(String subscriptionId) throws Exception { * raw Response. */ Response importUnbilledChargesRaw( - String subscriptionId, SubscriptionImportUnbilledChargesParams params) throws Exception { + String subscriptionId, SubscriptionImportUnbilledChargesParams params) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/import_unbilled_charges", @@ -957,7 +968,8 @@ Response importUnbilledChargesRaw( * importUnbilledCharges a subscription using raw JSON payload (executes immediately) - returns * raw Response. */ - Response importUnbilledChargesRaw(String subscriptionId, String jsonPayload) throws Exception { + Response importUnbilledChargesRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/import_unbilled_charges", @@ -967,13 +979,14 @@ Response importUnbilledChargesRaw(String subscriptionId, String jsonPayload) thr } public SubscriptionImportUnbilledChargesResponse importUnbilledCharges( - String subscriptionId, SubscriptionImportUnbilledChargesParams params) throws Exception { + String subscriptionId, SubscriptionImportUnbilledChargesParams params) + throws ChargebeeException { Response response = importUnbilledChargesRaw(subscriptionId, params); return SubscriptionImportUnbilledChargesResponse.fromJson(response.getBodyAsString(), response); } /** removeScheduledResumption a subscription (executes immediately) - returns raw Response. */ - Response removeScheduledResumptionRaw(String subscriptionId) throws Exception { + Response removeScheduledResumptionRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/remove_scheduled_resumption", @@ -984,27 +997,27 @@ Response removeScheduledResumptionRaw(String subscriptionId) throws Exception { } public SubscriptionRemoveScheduledResumptionResponse removeScheduledResumption( - String subscriptionId) throws Exception { + String subscriptionId) throws ChargebeeException { Response response = removeScheduledResumptionRaw(subscriptionId); return SubscriptionRemoveScheduledResumptionResponse.fromJson( response.getBodyAsString(), response); } /** retrieve a subscription (executes immediately) - returns raw Response. */ - Response retrieveRaw(String subscriptionId) throws Exception { + Response retrieveRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams("/subscriptions/{subscription-id}", "subscription-id", subscriptionId); return get(path, null); } - public SubscriptionRetrieveResponse retrieve(String subscriptionId) throws Exception { + public SubscriptionRetrieveResponse retrieve(String subscriptionId) throws ChargebeeException { Response response = retrieveRaw(subscriptionId); return SubscriptionRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** update a subscription (executes immediately) - returns raw Response. */ - Response updateRaw(String subscriptionId) throws Exception { + Response updateRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams("/subscriptions/{subscription-id}", "subscription-id", subscriptionId); @@ -1012,27 +1025,28 @@ Response updateRaw(String subscriptionId) throws Exception { } /** update a subscription using immutable params (executes immediately) - returns raw Response. */ - Response updateRaw(String subscriptionId, SubscriptionUpdateParams params) throws Exception { + Response updateRaw(String subscriptionId, SubscriptionUpdateParams params) + throws ChargebeeException { String path = buildPathWithParams("/subscriptions/{subscription-id}", "subscription-id", subscriptionId); return post(path, params.toFormData()); } /** update a subscription using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String subscriptionId, String jsonPayload) throws Exception { + Response updateRaw(String subscriptionId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams("/subscriptions/{subscription-id}", "subscription-id", subscriptionId); return postJson(path, jsonPayload); } public SubscriptionUpdateResponse update(String subscriptionId, SubscriptionUpdateParams params) - throws Exception { + throws ChargebeeException { Response response = updateRaw(subscriptionId, params); return SubscriptionUpdateResponse.fromJson(response.getBodyAsString(), response); } /** importContractTerm a subscription (executes immediately) - returns raw Response. */ - Response importContractTermRaw(String subscriptionId) throws Exception { + Response importContractTermRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/import_contract_term", @@ -1047,7 +1061,7 @@ Response importContractTermRaw(String subscriptionId) throws Exception { * Response. */ Response importContractTermRaw(String subscriptionId, SubscriptionImportContractTermParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/import_contract_term", @@ -1060,7 +1074,8 @@ Response importContractTermRaw(String subscriptionId, SubscriptionImportContract * importContractTerm a subscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response importContractTermRaw(String subscriptionId, String jsonPayload) throws Exception { + Response importContractTermRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/import_contract_term", @@ -1070,13 +1085,14 @@ Response importContractTermRaw(String subscriptionId, String jsonPayload) throws } public SubscriptionImportContractTermResponse importContractTerm( - String subscriptionId, SubscriptionImportContractTermParams params) throws Exception { + String subscriptionId, SubscriptionImportContractTermParams params) + throws ChargebeeException { Response response = importContractTermRaw(subscriptionId, params); return SubscriptionImportContractTermResponse.fromJson(response.getBodyAsString(), response); } /** overrideBillingProfile a subscription (executes immediately) - returns raw Response. */ - Response overrideBillingProfileRaw(String subscriptionId) throws Exception { + Response overrideBillingProfileRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/override_billing_profile", @@ -1091,7 +1107,8 @@ Response overrideBillingProfileRaw(String subscriptionId) throws Exception { * raw Response. */ Response overrideBillingProfileRaw( - String subscriptionId, SubscriptionOverrideBillingProfileParams params) throws Exception { + String subscriptionId, SubscriptionOverrideBillingProfileParams params) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/override_billing_profile", @@ -1104,7 +1121,8 @@ Response overrideBillingProfileRaw( * overrideBillingProfile a subscription using raw JSON payload (executes immediately) - returns * raw Response. */ - Response overrideBillingProfileRaw(String subscriptionId, String jsonPayload) throws Exception { + Response overrideBillingProfileRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/override_billing_profile", @@ -1114,14 +1132,15 @@ Response overrideBillingProfileRaw(String subscriptionId, String jsonPayload) th } public SubscriptionOverrideBillingProfileResponse overrideBillingProfile( - String subscriptionId, SubscriptionOverrideBillingProfileParams params) throws Exception { + String subscriptionId, SubscriptionOverrideBillingProfileParams params) + throws ChargebeeException { Response response = overrideBillingProfileRaw(subscriptionId, params); return SubscriptionOverrideBillingProfileResponse.fromJson( response.getBodyAsString(), response); } /** removeScheduledPause a subscription (executes immediately) - returns raw Response. */ - Response removeScheduledPauseRaw(String subscriptionId) throws Exception { + Response removeScheduledPauseRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/remove_scheduled_pause", @@ -1132,13 +1151,13 @@ Response removeScheduledPauseRaw(String subscriptionId) throws Exception { } public SubscriptionRemoveScheduledPauseResponse removeScheduledPause(String subscriptionId) - throws Exception { + throws ChargebeeException { Response response = removeScheduledPauseRaw(subscriptionId); return SubscriptionRemoveScheduledPauseResponse.fromJson(response.getBodyAsString(), response); } /** editAdvanceInvoiceSchedule a subscription (executes immediately) - returns raw Response. */ - Response editAdvanceInvoiceScheduleRaw(String subscriptionId) throws Exception { + Response editAdvanceInvoiceScheduleRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/edit_advance_invoice_schedule", @@ -1153,7 +1172,8 @@ Response editAdvanceInvoiceScheduleRaw(String subscriptionId) throws Exception { * returns raw Response. */ Response editAdvanceInvoiceScheduleRaw( - String subscriptionId, SubscriptionEditAdvanceInvoiceScheduleParams params) throws Exception { + String subscriptionId, SubscriptionEditAdvanceInvoiceScheduleParams params) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/edit_advance_invoice_schedule", @@ -1167,7 +1187,7 @@ Response editAdvanceInvoiceScheduleRaw( * returns raw Response. */ Response editAdvanceInvoiceScheduleRaw(String subscriptionId, String jsonPayload) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/edit_advance_invoice_schedule", @@ -1177,7 +1197,8 @@ Response editAdvanceInvoiceScheduleRaw(String subscriptionId, String jsonPayload } public SubscriptionEditAdvanceInvoiceScheduleResponse editAdvanceInvoiceSchedule( - String subscriptionId, SubscriptionEditAdvanceInvoiceScheduleParams params) throws Exception { + String subscriptionId, SubscriptionEditAdvanceInvoiceScheduleParams params) + throws ChargebeeException { Response response = editAdvanceInvoiceScheduleRaw(subscriptionId, params); return SubscriptionEditAdvanceInvoiceScheduleResponse.fromJson( response.getBodyAsString(), response); @@ -1188,7 +1209,7 @@ public SubscriptionEditAdvanceInvoiceScheduleResponse editAdvanceInvoiceSchedule * Response. */ Response listDiscountsRaw(String subscriptionId, SubscriptionListDiscountsParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/discounts", "subscription-id", subscriptionId); @@ -1196,7 +1217,7 @@ Response listDiscountsRaw(String subscriptionId, SubscriptionListDiscountsParams } /** listDiscounts a subscription without params (executes immediately) - returns raw Response. */ - Response listDiscountsRaw(String subscriptionId) throws Exception { + Response listDiscountsRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/discounts", "subscription-id", subscriptionId); @@ -1207,7 +1228,7 @@ Response listDiscountsRaw(String subscriptionId) throws Exception { * listDiscounts a subscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response listDiscountsRaw(String subscriptionId, String jsonPayload) throws Exception { + Response listDiscountsRaw(String subscriptionId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/discounts", "subscription-id", subscriptionId); @@ -1215,13 +1236,14 @@ Response listDiscountsRaw(String subscriptionId, String jsonPayload) throws Exce } public SubscriptionListDiscountsResponse listDiscounts( - String subscriptionId, SubscriptionListDiscountsParams params) throws Exception { + String subscriptionId, SubscriptionListDiscountsParams params) throws ChargebeeException { Response response = listDiscountsRaw(subscriptionId, params); return SubscriptionListDiscountsResponse.fromJson( response.getBodyAsString(), this, params, subscriptionId, response); } - public SubscriptionListDiscountsResponse listDiscounts(String subscriptionId) throws Exception { + public SubscriptionListDiscountsResponse listDiscounts(String subscriptionId) + throws ChargebeeException { Response response = listDiscountsRaw(subscriptionId); return SubscriptionListDiscountsResponse.fromJson( response.getBodyAsString(), this, null, subscriptionId, response); @@ -1232,8 +1254,7 @@ public SubscriptionListDiscountsResponse listDiscounts(String subscriptionId) th * returns raw Response. */ Response contractTermsForSubscriptionRaw( - String subscriptionId, SubscriptionContractTermsForSubscriptionParams params) - throws Exception { + String subscriptionId, ContractTermsForSubscriptionParams params) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/contract_terms", "subscription-id", subscriptionId); @@ -1244,7 +1265,7 @@ Response contractTermsForSubscriptionRaw( * contractTermsForSubscription a subscription without params (executes immediately) - returns raw * Response. */ - Response contractTermsForSubscriptionRaw(String subscriptionId) throws Exception { + Response contractTermsForSubscriptionRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/contract_terms", "subscription-id", subscriptionId); @@ -1256,30 +1277,29 @@ Response contractTermsForSubscriptionRaw(String subscriptionId) throws Exception * returns raw Response. */ Response contractTermsForSubscriptionRaw(String subscriptionId, String jsonPayload) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/contract_terms", "subscription-id", subscriptionId); throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public SubscriptionContractTermsForSubscriptionResponse contractTermsForSubscription( - String subscriptionId, SubscriptionContractTermsForSubscriptionParams params) - throws Exception { + public ContractTermsForSubscriptionResponse contractTermsForSubscription( + String subscriptionId, ContractTermsForSubscriptionParams params) throws ChargebeeException { Response response = contractTermsForSubscriptionRaw(subscriptionId, params); - return SubscriptionContractTermsForSubscriptionResponse.fromJson( + return ContractTermsForSubscriptionResponse.fromJson( response.getBodyAsString(), this, params, subscriptionId, response); } - public SubscriptionContractTermsForSubscriptionResponse contractTermsForSubscription( - String subscriptionId) throws Exception { + public ContractTermsForSubscriptionResponse contractTermsForSubscription(String subscriptionId) + throws ChargebeeException { Response response = contractTermsForSubscriptionRaw(subscriptionId); - return SubscriptionContractTermsForSubscriptionResponse.fromJson( + return ContractTermsForSubscriptionResponse.fromJson( response.getBodyAsString(), this, null, subscriptionId, response); } /** pause a subscription (executes immediately) - returns raw Response. */ - Response pauseRaw(String subscriptionId) throws Exception { + Response pauseRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/pause", "subscription-id", subscriptionId); @@ -1288,7 +1308,8 @@ Response pauseRaw(String subscriptionId) throws Exception { } /** pause a subscription using immutable params (executes immediately) - returns raw Response. */ - Response pauseRaw(String subscriptionId, SubscriptionPauseParams params) throws Exception { + Response pauseRaw(String subscriptionId, SubscriptionPauseParams params) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/pause", "subscription-id", subscriptionId); @@ -1296,7 +1317,7 @@ Response pauseRaw(String subscriptionId, SubscriptionPauseParams params) throws } /** pause a subscription using raw JSON payload (executes immediately) - returns raw Response. */ - Response pauseRaw(String subscriptionId, String jsonPayload) throws Exception { + Response pauseRaw(String subscriptionId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/pause", "subscription-id", subscriptionId); @@ -1304,13 +1325,13 @@ Response pauseRaw(String subscriptionId, String jsonPayload) throws Exception { } public SubscriptionPauseResponse pause(String subscriptionId, SubscriptionPauseParams params) - throws Exception { + throws ChargebeeException { Response response = pauseRaw(subscriptionId, params); return SubscriptionPauseResponse.fromJson(response.getBodyAsString(), response); } /** importForCustomer a subscription (executes immediately) - returns raw Response. */ - Response importForCustomerRaw(String customerId) throws Exception { + Response importForCustomerRaw(String customerId) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/import_subscription", "customer-id", customerId); @@ -1323,7 +1344,7 @@ Response importForCustomerRaw(String customerId) throws Exception { * Response. */ Response importForCustomerRaw(String customerId, SubscriptionImportForCustomerParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/import_subscription", "customer-id", customerId); @@ -1334,7 +1355,7 @@ Response importForCustomerRaw(String customerId, SubscriptionImportForCustomerPa * importForCustomer a subscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response importForCustomerRaw(String customerId, String jsonPayload) throws Exception { + Response importForCustomerRaw(String customerId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/customers/{customer-id}/import_subscription", "customer-id", customerId); @@ -1342,7 +1363,7 @@ Response importForCustomerRaw(String customerId, String jsonPayload) throws Exce } public SubscriptionImportForCustomerResponse importForCustomer( - String customerId, SubscriptionImportForCustomerParams params) throws Exception { + String customerId, SubscriptionImportForCustomerParams params) throws ChargebeeException { Response response = importForCustomerRaw(customerId, params); return SubscriptionImportForCustomerResponse.fromJson(response.getBodyAsString(), response); } @@ -1351,7 +1372,7 @@ public SubscriptionImportForCustomerResponse importForCustomer( * importSubscription a subscription using immutable params (executes immediately) - returns raw * Response. */ - Response importSubscriptionRaw(SubscriptionImportSubscriptionParams params) throws Exception { + Response importSubscriptionRaw(ImportSubscriptionParams params) throws ChargebeeException { return post("/subscriptions/import_subscription", params != null ? params.toFormData() : null); } @@ -1360,20 +1381,20 @@ Response importSubscriptionRaw(SubscriptionImportSubscriptionParams params) thro * importSubscription a subscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response importSubscriptionRaw(String jsonPayload) throws Exception { + Response importSubscriptionRaw(String jsonPayload) throws ChargebeeException { return postJson("/subscriptions/import_subscription", jsonPayload); } - public SubscriptionImportSubscriptionResponse importSubscription( - SubscriptionImportSubscriptionParams params) throws Exception { + public ImportSubscriptionResponse importSubscription(ImportSubscriptionParams params) + throws ChargebeeException { Response response = importSubscriptionRaw(params); - return SubscriptionImportSubscriptionResponse.fromJson(response.getBodyAsString(), response); + return ImportSubscriptionResponse.fromJson(response.getBodyAsString(), response); } /** cancel a subscription (executes immediately) - returns raw Response. */ - Response cancelRaw(String subscriptionId) throws Exception { + Response cancelRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/cancel", "subscription-id", subscriptionId); @@ -1382,7 +1403,8 @@ Response cancelRaw(String subscriptionId) throws Exception { } /** cancel a subscription using immutable params (executes immediately) - returns raw Response. */ - Response cancelRaw(String subscriptionId, SubscriptionCancelParams params) throws Exception { + Response cancelRaw(String subscriptionId, SubscriptionCancelParams params) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/cancel", "subscription-id", subscriptionId); @@ -1390,7 +1412,7 @@ Response cancelRaw(String subscriptionId, SubscriptionCancelParams params) throw } /** cancel a subscription using raw JSON payload (executes immediately) - returns raw Response. */ - Response cancelRaw(String subscriptionId, String jsonPayload) throws Exception { + Response cancelRaw(String subscriptionId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/cancel", "subscription-id", subscriptionId); @@ -1398,13 +1420,13 @@ Response cancelRaw(String subscriptionId, String jsonPayload) throws Exception { } public SubscriptionCancelResponse cancel(String subscriptionId, SubscriptionCancelParams params) - throws Exception { + throws ChargebeeException { Response response = cancelRaw(subscriptionId, params); return SubscriptionCancelResponse.fromJson(response.getBodyAsString(), response); } /** chargeAddonAtTermEnd a subscription (executes immediately) - returns raw Response. */ - Response chargeAddonAtTermEndRaw(String subscriptionId) throws Exception { + Response chargeAddonAtTermEndRaw(String subscriptionId) throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/charge_addon_at_term_end", @@ -1419,7 +1441,8 @@ Response chargeAddonAtTermEndRaw(String subscriptionId) throws Exception { * Response. */ Response chargeAddonAtTermEndRaw( - String subscriptionId, SubscriptionChargeAddonAtTermEndParams params) throws Exception { + String subscriptionId, SubscriptionChargeAddonAtTermEndParams params) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/charge_addon_at_term_end", @@ -1432,7 +1455,8 @@ Response chargeAddonAtTermEndRaw( * chargeAddonAtTermEnd a subscription using raw JSON payload (executes immediately) - returns raw * Response. */ - Response chargeAddonAtTermEndRaw(String subscriptionId, String jsonPayload) throws Exception { + Response chargeAddonAtTermEndRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { String path = buildPathWithParams( "/subscriptions/{subscription-id}/charge_addon_at_term_end", @@ -1442,7 +1466,8 @@ Response chargeAddonAtTermEndRaw(String subscriptionId, String jsonPayload) thro } public SubscriptionChargeAddonAtTermEndResponse chargeAddonAtTermEnd( - String subscriptionId, SubscriptionChargeAddonAtTermEndParams params) throws Exception { + String subscriptionId, SubscriptionChargeAddonAtTermEndParams params) + throws ChargebeeException { Response response = chargeAddonAtTermEndRaw(subscriptionId, params); return SubscriptionChargeAddonAtTermEndResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/core/services/SubscriptionSettingService.java b/src/main/java/com/chargebee/v4/services/SubscriptionSettingService.java similarity index 83% rename from src/main/java/com/chargebee/v4/core/services/SubscriptionSettingService.java rename to src/main/java/com/chargebee/v4/services/SubscriptionSettingService.java index 8d4dd6ad..1a002285 100644 --- a/src/main/java/com/chargebee/v4/core/services/SubscriptionSettingService.java +++ b/src/main/java/com/chargebee/v4/services/SubscriptionSettingService.java @@ -5,15 +5,16 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.subscriptionSetting.params.SubscriptionSettingRetrieveParams; +import com.chargebee.v4.models.subscriptionSetting.params.SubscriptionSettingRetrieveParams; -import com.chargebee.v4.core.responses.subscriptionSetting.SubscriptionSettingRetrieveResponse; +import com.chargebee.v4.models.subscriptionSetting.responses.SubscriptionSettingRetrieveResponse; public final class SubscriptionSettingService extends BaseService { @@ -54,7 +55,7 @@ public SubscriptionSettingService withOptions(RequestOptions options) { * retrieve a subscriptionSetting using immutable params (executes immediately) - returns raw * Response. */ - Response retrieveRaw(SubscriptionSettingRetrieveParams params) throws Exception { + Response retrieveRaw(SubscriptionSettingRetrieveParams params) throws ChargebeeException { return get("/subscription_settings/retrieve", params != null ? params.toQueryParams() : null); } @@ -63,13 +64,13 @@ Response retrieveRaw(SubscriptionSettingRetrieveParams params) throws Exception * retrieve a subscriptionSetting using raw JSON payload (executes immediately) - returns raw * Response. */ - Response retrieveRaw(String jsonPayload) throws Exception { + Response retrieveRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public SubscriptionSettingRetrieveResponse retrieve(SubscriptionSettingRetrieveParams params) - throws Exception { + throws ChargebeeException { Response response = retrieveRaw(params); return SubscriptionSettingRetrieveResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/core/services/ThirdPartyConfigurationService.java b/src/main/java/com/chargebee/v4/services/ThirdPartyConfigurationService.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/services/ThirdPartyConfigurationService.java rename to src/main/java/com/chargebee/v4/services/ThirdPartyConfigurationService.java index 79a4e487..46882176 100644 --- a/src/main/java/com/chargebee/v4/core/services/ThirdPartyConfigurationService.java +++ b/src/main/java/com/chargebee/v4/services/ThirdPartyConfigurationService.java @@ -5,23 +5,24 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.thirdPartyConfiguration.params.ThirdPartyConfigurationConfigurationsParams; +import com.chargebee.v4.models.thirdPartyConfiguration.params.ThirdPartyConfigurationConfigurationsParams; -import com.chargebee.v4.core.models.thirdPartyConfiguration.params.ThirdPartyConfigurationRetrieveParams; +import com.chargebee.v4.models.thirdPartyConfiguration.params.ThirdPartyConfigurationRetrieveParams; -import com.chargebee.v4.core.models.thirdPartyConfiguration.params.ThirdPartyConfigurationUpdateParams; +import com.chargebee.v4.models.thirdPartyConfiguration.params.ThirdPartyConfigurationUpdateParams; -import com.chargebee.v4.core.responses.thirdPartyConfiguration.ThirdPartyConfigurationConfigurationsResponse; +import com.chargebee.v4.models.thirdPartyConfiguration.responses.ThirdPartyConfigurationConfigurationsResponse; -import com.chargebee.v4.core.responses.thirdPartyConfiguration.ThirdPartyConfigurationRetrieveResponse; +import com.chargebee.v4.models.thirdPartyConfiguration.responses.ThirdPartyConfigurationRetrieveResponse; -import com.chargebee.v4.core.responses.thirdPartyConfiguration.ThirdPartyConfigurationUpdateResponse; +import com.chargebee.v4.models.thirdPartyConfiguration.responses.ThirdPartyConfigurationUpdateResponse; public final class ThirdPartyConfigurationService extends BaseService { @@ -63,7 +64,8 @@ public ThirdPartyConfigurationService withOptions(RequestOptions options) { * configurations a thirdPartyConfiguration using immutable params (executes immediately) - * returns raw Response. */ - Response configurationsRaw(ThirdPartyConfigurationConfigurationsParams params) throws Exception { + Response configurationsRaw(ThirdPartyConfigurationConfigurationsParams params) + throws ChargebeeException { return get( "/third_party_configurations/configurations", @@ -74,13 +76,13 @@ Response configurationsRaw(ThirdPartyConfigurationConfigurationsParams params) t * configurations a thirdPartyConfiguration using raw JSON payload (executes immediately) - * returns raw Response. */ - Response configurationsRaw(String jsonPayload) throws Exception { + Response configurationsRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public ThirdPartyConfigurationConfigurationsResponse configurations( - ThirdPartyConfigurationConfigurationsParams params) throws Exception { + ThirdPartyConfigurationConfigurationsParams params) throws ChargebeeException { Response response = configurationsRaw(params); return ThirdPartyConfigurationConfigurationsResponse.fromJson( @@ -91,7 +93,7 @@ public ThirdPartyConfigurationConfigurationsResponse configurations( * retrieve a thirdPartyConfiguration using immutable params (executes immediately) - returns raw * Response. */ - Response retrieveRaw(ThirdPartyConfigurationRetrieveParams params) throws Exception { + Response retrieveRaw(ThirdPartyConfigurationRetrieveParams params) throws ChargebeeException { return get("/third_party_configurations", params != null ? params.toQueryParams() : null); } @@ -100,13 +102,13 @@ Response retrieveRaw(ThirdPartyConfigurationRetrieveParams params) throws Except * retrieve a thirdPartyConfiguration using raw JSON payload (executes immediately) - returns raw * Response. */ - Response retrieveRaw(String jsonPayload) throws Exception { + Response retrieveRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public ThirdPartyConfigurationRetrieveResponse retrieve( - ThirdPartyConfigurationRetrieveParams params) throws Exception { + ThirdPartyConfigurationRetrieveParams params) throws ChargebeeException { Response response = retrieveRaw(params); return ThirdPartyConfigurationRetrieveResponse.fromJson(response.getBodyAsString(), response); @@ -116,7 +118,7 @@ public ThirdPartyConfigurationRetrieveResponse retrieve( * update a thirdPartyConfiguration using immutable params (executes immediately) - returns raw * Response. */ - Response updateRaw(ThirdPartyConfigurationUpdateParams params) throws Exception { + Response updateRaw(ThirdPartyConfigurationUpdateParams params) throws ChargebeeException { return post("/third_party_configurations", params != null ? params.toFormData() : null); } @@ -125,13 +127,13 @@ Response updateRaw(ThirdPartyConfigurationUpdateParams params) throws Exception * update a thirdPartyConfiguration using raw JSON payload (executes immediately) - returns raw * Response. */ - Response updateRaw(String jsonPayload) throws Exception { + Response updateRaw(String jsonPayload) throws ChargebeeException { return postJson("/third_party_configurations", jsonPayload); } public ThirdPartyConfigurationUpdateResponse update(ThirdPartyConfigurationUpdateParams params) - throws Exception { + throws ChargebeeException { Response response = updateRaw(params); return ThirdPartyConfigurationUpdateResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/services/ThirdPartyEntityMappingService.java b/src/main/java/com/chargebee/v4/services/ThirdPartyEntityMappingService.java new file mode 100644 index 00000000..00824544 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/ThirdPartyEntityMappingService.java @@ -0,0 +1,188 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.thirdPartyEntityMapping.params.ThirdPartyEntityMappingRetrieveEntityParams; + +import com.chargebee.v4.models.thirdPartyEntityMapping.params.ThirdPartyEntityMappingListAllParams; + +import com.chargebee.v4.models.thirdPartyEntityMapping.params.ThirdPartyEntityMappingUpdateEntityParams; + +import com.chargebee.v4.models.thirdPartyEntityMapping.params.ThirdPartyEntityMappingListParams; + +import com.chargebee.v4.models.thirdPartyEntityMapping.responses.ThirdPartyEntityMappingRetrieveEntityResponse; + +import com.chargebee.v4.models.thirdPartyEntityMapping.responses.ThirdPartyEntityMappingListAllResponse; + +import com.chargebee.v4.models.thirdPartyEntityMapping.responses.ThirdPartyEntityMappingUpdateEntityResponse; + +import com.chargebee.v4.models.thirdPartyEntityMapping.responses.ThirdPartyEntityMappingListResponse; + +public final class ThirdPartyEntityMappingService + extends BaseService { + + private final ServiceConfig config; + + public ThirdPartyEntityMappingService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private ThirdPartyEntityMappingService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private ThirdPartyEntityMappingService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + ThirdPartyEntityMappingService with(RequestOptions newOptions) { + return new ThirdPartyEntityMappingService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public ThirdPartyEntityMappingService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * retrieveEntity a thirdPartyEntityMapping using immutable params (executes immediately) - + * returns raw Response. + */ + Response retrieveEntityRaw(ThirdPartyEntityMappingRetrieveEntityParams params) + throws ChargebeeException { + + return get( + "/third_party_entity_mappings/retrieve", params != null ? params.toQueryParams() : null); + } + + /** + * retrieveEntity a thirdPartyEntityMapping using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response retrieveEntityRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ThirdPartyEntityMappingRetrieveEntityResponse retrieveEntity( + ThirdPartyEntityMappingRetrieveEntityParams params) throws ChargebeeException { + Response response = retrieveEntityRaw(params); + + return ThirdPartyEntityMappingRetrieveEntityResponse.fromJson( + response.getBodyAsString(), response); + } + + /** + * listAll a thirdPartyEntityMapping using immutable params (executes immediately) - returns raw + * Response. + */ + Response listAllRaw(ThirdPartyEntityMappingListAllParams params) throws ChargebeeException { + + return get( + "/third_party_entity_mappings/list_all", params != null ? params.toQueryParams() : null); + } + + /** + * listAll a thirdPartyEntityMapping using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response listAllRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ThirdPartyEntityMappingListAllResponse listAll(ThirdPartyEntityMappingListAllParams params) + throws ChargebeeException { + Response response = listAllRaw(params); + + return ThirdPartyEntityMappingListAllResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * updateEntity a thirdPartyEntityMapping using immutable params (executes immediately) - returns + * raw Response. + */ + Response updateEntityRaw(ThirdPartyEntityMappingUpdateEntityParams params) + throws ChargebeeException { + + return post( + "/third_party_entity_mappings/update_entity", params != null ? params.toFormData() : null); + } + + /** + * updateEntity a thirdPartyEntityMapping using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response updateEntityRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/third_party_entity_mappings/update_entity", jsonPayload); + } + + public ThirdPartyEntityMappingUpdateEntityResponse updateEntity( + ThirdPartyEntityMappingUpdateEntityParams params) throws ChargebeeException { + Response response = updateEntityRaw(params); + + return ThirdPartyEntityMappingUpdateEntityResponse.fromJson( + response.getBodyAsString(), response); + } + + /** + * list a thirdPartyEntityMapping using immutable params (executes immediately) - returns raw + * Response. + */ + Response listRaw(ThirdPartyEntityMappingListParams params) throws ChargebeeException { + + return get("/third_party_entity_mappings", params != null ? params.toQueryParams() : null); + } + + /** + * list a thirdPartyEntityMapping without params (executes immediately) - returns raw Response. + */ + Response listRaw() throws ChargebeeException { + + return get("/third_party_entity_mappings", null); + } + + /** + * list a thirdPartyEntityMapping using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ThirdPartyEntityMappingListResponse list(ThirdPartyEntityMappingListParams params) + throws ChargebeeException { + Response response = listRaw(params); + + return ThirdPartyEntityMappingListResponse.fromJson( + response.getBodyAsString(), this, params, response); + } + + public ThirdPartyEntityMappingListResponse list() throws ChargebeeException { + Response response = listRaw(); + return ThirdPartyEntityMappingListResponse.fromJson( + response.getBodyAsString(), this, null, response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/ThirdPartySyncDetailService.java b/src/main/java/com/chargebee/v4/services/ThirdPartySyncDetailService.java similarity index 78% rename from src/main/java/com/chargebee/v4/core/services/ThirdPartySyncDetailService.java rename to src/main/java/com/chargebee/v4/services/ThirdPartySyncDetailService.java index 557e8a7a..ace525cb 100644 --- a/src/main/java/com/chargebee/v4/core/services/ThirdPartySyncDetailService.java +++ b/src/main/java/com/chargebee/v4/services/ThirdPartySyncDetailService.java @@ -5,25 +5,26 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.thirdPartySyncDetail.params.ThirdPartySyncDetailUpdateParams; +import com.chargebee.v4.models.thirdPartySyncDetail.params.ThirdPartySyncDetailUpdateParams; -import com.chargebee.v4.core.models.thirdPartySyncDetail.params.ThirdPartySyncDetailCreateParams; +import com.chargebee.v4.models.thirdPartySyncDetail.params.ThirdPartySyncDetailCreateParams; -import com.chargebee.v4.core.models.thirdPartySyncDetail.params.ThirdPartySyncDetailRetrieveLatestSyncParams; +import com.chargebee.v4.models.thirdPartySyncDetail.params.ThirdPartySyncDetailRetrieveLatestSyncParams; -import com.chargebee.v4.core.responses.thirdPartySyncDetail.ThirdPartySyncDetailRetrieveResponse; +import com.chargebee.v4.models.thirdPartySyncDetail.responses.ThirdPartySyncDetailRetrieveResponse; -import com.chargebee.v4.core.responses.thirdPartySyncDetail.ThirdPartySyncDetailUpdateResponse; +import com.chargebee.v4.models.thirdPartySyncDetail.responses.ThirdPartySyncDetailUpdateResponse; -import com.chargebee.v4.core.responses.thirdPartySyncDetail.ThirdPartySyncDetailCreateResponse; +import com.chargebee.v4.models.thirdPartySyncDetail.responses.ThirdPartySyncDetailCreateResponse; -import com.chargebee.v4.core.responses.thirdPartySyncDetail.ThirdPartySyncDetailRetrieveLatestSyncResponse; +import com.chargebee.v4.models.thirdPartySyncDetail.responses.ThirdPartySyncDetailRetrieveLatestSyncResponse; public final class ThirdPartySyncDetailService extends BaseService { @@ -61,7 +62,7 @@ public ThirdPartySyncDetailService withOptions(RequestOptions options) { // === Operations === /** retrieve a thirdPartySyncDetail (executes immediately) - returns raw Response. */ - Response retrieveRaw(String tpIntegSyncDetailId) throws Exception { + Response retrieveRaw(String tpIntegSyncDetailId) throws ChargebeeException { String path = buildPathWithParams( "/third_party_sync_details/{tp-integ-sync-detail-id}", @@ -72,13 +73,13 @@ Response retrieveRaw(String tpIntegSyncDetailId) throws Exception { } public ThirdPartySyncDetailRetrieveResponse retrieve(String tpIntegSyncDetailId) - throws Exception { + throws ChargebeeException { Response response = retrieveRaw(tpIntegSyncDetailId); return ThirdPartySyncDetailRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** update a thirdPartySyncDetail (executes immediately) - returns raw Response. */ - Response updateRaw(String tpIntegSyncDetailId) throws Exception { + Response updateRaw(String tpIntegSyncDetailId) throws ChargebeeException { String path = buildPathWithParams( "/third_party_sync_details/{tp-integ-sync-detail-id}", @@ -93,7 +94,7 @@ Response updateRaw(String tpIntegSyncDetailId) throws Exception { * Response. */ Response updateRaw(String tpIntegSyncDetailId, ThirdPartySyncDetailUpdateParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/third_party_sync_details/{tp-integ-sync-detail-id}", @@ -106,7 +107,7 @@ Response updateRaw(String tpIntegSyncDetailId, ThirdPartySyncDetailUpdateParams * update a thirdPartySyncDetail using raw JSON payload (executes immediately) - returns raw * Response. */ - Response updateRaw(String tpIntegSyncDetailId, String jsonPayload) throws Exception { + Response updateRaw(String tpIntegSyncDetailId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/third_party_sync_details/{tp-integ-sync-detail-id}", @@ -116,7 +117,8 @@ Response updateRaw(String tpIntegSyncDetailId, String jsonPayload) throws Except } public ThirdPartySyncDetailUpdateResponse update( - String tpIntegSyncDetailId, ThirdPartySyncDetailUpdateParams params) throws Exception { + String tpIntegSyncDetailId, ThirdPartySyncDetailUpdateParams params) + throws ChargebeeException { Response response = updateRaw(tpIntegSyncDetailId, params); return ThirdPartySyncDetailUpdateResponse.fromJson(response.getBodyAsString(), response); } @@ -125,7 +127,7 @@ public ThirdPartySyncDetailUpdateResponse update( * create a thirdPartySyncDetail using immutable params (executes immediately) - returns raw * Response. */ - Response createRaw(ThirdPartySyncDetailCreateParams params) throws Exception { + Response createRaw(ThirdPartySyncDetailCreateParams params) throws ChargebeeException { return post("/third_party_sync_details", params != null ? params.toFormData() : null); } @@ -134,13 +136,13 @@ Response createRaw(ThirdPartySyncDetailCreateParams params) throws Exception { * create a thirdPartySyncDetail using raw JSON payload (executes immediately) - returns raw * Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/third_party_sync_details", jsonPayload); } public ThirdPartySyncDetailCreateResponse create(ThirdPartySyncDetailCreateParams params) - throws Exception { + throws ChargebeeException { Response response = createRaw(params); return ThirdPartySyncDetailCreateResponse.fromJson(response.getBodyAsString(), response); @@ -151,7 +153,7 @@ public ThirdPartySyncDetailCreateResponse create(ThirdPartySyncDetailCreateParam * returns raw Response. */ Response retrieveLatestSyncRaw(ThirdPartySyncDetailRetrieveLatestSyncParams params) - throws Exception { + throws ChargebeeException { return get( "/third_party_sync_details/retrieve_latest_sync", @@ -162,13 +164,13 @@ Response retrieveLatestSyncRaw(ThirdPartySyncDetailRetrieveLatestSyncParams para * retrieveLatestSync a thirdPartySyncDetail using raw JSON payload (executes immediately) - * returns raw Response. */ - Response retrieveLatestSyncRaw(String jsonPayload) throws Exception { + Response retrieveLatestSyncRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public ThirdPartySyncDetailRetrieveLatestSyncResponse retrieveLatestSync( - ThirdPartySyncDetailRetrieveLatestSyncParams params) throws Exception { + ThirdPartySyncDetailRetrieveLatestSyncParams params) throws ChargebeeException { Response response = retrieveLatestSyncRaw(params); return ThirdPartySyncDetailRetrieveLatestSyncResponse.fromJson( diff --git a/src/main/java/com/chargebee/v4/core/services/TimeMachineService.java b/src/main/java/com/chargebee/v4/services/TimeMachineService.java similarity index 82% rename from src/main/java/com/chargebee/v4/core/services/TimeMachineService.java rename to src/main/java/com/chargebee/v4/services/TimeMachineService.java index 4a8c8bfa..1deabbe4 100644 --- a/src/main/java/com/chargebee/v4/core/services/TimeMachineService.java +++ b/src/main/java/com/chargebee/v4/services/TimeMachineService.java @@ -5,21 +5,22 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.timeMachine.params.TimeMachineTravelForwardParams; +import com.chargebee.v4.models.timeMachine.params.TimeMachineTravelForwardParams; -import com.chargebee.v4.core.models.timeMachine.params.TimeMachineStartAfreshParams; +import com.chargebee.v4.models.timeMachine.params.TimeMachineStartAfreshParams; -import com.chargebee.v4.core.responses.timeMachine.TimeMachineRetrieveResponse; +import com.chargebee.v4.models.timeMachine.responses.TimeMachineRetrieveResponse; -import com.chargebee.v4.core.responses.timeMachine.TimeMachineTravelForwardResponse; +import com.chargebee.v4.models.timeMachine.responses.TimeMachineTravelForwardResponse; -import com.chargebee.v4.core.responses.timeMachine.TimeMachineStartAfreshResponse; +import com.chargebee.v4.models.timeMachine.responses.TimeMachineStartAfreshResponse; public final class TimeMachineService extends BaseService { @@ -56,7 +57,7 @@ public TimeMachineService withOptions(RequestOptions options) { // === Operations === /** retrieve a timeMachine (executes immediately) - returns raw Response. */ - Response retrieveRaw(String timeMachineName) throws Exception { + Response retrieveRaw(String timeMachineName) throws ChargebeeException { String path = buildPathWithParams( "/time_machines/{time-machine-name}", "time-machine-name", timeMachineName); @@ -64,13 +65,13 @@ Response retrieveRaw(String timeMachineName) throws Exception { return get(path, null); } - public TimeMachineRetrieveResponse retrieve(String timeMachineName) throws Exception { + public TimeMachineRetrieveResponse retrieve(String timeMachineName) throws ChargebeeException { Response response = retrieveRaw(timeMachineName); return TimeMachineRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** travelForward a timeMachine (executes immediately) - returns raw Response. */ - Response travelForwardRaw(String timeMachineName) throws Exception { + Response travelForwardRaw(String timeMachineName) throws ChargebeeException { String path = buildPathWithParams( "/time_machines/{time-machine-name}/travel_forward", @@ -85,7 +86,7 @@ Response travelForwardRaw(String timeMachineName) throws Exception { * Response. */ Response travelForwardRaw(String timeMachineName, TimeMachineTravelForwardParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/time_machines/{time-machine-name}/travel_forward", @@ -98,7 +99,7 @@ Response travelForwardRaw(String timeMachineName, TimeMachineTravelForwardParams * travelForward a timeMachine using raw JSON payload (executes immediately) - returns raw * Response. */ - Response travelForwardRaw(String timeMachineName, String jsonPayload) throws Exception { + Response travelForwardRaw(String timeMachineName, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/time_machines/{time-machine-name}/travel_forward", @@ -108,13 +109,13 @@ Response travelForwardRaw(String timeMachineName, String jsonPayload) throws Exc } public TimeMachineTravelForwardResponse travelForward( - String timeMachineName, TimeMachineTravelForwardParams params) throws Exception { + String timeMachineName, TimeMachineTravelForwardParams params) throws ChargebeeException { Response response = travelForwardRaw(timeMachineName, params); return TimeMachineTravelForwardResponse.fromJson(response.getBodyAsString(), response); } /** startAfresh a timeMachine (executes immediately) - returns raw Response. */ - Response startAfreshRaw(String timeMachineName) throws Exception { + Response startAfreshRaw(String timeMachineName) throws ChargebeeException { String path = buildPathWithParams( "/time_machines/{time-machine-name}/start_afresh", @@ -128,7 +129,7 @@ Response startAfreshRaw(String timeMachineName) throws Exception { * startAfresh a timeMachine using immutable params (executes immediately) - returns raw Response. */ Response startAfreshRaw(String timeMachineName, TimeMachineStartAfreshParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/time_machines/{time-machine-name}/start_afresh", @@ -140,7 +141,7 @@ Response startAfreshRaw(String timeMachineName, TimeMachineStartAfreshParams par /** * startAfresh a timeMachine using raw JSON payload (executes immediately) - returns raw Response. */ - Response startAfreshRaw(String timeMachineName, String jsonPayload) throws Exception { + Response startAfreshRaw(String timeMachineName, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/time_machines/{time-machine-name}/start_afresh", @@ -150,7 +151,7 @@ Response startAfreshRaw(String timeMachineName, String jsonPayload) throws Excep } public TimeMachineStartAfreshResponse startAfresh( - String timeMachineName, TimeMachineStartAfreshParams params) throws Exception { + String timeMachineName, TimeMachineStartAfreshParams params) throws ChargebeeException { Response response = startAfreshRaw(timeMachineName, params); return TimeMachineStartAfreshResponse.fromJson(response.getBodyAsString(), response); } diff --git a/src/main/java/com/chargebee/v4/services/TpSiteUserService.java b/src/main/java/com/chargebee/v4/services/TpSiteUserService.java new file mode 100644 index 00000000..03c77958 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/TpSiteUserService.java @@ -0,0 +1,181 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.tpSiteUser.params.UsersForTpSiteUserParams; + +import com.chargebee.v4.models.tpSiteUser.params.TpSiteUserPayNowEnableLiveParams; + +import com.chargebee.v4.models.tpSiteUser.params.GuestsForTpSiteUserParams; + +import com.chargebee.v4.models.tpSiteUser.responses.UsersForTpSiteUserResponse; + +import com.chargebee.v4.models.tpSiteUser.responses.TpSiteUserPayNowEnableLiveResponse; + +import com.chargebee.v4.models.tpSiteUser.responses.GuestsForTpSiteUserResponse; + +public final class TpSiteUserService extends BaseService { + + private final ServiceConfig config; + + public TpSiteUserService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private TpSiteUserService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private TpSiteUserService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + TpSiteUserService with(RequestOptions newOptions) { + return new TpSiteUserService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public TpSiteUserService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * usersForTpSiteUser a tpSiteUser using immutable params (executes immediately) - returns raw + * Response. + */ + Response usersForTpSiteUserRaw(String tpSiteUserDomain, UsersForTpSiteUserParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/tp_site_users/{tp-site-user-domain}/users", "tp-site-user-domain", tpSiteUserDomain); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * usersForTpSiteUser a tpSiteUser without params (executes immediately) - returns raw Response. + */ + Response usersForTpSiteUserRaw(String tpSiteUserDomain) throws ChargebeeException { + String path = + buildPathWithParams( + "/tp_site_users/{tp-site-user-domain}/users", "tp-site-user-domain", tpSiteUserDomain); + return get(path, null); + } + + /** + * usersForTpSiteUser a tpSiteUser using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response usersForTpSiteUserRaw(String tpSiteUserDomain, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/tp_site_users/{tp-site-user-domain}/users", "tp-site-user-domain", tpSiteUserDomain); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public UsersForTpSiteUserResponse usersForTpSiteUser( + String tpSiteUserDomain, UsersForTpSiteUserParams params) throws ChargebeeException { + Response response = usersForTpSiteUserRaw(tpSiteUserDomain, params); + return UsersForTpSiteUserResponse.fromJson( + response.getBodyAsString(), this, params, tpSiteUserDomain, response); + } + + public UsersForTpSiteUserResponse usersForTpSiteUser(String tpSiteUserDomain) + throws ChargebeeException { + Response response = usersForTpSiteUserRaw(tpSiteUserDomain); + return UsersForTpSiteUserResponse.fromJson( + response.getBodyAsString(), this, null, tpSiteUserDomain, response); + } + + /** + * payNowEnableLive a tpSiteUser using immutable params (executes immediately) - returns raw + * Response. + */ + Response payNowEnableLiveRaw(TpSiteUserPayNowEnableLiveParams params) throws ChargebeeException { + + return post("/tp_site_users/pay_now_enable_live", params != null ? params.toFormData() : null); + } + + /** + * payNowEnableLive a tpSiteUser using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response payNowEnableLiveRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/tp_site_users/pay_now_enable_live", jsonPayload); + } + + public TpSiteUserPayNowEnableLiveResponse payNowEnableLive( + TpSiteUserPayNowEnableLiveParams params) throws ChargebeeException { + Response response = payNowEnableLiveRaw(params); + + return TpSiteUserPayNowEnableLiveResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * guestsForTpSiteUser a tpSiteUser using immutable params (executes immediately) - returns raw + * Response. + */ + Response guestsForTpSiteUserRaw(String tpSiteUserDomain, GuestsForTpSiteUserParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/tp_site_users/{tp-site-user-domain}/guests", "tp-site-user-domain", tpSiteUserDomain); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * guestsForTpSiteUser a tpSiteUser without params (executes immediately) - returns raw Response. + */ + Response guestsForTpSiteUserRaw(String tpSiteUserDomain) throws ChargebeeException { + String path = + buildPathWithParams( + "/tp_site_users/{tp-site-user-domain}/guests", "tp-site-user-domain", tpSiteUserDomain); + return get(path, null); + } + + /** + * guestsForTpSiteUser a tpSiteUser using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response guestsForTpSiteUserRaw(String tpSiteUserDomain, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/tp_site_users/{tp-site-user-domain}/guests", "tp-site-user-domain", tpSiteUserDomain); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public GuestsForTpSiteUserResponse guestsForTpSiteUser( + String tpSiteUserDomain, GuestsForTpSiteUserParams params) throws ChargebeeException { + Response response = guestsForTpSiteUserRaw(tpSiteUserDomain, params); + return GuestsForTpSiteUserResponse.fromJson( + response.getBodyAsString(), this, params, tpSiteUserDomain, response); + } + + public GuestsForTpSiteUserResponse guestsForTpSiteUser(String tpSiteUserDomain) + throws ChargebeeException { + Response response = guestsForTpSiteUserRaw(tpSiteUserDomain); + return GuestsForTpSiteUserResponse.fromJson( + response.getBodyAsString(), this, null, tpSiteUserDomain, response); + } +} diff --git a/src/main/java/com/chargebee/v4/services/TransactionService.java b/src/main/java/com/chargebee/v4/services/TransactionService.java new file mode 100644 index 00000000..575db5bf --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/TransactionService.java @@ -0,0 +1,471 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.transaction.params.TransactionListParams; + +import com.chargebee.v4.models.transaction.params.TransactionReconcileParams; + +import com.chargebee.v4.models.transaction.params.TransactionRefundParams; + +import com.chargebee.v4.models.transaction.params.TransactionsForCustomerParams; + +import com.chargebee.v4.models.transaction.params.TransactionRecordRefundParams; + +import com.chargebee.v4.models.transaction.params.TransactionsForSubscriptionParams; + +import com.chargebee.v4.models.transaction.params.TransactionCreateAuthorizationParams; + +import com.chargebee.v4.models.transaction.params.TransactionPaymentsForInvoiceParams; + +import com.chargebee.v4.models.transaction.params.DeleteOfflineTransactionParams; + +import com.chargebee.v4.models.transaction.responses.TransactionListResponse; + +import com.chargebee.v4.models.transaction.responses.TransactionReconcileResponse; + +import com.chargebee.v4.models.transaction.responses.TransactionRetrieveResponse; + +import com.chargebee.v4.models.transaction.responses.TransactionRefundResponse; + +import com.chargebee.v4.models.transaction.responses.TransactionsForCustomerResponse; + +import com.chargebee.v4.models.transaction.responses.TransactionRecordRefundResponse; + +import com.chargebee.v4.models.transaction.responses.TransactionsForSubscriptionResponse; + +import com.chargebee.v4.models.transaction.responses.VoidTransactionResponse; + +import com.chargebee.v4.models.transaction.responses.SyncTransactionResponse; + +import com.chargebee.v4.models.transaction.responses.TransactionCreateAuthorizationResponse; + +import com.chargebee.v4.models.transaction.responses.TransactionPaymentsForInvoiceResponse; + +import com.chargebee.v4.models.transaction.responses.DeleteOfflineTransactionResponse; + +public final class TransactionService extends BaseService { + + private final ServiceConfig config; + + public TransactionService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private TransactionService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private TransactionService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + TransactionService with(RequestOptions newOptions) { + return new TransactionService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public TransactionService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** list a transaction using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(TransactionListParams params) throws ChargebeeException { + + return get("/transactions", params != null ? params.toQueryParams() : null); + } + + /** list a transaction without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/transactions", null); + } + + /** list a transaction using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public TransactionListResponse list(TransactionListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return TransactionListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public TransactionListResponse list() throws ChargebeeException { + Response response = listRaw(); + return TransactionListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** reconcile a transaction (executes immediately) - returns raw Response. */ + Response reconcileRaw(String transactionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/transactions/{transaction-id}/reconcile", "transaction-id", transactionId); + + return post(path, null); + } + + /** + * reconcile a transaction using immutable params (executes immediately) - returns raw Response. + */ + Response reconcileRaw(String transactionId, TransactionReconcileParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/transactions/{transaction-id}/reconcile", "transaction-id", transactionId); + return post(path, params.toFormData()); + } + + /** + * reconcile a transaction using raw JSON payload (executes immediately) - returns raw Response. + */ + Response reconcileRaw(String transactionId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/transactions/{transaction-id}/reconcile", "transaction-id", transactionId); + return postJson(path, jsonPayload); + } + + public TransactionReconcileResponse reconcile( + String transactionId, TransactionReconcileParams params) throws ChargebeeException { + Response response = reconcileRaw(transactionId, params); + return TransactionReconcileResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a transaction (executes immediately) - returns raw Response. */ + Response retrieveRaw(String transactionId) throws ChargebeeException { + String path = + buildPathWithParams("/transactions/{transaction-id}", "transaction-id", transactionId); + + return get(path, null); + } + + public TransactionRetrieveResponse retrieve(String transactionId) throws ChargebeeException { + Response response = retrieveRaw(transactionId); + return TransactionRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** refund a transaction (executes immediately) - returns raw Response. */ + Response refundRaw(String transactionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/transactions/{transaction-id}/refund", "transaction-id", transactionId); + + return post(path, null); + } + + /** refund a transaction using immutable params (executes immediately) - returns raw Response. */ + Response refundRaw(String transactionId, TransactionRefundParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/transactions/{transaction-id}/refund", "transaction-id", transactionId); + return post(path, params.toFormData()); + } + + /** refund a transaction using raw JSON payload (executes immediately) - returns raw Response. */ + Response refundRaw(String transactionId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/transactions/{transaction-id}/refund", "transaction-id", transactionId); + return postJson(path, jsonPayload); + } + + public TransactionRefundResponse refund(String transactionId, TransactionRefundParams params) + throws ChargebeeException { + Response response = refundRaw(transactionId, params); + return TransactionRefundResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * transactionsForCustomer a transaction using immutable params (executes immediately) - returns + * raw Response. + */ + Response transactionsForCustomerRaw(String customerId, TransactionsForCustomerParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/transactions", "customer-id", customerId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * transactionsForCustomer a transaction without params (executes immediately) - returns raw + * Response. + */ + Response transactionsForCustomerRaw(String customerId) throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/transactions", "customer-id", customerId); + return get(path, null); + } + + /** + * transactionsForCustomer a transaction using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response transactionsForCustomerRaw(String customerId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/transactions", "customer-id", customerId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public TransactionsForCustomerResponse transactionsForCustomer( + String customerId, TransactionsForCustomerParams params) throws ChargebeeException { + Response response = transactionsForCustomerRaw(customerId, params); + return TransactionsForCustomerResponse.fromJson( + response.getBodyAsString(), this, params, customerId, response); + } + + public TransactionsForCustomerResponse transactionsForCustomer(String customerId) + throws ChargebeeException { + Response response = transactionsForCustomerRaw(customerId); + return TransactionsForCustomerResponse.fromJson( + response.getBodyAsString(), this, null, customerId, response); + } + + /** recordRefund a transaction (executes immediately) - returns raw Response. */ + Response recordRefundRaw(String transactionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/transactions/{transaction-id}/record_refund", "transaction-id", transactionId); + + return post(path, null); + } + + /** + * recordRefund a transaction using immutable params (executes immediately) - returns raw + * Response. + */ + Response recordRefundRaw(String transactionId, TransactionRecordRefundParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/transactions/{transaction-id}/record_refund", "transaction-id", transactionId); + return post(path, params.toFormData()); + } + + /** + * recordRefund a transaction using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response recordRefundRaw(String transactionId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/transactions/{transaction-id}/record_refund", "transaction-id", transactionId); + return postJson(path, jsonPayload); + } + + public TransactionRecordRefundResponse recordRefund( + String transactionId, TransactionRecordRefundParams params) throws ChargebeeException { + Response response = recordRefundRaw(transactionId, params); + return TransactionRecordRefundResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * transactionsForSubscription a transaction using immutable params (executes immediately) - + * returns raw Response. + */ + Response transactionsForSubscriptionRaw( + String subscriptionId, TransactionsForSubscriptionParams params) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/transactions", "subscription-id", subscriptionId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * transactionsForSubscription a transaction without params (executes immediately) - returns raw + * Response. + */ + Response transactionsForSubscriptionRaw(String subscriptionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/transactions", "subscription-id", subscriptionId); + return get(path, null); + } + + /** + * transactionsForSubscription a transaction using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response transactionsForSubscriptionRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/transactions", "subscription-id", subscriptionId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public TransactionsForSubscriptionResponse transactionsForSubscription( + String subscriptionId, TransactionsForSubscriptionParams params) throws ChargebeeException { + Response response = transactionsForSubscriptionRaw(subscriptionId, params); + return TransactionsForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, params, subscriptionId, response); + } + + public TransactionsForSubscriptionResponse transactionsForSubscription(String subscriptionId) + throws ChargebeeException { + Response response = transactionsForSubscriptionRaw(subscriptionId); + return TransactionsForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, null, subscriptionId, response); + } + + /** voidTransaction a transaction (executes immediately) - returns raw Response. */ + Response voidTransactionRaw(String transactionId) throws ChargebeeException { + String path = + buildPathWithParams("/transactions/{transaction-id}/void", "transaction-id", transactionId); + + return post(path, null); + } + + public VoidTransactionResponse voidTransaction(String transactionId) throws ChargebeeException { + Response response = voidTransactionRaw(transactionId); + return VoidTransactionResponse.fromJson(response.getBodyAsString(), response); + } + + /** syncTransaction a transaction (executes immediately) - returns raw Response. */ + Response syncTransactionRaw(String transactionId) throws ChargebeeException { + String path = + buildPathWithParams("/transactions/{transaction-id}/sync", "transaction-id", transactionId); + + return post(path, null); + } + + public SyncTransactionResponse syncTransaction(String transactionId) throws ChargebeeException { + Response response = syncTransactionRaw(transactionId); + return SyncTransactionResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createAuthorization a transaction using immutable params (executes immediately) - returns raw + * Response. + */ + Response createAuthorizationRaw(TransactionCreateAuthorizationParams params) + throws ChargebeeException { + + return post("/transactions/create_authorization", params != null ? params.toFormData() : null); + } + + /** + * createAuthorization a transaction using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response createAuthorizationRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/transactions/create_authorization", jsonPayload); + } + + public TransactionCreateAuthorizationResponse createAuthorization( + TransactionCreateAuthorizationParams params) throws ChargebeeException { + Response response = createAuthorizationRaw(params); + + return TransactionCreateAuthorizationResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * paymentsForInvoice a transaction using immutable params (executes immediately) - returns raw + * Response. + */ + Response paymentsForInvoiceRaw(String invoiceId, TransactionPaymentsForInvoiceParams params) + throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/payments", "invoice-id", invoiceId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * paymentsForInvoice a transaction without params (executes immediately) - returns raw Response. + */ + Response paymentsForInvoiceRaw(String invoiceId) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/payments", "invoice-id", invoiceId); + return get(path, null); + } + + /** + * paymentsForInvoice a transaction using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response paymentsForInvoiceRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/payments", "invoice-id", invoiceId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public TransactionPaymentsForInvoiceResponse paymentsForInvoice( + String invoiceId, TransactionPaymentsForInvoiceParams params) throws ChargebeeException { + Response response = paymentsForInvoiceRaw(invoiceId, params); + return TransactionPaymentsForInvoiceResponse.fromJson( + response.getBodyAsString(), this, params, invoiceId, response); + } + + public TransactionPaymentsForInvoiceResponse paymentsForInvoice(String invoiceId) + throws ChargebeeException { + Response response = paymentsForInvoiceRaw(invoiceId); + return TransactionPaymentsForInvoiceResponse.fromJson( + response.getBodyAsString(), this, null, invoiceId, response); + } + + /** deleteOfflineTransaction a transaction (executes immediately) - returns raw Response. */ + Response deleteOfflineTransactionRaw(String transactionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/transactions/{transaction-id}/delete_offline_transaction", + "transaction-id", + transactionId); + + return post(path, null); + } + + /** + * deleteOfflineTransaction a transaction using immutable params (executes immediately) - returns + * raw Response. + */ + Response deleteOfflineTransactionRaw(String transactionId, DeleteOfflineTransactionParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/transactions/{transaction-id}/delete_offline_transaction", + "transaction-id", + transactionId); + return post(path, params.toFormData()); + } + + /** + * deleteOfflineTransaction a transaction using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response deleteOfflineTransactionRaw(String transactionId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/transactions/{transaction-id}/delete_offline_transaction", + "transaction-id", + transactionId); + return postJson(path, jsonPayload); + } + + public DeleteOfflineTransactionResponse deleteOfflineTransaction( + String transactionId, DeleteOfflineTransactionParams params) throws ChargebeeException { + Response response = deleteOfflineTransactionRaw(transactionId, params); + return DeleteOfflineTransactionResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/services/UnbilledChargeService.java b/src/main/java/com/chargebee/v4/services/UnbilledChargeService.java new file mode 100644 index 00000000..47058988 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/UnbilledChargeService.java @@ -0,0 +1,219 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.unbilledCharge.params.UnbilledChargeInvoiceNowEstimateParams; + +import com.chargebee.v4.models.unbilledCharge.params.InvoiceUnbilledChargesParams; + +import com.chargebee.v4.models.unbilledCharge.params.UnbilledChargeListParams; + +import com.chargebee.v4.models.unbilledCharge.params.UnbilledChargeCreateParams; + +import com.chargebee.v4.models.unbilledCharge.params.CreateUnbilledChargeParams; + +import com.chargebee.v4.models.unbilledCharge.responses.UnbilledChargeDeleteResponse; + +import com.chargebee.v4.models.unbilledCharge.responses.UnbilledChargeInvoiceNowEstimateResponse; + +import com.chargebee.v4.models.unbilledCharge.responses.InvoiceUnbilledChargesResponse; + +import com.chargebee.v4.models.unbilledCharge.responses.UnbilledChargeListResponse; + +import com.chargebee.v4.models.unbilledCharge.responses.UnbilledChargeCreateResponse; + +import com.chargebee.v4.models.unbilledCharge.responses.CreateUnbilledChargeResponse; + +public final class UnbilledChargeService extends BaseService { + + private final ServiceConfig config; + + public UnbilledChargeService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private UnbilledChargeService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private UnbilledChargeService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + UnbilledChargeService with(RequestOptions newOptions) { + return new UnbilledChargeService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public UnbilledChargeService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** delete a unbilledCharge (executes immediately) - returns raw Response. */ + Response deleteRaw(String unbilledChargeId) throws ChargebeeException { + String path = + buildPathWithParams( + "/unbilled_charges/{unbilled-charge-id}/delete", + "unbilled-charge-id", + unbilledChargeId); + + return post(path, null); + } + + public UnbilledChargeDeleteResponse delete(String unbilledChargeId) throws ChargebeeException { + Response response = deleteRaw(unbilledChargeId); + return UnbilledChargeDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * invoiceNowEstimate a unbilledCharge using immutable params (executes immediately) - returns raw + * Response. + */ + Response invoiceNowEstimateRaw(UnbilledChargeInvoiceNowEstimateParams params) + throws ChargebeeException { + + return post( + "/unbilled_charges/invoice_now_estimate", params != null ? params.toFormData() : null); + } + + /** + * invoiceNowEstimate a unbilledCharge using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response invoiceNowEstimateRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/unbilled_charges/invoice_now_estimate", jsonPayload); + } + + public UnbilledChargeInvoiceNowEstimateResponse invoiceNowEstimate( + UnbilledChargeInvoiceNowEstimateParams params) throws ChargebeeException { + Response response = invoiceNowEstimateRaw(params); + + return UnbilledChargeInvoiceNowEstimateResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * invoiceUnbilledCharges a unbilledCharge using immutable params (executes immediately) - returns + * raw Response. + */ + Response invoiceUnbilledChargesRaw(InvoiceUnbilledChargesParams params) + throws ChargebeeException { + + return post( + "/unbilled_charges/invoice_unbilled_charges", params != null ? params.toFormData() : null); + } + + /** + * invoiceUnbilledCharges a unbilledCharge using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response invoiceUnbilledChargesRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/unbilled_charges/invoice_unbilled_charges", jsonPayload); + } + + public InvoiceUnbilledChargesResponse invoiceUnbilledCharges(InvoiceUnbilledChargesParams params) + throws ChargebeeException { + Response response = invoiceUnbilledChargesRaw(params); + + return InvoiceUnbilledChargesResponse.fromJson(response.getBodyAsString(), response); + } + + /** list a unbilledCharge using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(UnbilledChargeListParams params) throws ChargebeeException { + + return get("/unbilled_charges", params != null ? params.toQueryParams() : null); + } + + /** list a unbilledCharge without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/unbilled_charges", null); + } + + /** list a unbilledCharge using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public UnbilledChargeListResponse list(UnbilledChargeListParams params) + throws ChargebeeException { + Response response = listRaw(params); + + return UnbilledChargeListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public UnbilledChargeListResponse list() throws ChargebeeException { + Response response = listRaw(); + return UnbilledChargeListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** + * create a unbilledCharge using immutable params (executes immediately) - returns raw Response. + */ + Response createRaw(UnbilledChargeCreateParams params) throws ChargebeeException { + + return post("/unbilled_charges", params != null ? params.toFormData() : null); + } + + /** + * create a unbilledCharge using raw JSON payload (executes immediately) - returns raw Response. + */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/unbilled_charges", jsonPayload); + } + + public UnbilledChargeCreateResponse create(UnbilledChargeCreateParams params) + throws ChargebeeException { + Response response = createRaw(params); + + return UnbilledChargeCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createUnbilledCharge a unbilledCharge using immutable params (executes immediately) - returns + * raw Response. + */ + Response createUnbilledChargeRaw(CreateUnbilledChargeParams params) throws ChargebeeException { + + return post("/unbilled_charges/create", params != null ? params.toFormData() : null); + } + + /** + * createUnbilledCharge a unbilledCharge using raw JSON payload (executes immediately) - returns + * raw Response. + */ + Response createUnbilledChargeRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/unbilled_charges/create", jsonPayload); + } + + public CreateUnbilledChargeResponse createUnbilledCharge(CreateUnbilledChargeParams params) + throws ChargebeeException { + Response response = createUnbilledChargeRaw(params); + + return CreateUnbilledChargeResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/UnbilledChargesSettingService.java b/src/main/java/com/chargebee/v4/services/UnbilledChargesSettingService.java similarity index 82% rename from src/main/java/com/chargebee/v4/core/services/UnbilledChargesSettingService.java rename to src/main/java/com/chargebee/v4/services/UnbilledChargesSettingService.java index 96907374..03d3f467 100644 --- a/src/main/java/com/chargebee/v4/core/services/UnbilledChargesSettingService.java +++ b/src/main/java/com/chargebee/v4/services/UnbilledChargesSettingService.java @@ -5,15 +5,16 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.unbilledChargesSetting.params.UnbilledChargesSettingRetrieveParams; +import com.chargebee.v4.models.unbilledChargesSetting.params.UnbilledChargesSettingRetrieveParams; -import com.chargebee.v4.core.responses.unbilledChargesSetting.UnbilledChargesSettingRetrieveResponse; +import com.chargebee.v4.models.unbilledChargesSetting.responses.UnbilledChargesSettingRetrieveResponse; public final class UnbilledChargesSettingService extends BaseService { @@ -55,7 +56,7 @@ public UnbilledChargesSettingService withOptions(RequestOptions options) { * retrieve a unbilledChargesSetting using immutable params (executes immediately) - returns raw * Response. */ - Response retrieveRaw(UnbilledChargesSettingRetrieveParams params) throws Exception { + Response retrieveRaw(UnbilledChargesSettingRetrieveParams params) throws ChargebeeException { return get("/unbilled_charges_settings", params != null ? params.toQueryParams() : null); } @@ -64,13 +65,13 @@ Response retrieveRaw(UnbilledChargesSettingRetrieveParams params) throws Excepti * retrieve a unbilledChargesSetting using raw JSON payload (executes immediately) - returns raw * Response. */ - Response retrieveRaw(String jsonPayload) throws Exception { + Response retrieveRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } public UnbilledChargesSettingRetrieveResponse retrieve( - UnbilledChargesSettingRetrieveParams params) throws Exception { + UnbilledChargesSettingRetrieveParams params) throws ChargebeeException { Response response = retrieveRaw(params); return UnbilledChargesSettingRetrieveResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/core/services/UsageEventService.java b/src/main/java/com/chargebee/v4/services/UsageEventService.java similarity index 77% rename from src/main/java/com/chargebee/v4/core/services/UsageEventService.java rename to src/main/java/com/chargebee/v4/services/UsageEventService.java index 3684c19d..7900dc11 100644 --- a/src/main/java/com/chargebee/v4/core/services/UsageEventService.java +++ b/src/main/java/com/chargebee/v4/services/UsageEventService.java @@ -5,19 +5,20 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.usageEvent.params.UsageEventCreateParams; +import com.chargebee.v4.models.usageEvent.params.UsageEventCreateParams; -import com.chargebee.v4.core.models.usageEvent.params.UsageEventBatchIngestParams; +import com.chargebee.v4.models.usageEvent.params.UsageEventBatchIngestParams; -import com.chargebee.v4.core.responses.usageEvent.UsageEventCreateResponse; +import com.chargebee.v4.models.usageEvent.responses.UsageEventCreateResponse; -import com.chargebee.v4.core.responses.usageEvent.UsageEventBatchIngestResponse; +import com.chargebee.v4.models.usageEvent.responses.UsageEventBatchIngestResponse; public final class UsageEventService extends BaseService { @@ -54,18 +55,18 @@ public UsageEventService withOptions(RequestOptions options) { // === Operations === /** create a usageEvent using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(UsageEventCreateParams params) throws Exception { + Response createRaw(UsageEventCreateParams params) throws ChargebeeException { return post("/usage_events", params != null ? params.toFormData() : null); } /** create a usageEvent using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/usage_events", jsonPayload); } - public UsageEventCreateResponse create(UsageEventCreateParams params) throws Exception { + public UsageEventCreateResponse create(UsageEventCreateParams params) throws ChargebeeException { Response response = createRaw(params); return UsageEventCreateResponse.fromJson(response.getBodyAsString(), response); @@ -74,7 +75,7 @@ public UsageEventCreateResponse create(UsageEventCreateParams params) throws Exc /** * batchIngest a usageEvent using immutable params (executes immediately) - returns raw Response. */ - Response batchIngestRaw(UsageEventBatchIngestParams params) throws Exception { + Response batchIngestRaw(UsageEventBatchIngestParams params) throws ChargebeeException { return post("/batch/usage_events", params != null ? params.toFormData() : null); } @@ -82,13 +83,13 @@ Response batchIngestRaw(UsageEventBatchIngestParams params) throws Exception { /** * batchIngest a usageEvent using raw JSON payload (executes immediately) - returns raw Response. */ - Response batchIngestRaw(String jsonPayload) throws Exception { + Response batchIngestRaw(String jsonPayload) throws ChargebeeException { return postJson("/batch/usage_events", jsonPayload); } public UsageEventBatchIngestResponse batchIngest(UsageEventBatchIngestParams params) - throws Exception { + throws ChargebeeException { Response response = batchIngestRaw(params); return UsageEventBatchIngestResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/core/services/UsageFileService.java b/src/main/java/com/chargebee/v4/services/UsageFileService.java similarity index 80% rename from src/main/java/com/chargebee/v4/core/services/UsageFileService.java rename to src/main/java/com/chargebee/v4/services/UsageFileService.java index 034aba31..b133745f 100644 --- a/src/main/java/com/chargebee/v4/core/services/UsageFileService.java +++ b/src/main/java/com/chargebee/v4/services/UsageFileService.java @@ -5,17 +5,18 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.usageFile.params.UsageFileUploadUrlParams; +import com.chargebee.v4.models.usageFile.params.UsageFileUploadUrlParams; -import com.chargebee.v4.core.responses.usageFile.UsageFileProcessingStatusResponse; +import com.chargebee.v4.models.usageFile.responses.UsageFileProcessingStatusResponse; -import com.chargebee.v4.core.responses.usageFile.UsageFileUploadUrlResponse; +import com.chargebee.v4.models.usageFile.responses.UsageFileUploadUrlResponse; public final class UsageFileService extends BaseService { @@ -52,7 +53,7 @@ public UsageFileService withOptions(RequestOptions options) { // === Operations === /** processingStatus a usageFile (executes immediately) - returns raw Response. */ - Response processingStatusRaw(String usageFileId) throws Exception { + Response processingStatusRaw(String usageFileId) throws ChargebeeException { String path = buildPathWithParams( "/usage_files/{usage-file-id}/processing_status", "usage-file-id", usageFileId); @@ -60,24 +61,26 @@ Response processingStatusRaw(String usageFileId) throws Exception { return get(path, null); } - public UsageFileProcessingStatusResponse processingStatus(String usageFileId) throws Exception { + public UsageFileProcessingStatusResponse processingStatus(String usageFileId) + throws ChargebeeException { Response response = processingStatusRaw(usageFileId); return UsageFileProcessingStatusResponse.fromJson(response.getBodyAsString(), response); } /** uploadUrl a usageFile using immutable params (executes immediately) - returns raw Response. */ - Response uploadUrlRaw(UsageFileUploadUrlParams params) throws Exception { + Response uploadUrlRaw(UsageFileUploadUrlParams params) throws ChargebeeException { return post("/usage_files/upload_url", params != null ? params.toFormData() : null); } /** uploadUrl a usageFile using raw JSON payload (executes immediately) - returns raw Response. */ - Response uploadUrlRaw(String jsonPayload) throws Exception { + Response uploadUrlRaw(String jsonPayload) throws ChargebeeException { return postJson("/usage_files/upload_url", jsonPayload); } - public UsageFileUploadUrlResponse uploadUrl(UsageFileUploadUrlParams params) throws Exception { + public UsageFileUploadUrlResponse uploadUrl(UsageFileUploadUrlParams params) + throws ChargebeeException { Response response = uploadUrlRaw(params); return UsageFileUploadUrlResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/services/UsageService.java b/src/main/java/com/chargebee/v4/services/UsageService.java new file mode 100644 index 00000000..036f7206 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/UsageService.java @@ -0,0 +1,206 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.usage.params.UsagePdfParams; + +import com.chargebee.v4.models.usage.params.UsageRetrieveParams; + +import com.chargebee.v4.models.usage.params.UsageCreateParams; + +import com.chargebee.v4.models.usage.params.UsageDeleteParams; + +import com.chargebee.v4.models.usage.params.UsageListParams; + +import com.chargebee.v4.models.usage.responses.UsagePdfResponse; + +import com.chargebee.v4.models.usage.responses.UsageRetrieveResponse; + +import com.chargebee.v4.models.usage.responses.UsageCreateResponse; + +import com.chargebee.v4.models.usage.responses.UsageDeleteResponse; + +import com.chargebee.v4.models.usage.responses.UsageListResponse; + +public final class UsageService extends BaseService { + + private final ServiceConfig config; + + public UsageService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private UsageService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private UsageService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + UsageService with(RequestOptions newOptions) { + return new UsageService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public UsageService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** pdf a usage using immutable params (executes immediately) - returns raw Response. */ + Response pdfRaw(UsagePdfParams params) throws ChargebeeException { + + return post("/usages/pdf", params != null ? params.toFormData() : null); + } + + /** pdf a usage using raw JSON payload (executes immediately) - returns raw Response. */ + Response pdfRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/usages/pdf", jsonPayload); + } + + public UsagePdfResponse pdf(UsagePdfParams params) throws ChargebeeException { + Response response = pdfRaw(params); + + return UsagePdfResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a usage (executes immediately) - returns raw Response. */ + Response retrieveRaw(String subscriptionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/usages", "subscription-id", subscriptionId); + + return get(path, null); + } + + /** retrieve a usage using immutable params (executes immediately) - returns raw Response. */ + Response retrieveRaw(String subscriptionId, UsageRetrieveParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/usages", "subscription-id", subscriptionId); + return get(path, params != null ? params.toQueryParams() : null); + } + + public UsageRetrieveResponse retrieve(String subscriptionId, UsageRetrieveParams params) + throws ChargebeeException { + Response response = retrieveRaw(subscriptionId, params); + return UsageRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + public UsageRetrieveResponse retrieve(String subscriptionId) throws ChargebeeException { + Response response = retrieveRaw(subscriptionId); + return UsageRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** create a usage (executes immediately) - returns raw Response. */ + Response createRaw(String subscriptionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/usages", "subscription-id", subscriptionId); + + return post(path, null); + } + + /** create a usage using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(String subscriptionId, UsageCreateParams params) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/usages", "subscription-id", subscriptionId); + return post(path, params.toFormData()); + } + + /** create a usage using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String subscriptionId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/usages", "subscription-id", subscriptionId); + return postJson(path, jsonPayload); + } + + public UsageCreateResponse create(String subscriptionId, UsageCreateParams params) + throws ChargebeeException { + Response response = createRaw(subscriptionId, params); + return UsageCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** delete a usage (executes immediately) - returns raw Response. */ + Response deleteRaw(String subscriptionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/delete_usage", "subscription-id", subscriptionId); + + return post(path, null); + } + + /** delete a usage using immutable params (executes immediately) - returns raw Response. */ + Response deleteRaw(String subscriptionId, UsageDeleteParams params) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/delete_usage", "subscription-id", subscriptionId); + return post(path, params.toFormData()); + } + + /** delete a usage using raw JSON payload (executes immediately) - returns raw Response. */ + Response deleteRaw(String subscriptionId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/delete_usage", "subscription-id", subscriptionId); + return postJson(path, jsonPayload); + } + + public UsageDeleteResponse delete(String subscriptionId, UsageDeleteParams params) + throws ChargebeeException { + Response response = deleteRaw(subscriptionId, params); + return UsageDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** list a usage using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(UsageListParams params) throws ChargebeeException { + + return get("/usages", params != null ? params.toQueryParams() : null); + } + + /** list a usage without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/usages", null); + } + + /** list a usage using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public UsageListResponse list(UsageListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return UsageListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + public UsageListResponse list() throws ChargebeeException { + Response response = listRaw(); + return UsageListResponse.fromJson(response.getBodyAsString(), this, null, response); + } +} diff --git a/src/main/java/com/chargebee/v4/services/VariantService.java b/src/main/java/com/chargebee/v4/services/VariantService.java new file mode 100644 index 00000000..9c95f3ac --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/VariantService.java @@ -0,0 +1,195 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.variant.params.ListProductVariantsParams; + +import com.chargebee.v4.models.variant.params.CreateProductVariantParams; + +import com.chargebee.v4.models.variant.params.VariantUpdateParams; + +import com.chargebee.v4.models.variant.responses.ListProductVariantsResponse; + +import com.chargebee.v4.models.variant.responses.CreateProductVariantResponse; + +import com.chargebee.v4.models.variant.responses.VariantRetrieveResponse; + +import com.chargebee.v4.models.variant.responses.VariantUpdateResponse; + +import com.chargebee.v4.models.variant.responses.VariantDeleteResponse; + +public final class VariantService extends BaseService { + + private final ServiceConfig config; + + public VariantService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private VariantService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private VariantService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + VariantService with(RequestOptions newOptions) { + return new VariantService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public VariantService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * listProductVariants a variant using immutable params (executes immediately) - returns raw + * Response. + */ + Response listProductVariantsRaw(String productId, ListProductVariantsParams params) + throws ChargebeeException { + String path = buildPathWithParams("/products/{product-id}/variants", "product-id", productId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** listProductVariants a variant without params (executes immediately) - returns raw Response. */ + Response listProductVariantsRaw(String productId) throws ChargebeeException { + String path = buildPathWithParams("/products/{product-id}/variants", "product-id", productId); + return get(path, null); + } + + /** + * listProductVariants a variant using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response listProductVariantsRaw(String productId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/products/{product-id}/variants", "product-id", productId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ListProductVariantsResponse listProductVariants( + String productId, ListProductVariantsParams params) throws ChargebeeException { + Response response = listProductVariantsRaw(productId, params); + return ListProductVariantsResponse.fromJson( + response.getBodyAsString(), this, params, productId, response); + } + + public ListProductVariantsResponse listProductVariants(String productId) + throws ChargebeeException { + Response response = listProductVariantsRaw(productId); + return ListProductVariantsResponse.fromJson( + response.getBodyAsString(), this, null, productId, response); + } + + /** createProductVariant a variant (executes immediately) - returns raw Response. */ + Response createProductVariantRaw(String productId) throws ChargebeeException { + String path = buildPathWithParams("/products/{product-id}/variants", "product-id", productId); + + return post(path, null); + } + + /** + * createProductVariant a variant using immutable params (executes immediately) - returns raw + * Response. + */ + Response createProductVariantRaw(String productId, CreateProductVariantParams params) + throws ChargebeeException { + String path = buildPathWithParams("/products/{product-id}/variants", "product-id", productId); + return post(path, params.toFormData()); + } + + /** + * createProductVariant a variant using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response createProductVariantRaw(String productId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/products/{product-id}/variants", "product-id", productId); + return postJson(path, jsonPayload); + } + + public CreateProductVariantResponse createProductVariant( + String productId, CreateProductVariantParams params) throws ChargebeeException { + Response response = createProductVariantRaw(productId, params); + return CreateProductVariantResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a variant (executes immediately) - returns raw Response. */ + Response retrieveRaw(String productVariantId) throws ChargebeeException { + String path = + buildPathWithParams( + "/variants/{product-variant-id}", "product-variant-id", productVariantId); + + return get(path, null); + } + + public VariantRetrieveResponse retrieve(String productVariantId) throws ChargebeeException { + Response response = retrieveRaw(productVariantId); + return VariantRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** update a variant (executes immediately) - returns raw Response. */ + Response updateRaw(String productVariantId) throws ChargebeeException { + String path = + buildPathWithParams( + "/variants/{product-variant-id}", "product-variant-id", productVariantId); + + return post(path, null); + } + + /** update a variant using immutable params (executes immediately) - returns raw Response. */ + Response updateRaw(String productVariantId, VariantUpdateParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/variants/{product-variant-id}", "product-variant-id", productVariantId); + return post(path, params.toFormData()); + } + + /** update a variant using raw JSON payload (executes immediately) - returns raw Response. */ + Response updateRaw(String productVariantId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/variants/{product-variant-id}", "product-variant-id", productVariantId); + return postJson(path, jsonPayload); + } + + public VariantUpdateResponse update(String productVariantId, VariantUpdateParams params) + throws ChargebeeException { + Response response = updateRaw(productVariantId, params); + return VariantUpdateResponse.fromJson(response.getBodyAsString(), response); + } + + /** delete a variant (executes immediately) - returns raw Response. */ + Response deleteRaw(String productVariantId) throws ChargebeeException { + String path = + buildPathWithParams( + "/variants/{product-variant-id}/delete", "product-variant-id", productVariantId); + + return post(path, null); + } + + public VariantDeleteResponse delete(String productVariantId) throws ChargebeeException { + Response response = deleteRaw(productVariantId); + return VariantDeleteResponse.fromJson(response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/services/VirtualBankAccountService.java b/src/main/java/com/chargebee/v4/services/VirtualBankAccountService.java new file mode 100644 index 00000000..24a952f6 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/VirtualBankAccountService.java @@ -0,0 +1,227 @@ +/* + * 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.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; + +import com.chargebee.v4.models.virtualBankAccount.params.VirtualBankAccountListParams; + +import com.chargebee.v4.models.virtualBankAccount.params.VirtualBankAccountCreateParams; + +import com.chargebee.v4.models.virtualBankAccount.params.VirtualBankAccountCreateUsingPermanentTokenParams; + +import com.chargebee.v4.models.virtualBankAccount.responses.VirtualBankAccountDeleteLocalResponse; + +import com.chargebee.v4.models.virtualBankAccount.responses.VirtualBankAccountDeleteResponse; + +import com.chargebee.v4.models.virtualBankAccount.responses.VirtualBankAccountListResponse; + +import com.chargebee.v4.models.virtualBankAccount.responses.VirtualBankAccountCreateResponse; + +import com.chargebee.v4.models.virtualBankAccount.responses.VirtualBankAccountSyncFundResponse; + +import com.chargebee.v4.models.virtualBankAccount.responses.VirtualBankAccountRetrieveResponse; + +import com.chargebee.v4.models.virtualBankAccount.responses.VirtualBankAccountCreateUsingPermanentTokenResponse; + +public final class VirtualBankAccountService extends BaseService { + + private final ServiceConfig config; + + public VirtualBankAccountService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private VirtualBankAccountService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private VirtualBankAccountService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + VirtualBankAccountService with(RequestOptions newOptions) { + return new VirtualBankAccountService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public VirtualBankAccountService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** deleteLocal a virtualBankAccount (executes immediately) - returns raw Response. */ + Response deleteLocalRaw(String virtualBankAccountId) throws ChargebeeException { + String path = + buildPathWithParams( + "/virtual_bank_accounts/{virtual-bank-account-id}/delete_local", + "virtual-bank-account-id", + virtualBankAccountId); + + return post(path, null); + } + + public VirtualBankAccountDeleteLocalResponse deleteLocal(String virtualBankAccountId) + throws ChargebeeException { + Response response = deleteLocalRaw(virtualBankAccountId); + return VirtualBankAccountDeleteLocalResponse.fromJson(response.getBodyAsString(), response); + } + + /** delete a virtualBankAccount (executes immediately) - returns raw Response. */ + Response deleteRaw(String virtualBankAccountId) throws ChargebeeException { + String path = + buildPathWithParams( + "/virtual_bank_accounts/{virtual-bank-account-id}/delete", + "virtual-bank-account-id", + virtualBankAccountId); + + return post(path, null); + } + + public VirtualBankAccountDeleteResponse delete(String virtualBankAccountId) + throws ChargebeeException { + Response response = deleteRaw(virtualBankAccountId); + return VirtualBankAccountDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * list a virtualBankAccount using immutable params (executes immediately) - returns raw Response. + */ + Response listRaw(VirtualBankAccountListParams params) throws ChargebeeException { + + return get("/virtual_bank_accounts", params != null ? params.toQueryParams() : null); + } + + /** list a virtualBankAccount without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/virtual_bank_accounts", null); + } + + /** + * list a virtualBankAccount using raw JSON payload (executes immediately) - returns raw Response. + */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public VirtualBankAccountListResponse list(VirtualBankAccountListParams params) + throws ChargebeeException { + Response response = listRaw(params); + + return VirtualBankAccountListResponse.fromJson( + response.getBodyAsString(), this, params, response); + } + + public VirtualBankAccountListResponse list() throws ChargebeeException { + Response response = listRaw(); + return VirtualBankAccountListResponse.fromJson( + response.getBodyAsString(), this, null, response); + } + + /** + * create a virtualBankAccount using immutable params (executes immediately) - returns raw + * Response. + */ + Response createRaw(VirtualBankAccountCreateParams params) throws ChargebeeException { + + return post("/virtual_bank_accounts", params != null ? params.toFormData() : null); + } + + /** + * create a virtualBankAccount using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/virtual_bank_accounts", jsonPayload); + } + + public VirtualBankAccountCreateResponse create(VirtualBankAccountCreateParams params) + throws ChargebeeException { + Response response = createRaw(params); + + return VirtualBankAccountCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** syncFund a virtualBankAccount (executes immediately) - returns raw Response. */ + Response syncFundRaw(String virtualBankAccountId) throws ChargebeeException { + String path = + buildPathWithParams( + "/virtual_bank_accounts/{virtual-bank-account-id}/sync_fund", + "virtual-bank-account-id", + virtualBankAccountId); + + return post(path, null); + } + + public VirtualBankAccountSyncFundResponse syncFund(String virtualBankAccountId) + throws ChargebeeException { + Response response = syncFundRaw(virtualBankAccountId); + return VirtualBankAccountSyncFundResponse.fromJson(response.getBodyAsString(), response); + } + + /** retrieve a virtualBankAccount (executes immediately) - returns raw Response. */ + Response retrieveRaw(String virtualBankAccountId) throws ChargebeeException { + String path = + buildPathWithParams( + "/virtual_bank_accounts/{virtual-bank-account-id}", + "virtual-bank-account-id", + virtualBankAccountId); + + return get(path, null); + } + + public VirtualBankAccountRetrieveResponse retrieve(String virtualBankAccountId) + throws ChargebeeException { + Response response = retrieveRaw(virtualBankAccountId); + return VirtualBankAccountRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** + * createUsingPermanentToken a virtualBankAccount using immutable params (executes immediately) - + * returns raw Response. + */ + Response createUsingPermanentTokenRaw(VirtualBankAccountCreateUsingPermanentTokenParams params) + throws ChargebeeException { + + return post( + "/virtual_bank_accounts/create_using_permanent_token", + params != null ? params.toFormData() : null); + } + + /** + * createUsingPermanentToken a virtualBankAccount using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response createUsingPermanentTokenRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/virtual_bank_accounts/create_using_permanent_token", jsonPayload); + } + + public VirtualBankAccountCreateUsingPermanentTokenResponse createUsingPermanentToken( + VirtualBankAccountCreateUsingPermanentTokenParams params) throws ChargebeeException { + Response response = createUsingPermanentTokenRaw(params); + + return VirtualBankAccountCreateUsingPermanentTokenResponse.fromJson( + response.getBodyAsString(), response); + } +} diff --git a/src/main/java/com/chargebee/v4/core/services/WebhookEndpointService.java b/src/main/java/com/chargebee/v4/services/WebhookEndpointService.java similarity index 76% rename from src/main/java/com/chargebee/v4/core/services/WebhookEndpointService.java rename to src/main/java/com/chargebee/v4/services/WebhookEndpointService.java index 0d0c4ff8..4d3589a9 100644 --- a/src/main/java/com/chargebee/v4/core/services/WebhookEndpointService.java +++ b/src/main/java/com/chargebee/v4/services/WebhookEndpointService.java @@ -5,27 +5,28 @@ * Copyright 2025 Chargebee Inc. */ -package com.chargebee.v4.core.services; +package com.chargebee.v4.services; import com.chargebee.v4.client.ChargebeeClient; import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.core.models.webhookEndpoint.params.WebhookEndpointUpdateParams; +import com.chargebee.v4.models.webhookEndpoint.params.WebhookEndpointUpdateParams; -import com.chargebee.v4.core.models.webhookEndpoint.params.WebhookEndpointListParams; +import com.chargebee.v4.models.webhookEndpoint.params.WebhookEndpointListParams; -import com.chargebee.v4.core.models.webhookEndpoint.params.WebhookEndpointCreateParams; +import com.chargebee.v4.models.webhookEndpoint.params.WebhookEndpointCreateParams; -import com.chargebee.v4.core.responses.webhookEndpoint.WebhookEndpointDeleteResponse; +import com.chargebee.v4.models.webhookEndpoint.responses.WebhookEndpointDeleteResponse; -import com.chargebee.v4.core.responses.webhookEndpoint.WebhookEndpointRetrieveResponse; +import com.chargebee.v4.models.webhookEndpoint.responses.WebhookEndpointRetrieveResponse; -import com.chargebee.v4.core.responses.webhookEndpoint.WebhookEndpointUpdateResponse; +import com.chargebee.v4.models.webhookEndpoint.responses.WebhookEndpointUpdateResponse; -import com.chargebee.v4.core.responses.webhookEndpoint.WebhookEndpointListResponse; +import com.chargebee.v4.models.webhookEndpoint.responses.WebhookEndpointListResponse; -import com.chargebee.v4.core.responses.webhookEndpoint.WebhookEndpointCreateResponse; +import com.chargebee.v4.models.webhookEndpoint.responses.WebhookEndpointCreateResponse; public final class WebhookEndpointService extends BaseService { @@ -63,7 +64,7 @@ public WebhookEndpointService withOptions(RequestOptions options) { // === Operations === /** delete a webhookEndpoint (executes immediately) - returns raw Response. */ - Response deleteRaw(String webhookEndpointId) throws Exception { + Response deleteRaw(String webhookEndpointId) throws ChargebeeException { String path = buildPathWithParams( "/webhook_endpoints/{webhook-endpoint-id}/delete", @@ -73,13 +74,13 @@ Response deleteRaw(String webhookEndpointId) throws Exception { return post(path, null); } - public WebhookEndpointDeleteResponse delete(String webhookEndpointId) throws Exception { + public WebhookEndpointDeleteResponse delete(String webhookEndpointId) throws ChargebeeException { Response response = deleteRaw(webhookEndpointId); return WebhookEndpointDeleteResponse.fromJson(response.getBodyAsString(), response); } /** retrieve a webhookEndpoint (executes immediately) - returns raw Response. */ - Response retrieveRaw(String webhookEndpointId) throws Exception { + Response retrieveRaw(String webhookEndpointId) throws ChargebeeException { String path = buildPathWithParams( "/webhook_endpoints/{webhook-endpoint-id}", "webhook-endpoint-id", webhookEndpointId); @@ -87,13 +88,14 @@ Response retrieveRaw(String webhookEndpointId) throws Exception { return get(path, null); } - public WebhookEndpointRetrieveResponse retrieve(String webhookEndpointId) throws Exception { + public WebhookEndpointRetrieveResponse retrieve(String webhookEndpointId) + throws ChargebeeException { Response response = retrieveRaw(webhookEndpointId); return WebhookEndpointRetrieveResponse.fromJson(response.getBodyAsString(), response); } /** update a webhookEndpoint (executes immediately) - returns raw Response. */ - Response updateRaw(String webhookEndpointId) throws Exception { + Response updateRaw(String webhookEndpointId) throws ChargebeeException { String path = buildPathWithParams( "/webhook_endpoints/{webhook-endpoint-id}", "webhook-endpoint-id", webhookEndpointId); @@ -105,7 +107,7 @@ Response updateRaw(String webhookEndpointId) throws Exception { * update a webhookEndpoint using immutable params (executes immediately) - returns raw Response. */ Response updateRaw(String webhookEndpointId, WebhookEndpointUpdateParams params) - throws Exception { + throws ChargebeeException { String path = buildPathWithParams( "/webhook_endpoints/{webhook-endpoint-id}", "webhook-endpoint-id", webhookEndpointId); @@ -115,7 +117,7 @@ Response updateRaw(String webhookEndpointId, WebhookEndpointUpdateParams params) /** * update a webhookEndpoint using raw JSON payload (executes immediately) - returns raw Response. */ - Response updateRaw(String webhookEndpointId, String jsonPayload) throws Exception { + Response updateRaw(String webhookEndpointId, String jsonPayload) throws ChargebeeException { String path = buildPathWithParams( "/webhook_endpoints/{webhook-endpoint-id}", "webhook-endpoint-id", webhookEndpointId); @@ -123,7 +125,7 @@ Response updateRaw(String webhookEndpointId, String jsonPayload) throws Exceptio } public WebhookEndpointUpdateResponse update( - String webhookEndpointId, WebhookEndpointUpdateParams params) throws Exception { + String webhookEndpointId, WebhookEndpointUpdateParams params) throws ChargebeeException { Response response = updateRaw(webhookEndpointId, params); return WebhookEndpointUpdateResponse.fromJson(response.getBodyAsString(), response); } @@ -131,13 +133,13 @@ public WebhookEndpointUpdateResponse update( /** * list a webhookEndpoint using immutable params (executes immediately) - returns raw Response. */ - Response listRaw(WebhookEndpointListParams params) throws Exception { + Response listRaw(WebhookEndpointListParams params) throws ChargebeeException { return get("/webhook_endpoints", params != null ? params.toQueryParams() : null); } /** list a webhookEndpoint without params (executes immediately) - returns raw Response. */ - Response listRaw() throws Exception { + Response listRaw() throws ChargebeeException { return get("/webhook_endpoints", null); } @@ -145,18 +147,19 @@ Response listRaw() throws Exception { /** * list a webhookEndpoint using raw JSON payload (executes immediately) - returns raw Response. */ - Response listRaw(String jsonPayload) throws Exception { + Response listRaw(String jsonPayload) throws ChargebeeException { throw new UnsupportedOperationException("JSON payload not supported for GET operations"); } - public WebhookEndpointListResponse list(WebhookEndpointListParams params) throws Exception { + public WebhookEndpointListResponse list(WebhookEndpointListParams params) + throws ChargebeeException { Response response = listRaw(params); return WebhookEndpointListResponse.fromJson(response.getBodyAsString(), this, params, response); } - public WebhookEndpointListResponse list() throws Exception { + public WebhookEndpointListResponse list() throws ChargebeeException { Response response = listRaw(); return WebhookEndpointListResponse.fromJson(response.getBodyAsString(), this, null, response); } @@ -164,7 +167,7 @@ public WebhookEndpointListResponse list() throws Exception { /** * create a webhookEndpoint using immutable params (executes immediately) - returns raw Response. */ - Response createRaw(WebhookEndpointCreateParams params) throws Exception { + Response createRaw(WebhookEndpointCreateParams params) throws ChargebeeException { return post("/webhook_endpoints", params != null ? params.toFormData() : null); } @@ -172,12 +175,13 @@ Response createRaw(WebhookEndpointCreateParams params) throws Exception { /** * create a webhookEndpoint using raw JSON payload (executes immediately) - returns raw Response. */ - Response createRaw(String jsonPayload) throws Exception { + Response createRaw(String jsonPayload) throws ChargebeeException { return postJson("/webhook_endpoints", jsonPayload); } - public WebhookEndpointCreateResponse create(WebhookEndpointCreateParams params) throws Exception { + public WebhookEndpointCreateResponse create(WebhookEndpointCreateParams params) + throws ChargebeeException { Response response = createRaw(params); return WebhookEndpointCreateResponse.fromJson(response.getBodyAsString(), response); diff --git a/src/main/java/com/chargebee/v4/transport/ClientErrorException.java b/src/main/java/com/chargebee/v4/transport/ClientErrorException.java deleted file mode 100644 index a1d0769b..00000000 --- a/src/main/java/com/chargebee/v4/transport/ClientErrorException.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.chargebee.v4.transport; - -/** - * Exception for 4xx HTTP status codes (client errors). - * Indicates issues with the request (bad request, unauthorized, not found, etc.). - */ -public class ClientErrorException extends HttpException { - - public ClientErrorException(int statusCode, String message, Response response) { - super(statusCode, message, response); - } - - public ClientErrorException(int statusCode, String message, Response response, Throwable cause) { - super(statusCode, message, response, cause); - } - - /** - * Check if this is a specific client error type. - */ - public boolean isBadRequest() { - return getStatusCode() == 400; - } - - public boolean isUnauthorized() { - return getStatusCode() == 401; - } - - public boolean isForbidden() { - return getStatusCode() == 403; - } - - public boolean isNotFound() { - return getStatusCode() == 404; - } - - public boolean isMethodNotAllowed() { - return getStatusCode() == 405; - } - - public boolean isConflict() { - return getStatusCode() == 409; - } - - public boolean isUnprocessableEntity() { - return getStatusCode() == 422; - } - - public boolean isTooManyRequests() { - return getStatusCode() == 429; - } -} \ No newline at end of file diff --git a/src/main/java/com/chargebee/v4/transport/ConfigurationException.java b/src/main/java/com/chargebee/v4/transport/ConfigurationException.java deleted file mode 100644 index 4b37062e..00000000 --- a/src/main/java/com/chargebee/v4/transport/ConfigurationException.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.chargebee.v4.transport; - -/** - * Exception thrown when there's an issue with transport or client configuration. - * This is a runtime exception to allow fluent builder usage. - */ -public class ConfigurationException extends RuntimeException { - - public ConfigurationException(String message) { - super(message); - } - - public ConfigurationException(String message, Throwable cause) { - super(message, cause); - } -} \ No newline at end of file diff --git a/src/main/java/com/chargebee/v4/transport/ConsoleRequestLogger.java b/src/main/java/com/chargebee/v4/transport/ConsoleRequestLogger.java index a6dc7ab3..c00c9cf0 100644 --- a/src/main/java/com/chargebee/v4/transport/ConsoleRequestLogger.java +++ b/src/main/java/com/chargebee/v4/transport/ConsoleRequestLogger.java @@ -1,5 +1,7 @@ package com.chargebee.v4.transport; +import com.chargebee.v4.exceptions.HttpException; + import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.List; diff --git a/src/main/java/com/chargebee/v4/transport/DefaultTransport.java b/src/main/java/com/chargebee/v4/transport/DefaultTransport.java index 81ce9ab8..7c43abd3 100644 --- a/src/main/java/com/chargebee/v4/transport/DefaultTransport.java +++ b/src/main/java/com/chargebee/v4/transport/DefaultTransport.java @@ -1,5 +1,7 @@ package com.chargebee.v4.transport; +import com.chargebee.v4.exceptions.*; + import java.io.*; import java.net.*; import java.nio.charset.StandardCharsets; @@ -43,7 +45,7 @@ public DefaultTransport(TransportConfig config) { } @Override - public Response send(Request request) throws TransportException { + public Response send(Request request) { RequestLogger logger = config.getRequestLogger(); long startTime = System.currentTimeMillis(); @@ -83,22 +85,22 @@ public Response send(Request request) throws TransportException { } throw e; } catch (SocketTimeoutException e) { - String timeoutType = e.getMessage().contains("connect") ? "connect" : "read"; - TimeoutException timeoutException = new TimeoutException(timeoutType, "Request timed out", e); + String timeoutType = e.getMessage() != null && e.getMessage().contains("connect") ? "connect" : "read"; + TimeoutException timeoutException = new TimeoutException(timeoutType, "Request timed out", e, request); if (logger != null && logger.isEnabled()) { long duration = System.currentTimeMillis() - startTime; logger.logError(request, timeoutException, duration); } throw timeoutException; } catch (UnknownHostException | NoRouteToHostException e) { - NetworkException networkException = new NetworkException("Network connectivity issue", e); + NetworkException networkException = new NetworkException("Network connectivity issue: " + e.getMessage(), e, request); if (logger != null && logger.isEnabled()) { long duration = System.currentTimeMillis() - startTime; logger.logError(request, networkException, duration); } throw networkException; } catch (IOException e) { - NetworkException networkException = new NetworkException("Network error", e); + NetworkException networkException = new NetworkException("Network error: " + e.getMessage(), e, request); if (logger != null && logger.isEnabled()) { long duration = System.currentTimeMillis() - startTime; logger.logError(request, networkException, duration); @@ -124,7 +126,7 @@ public CompletableFuture sendAsync(Request request) { return future; } - private HttpURLConnection createConnection(Request request) throws IOException, TransportException { + private HttpURLConnection createConnection(Request request) throws IOException { String fullUrl = buildFullUrl(request); URL url; @@ -281,7 +283,7 @@ private void writeRequestBody(HttpURLConnection connection, Request request) thr } } - private Response readResponse(HttpURLConnection connection) throws IOException, TransportException { + private Response readResponse(HttpURLConnection connection) throws IOException { int statusCode = connection.getResponseCode(); Map> headers = connection.getHeaderFields(); diff --git a/src/main/java/com/chargebee/v4/transport/HttpException.java b/src/main/java/com/chargebee/v4/transport/HttpException.java deleted file mode 100644 index e7fbde26..00000000 --- a/src/main/java/com/chargebee/v4/transport/HttpException.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.chargebee.v4.transport; - -/** - * Base exception for HTTP status code errors (4xx, 5xx). - * Contains the HTTP response information for error handling. - */ -public class HttpException extends TransportException { - private final int statusCode; - private final Response response; - - public HttpException(int statusCode, String message, Response response) { - super(message); - this.statusCode = statusCode; - this.response = response; - } - - public HttpException(int statusCode, String message, Response response, Throwable cause) { - super(message, cause); - this.statusCode = statusCode; - this.response = response; - } - - /** - * Get the HTTP status code. - */ - public int getStatusCode() { - return statusCode; - } - - /** - * Get the full HTTP response. - */ - public Response getResponse() { - return response; - } - - /** - * Get the response body as string for error details. - */ - public String getResponseBody() { - return response != null ? response.getBodyAsString() : null; - } - - @Override - public String toString() { - return String.format("%s{statusCode=%d, message='%s'}", - getClass().getSimpleName(), statusCode, getMessage()); - } -} \ No newline at end of file diff --git a/src/main/java/com/chargebee/v4/transport/HttpStatusHandler.java b/src/main/java/com/chargebee/v4/transport/HttpStatusHandler.java index 287ee165..b79c0120 100644 --- a/src/main/java/com/chargebee/v4/transport/HttpStatusHandler.java +++ b/src/main/java/com/chargebee/v4/transport/HttpStatusHandler.java @@ -1,186 +1,196 @@ +/* + * This file is auto-generated by Chargebee. + * Copyright 2025 Chargebee Inc. + */ + package com.chargebee.v4.transport; import com.chargebee.v4.exceptions.*; +import com.chargebee.v4.exceptions.codes.*; import com.chargebee.v4.internal.JsonUtil; /** - * Utility class for handling HTTP status codes and creating appropriate exceptions. + * Utility class for handling HTTP status codes and creating appropriate exceptions. This handler + * parses API error responses and throws strongly-typed exceptions based on the error type returned + * by the API. */ public final class HttpStatusHandler { - private static final String UBB_BATCH_INGESTION_INVALID_REQUEST = "ubb_batch_ingestion_invalid_request"; + private HttpStatusHandler() { + // Utility class + } + + /** + * Validate HTTP response and throw appropriate exception if not successful. + * + * @param request the HTTP request that generated this response + * @param response the HTTP response to validate + * @throws HttpException if the response indicates an error (4xx or 5xx) + */ + public static void validateResponse(Request request, Response response) throws HttpException { + int statusCode = response.getStatusCode(); - private HttpStatusHandler() { - // Utility class + if (response.isSuccessful()) { + return; } - /** - * Validate HTTP response and throw appropriate exception if not successful. - * - * @param request the HTTP request that generated this response - * @param response the HTTP response to validate - * @throws HttpException if the response indicates an error (4xx or 5xx) - */ - public static void validateResponse(Request request, Response response) throws HttpException { - int statusCode = response.getStatusCode(); - - if (response.isSuccessful()) { - return; // 2xx status codes are successful - } + String body = response.getBodyAsString(); + if (body != null && !body.trim().isEmpty() && body.trim().startsWith("{")) { + boolean hasType = JsonUtil.hasValue(body, "type"); + boolean hasMessage = JsonUtil.hasValue(body, "message"); + boolean hasApiErrorCode = JsonUtil.hasValue(body, "api_error_code"); - // Try to parse error response as JSON and throw appropriate API exception - // Only treat as API exception if it has the 'type' field or has both 'message' and 'api_error_code' - String body = response.getBodyAsString(); - if (body != null && !body.trim().isEmpty() && body.trim().startsWith("{")) { - boolean hasType = JsonUtil.hasValue(body, "type"); - boolean hasMessage = JsonUtil.hasValue(body, "message"); - boolean hasApiErrorCode = JsonUtil.hasValue(body, "api_error_code"); - - // Treat as Chargebee API error if it has type field, or both message and api_error_code - if (hasType || (hasMessage && hasApiErrorCode)) { - throwAPIException(statusCode, body, request, response); - return; - } - } + if (hasType || (hasMessage && hasApiErrorCode)) { + throwAPIException(statusCode, body, request, response); + return; + } + } - // Fallback to generic HTTP exceptions if response is not valid JSON - String message = createErrorMessage(statusCode, response); + String message = createErrorMessage(statusCode, response); - if (statusCode >= 400 && statusCode < 500) { - throw new ClientErrorException(statusCode, message, response); - } else if (statusCode >= 500) { - throw new ServerErrorException(statusCode, message, response); - } + if (statusCode >= 400 && statusCode < 500) { + throw new ClientErrorException(statusCode, message, request, response); + } else if (statusCode >= 500) { + throw new ServerErrorException(statusCode, message, request, response); + } + } - // For other non-2xx codes (1xx, 3xx), we don't throw exceptions - // 1xx are informational, 3xx are redirects (should be handled by HTTP client) + /** Throw appropriate API exception based on error type in JSON response. */ + private static void throwAPIException( + int statusCode, String jsonResponse, Request request, Response response) throws APIException { + String type = JsonUtil.getString(jsonResponse, "type"); + String apiErrorCodeStr = JsonUtil.getString(jsonResponse, "api_error_code"); + String message = JsonUtil.getString(jsonResponse, "message"); + if (message == null) { + message = "API Error"; } - /** - * Throw appropriate API exception based on error type in JSON response. - */ - private static void throwAPIException(int statusCode, String jsonResponse, Request request, Response response) - throws APIException { - String type = JsonUtil.getString(jsonResponse, "type"); - String apiErrorCode = JsonUtil.getString(jsonResponse, "api_error_code"); - String message = JsonUtil.getString(jsonResponse, "message"); - if (message == null) { - message = "API Error"; - } + ErrorType errorType = ErrorType.fromString(type); + ApiErrorCode apiErrorCode = parseApiErrorCode(statusCode, apiErrorCodeStr); - // Check if this is a batch API error by examining the request URL - boolean isBatchApi = isBatchApiRequest(request); - - // Throw specific exception based on error type - if (UBB_BATCH_INGESTION_INVALID_REQUEST.equals(type)) { - throw new UbbBatchIngestionInvalidRequestException( - statusCode, type, apiErrorCode, message, jsonResponse, response); - } else if (isBatchApi) { - throw new BatchAPIException( - statusCode, type, apiErrorCode, message, jsonResponse, response); - } else if ("payment".equals(type)) { - throw new PaymentException( - statusCode, type, apiErrorCode, message, jsonResponse, response); - } else if ("operation_failed".equals(type)) { - throw new OperationFailedException( - statusCode, type, apiErrorCode, message, jsonResponse, response); - } else if ("invalid_request".equals(type)) { - throw new InvalidRequestException( - statusCode, type, apiErrorCode, message, jsonResponse, response); - } else { - // Generic API exception for unknown types - throw new APIException( - statusCode, type, apiErrorCode, message, jsonResponse, response); - } + // Throw specific exception based on error type + switch (errorType) { + case INVALID_REQUEST: + throw new InvalidRequestException( + statusCode, type, apiErrorCode, message, jsonResponse, request, response); + + case PAYMENT: + throw new PaymentException( + statusCode, type, apiErrorCode, message, jsonResponse, request, response); + + case OPERATION_FAILED: + throw new OperationFailedException( + statusCode, type, apiErrorCode, message, jsonResponse, request, response); + + default: + // Generic API exception for unknown or untyped errors + throw new APIException( + statusCode, type, apiErrorCode, message, jsonResponse, request, response); } + } - /** - * Check if the request is a batch API request by examining the URL. - * - * @param request the HTTP request - * @return true if the request URL contains "/batch/" - */ - private static boolean isBatchApiRequest(Request request) { - if (request == null || request.getUrl() == null) { - return false; - } - return request.getUrl().contains("/batch/"); + /** Parse the API error code string to the appropriate typed enum based on HTTP status code. */ + private static ApiErrorCode parseApiErrorCode(int statusCode, String apiErrorCodeStr) { + if (apiErrorCodeStr == null) { + return null; } - - /** - * Create a descriptive error message based on status code and response. - */ - private static String createErrorMessage(int statusCode, Response response) { - String statusMessage = getStatusMessage(statusCode); - String body = response.getBodyAsString(); - - if (body != null && !body.trim().isEmpty()) { - // Try to extract error message from response body - String extractedMessage = extractErrorMessage(body); - if (extractedMessage != null && !extractedMessage.isEmpty()) { - return String.format("HTTP %d %s: %s", statusCode, statusMessage, extractedMessage); - } - } - - return String.format("HTTP %d %s", statusCode, statusMessage); + switch (statusCode) { + case 400: + return BadRequestApiErrorCode.fromString(apiErrorCodeStr); + case 401: + return UnauthorizedApiErrorCode.fromString(apiErrorCodeStr); + case 403: + return ForbiddenApiErrorCode.fromString(apiErrorCodeStr); + case 404: + return NotFoundApiErrorCode.fromString(apiErrorCodeStr); + case 405: + return MethodNotAllowedApiErrorCode.fromString(apiErrorCodeStr); + case 409: + return ConflictApiErrorCode.fromString(apiErrorCodeStr); + case 422: + return UnprocessableEntityApiErrorCode.fromString(apiErrorCodeStr); + case 429: + return TooManyRequestsApiErrorCode.fromString(apiErrorCodeStr); + case 500: + return InternalServerErrorApiErrorCode.fromString(apiErrorCodeStr); + case 503: + return ServiceUnavailableApiErrorCode.fromString(apiErrorCodeStr); + default: + return BadRequestApiErrorCode.fromString(apiErrorCodeStr); } - - /** - * Get standard HTTP status message for a status code. - */ - private static String getStatusMessage(int statusCode) { - switch (statusCode) { - // 4xx Client Errors - case 400: return "Bad Request"; - case 401: return "Unauthorized"; - case 403: return "Forbidden"; - case 404: return "Not Found"; - case 405: return "Method Not Allowed"; - case 409: return "Conflict"; - case 422: return "Unprocessable Entity"; - case 429: return "Too Many Requests"; - - // 5xx Server Errors - case 500: return "Internal Server Error"; - case 502: return "Bad Gateway"; - case 503: return "Service Unavailable"; - case 504: return "Gateway Timeout"; - - // Generic messages - default: - if (statusCode >= 400 && statusCode < 500) { - return "Client Error"; - } else if (statusCode >= 500) { - return "Server Error"; - } else { - return "HTTP Error"; - } - } + } + + /** Create a descriptive error message based on status code and response. */ + private static String createErrorMessage(int statusCode, Response response) { + String statusMessage = getStatusMessage(statusCode); + String body = response.getBodyAsString(); + + if (body != null && !body.trim().isEmpty()) { + String extractedMessage = extractErrorMessage(body); + if (extractedMessage != null && !extractedMessage.isEmpty()) { + return String.format("HTTP %d %s: %s", statusCode, statusMessage, extractedMessage); + } } - - /** - * Try to extract error message from JSON response body. - * This is a simple implementation - could be enhanced for specific API error formats. - */ - private static String extractErrorMessage(String body) { - if (body == null || body.trim().isEmpty()) { - return null; - } - - // Simple JSON parsing to extract common error message fields - // This could be enhanced with a proper JSON parser if needed - String[] possibleFields = {"message", "error", "error_description", "detail"}; - - for (String field : possibleFields) { - String pattern = "\"" + field + "\"\\s*:\\s*\"([^\"]+)\""; - java.util.regex.Pattern regex = java.util.regex.Pattern.compile(pattern, java.util.regex.Pattern.CASE_INSENSITIVE); - java.util.regex.Matcher matcher = regex.matcher(body); - if (matcher.find()) { - return matcher.group(1); - } + + return String.format("HTTP %d %s", statusCode, statusMessage); + } + + /** Get standard HTTP status message for a status code. */ + private static String getStatusMessage(int statusCode) { + switch (statusCode) { + case 400: + return "Bad Request"; + case 401: + return "Unauthorized"; + case 403: + return "Forbidden"; + case 404: + return "Not Found"; + case 405: + return "Method Not Allowed"; + case 409: + return "Conflict"; + case 422: + return "Unprocessable Entity"; + case 429: + return "Too Many Requests"; + case 500: + return "Internal Server Error"; + case 502: + return "Bad Gateway"; + case 503: + return "Service Unavailable"; + case 504: + return "Gateway Timeout"; + default: + if (statusCode >= 400 && statusCode < 500) { + return "Client Error"; + } else if (statusCode >= 500) { + return "Server Error"; + } else { + return "HTTP Error"; } - - // If no specific error message found, return first 200 characters of body - return body.length() > 200 ? body.substring(0, 200) + "..." : body; } -} \ No newline at end of file + } + + /** Try to extract error message from JSON response body. */ + private static String extractErrorMessage(String body) { + if (body == null || body.trim().isEmpty()) { + return null; + } + + String[] possibleFields = {"message", "error", "error_description", "detail"}; + + for (String field : possibleFields) { + String pattern = "\"" + field + "\"\\s*:\\s*\"([^\"]+)\""; + java.util.regex.Pattern regex = + java.util.regex.Pattern.compile(pattern, java.util.regex.Pattern.CASE_INSENSITIVE); + java.util.regex.Matcher matcher = regex.matcher(body); + if (matcher.find()) { + return matcher.group(1); + } + } + + return body.length() > 200 ? body.substring(0, 200) + "..." : body; + } +} diff --git a/src/main/java/com/chargebee/v4/transport/NetworkException.java b/src/main/java/com/chargebee/v4/transport/NetworkException.java deleted file mode 100644 index 939c3927..00000000 --- a/src/main/java/com/chargebee/v4/transport/NetworkException.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.chargebee.v4.transport; - -/** - * Network connectivity issues, DNS failures. - */ -public class NetworkException extends TransportException { - - public NetworkException(String message, Throwable cause) { - super(message, cause); - } -} \ No newline at end of file diff --git a/src/main/java/com/chargebee/v4/transport/Response.java b/src/main/java/com/chargebee/v4/transport/Response.java index c1585245..a6cedb35 100644 --- a/src/main/java/com/chargebee/v4/transport/Response.java +++ b/src/main/java/com/chargebee/v4/transport/Response.java @@ -55,6 +55,27 @@ public boolean isSuccessful() { return statusCode >= 200 && statusCode < 300; } + /** + * Get a single header value by name (case-insensitive). + * + * @param name the header name + * @return the first header value, or null if not found + */ + public String getHeader(String name) { + List values = getHeaderValue(headers, name); + return (values != null && !values.isEmpty()) ? values.get(0) : null; + } + + /** + * Get all values for a header by name (case-insensitive). + * + * @param name the header name + * @return list of header values, or null if not found + */ + public List getHeaderValues(String name) { + return getHeaderValue(headers, name); + } + private static String parseContentType(Map> headers) { List values = getHeaderValue(headers, "Content-Type"); if (values == null || values.isEmpty()) return null; diff --git a/src/main/java/com/chargebee/v4/transport/ServerErrorException.java b/src/main/java/com/chargebee/v4/transport/ServerErrorException.java deleted file mode 100644 index 12de791e..00000000 --- a/src/main/java/com/chargebee/v4/transport/ServerErrorException.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.chargebee.v4.transport; - -/** - * Exception for 5xx HTTP status codes (server errors). - * Indicates issues on the server side that may be temporary. - */ -public class ServerErrorException extends HttpException { - - public ServerErrorException(int statusCode, String message, Response response) { - super(statusCode, message, response); - } - - public ServerErrorException(int statusCode, String message, Response response, Throwable cause) { - super(statusCode, message, response, cause); - } - - /** - * Check if this is a specific server error type. - */ - public boolean isInternalServerError() { - return getStatusCode() == 500; - } - - public boolean isBadGateway() { - return getStatusCode() == 502; - } - - public boolean isServiceUnavailable() { - return getStatusCode() == 503; - } - - public boolean isGatewayTimeout() { - return getStatusCode() == 504; - } - - /** - * Check if this error might be retryable. - * Generally, 5xx errors except 501 (Not Implemented) are considered retryable. - */ - public boolean isRetryable() { - int code = getStatusCode(); - return code >= 500 && code != 501; // 501 Not Implemented is not retryable - } -} \ No newline at end of file diff --git a/src/main/java/com/chargebee/v4/transport/TimeoutException.java b/src/main/java/com/chargebee/v4/transport/TimeoutException.java deleted file mode 100644 index 96788f5d..00000000 --- a/src/main/java/com/chargebee/v4/transport/TimeoutException.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.chargebee.v4.transport; - -/** - * Connection or read timeouts. - */ -public class TimeoutException extends TransportException { - private final String timeoutType; // "connect" or "read" - - public TimeoutException(String timeoutType, String message, Throwable cause) { - super(message, cause); - this.timeoutType = timeoutType; - } - - public String getTimeoutType() { - return timeoutType; - } - - public boolean isRetryable() { - return true; // Timeouts are generally retryable - } -} \ No newline at end of file diff --git a/src/main/java/com/chargebee/v4/transport/Transport.java b/src/main/java/com/chargebee/v4/transport/Transport.java index e6cb92a7..1b6813ef 100644 --- a/src/main/java/com/chargebee/v4/transport/Transport.java +++ b/src/main/java/com/chargebee/v4/transport/Transport.java @@ -1,5 +1,8 @@ package com.chargebee.v4.transport; +import com.chargebee.v4.exceptions.HttpException; +import com.chargebee.v4.exceptions.TransportException; + import java.util.concurrent.CompletableFuture; /** @@ -13,10 +16,8 @@ public interface Transport { * * @param request the HTTP request to send * @return the HTTP response - * @throws TransportException for network, timeout, or configuration failures - * @throws HttpException for HTTP error status codes (4xx, 5xx) */ - Response send(Request request) throws TransportException; + Response send(Request request); /** * Send an HTTP request asynchronously and return a CompletableFuture with the response. diff --git a/src/main/java/com/chargebee/v4/transport/TransportException.java b/src/main/java/com/chargebee/v4/transport/TransportException.java deleted file mode 100644 index 5b3c8790..00000000 --- a/src/main/java/com/chargebee/v4/transport/TransportException.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.chargebee.v4.transport; - -/** - * Base exception for transport-layer failures. - * Transport never interprets HTTP status codes - only throws for infrastructure issues. - */ -public class TransportException extends Exception { - - public TransportException(String message) { - super(message); - } - - public TransportException(String message, Throwable cause) { - super(message, cause); - } -} \ No newline at end of file diff --git a/src/main/java/com/chargebee/v4/webhook/UnhandledEventCallback.java b/src/main/java/com/chargebee/v4/webhook/UnhandledEventCallback.java new file mode 100644 index 00000000..ef593a43 --- /dev/null +++ b/src/main/java/com/chargebee/v4/webhook/UnhandledEventCallback.java @@ -0,0 +1,36 @@ +/* + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.webhook; + +import com.chargebee.v4.models.event.Event; + +/** + * Functional interface for handling unregistered/unhandled Chargebee webhook events. + * + *

This interface is invoked when no specific handler is registered for an event type. + * This allows you to log, store, or process unknown/unhandled events.

+ * + *

Example usage:

+ *
+ * UnhandledEventCallback fallbackHandler = (event, eventType, rawPayload) -> {
+ *     log.warn("Unhandled event: type={}, id={}", eventType, event.getId());
+ *     return WebhookResult.unhandled(eventType, event.getId());
+ * };
+ * 
+ */ +@FunctionalInterface +public interface UnhandledEventCallback { + + /** + * Handles an unhandled/unregistered webhook event and returns the processing result. + * + * @param event The base Event object (with content as Map) + * @param eventType The event type string that was not handled + * @param rawPayload The raw JSON payload (for custom parsing if needed) + * @return WebhookResult indicating the outcome of processing + * @throws Exception if event processing fails + */ + WebhookResult handle(Event event, String eventType, String rawPayload) throws Exception; +} diff --git a/src/main/java/com/chargebee/v4/webhook/WebhookEventCallback.java b/src/main/java/com/chargebee/v4/webhook/WebhookEventCallback.java new file mode 100644 index 00000000..5d99ad4c --- /dev/null +++ b/src/main/java/com/chargebee/v4/webhook/WebhookEventCallback.java @@ -0,0 +1,35 @@ +/* + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.webhook; + +/** + * Functional interface for handling Chargebee webhook events. + * + *

Implement this interface to create handlers for specific event types. + * The callback receives the fully typed event object from the SDK.

+ * + *

Example usage:

+ *
+ * handler.on(Event.EventType.CUSTOMER_CREATED, CustomerCreatedEvent.class, (typedEvent) -> {
+ *     Customer customer = typedEvent.getContent().getCustomer();
+ *     System.out.println("New customer: " + customer.getId());
+ *     return WebhookResult.success(typedEvent.getEventType(), typedEvent.getId());
+ * });
+ * 
+ * + * @param The typed event class (e.g., CustomerCreatedEvent, SubscriptionCreatedEvent) + */ +@FunctionalInterface +public interface WebhookEventCallback { + + /** + * Handles a webhook event and returns the processing result. + * + * @param typedEvent The typed event object with strongly-typed content + * @return WebhookResult indicating the outcome of processing + * @throws Exception if event processing fails + */ + WebhookResult handle(T typedEvent) throws Exception; +} diff --git a/src/main/java/com/chargebee/v4/webhook/WebhookEventHandler.java b/src/main/java/com/chargebee/v4/webhook/WebhookEventHandler.java new file mode 100644 index 00000000..00517a2e --- /dev/null +++ b/src/main/java/com/chargebee/v4/webhook/WebhookEventHandler.java @@ -0,0 +1,340 @@ +/* + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.webhook; + +import com.chargebee.v4.models.event.Event; + +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +/** + * Central handler for processing Chargebee webhook events. + * + *

This class provides a fluent API for registering event callbacks and processing + * incoming webhook notifications. It handles optional Basic Auth verification, event + * parsing, and routing to appropriate handlers.

+ * + *

Quick Start:

+ *
+ * // Create the handler
+ * WebhookEventHandler handler = WebhookEventHandler.create();
+ * 
+ * // Register callbacks for specific event types (class is auto-resolved via type witness)
+ * handler.<CustomerCreatedEvent>on(Event.EventType.CUSTOMER_CREATED, event -> {
+ *     Customer customer = event.getContent().getCustomer();
+ *     System.out.println("Customer created: " + customer.getEmail());
+ *     return WebhookResult.success(event.getEventType(), event.getId());
+ * });
+ * 
+ * handler.<SubscriptionCancelledEvent>on(Event.EventType.SUBSCRIPTION_CANCELLED, event -> {
+ *     Subscription sub = event.getContent().getSubscription();
+ *     System.out.println("Subscription cancelled: " + sub.getId());
+ *     return WebhookResult.success(event.getEventType(), event.getId());
+ * });
+ * 
+ * // Process incoming webhook (in your controller)
+ * WebhookResult result = handler.handleWebhook(requestBody);
+ * 
+ * + *

With Basic Auth (Optional):

+ *
+ * WebhookEventHandler handler = WebhookEventHandler.builder()
+ *     .basicAuth("username", "password")
+ *     .fallbackCallback((event, eventType, rawPayload) -> {
+ *         System.out.println("Unhandled event: " + eventType);
+ *         return WebhookResult.unhandled(eventType, event.getId());
+ *     })
+ *     .build();
+ * 
+ * // Process with auth verification
+ * WebhookResult result = handler.handleWebhook(requestBody, authorizationHeader);
+ * 
+ * + *

Common Event Types:

+ *
    + *
  • customer_created, customer_changed, customer_deleted
  • + *
  • subscription_created, subscription_activated, subscription_cancelled, subscription_renewed
  • + *
  • invoice_generated, invoice_updated, invoice_deleted
  • + *
  • payment_succeeded, payment_failed, payment_refunded
  • + *
  • card_added, card_updated, card_expired
  • + *
+ * + * @see WebhookEventCallback + * @see UnhandledEventCallback + * @see WebhookResult + */ +public class WebhookEventHandler { + + private final String webhookUsername; + private final String webhookPassword; + private final WebhookVerifier webhookVerifier; + private final UnhandledEventCallback fallbackCallback; + private final Map> callbacks; + + private WebhookEventHandler(Builder builder) { + this.webhookUsername = builder.webhookUsername; + this.webhookPassword = builder.webhookPassword; + this.webhookVerifier = builder.webhookVerifier; + this.fallbackCallback = builder.fallbackCallback; + this.callbacks = new ConcurrentHashMap<>(); + } + + /** + * Creates a simple WebhookEventHandler without authentication. + * + * @return A new WebhookEventHandler instance + */ + public static WebhookEventHandler create() { + return builder().build(); + } + + /** + * Creates a new builder for WebhookEventHandler. + * + * @return A new Builder instance + */ + public static Builder builder() { + return new Builder(); + } + + private static final String EVENT_CLASS_PACKAGE = "com.chargebee.v4.models.event"; + + /** + * Registers a callback for a specific event type. + * The event class is automatically derived from the event type. + * + *

Usage with type witness:

+ *
+     * handler.<CustomerCreatedEvent>on(Event.EventType.CUSTOMER_CREATED, event -> {
+     *     Customer customer = event.getContent().getCustomer();
+     *     return WebhookResult.success(event.getEventType(), event.getId());
+     * });
+     * 
+ * + * @param eventType The event type enum value (e.g., Event.EventType.CUSTOMER_CREATED) + * @param callback The callback to invoke when this event type is received + * @param The type of the event class + * @return This handler for method chaining + * @throws WebhookException if the event class cannot be found + */ + @SuppressWarnings("unchecked") + public WebhookEventHandler on(Event.EventType eventType, WebhookEventCallback callback) { + String eventTypeValue = eventType.getValue(); + if (eventTypeValue == null) { + throw new WebhookException("Event type value cannot be null"); + } + Class eventClass = (Class) resolveEventClass(eventTypeValue); + callbacks.put(eventTypeValue, new EventCallbackWrapper<>(eventClass, callback)); + return this; + } + + /** + * Resolves the event class from the event type string. + * Converts snake_case event type to PascalCase class name. + * e.g., "customer_moved_in" -> CustomerMovedInEvent + * + * @param eventType The event type string (e.g., "customer_moved_in") + * @return The resolved event class + * @throws WebhookException if the class cannot be found + */ + private Class resolveEventClass(String eventType) { + String className = Arrays.stream(eventType.split("_")) + .map(word -> word.substring(0, 1).toUpperCase() + word.substring(1).toLowerCase()) + .collect(Collectors.joining()) + "Event"; + + String fullClassName = EVENT_CLASS_PACKAGE + "." + className; + + try { + return Class.forName(fullClassName); + } catch (ClassNotFoundException e) { + throw new WebhookException("Event class not found: " + fullClassName + + ". Ensure the event type '" + eventType + "' is supported.", e); + } + } + + /** + * Processes an incoming webhook request without authentication. + * + * @param payload The raw request body (JSON) + * @return WebhookResult from the callback + * @throws WebhookException if processing fails + */ + public WebhookResult handleWebhook(String payload) { + return handleWebhook(payload, null); + } + + /** + * Processes an incoming webhook request with optional authentication. + * + *

This method:

+ *
    + *
  1. Verifies Basic Auth credentials (if configured)
  2. + *
  3. Parses the payload to determine event type
  4. + *
  5. Parses the payload to the typed event class
  6. + *
  7. Routes to the appropriate registered callback or fallback
  8. + *
  9. Returns the WebhookResult from the callback
  10. + *
+ * + * @param payload The raw request body (JSON) + * @param authorizationHeader The Authorization header value (can be null) + * @return WebhookResult from the callback + * @throws WebhookException if processing fails + */ + public WebhookResult handleWebhook(String payload, String authorizationHeader) { + // Verify Basic Auth if configured + if (webhookUsername != null && !webhookUsername.isEmpty() && + webhookPassword != null && !webhookPassword.isEmpty()) { + + if (webhookVerifier == null) { + throw new WebhookException("Basic Auth is configured but verifier is not set"); + } + + if (!webhookVerifier.verifyBasicAuth(authorizationHeader, webhookUsername, webhookPassword)) { + return WebhookResult.failure("Invalid webhook credentials"); + } + } + + // Parse the event to get event type + Event event; + try { + event = Event.fromJson(payload); + } catch (Exception e) { + throw new WebhookException("Failed to parse webhook payload", e); + } + + if (event.getEventType() == null) { + return WebhookResult.failure("Event type is missing"); + } + + String eventType = event.getEventType().getValue(); + + if (eventType == null) { + return WebhookResult.failure("Event type value is null"); + } + + // Route to appropriate callback + EventCallbackWrapper wrapper = callbacks.get(eventType); + + try { + if (wrapper != null) { + return invokeCallback(wrapper, payload); + } else if (fallbackCallback != null) { + return fallbackCallback.handle(event, eventType, payload); + } else { + return WebhookResult.unhandled(eventType, event.getId()); + } + } catch (Exception e) { + throw new WebhookException("Failed to process webhook event: " + eventType, e); + } + } + + /** + * Checks if a callback is registered for the given event type. + * + * @param eventType The event type to check + * @return true if a callback is registered + */ + public boolean hasCallback(String eventType) { + return callbacks.containsKey(eventType); + } + + /** + * Returns the number of registered callbacks. + * + * @return The number of registered callbacks + */ + public int getRegisteredCallbackCount() { + return callbacks.size(); + } + + @SuppressWarnings("unchecked") + private WebhookResult invokeCallback(EventCallbackWrapper wrapper, String payload) throws Exception { + // Parse to typed event using the event class's fromJson method + Method fromJsonMethod = wrapper.eventClass.getMethod("fromJson", String.class); + T typedEvent = (T) fromJsonMethod.invoke(null, payload); + return wrapper.callback.handle(typedEvent); + } + + private static class EventCallbackWrapper { + final Class eventClass; + final WebhookEventCallback callback; + + EventCallbackWrapper(Class eventClass, WebhookEventCallback callback) { + this.eventClass = eventClass; + this.callback = callback; + } + } + + /** + * Builder for WebhookEventHandler. + */ + public static class Builder { + private String webhookUsername; + private String webhookPassword; + private WebhookVerifier webhookVerifier; + private UnhandledEventCallback fallbackCallback; + + /** + * Configures Basic Auth credentials for webhook verification (optional). + * + * @param username The username configured in Chargebee webhook settings + * @param password The password configured in Chargebee webhook settings + * @return This builder + */ + public Builder basicAuth(String username, String password) { + this.webhookUsername = username; + this.webhookPassword = password; + this.webhookVerifier = new WebhookVerifier(); + return this; + } + + /** + * Sets a custom webhook verifier instance. + * + * @param webhookVerifier The WebhookVerifier to use + * @return This builder + */ + public Builder webhookVerifier(WebhookVerifier webhookVerifier) { + this.webhookVerifier = webhookVerifier; + return this; + } + + /** + * Sets the fallback callback for unhandled events. + * + * @param fallbackCallback The callback for unregistered event types + * @return This builder + */ + public Builder fallbackCallback(UnhandledEventCallback fallbackCallback) { + this.fallbackCallback = fallbackCallback; + return this; + } + + /** + * Builds the WebhookEventHandler. + * + * @return The configured WebhookEventHandler + */ + public WebhookEventHandler build() { + return new WebhookEventHandler(this); + } + } + + /** + * Exception thrown when webhook processing fails. + */ + public static class WebhookException extends RuntimeException { + public WebhookException(String message) { + super(message); + } + + public WebhookException(String message, Throwable cause) { + super(message, cause); + } + } +} diff --git a/src/main/java/com/chargebee/v4/webhook/WebhookResult.java b/src/main/java/com/chargebee/v4/webhook/WebhookResult.java new file mode 100644 index 00000000..1dd6fa92 --- /dev/null +++ b/src/main/java/com/chargebee/v4/webhook/WebhookResult.java @@ -0,0 +1,112 @@ +/* + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.webhook; + +/** + * Result of webhook processing. + * + *

This class represents the outcome of processing a Chargebee webhook event. + * Use the static factory methods to create appropriate results:

+ *
    + *
  • {@link #success(String, String)} - Event processed successfully
  • + *
  • {@link #unhandled(String, String)} - Event received but no handler registered
  • + *
  • {@link #failure(String)} - Event processing failed
  • + *
+ */ +public class WebhookResult { + + private final boolean success; + private final boolean handled; + private final String eventType; + private final String eventId; + private final String errorMessage; + + private WebhookResult(boolean success, boolean handled, String eventType, String eventId, String errorMessage) { + this.success = success; + this.handled = handled; + this.eventType = eventType; + this.eventId = eventId; + this.errorMessage = errorMessage; + } + + /** + * Creates a success result indicating the event was processed successfully. + * + * @param eventType The event type that was processed + * @param eventId The event ID + * @return A success WebhookResult + */ + public static WebhookResult success(String eventType, String eventId) { + return new WebhookResult(true, true, eventType, eventId, null); + } + + /** + * Creates an unhandled result indicating the event was received but no handler was registered. + * + * @param eventType The event type + * @param eventId The event ID + * @return An unhandled WebhookResult + */ + public static WebhookResult unhandled(String eventType, String eventId) { + return new WebhookResult(true, false, eventType, eventId, null); + } + + /** + * Creates a failure result indicating the event processing failed. + * + * @param errorMessage Description of the failure + * @return A failure WebhookResult + */ + public static WebhookResult failure(String errorMessage) { + return new WebhookResult(false, false, null, null, errorMessage); + } + + /** + * @return true if the webhook was processed without errors + */ + public boolean isSuccess() { + return success; + } + + /** + * @return true if a handler was found and executed for this event + */ + public boolean isHandled() { + return handled; + } + + /** + * @return The event type that was processed, or null on failure + */ + public String getEventType() { + return eventType; + } + + /** + * @return The event ID, or null on failure + */ + public String getEventId() { + return eventId; + } + + /** + * @return Error message if processing failed, null otherwise + */ + public String getErrorMessage() { + return errorMessage; + } + + @Override + public String toString() { + return "WebhookResult{" + + "success=" + success + + ", handled=" + handled + + ", eventType='" + eventType + '\'' + + ", eventId='" + eventId + '\'' + + ", errorMessage='" + errorMessage + '\'' + + '}'; + } +} + diff --git a/src/main/java/com/chargebee/v4/webhook/WebhookVerifier.java b/src/main/java/com/chargebee/v4/webhook/WebhookVerifier.java new file mode 100644 index 00000000..092ba7e8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/webhook/WebhookVerifier.java @@ -0,0 +1,141 @@ +/* + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.webhook; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +/** + * Utility class for verifying Chargebee webhook requests using HTTP Basic Authentication. + * + *

Chargebee supports optional HTTP Basic Authentication for webhooks. When configured, + * Chargebee sends the username and password in the Authorization header as Base64-encoded + * credentials.

+ * + *

To enable webhook authentication in Chargebee:

+ *
    + *
  1. Go to Settings → Configure Chargebee → Webhooks
  2. + *
  3. Edit your webhook endpoint
  4. + *
  5. Enable "Basic Authentication" and set username/password
  6. + *
+ * + *

Usage example:

+ *
+ * WebhookVerifier verifier = new WebhookVerifier();
+ * boolean isValid = verifier.verifyBasicAuth(
+ *     authorizationHeader,
+ *     expectedUsername,
+ *     expectedPassword
+ * );
+ * 
+ * + * @see Chargebee Events API + */ +public class WebhookVerifier { + + private static final String BASIC_AUTH_PREFIX = "Basic "; + + /** + * Verifies the webhook request using HTTP Basic Authentication. + * + *

Chargebee sends credentials in the Authorization header as: + * "Basic base64(username:password)"

+ * + * @param authorizationHeader The Authorization header value from the request + * @param expectedUsername The expected username configured in Chargebee + * @param expectedPassword The expected password configured in Chargebee + * @return true if credentials match, false otherwise + */ + public boolean verifyBasicAuth(String authorizationHeader, String expectedUsername, String expectedPassword) { + if (authorizationHeader == null || !authorizationHeader.startsWith(BASIC_AUTH_PREFIX)) { + return false; + } + + if (expectedUsername == null || expectedPassword == null) { + return false; + } + + try { + // Extract Base64 encoded credentials + String base64Credentials = authorizationHeader.substring(BASIC_AUTH_PREFIX.length()).trim(); + + // Decode credentials + byte[] decodedBytes = Base64.getDecoder().decode(base64Credentials); + String decodedCredentials = new String(decodedBytes, StandardCharsets.UTF_8); + + // Split into username:password + int colonIndex = decodedCredentials.indexOf(':'); + if (colonIndex == -1) { + return false; + } + + String receivedUsername = decodedCredentials.substring(0, colonIndex); + String receivedPassword = decodedCredentials.substring(colonIndex + 1); + + // Use constant-time comparison to prevent timing attacks + boolean usernameMatch = secureCompare(receivedUsername, expectedUsername); + boolean passwordMatch = secureCompare(receivedPassword, expectedPassword); + + return usernameMatch && passwordMatch; + + } catch (IllegalArgumentException e) { + return false; + } + } + + /** + * Extracts username from the Authorization header. + * + * @param authorizationHeader The Authorization header value + * @return The username, or null if extraction fails + */ + public String extractUsername(String authorizationHeader) { + if (authorizationHeader == null || !authorizationHeader.startsWith(BASIC_AUTH_PREFIX)) { + return null; + } + + try { + String base64Credentials = authorizationHeader.substring(BASIC_AUTH_PREFIX.length()).trim(); + byte[] decodedBytes = Base64.getDecoder().decode(base64Credentials); + String decodedCredentials = new String(decodedBytes, StandardCharsets.UTF_8); + + int colonIndex = decodedCredentials.indexOf(':'); + if (colonIndex == -1) { + return null; + } + + return decodedCredentials.substring(0, colonIndex); + } catch (IllegalArgumentException e) { + return null; + } + } + + /** + * Performs a constant-time comparison of two strings to prevent timing attacks. + * + * @param a First string + * @param b Second string + * @return true if strings are equal, false otherwise + */ + private boolean secureCompare(String a, String b) { + if (a == null || b == null) { + return false; + } + + byte[] aBytes = a.getBytes(StandardCharsets.UTF_8); + byte[] bBytes = b.getBytes(StandardCharsets.UTF_8); + + if (aBytes.length != bBytes.length) { + return false; + } + + int result = 0; + for (int i = 0; i < aBytes.length; i++) { + result |= aBytes[i] ^ bBytes[i]; + } + return result == 0; + } +} + diff --git a/src/test/java/com/chargebee/ChargebeeClientTest.java b/src/test/java/com/chargebee/ChargebeeClientTest.java index e8ea6f37..2e7ddc47 100644 --- a/src/test/java/com/chargebee/ChargebeeClientTest.java +++ b/src/test/java/com/chargebee/ChargebeeClientTest.java @@ -1,6 +1,7 @@ package com.chargebee; import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.exceptions.ConfigurationException; import com.chargebee.v4.internal.RetryConfig; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.DisplayName; @@ -24,7 +25,7 @@ void testBuilderWithRequiredFields() { @Test @DisplayName("Builder should fail when apiKey is missing") void testBuilderFailsWithoutApiKey() { - com.chargebee.v4.transport.ConfigurationException exception = assertThrows(com.chargebee.v4.transport.ConfigurationException.class, () -> + ConfigurationException exception = assertThrows(ConfigurationException.class, () -> ChargebeeClient.builder() .siteName("acme") .build() @@ -35,7 +36,7 @@ void testBuilderFailsWithoutApiKey() { @Test @DisplayName("Builder should fail when siteName is missing") void testBuilderFailsWithoutSiteName() { - com.chargebee.v4.transport.ConfigurationException exception = assertThrows(com.chargebee.v4.transport.ConfigurationException.class, () -> + ConfigurationException exception = assertThrows(ConfigurationException.class, () -> ChargebeeClient.builder() .apiKey("cb_test_123") .build() @@ -46,7 +47,7 @@ void testBuilderFailsWithoutSiteName() { @Test @DisplayName("Builder should fail when both required fields are missing") void testBuilderFailsWithoutRequiredFields() { - com.chargebee.v4.transport.ConfigurationException exception = assertThrows(com.chargebee.v4.transport.ConfigurationException.class, () -> + ConfigurationException exception = assertThrows(ConfigurationException.class, () -> ChargebeeClient.builder().build() ); assertEquals("API key is required", exception.getMessage()); diff --git a/src/test/java/com/chargebee/transport/FakeTransport.java b/src/test/java/com/chargebee/transport/FakeTransport.java index 580da4cc..382f7407 100644 --- a/src/test/java/com/chargebee/transport/FakeTransport.java +++ b/src/test/java/com/chargebee/transport/FakeTransport.java @@ -1,5 +1,7 @@ package com.chargebee.v4.transport; +import com.chargebee.v4.exceptions.TransportException; + import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentLinkedQueue; @@ -21,7 +23,7 @@ public FakeTransport() { } @Override - public Response send(Request request) throws TransportException { + public Response send(Request request) { recordedRequests.add(request); Response response = queuedResponses.poll(); diff --git a/src/test/java/com/chargebee/v4/RequestParamsTest.java b/src/test/java/com/chargebee/v4/RequestParamsTest.java new file mode 100644 index 00000000..687725cb --- /dev/null +++ b/src/test/java/com/chargebee/v4/RequestParamsTest.java @@ -0,0 +1,199 @@ +package com.chargebee.v4; + +import com.chargebee.v4.models.estimate.params.CreateSubscriptionItemEstimateParams; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.DisplayName; +import java.util.Map; +import java.util.List; +import java.util.Arrays; +import java.sql.Timestamp; +import java.time.Instant; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * Test class for strongly-typed request parameter POJOs. + * Demonstrates MapStruct compatibility and proper Java Bean behavior. + */ +class RequestParamsTest { + + @Test + @DisplayName("CreateSubscriptionItemEstimateParams should build with strongly-typed fields") + void testCreateSubscriptionItemEstimateParamsBuilding() { + // Build request using the strongly-typed builder + CreateSubscriptionItemEstimateParams params = CreateSubscriptionItemEstimateParams.builder() + .billingCycles(3) + .mandatoryItemsToRemove(Arrays.asList("item1", "item2")) + .termsToCharge(12) + .billingAlignmentMode(CreateSubscriptionItemEstimateParams.BillingAlignmentMode.IMMEDIATE) + .couponIds(Arrays.asList("coupon1", "coupon2")) + .invoiceImmediately(true) + .invoiceDate(Timestamp.from(Instant.now())) + .clientProfileId("profile123") + .build(); + + // Test Java Bean getters (MapStruct compatible) + assertEquals(3, params.getBillingCycles()); + assertEquals(Arrays.asList("item1", "item2"), params.getMandatoryItemsToRemove()); + assertEquals(12, params.getTermsToCharge()); + assertEquals(CreateSubscriptionItemEstimateParams.BillingAlignmentMode.IMMEDIATE, params.getBillingAlignmentMode()); + assertEquals(Arrays.asList("coupon1", "coupon2"), params.getCouponIds()); + assertTrue(params.getInvoiceImmediately()); + assertNotNull(params.getInvoiceDate()); + assertEquals("profile123", params.getClientProfileId()); + } + + @Test + @DisplayName("CreateSubscriptionItemEstimateParams should serialize to Map for HTTP transport") + void testCreateSubscriptionItemEstimateParamsToFormData() { + // Build request + CreateSubscriptionItemEstimateParams params = CreateSubscriptionItemEstimateParams.builder() + .billingCycles(6) + .mandatoryItemsToRemove(Arrays.asList("remove1")) + .termsToCharge(24) + .invoiceImmediately(false) + .build(); + + // Convert to form data (maintains backward compatibility) + Map formData = params.toFormData(); + + // Verify the Map contains the expected data + assertEquals(6, formData.get("billing_cycles")); + assertEquals(Arrays.asList("remove1"), formData.get("mandatory_items_to_remove")); + assertEquals(24, formData.get("terms_to_charge")); + assertFalse((Boolean) formData.get("invoice_immediately")); + } + + @Test + @DisplayName("Nested SubscriptionParams should work correctly") + void testNestedSubscriptionParams() { + // Build nested subscription params + CreateSubscriptionItemEstimateParams.SubscriptionParams subscription = + CreateSubscriptionItemEstimateParams.SubscriptionParams.builder() + .id("sub123") + .trialEnd(Timestamp.from(Instant.now().plusSeconds(86400))) + .build(); + + // Build main params with nested subscription + CreateSubscriptionItemEstimateParams params = CreateSubscriptionItemEstimateParams.builder() + .subscription(subscription) + .billingCycles(12) + .build(); + + // Test nested getters + assertEquals("sub123", params.getSubscription().getId()); + assertNotNull(params.getSubscription().getTrialEnd()); + assertEquals(12, params.getBillingCycles()); + } + + @Test + @DisplayName("BillingAddressParams should work as nested object") + void testNestedBillingAddressParams() { + // Build nested billing address + CreateSubscriptionItemEstimateParams.BillingAddressParams billingAddress = + CreateSubscriptionItemEstimateParams.BillingAddressParams.builder() + .line1("123 Main St") + .city("San Francisco") + .stateCode("CA") + .zip("94105") + .country("US") + .build(); + + // Build main params + CreateSubscriptionItemEstimateParams params = CreateSubscriptionItemEstimateParams.builder() + .billingAddress(billingAddress) + .build(); + + // Test nested getters + assertEquals("123 Main St", params.getBillingAddress().getLine1()); + assertEquals("San Francisco", params.getBillingAddress().getCity()); + assertEquals("CA", params.getBillingAddress().getStateCode()); + assertEquals("94105", params.getBillingAddress().getZip()); + assertEquals("US", params.getBillingAddress().getCountry()); + } + + @Test + @DisplayName("Null values should be handled correctly") + void testNullValues() { + CreateSubscriptionItemEstimateParams params = CreateSubscriptionItemEstimateParams.builder() + .billingCycles(1) + .build(); + + // Test that only set values appear in form data + Map formData = params.toFormData(); + assertEquals(1, formData.get("billing_cycles")); + assertFalse(formData.containsKey("terms_to_charge")); // null values not included + } + + @Test + @DisplayName("List of SubscriptionItemsParams should work correctly") + void testListOfSubscriptionItemsParams() { + // Build list of subscription items + List items = Arrays.asList( + CreateSubscriptionItemEstimateParams.SubscriptionItemsParams.builder() + .itemPriceId("price1") + .quantity(5) + .build(), + CreateSubscriptionItemEstimateParams.SubscriptionItemsParams.builder() + .itemPriceId("price2") + .quantity(10) + .build() + ); + + // Build main params + CreateSubscriptionItemEstimateParams params = CreateSubscriptionItemEstimateParams.builder() + .subscriptionItems(items) + .build(); + + // Test list getters + assertEquals(2, params.getSubscriptionItems().size()); + assertEquals("price1", params.getSubscriptionItems().get(0).getItemPriceId()); + assertEquals(5, params.getSubscriptionItems().get(0).getQuantity()); + assertEquals("price2", params.getSubscriptionItems().get(1).getItemPriceId()); + assertEquals(10, params.getSubscriptionItems().get(1).getQuantity()); + } + + @Test + @DisplayName("Enum values should work correctly") + void testEnumValues() { + CreateSubscriptionItemEstimateParams params = CreateSubscriptionItemEstimateParams.builder() + .billingAlignmentMode(CreateSubscriptionItemEstimateParams.BillingAlignmentMode.DELAYED) + .build(); + + assertEquals(CreateSubscriptionItemEstimateParams.BillingAlignmentMode.DELAYED, + params.getBillingAlignmentMode()); + assertEquals("delayed", params.getBillingAlignmentMode().getValue()); + + // Test enum fromString + CreateSubscriptionItemEstimateParams.BillingAlignmentMode parsed = + CreateSubscriptionItemEstimateParams.BillingAlignmentMode.fromString("immediate"); + assertEquals(CreateSubscriptionItemEstimateParams.BillingAlignmentMode.IMMEDIATE, parsed); + } + + @Test + @DisplayName("MapStruct compatibility - getters follow Java Bean convention") + void testMapStructCompatibility() { + CreateSubscriptionItemEstimateParams params = CreateSubscriptionItemEstimateParams.builder() + .billingCycles(42) + .clientProfileId("test-profile") + .build(); + + // These are the methods MapStruct would use for mapping + assertEquals(42, params.getBillingCycles()); + assertEquals("test-profile", params.getClientProfileId()); + + // Verify the class follows Java Bean conventions + assertTrue(params.getClass().getDeclaredMethods().length > 0); + + // Check that getters exist and are public + try { + java.lang.reflect.Method getBillingCycles = params.getClass().getMethod("getBillingCycles"); + assertTrue(java.lang.reflect.Modifier.isPublic(getBillingCycles.getModifiers())); + + java.lang.reflect.Method getClientProfileId = params.getClass().getMethod("getClientProfileId"); + assertTrue(java.lang.reflect.Modifier.isPublic(getClientProfileId.getModifiers())); + } catch (NoSuchMethodException e) { + fail("Required getter methods not found", e); + } + } +} diff --git a/src/test/java/com/chargebee/v4/client/ChargebeeClientRetryTest.java b/src/test/java/com/chargebee/v4/client/ChargebeeClientRetryTest.java index b2c81c42..c7212676 100644 --- a/src/test/java/com/chargebee/v4/client/ChargebeeClientRetryTest.java +++ b/src/test/java/com/chargebee/v4/client/ChargebeeClientRetryTest.java @@ -1,9 +1,12 @@ package com.chargebee.v4.client; +import com.chargebee.v4.exceptions.ClientErrorException; +import com.chargebee.v4.exceptions.ConfigurationException; +import com.chargebee.v4.exceptions.NetworkException; +import com.chargebee.v4.exceptions.TimeoutException; import com.chargebee.v4.internal.RetryConfig; import com.chargebee.v4.transport.*; import org.junit.jupiter.api.*; -import org.mockito.*; import java.util.*; import java.util.concurrent.CompletableFuture; @@ -473,7 +476,8 @@ void shouldNotRetryOnConfigurationException() throws Exception { void shouldNotRetryOnClientErrorException() throws Exception { Transport mockTransport = mock(Transport.class); Response errorResponse = createResponse(400); - ClientErrorException clientError = new ClientErrorException(400, "Bad Request", errorResponse); + Request errorRequest = Request.builder().method("GET").url("http://test.com").build(); + ClientErrorException clientError = new ClientErrorException(400, "Bad Request", errorRequest, errorResponse); when(mockTransport.send(any(Request.class))).thenThrow(clientError); diff --git a/src/test/java/com/chargebee/v4/client/CustomTransportHeaderTest.java b/src/test/java/com/chargebee/v4/client/CustomTransportHeaderTest.java index 01395792..8c387414 100644 --- a/src/test/java/com/chargebee/v4/client/CustomTransportHeaderTest.java +++ b/src/test/java/com/chargebee/v4/client/CustomTransportHeaderTest.java @@ -1,5 +1,6 @@ package com.chargebee.v4.client; +import com.chargebee.v4.exceptions.TransportException; import com.chargebee.v4.transport.*; import org.junit.jupiter.api.Test; import java.util.concurrent.CompletableFuture; @@ -14,7 +15,7 @@ void customTransportShouldReceiveDefaultHeaders() throws Exception { Transport customTransport = new Transport() { @Override - public Response send(Request request) throws TransportException { + public Response send(Request request) { capturedRequest.set(request); return new Response(200, java.util.Collections.emptyMap(), "{}".getBytes()); } diff --git a/src/test/java/com/chargebee/v4/exceptions/APIExceptionTest.java b/src/test/java/com/chargebee/v4/exceptions/APIExceptionTest.java index d7a23839..184eb0d1 100644 --- a/src/test/java/com/chargebee/v4/exceptions/APIExceptionTest.java +++ b/src/test/java/com/chargebee/v4/exceptions/APIExceptionTest.java @@ -1,5 +1,8 @@ package com.chargebee.v4.exceptions; +import com.chargebee.v4.exceptions.codes.ApiErrorCode; +import com.chargebee.v4.exceptions.codes.BadRequestApiErrorCode; +import com.chargebee.v4.transport.Request; import com.chargebee.v4.transport.Response; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -16,31 +19,36 @@ class APIExceptionTest { @Test @DisplayName("Should create APIException with all fields") void shouldCreateAPIExceptionWithAllFields() { - String jsonResponse = "{\"type\":\"invalid_request\",\"api_error_code\":\"missing_field\",\"message\":\"Required field is missing\",\"param\":\"email\"}"; + String jsonResponse = "{\"type\":\"invalid_request\",\"api_error_code\":\"param_wrong_value\",\"message\":\"Required field is missing\",\"param\":\"email\"}"; + Request mockRequest = createMockRequest(); Response mockResponse = createMockResponse(400, jsonResponse); APIException exception = new APIException( - 400, "invalid_request", "missing_field", "Required field is missing", jsonResponse, mockResponse + 400, "invalid_request", BadRequestApiErrorCode.PARAM_WRONG_VALUE, "Required field is missing", jsonResponse, mockRequest, mockResponse ); assertEquals(400, exception.getStatusCode()); assertEquals("invalid_request", exception.getType()); - assertEquals("missing_field", exception.getApiErrorCode()); + assertEquals(BadRequestApiErrorCode.PARAM_WRONG_VALUE, exception.getApiErrorCode()); + assertEquals("param_wrong_value", exception.getApiErrorCodeRaw()); assertEquals("Required field is missing", exception.getMessage()); assertEquals(jsonResponse, exception.getJsonResponse()); assertNotNull(exception.getParams()); assertEquals(1, exception.getParams().size()); assertEquals("email", exception.getParams().get(0)); + assertNotNull(exception.getRequest()); + assertEquals("https://test-site.chargebee.com/api/v2/customers", exception.getRequest().getUrl()); } @Test @DisplayName("Should extract single param from error response") void shouldExtractSingleParamFromErrorResponse() { String jsonResponse = "{\"type\":\"invalid_request\",\"message\":\"Invalid parameter\",\"param\":\"customer_id\"}"; + Request mockRequest = createMockRequest(); Response mockResponse = createMockResponse(400, jsonResponse); APIException exception = new APIException( - 400, "invalid_request", null, "Invalid parameter", jsonResponse, mockResponse + 400, "invalid_request", null, "Invalid parameter", jsonResponse, mockRequest, mockResponse ); List params = exception.getParams(); @@ -52,10 +60,11 @@ void shouldExtractSingleParamFromErrorResponse() { @DisplayName("Should extract multiple params from error response array") void shouldExtractMultipleParamsFromArray() { String jsonResponse = "{\"type\":\"invalid_request\",\"message\":\"Invalid parameters\",\"param\":[\"email\",\"phone\"]}"; + Request mockRequest = createMockRequest(); Response mockResponse = createMockResponse(400, jsonResponse); APIException exception = new APIException( - 400, "invalid_request", null, "Invalid parameters", jsonResponse, mockResponse + 400, "invalid_request", null, "Invalid parameters", jsonResponse, mockRequest, mockResponse ); List params = exception.getParams(); @@ -68,10 +77,11 @@ void shouldExtractMultipleParamsFromArray() { @DisplayName("Should handle missing params gracefully") void shouldHandleMissingParamsGracefully() { String jsonResponse = "{\"type\":\"operation_failed\",\"message\":\"Operation failed\"}"; + Request mockRequest = createMockRequest(); Response mockResponse = createMockResponse(400, jsonResponse); APIException exception = new APIException( - 400, "operation_failed", null, "Operation failed", jsonResponse, mockResponse + 400, "operation_failed", null, "Operation failed", jsonResponse, mockRequest, mockResponse ); List params = exception.getParams(); @@ -82,21 +92,193 @@ void shouldHandleMissingParamsGracefully() { @Test @DisplayName("Should create meaningful toString representation") void shouldCreateMeaningfulToString() { - String jsonResponse = "{\"type\":\"payment\",\"api_error_code\":\"card_declined\",\"message\":\"Card was declined\"}"; + String jsonResponse = "{\"type\":\"payment\",\"api_error_code\":\"payment_processing_failed\",\"message\":\"Card was declined\"}"; + Request mockRequest = createMockRequest(); Response mockResponse = createMockResponse(402, jsonResponse); APIException exception = new PaymentException( - 402, "payment", "card_declined", "Card was declined", jsonResponse, mockResponse + 402, "payment", BadRequestApiErrorCode.PAYMENT_PROCESSING_FAILED, "Card was declined", jsonResponse, mockRequest, mockResponse ); String toString = exception.toString(); assertTrue(toString.contains("PaymentException")); assertTrue(toString.contains("statusCode=402")); assertTrue(toString.contains("type='payment'")); - assertTrue(toString.contains("apiErrorCode='card_declined'")); + assertTrue(toString.contains("apiErrorCode='payment_processing_failed'")); assertTrue(toString.contains("Card was declined")); } + @Test + @DisplayName("Should handle strongly-typed error type enum") + void shouldHandleStronglyTypedErrorTypeEnum() { + String jsonResponse = "{\"type\":\"invalid_request\",\"api_error_code\":\"duplicate_entry\",\"message\":\"Duplicate entry\"}"; + Request mockRequest = createMockRequest(); + Response mockResponse = createMockResponse(400, jsonResponse); + + APIException exception = new APIException( + 400, "invalid_request", BadRequestApiErrorCode.DUPLICATE_ENTRY, "Duplicate entry", jsonResponse, mockRequest, mockResponse + ); + + assertEquals(ErrorType.INVALID_REQUEST, exception.getErrorType()); + assertTrue(exception.getErrorType().isKnown()); + assertEquals("invalid_request", exception.getType()); + } + + @Test + @DisplayName("Should handle unknown error type gracefully") + void shouldHandleUnknownErrorTypeGracefully() { + String jsonResponse = "{\"type\":\"future_error_type\",\"message\":\"Some future error\"}"; + Request mockRequest = createMockRequest(); + Response mockResponse = createMockResponse(400, jsonResponse); + + APIException exception = new APIException( + 400, "future_error_type", null, "Some future error", jsonResponse, mockRequest, mockResponse + ); + + assertEquals(ErrorType._UNKNOWN, exception.getErrorType()); + assertFalse(exception.getErrorType().isKnown()); + assertEquals("future_error_type", exception.getType()); // Raw value still accessible + } + + @Test + @DisplayName("Should extract error_cause_id from response") + void shouldExtractErrorCauseIdFromResponse() { + String jsonResponse = "{\"type\":\"payment\",\"api_error_code\":\"payment_processing_failed\",\"message\":\"Payment failed\",\"error_cause_id\":\"card_declined_do_not_honor\"}"; + Request mockRequest = createMockRequest(); + Response mockResponse = createMockResponse(402, jsonResponse); + + APIException exception = new PaymentException( + 402, "payment", BadRequestApiErrorCode.PAYMENT_PROCESSING_FAILED, "Payment failed", jsonResponse, mockRequest, mockResponse + ); + + assertEquals("card_declined_do_not_honor", exception.getErrorCauseId()); + } + + @Test + @DisplayName("Should handle unknown api_error_code with _UNKNOWN enum") + void shouldHandleUnknownApiErrorCodeWithUnknownEnum() { + String jsonResponse = "{\"type\":\"invalid_request\",\"api_error_code\":\"some_future_error_code\",\"message\":\"Unknown error\"}"; + Request mockRequest = createMockRequest(); + Response mockResponse = createMockResponse(400, jsonResponse); + + // Simulate parsing an unknown error code + ApiErrorCode errorCode = BadRequestApiErrorCode.fromString("some_future_error_code"); + + APIException exception = new APIException( + 400, "invalid_request", errorCode, "Unknown error", jsonResponse, mockRequest, mockResponse + ); + + assertEquals(BadRequestApiErrorCode._UNKNOWN, exception.getApiErrorCode()); + assertFalse(((BadRequestApiErrorCode) exception.getApiErrorCode()).isKnown()); + assertNull(exception.getApiErrorCodeRaw()); // _UNKNOWN has null value + } + + @Test + @DisplayName("Should be retryable for 429 status code") + void shouldBeRetryableFor429() { + String jsonResponse = "{\"type\":\"invalid_request\",\"message\":\"Rate limit exceeded\"}"; + Request mockRequest = createMockRequest(); + Response mockResponse = createMockResponse(429, jsonResponse); + + APIException exception = new APIException( + 429, "invalid_request", null, "Rate limit exceeded", jsonResponse, mockRequest, mockResponse + ); + + assertTrue(exception.isRetryable()); + } + + @Test + @DisplayName("Should be retryable for 5xx status codes except 501") + void shouldBeRetryableFor5xxExcept501() { + String jsonResponse = "{\"type\":\"operation_failed\",\"message\":\"Server error\"}"; + Request mockRequest = createMockRequest(); + + // 500 should be retryable + APIException exception500 = new APIException( + 500, "operation_failed", null, "Server error", jsonResponse, mockRequest, createMockResponse(500, jsonResponse) + ); + assertTrue(exception500.isRetryable()); + + // 502 should be retryable + APIException exception502 = new APIException( + 502, "operation_failed", null, "Bad gateway", jsonResponse, mockRequest, createMockResponse(502, jsonResponse) + ); + assertTrue(exception502.isRetryable()); + + // 503 should be retryable + APIException exception503 = new APIException( + 503, "operation_failed", null, "Service unavailable", jsonResponse, mockRequest, createMockResponse(503, jsonResponse) + ); + assertTrue(exception503.isRetryable()); + + // 501 should NOT be retryable + APIException exception501 = new APIException( + 501, "operation_failed", null, "Not implemented", jsonResponse, mockRequest, createMockResponse(501, jsonResponse) + ); + assertFalse(exception501.isRetryable()); + } + + @Test + @DisplayName("Should NOT be retryable for 4xx status codes except 429") + void shouldNotBeRetryableFor4xxExcept429() { + String jsonResponse = "{\"type\":\"invalid_request\",\"message\":\"Bad request\"}"; + Request mockRequest = createMockRequest(); + + // 400 should NOT be retryable + APIException exception400 = new APIException( + 400, "invalid_request", null, "Bad request", jsonResponse, mockRequest, createMockResponse(400, jsonResponse) + ); + assertFalse(exception400.isRetryable()); + + // 401 should NOT be retryable + APIException exception401 = new APIException( + 401, "invalid_request", null, "Unauthorized", jsonResponse, mockRequest, createMockResponse(401, jsonResponse) + ); + assertFalse(exception401.isRetryable()); + + // 404 should NOT be retryable + APIException exception404 = new APIException( + 404, "invalid_request", null, "Not found", jsonResponse, mockRequest, createMockResponse(404, jsonResponse) + ); + assertFalse(exception404.isRetryable()); + } + + @Test + @DisplayName("Should inherit getUrl from HttpException") + void shouldInheritGetUrl() { + String jsonResponse = "{\"type\":\"invalid_request\",\"message\":\"Error\"}"; + Request mockRequest = createMockRequest(); + Response mockResponse = createMockResponse(400, jsonResponse); + + APIException exception = new APIException( + 400, "invalid_request", null, "Error", jsonResponse, mockRequest, mockResponse + ); + + assertEquals("https://test-site.chargebee.com/api/v2/customers", exception.getUrl()); + } + + @Test + @DisplayName("Should inherit getHttpMethod from HttpException") + void shouldInheritGetHttpMethod() { + String jsonResponse = "{\"type\":\"invalid_request\",\"message\":\"Error\"}"; + Request mockRequest = createMockRequest(); + Response mockResponse = createMockResponse(400, jsonResponse); + + APIException exception = new APIException( + 400, "invalid_request", null, "Error", jsonResponse, mockRequest, mockResponse + ); + + assertEquals("POST", exception.getHttpMethod()); + } + + private Request createMockRequest() { + return Request.builder() + .method("POST") + .url("https://test-site.chargebee.com/api/v2/customers") + .header("Authorization", "Basic dGVzdF9hcGlfa2V5Og==") + .build(); + } + private Response createMockResponse(int statusCode, String body) { Map> headers = new HashMap<>(); return new Response(statusCode, headers, body.getBytes()); diff --git a/src/test/java/com/chargebee/v4/exceptions/ClientErrorExceptionTest.java b/src/test/java/com/chargebee/v4/exceptions/ClientErrorExceptionTest.java new file mode 100644 index 00000000..cece1b84 --- /dev/null +++ b/src/test/java/com/chargebee/v4/exceptions/ClientErrorExceptionTest.java @@ -0,0 +1,254 @@ +package com.chargebee.v4.exceptions; + +import com.chargebee.v4.transport.Request; +import com.chargebee.v4.transport.Response; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.*; + +@DisplayName("ClientErrorException Tests") +class ClientErrorExceptionTest { + + private static final String TEST_URL = "https://test-site.chargebee.com/api/v2/customers"; + + @Nested + @DisplayName("Status Code Helper Tests") + class StatusCodeHelperTests { + + @Test + @DisplayName("should identify 400 as bad request") + void shouldIdentify400AsBadRequest() { + ClientErrorException exception = createException(400); + assertTrue(exception.isBadRequest()); + } + + @Test + @DisplayName("should identify 401 as unauthorized") + void shouldIdentify401AsUnauthorized() { + ClientErrorException exception = createException(401); + assertTrue(exception.isUnauthorized()); + } + + @Test + @DisplayName("should identify 403 as forbidden") + void shouldIdentify403AsForbidden() { + ClientErrorException exception = createException(403); + assertTrue(exception.isForbidden()); + } + + @Test + @DisplayName("should identify 404 as not found") + void shouldIdentify404AsNotFound() { + ClientErrorException exception = createException(404); + assertTrue(exception.isNotFound()); + } + + @Test + @DisplayName("should identify 405 as method not allowed") + void shouldIdentify405AsMethodNotAllowed() { + ClientErrorException exception = createException(405); + assertTrue(exception.isMethodNotAllowed()); + } + + @Test + @DisplayName("should identify 409 as conflict") + void shouldIdentify409AsConflict() { + ClientErrorException exception = createException(409); + assertTrue(exception.isConflict()); + } + + @Test + @DisplayName("should identify 422 as unprocessable entity") + void shouldIdentify422AsUnprocessableEntity() { + ClientErrorException exception = createException(422); + assertTrue(exception.isUnprocessableEntity()); + } + + @Test + @DisplayName("should identify 429 as too many requests") + void shouldIdentify429AsTooManyRequests() { + ClientErrorException exception = createException(429); + assertTrue(exception.isTooManyRequests()); + } + + @Test + @DisplayName("TOO_MANY_REQUESTS constant should be 429") + void tooManyRequestsConstantShouldBe429() { + assertEquals(429, ClientErrorException.TOO_MANY_REQUESTS); + } + } + + @Nested + @DisplayName("isRetryable Tests") + class IsRetryableTests { + + @Test + @DisplayName("429 Too Many Requests should be retryable") + void shouldBeRetryableFor429() { + ClientErrorException exception = createException(429); + assertTrue(exception.isRetryable()); + } + + @ParameterizedTest + @ValueSource(ints = {400, 401, 403, 404, 405, 409, 422}) + @DisplayName("other client errors should not be retryable") + void shouldNotBeRetryableForOtherErrors(int statusCode) { + ClientErrorException exception = createException(statusCode); + assertFalse(exception.isRetryable()); + } + } + + @Nested + @DisplayName("Retry-After Header Tests") + class RetryAfterHeaderTests { + + @Test + @DisplayName("should parse Retry-After header in seconds") + void shouldParseRetryAfterInSeconds() { + Map> headers = new HashMap<>(); + headers.put("Retry-After", Arrays.asList("30")); + Response response = new Response(429, headers, "".getBytes()); + Request request = createRequest(); + + ClientErrorException exception = new ClientErrorException(429, "Too Many Requests", request, response); + + assertEquals(30000L, exception.getRetryAfterMs()); + } + + @Test + @DisplayName("should return -1 when Retry-After header is missing") + void shouldReturnNegativeOneWhenHeaderMissing() { + ClientErrorException exception = createException(429); + assertEquals(-1L, exception.getRetryAfterMs()); + } + + @Test + @DisplayName("should return -1 when response is null") + void shouldReturnNegativeOneWhenResponseNull() { + Request request = createRequest(); + ClientErrorException exception = new ClientErrorException(429, "Too Many Requests", request, null); + + assertEquals(-1L, exception.getRetryAfterMs()); + } + + @Test + @DisplayName("should return -1 for non-numeric Retry-After value") + void shouldReturnNegativeOneForNonNumericValue() { + Map> headers = new HashMap<>(); + headers.put("Retry-After", Arrays.asList("Wed, 21 Oct 2024 07:28:00 GMT")); + Response response = new Response(429, headers, "".getBytes()); + Request request = createRequest(); + + ClientErrorException exception = new ClientErrorException(429, "Too Many Requests", request, response); + + assertEquals(-1L, exception.getRetryAfterMs()); + } + + @Test + @DisplayName("should handle whitespace in Retry-After value") + void shouldHandleWhitespaceInRetryAfterValue() { + Map> headers = new HashMap<>(); + headers.put("Retry-After", Arrays.asList(" 60 ")); + Response response = new Response(429, headers, "".getBytes()); + Request request = createRequest(); + + ClientErrorException exception = new ClientErrorException(429, "Too Many Requests", request, response); + + assertEquals(60000L, exception.getRetryAfterMs()); + } + } + + @Nested + @DisplayName("Exception Hierarchy Tests") + class ExceptionHierarchyTests { + + @Test + @DisplayName("should be instance of HttpException") + void shouldBeInstanceOfHttpException() { + ClientErrorException exception = createException(400); + assertTrue(exception instanceof HttpException); + } + + @Test + @DisplayName("should be instance of TransportException") + void shouldBeInstanceOfTransportException() { + ClientErrorException exception = createException(400); + assertTrue(exception instanceof TransportException); + } + + @Test + @DisplayName("should be catchable as HttpException") + void shouldBeCatchableAsHttpException() { + try { + throw createException(404); + } catch (HttpException e) { + assertTrue(e instanceof ClientErrorException); + assertEquals(404, e.getStatusCode()); + } + } + } + + @Nested + @DisplayName("Inherited Methods Tests") + class InheritedMethodsTests { + + @Test + @DisplayName("should inherit isClientError returning true") + void shouldInheritIsClientError() { + ClientErrorException exception = createException(400); + assertTrue(exception.isClientError()); + } + + @Test + @DisplayName("should inherit isServerError returning false") + void shouldInheritIsServerError() { + ClientErrorException exception = createException(400); + assertFalse(exception.isServerError()); + } + + @Test + @DisplayName("should inherit getUrl") + void shouldInheritGetUrl() { + ClientErrorException exception = createException(400); + assertEquals(TEST_URL, exception.getUrl()); + } + + @Test + @DisplayName("should inherit getResponseBody") + void shouldInheritGetResponseBody() { + Response response = createResponse(400, "{\"error\":\"bad request\"}"); + Request request = createRequest(); + ClientErrorException exception = new ClientErrorException(400, "Bad Request", request, response); + + assertEquals("{\"error\":\"bad request\"}", exception.getResponseBody()); + } + } + + private ClientErrorException createException(int statusCode) { + Request request = createRequest(); + Response response = createResponse(statusCode, "{}"); + return new ClientErrorException(statusCode, "Error " + statusCode, request, response); + } + + private Request createRequest() { + return Request.builder() + .method("GET") + .url(TEST_URL) + .build(); + } + + private Response createResponse(int statusCode, String body) { + Map> headers = new HashMap<>(); + return new Response(statusCode, headers, body.getBytes()); + } +} + diff --git a/src/test/java/com/chargebee/v4/exceptions/ConfigurationExceptionTest.java b/src/test/java/com/chargebee/v4/exceptions/ConfigurationExceptionTest.java new file mode 100644 index 00000000..94f41fca --- /dev/null +++ b/src/test/java/com/chargebee/v4/exceptions/ConfigurationExceptionTest.java @@ -0,0 +1,170 @@ +package com.chargebee.v4.exceptions; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +@DisplayName("ConfigurationException Tests") +class ConfigurationExceptionTest { + + @Nested + @DisplayName("Constructor Tests") + class ConstructorTests { + + @Test + @DisplayName("should create exception with message only") + void shouldCreateWithMessageOnly() { + ConfigurationException exception = new ConfigurationException("Missing API key"); + + assertEquals("Missing API key", exception.getMessage()); + assertNull(exception.getCause()); + } + + @Test + @DisplayName("should create exception with message and cause") + void shouldCreateWithMessageAndCause() { + IllegalArgumentException cause = new IllegalArgumentException("Invalid format"); + ConfigurationException exception = new ConfigurationException("Invalid URL format", cause); + + assertEquals("Invalid URL format", exception.getMessage()); + assertEquals(cause, exception.getCause()); + } + } + + @Nested + @DisplayName("isRetryable Tests") + class IsRetryableTests { + + @Test + @DisplayName("should never be retryable") + void shouldNeverBeRetryable() { + ConfigurationException exception = new ConfigurationException("Config error"); + assertFalse(exception.isRetryable()); + } + + @Test + @DisplayName("should never be retryable even with cause") + void shouldNeverBeRetryableEvenWithCause() { + ConfigurationException exception = new ConfigurationException( + "Config error", + new RuntimeException("cause") + ); + assertFalse(exception.isRetryable()); + } + } + + @Nested + @DisplayName("toString Tests") + class ToStringTests { + + @Test + @DisplayName("should include class name in toString") + void shouldIncludeClassNameInToString() { + ConfigurationException exception = new ConfigurationException("Error"); + + String toString = exception.toString(); + + assertTrue(toString.contains("ConfigurationException")); + } + + @Test + @DisplayName("should include message in toString") + void shouldIncludeMessageInToString() { + ConfigurationException exception = new ConfigurationException("API key is required"); + + String toString = exception.toString(); + + assertTrue(toString.contains("API key is required")); + } + + @Test + @DisplayName("should include cause in toString when present") + void shouldIncludeCauseInToString() { + IllegalArgumentException cause = new IllegalArgumentException("bad value"); + ConfigurationException exception = new ConfigurationException("Config error", cause); + + String toString = exception.toString(); + + assertTrue(toString.contains("cause=IllegalArgumentException")); + assertTrue(toString.contains("bad value")); + } + + @Test + @DisplayName("should handle cause with null message") + void shouldHandleCauseWithNullMessage() { + RuntimeException cause = new RuntimeException(); + ConfigurationException exception = new ConfigurationException("Config error", cause); + + String toString = exception.toString(); + + assertTrue(toString.contains("cause=RuntimeException")); + // Should not contain "null" from the cause message + } + } + + @Nested + @DisplayName("Exception Hierarchy Tests") + class ExceptionHierarchyTests { + + @Test + @DisplayName("should be instance of RuntimeException") + void shouldBeInstanceOfRuntimeException() { + ConfigurationException exception = new ConfigurationException("Error"); + assertTrue(exception instanceof RuntimeException); + } + + @Test + @DisplayName("should be unchecked exception") + void shouldBeUncheckedException() { + // This compiles without try-catch because it's a RuntimeException + ConfigurationException exception = new ConfigurationException("Error"); + assertNotNull(exception); + } + + @Test + @DisplayName("should NOT be instance of Exception subclass TransportException") + void shouldNotBeInstanceOfTransportException() { + ConfigurationException exception = new ConfigurationException("Error"); + // ConfigurationException is RuntimeException, not TransportException (which is checked Exception) + assertFalse(TransportException.class.isAssignableFrom(ConfigurationException.class)); + } + } + + @Nested + @DisplayName("Usage Pattern Tests") + class UsagePatternTests { + + @Test + @DisplayName("should be throwable without checked exception handling") + void shouldBeThrowableWithoutCheckedExceptionHandling() { + // This test validates that ConfigurationException is a RuntimeException + // and can be thrown without requiring a throws clause + assertThrows(ConfigurationException.class, () -> { + throw new ConfigurationException("Missing required config"); + }); + } + + @Test + @DisplayName("should be catchable as RuntimeException") + void shouldBeCatchableAsRuntimeException() { + try { + throw new ConfigurationException("Error"); + } catch (RuntimeException e) { + assertTrue(e instanceof ConfigurationException); + } + } + + @Test + @DisplayName("common configuration errors should have descriptive messages") + void commonConfigurationErrorsShouldHaveDescriptiveMessages() { + ConfigurationException apiKeyError = new ConfigurationException("API key is required"); + ConfigurationException urlError = new ConfigurationException("Invalid URL: not-a-url"); + + assertTrue(apiKeyError.getMessage().contains("API key")); + assertTrue(urlError.getMessage().contains("Invalid URL")); + } + } +} + diff --git a/src/test/java/com/chargebee/v4/exceptions/HttpExceptionTest.java b/src/test/java/com/chargebee/v4/exceptions/HttpExceptionTest.java new file mode 100644 index 00000000..b111b794 --- /dev/null +++ b/src/test/java/com/chargebee/v4/exceptions/HttpExceptionTest.java @@ -0,0 +1,234 @@ +package com.chargebee.v4.exceptions; + +import com.chargebee.v4.transport.Request; +import com.chargebee.v4.transport.Response; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.*; + +@DisplayName("HttpException Tests") +class HttpExceptionTest { + + private static final String TEST_URL = "https://test-site.chargebee.com/api/v2/customers"; + + @Nested + @DisplayName("Constructor Tests") + class ConstructorTests { + + @Test + @DisplayName("should create exception with all parameters") + void shouldCreateWithAllParameters() { + Request request = createRequest("GET", TEST_URL); + Response response = createResponse(404, "{\"error\":\"not found\"}"); + + HttpException exception = new HttpException(404, "Not Found", request, response); + + assertEquals(404, exception.getStatusCode()); + assertEquals("Not Found", exception.getMessage()); + assertNotNull(exception.getRequest()); + assertNotNull(exception.getResponse()); + } + + @Test + @DisplayName("should create exception with cause") + void shouldCreateWithCause() { + Request request = createRequest("POST", TEST_URL); + Response response = createResponse(500, "{\"error\":\"server error\"}"); + Exception cause = new RuntimeException("parsing error"); + + HttpException exception = new HttpException(500, "Server Error", request, response, cause); + + assertEquals(500, exception.getStatusCode()); + assertEquals(cause, exception.getCause()); + } + } + + @Nested + @DisplayName("Status Code Helpers Tests") + class StatusCodeHelperTests { + + @Test + @DisplayName("should identify client error (4xx)") + void shouldIdentifyClientError() { + HttpException exception = createException(400); + assertTrue(exception.isClientError()); + assertFalse(exception.isServerError()); + } + + @Test + @DisplayName("should identify server error (5xx)") + void shouldIdentifyServerError() { + HttpException exception = createException(503); + assertFalse(exception.isClientError()); + assertTrue(exception.isServerError()); + } + + @Test + @DisplayName("should identify 401 as client error") + void shouldIdentify401AsClientError() { + HttpException exception = createException(401); + assertTrue(exception.isClientError()); + } + + @Test + @DisplayName("should identify 499 as client error") + void shouldIdentify499AsClientError() { + HttpException exception = createException(499); + assertTrue(exception.isClientError()); + } + + @Test + @DisplayName("should identify 500 as server error") + void shouldIdentify500AsServerError() { + HttpException exception = createException(500); + assertTrue(exception.isServerError()); + } + + @Test + @DisplayName("should identify 599 as server error") + void shouldIdentify599AsServerError() { + HttpException exception = createException(599); + assertTrue(exception.isServerError()); + } + + @Test + @DisplayName("should not identify 200 as error") + void shouldNotIdentify200AsError() { + HttpException exception = createException(200); + assertFalse(exception.isClientError()); + assertFalse(exception.isServerError()); + } + } + + @Nested + @DisplayName("Response Body Tests") + class ResponseBodyTests { + + @Test + @DisplayName("should return response body as string") + void shouldReturnResponseBodyAsString() { + Response response = createResponse(400, "{\"error\":\"bad request\"}"); + HttpException exception = new HttpException(400, "Bad Request", createRequest("GET", TEST_URL), response); + + assertEquals("{\"error\":\"bad request\"}", exception.getResponseBody()); + } + + @Test + @DisplayName("should return null when response is null") + void shouldReturnNullWhenResponseIsNull() { + HttpException exception = new HttpException(500, "Error", createRequest("GET", TEST_URL), null); + + assertNull(exception.getResponseBody()); + } + } + + @Nested + @DisplayName("Request Context Tests") + class RequestContextTests { + + @Test + @DisplayName("should return URL from request") + void shouldReturnUrlFromRequest() { + Request request = createRequest("GET", TEST_URL); + HttpException exception = new HttpException(404, "Not Found", request, createResponse(404, "")); + + assertEquals(TEST_URL, exception.getUrl()); + } + + @Test + @DisplayName("should return HTTP method from request") + void shouldReturnHttpMethodFromRequest() { + Request request = createRequest("DELETE", TEST_URL); + HttpException exception = new HttpException(404, "Not Found", request, createResponse(404, "")); + + assertEquals("DELETE", exception.getHttpMethod()); + } + } + + @Nested + @DisplayName("isRetryable Tests") + class IsRetryableTests { + + @Test + @DisplayName("base HttpException should not be retryable") + void shouldNotBeRetryableByDefault() { + HttpException exception = createException(500); + assertFalse(exception.isRetryable()); + } + } + + @Nested + @DisplayName("toString Tests") + class ToStringTests { + + @Test + @DisplayName("should include status code in toString") + void shouldIncludeStatusCodeInToString() { + HttpException exception = createException(404); + + String toString = exception.toString(); + + assertTrue(toString.contains("statusCode=404")); + } + + @Test + @DisplayName("should include message in toString") + void shouldIncludeMessageInToString() { + Request request = createRequest("GET", TEST_URL); + Response response = createResponse(404, ""); + HttpException exception = new HttpException(404, "Resource not found", request, response); + + String toString = exception.toString(); + + assertTrue(toString.contains("Resource not found")); + } + + @Test + @DisplayName("should include URL in toString") + void shouldIncludeUrlInToString() { + HttpException exception = createException(500); + + String toString = exception.toString(); + + assertTrue(toString.contains(TEST_URL)); + } + } + + @Nested + @DisplayName("Exception Hierarchy Tests") + class ExceptionHierarchyTests { + + @Test + @DisplayName("should be instance of TransportException") + void shouldBeInstanceOfTransportException() { + HttpException exception = createException(400); + assertTrue(exception instanceof TransportException); + } + } + + private HttpException createException(int statusCode) { + Request request = createRequest("GET", TEST_URL); + Response response = createResponse(statusCode, "{\"status\":" + statusCode + "}"); + return new HttpException(statusCode, "Error " + statusCode, request, response); + } + + private Request createRequest(String method, String url) { + return Request.builder() + .method(method) + .url(url) + .build(); + } + + private Response createResponse(int statusCode, String body) { + Map> headers = new HashMap<>(); + return new Response(statusCode, headers, body.getBytes()); + } +} + diff --git a/src/test/java/com/chargebee/v4/exceptions/NetworkExceptionTest.java b/src/test/java/com/chargebee/v4/exceptions/NetworkExceptionTest.java new file mode 100644 index 00000000..3e5908d9 --- /dev/null +++ b/src/test/java/com/chargebee/v4/exceptions/NetworkExceptionTest.java @@ -0,0 +1,162 @@ +package com.chargebee.v4.exceptions; + +import com.chargebee.v4.transport.Request; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.net.UnknownHostException; + +import static org.junit.jupiter.api.Assertions.*; + +@DisplayName("NetworkException Tests") +class NetworkExceptionTest { + + private static final String TEST_URL = "https://test-site.chargebee.com/api/v2/customers"; + + @Nested + @DisplayName("Constructor Tests") + class ConstructorTests { + + @Test + @DisplayName("should create exception with message and cause only") + void shouldCreateWithMessageAndCauseOnly() { + IOException cause = new IOException("Connection refused"); + NetworkException exception = new NetworkException("Network error", cause); + + assertEquals("Network error", exception.getMessage()); + assertEquals(cause, exception.getCause()); + assertNull(exception.getRequest()); + assertNull(exception.getUrl()); + } + + @Test + @DisplayName("should create exception with full context") + void shouldCreateWithFullContext() { + UnknownHostException cause = new UnknownHostException("unknown-host.com"); + Request request = createRequest("GET", TEST_URL); + + NetworkException exception = new NetworkException("DNS lookup failed", cause, request); + + assertEquals("DNS lookup failed", exception.getMessage()); + assertEquals(cause, exception.getCause()); + assertNotNull(exception.getRequest()); + assertEquals(TEST_URL, exception.getUrl()); + assertEquals("GET", exception.getHttpMethod()); + } + } + + @Nested + @DisplayName("isRetryable Tests") + class IsRetryableTests { + + @Test + @DisplayName("should always be retryable") + void shouldAlwaysBeRetryable() { + NetworkException exception = new NetworkException("Network error", new IOException()); + assertTrue(exception.isRetryable()); + } + + @Test + @DisplayName("should be retryable even with UnknownHostException") + void shouldBeRetryableEvenWithUnknownHostException() { + NetworkException exception = new NetworkException( + "DNS failed", + new UnknownHostException("host.example.com") + ); + assertTrue(exception.isRetryable()); + } + } + + @Nested + @DisplayName("Inherited Methods Tests") + class InheritedMethodsTests { + + @Test + @DisplayName("should inherit getUrl from TransportException") + void shouldInheritGetUrl() { + Request request = createRequest("POST", TEST_URL); + NetworkException exception = new NetworkException("Error", new IOException(), request); + + assertEquals(TEST_URL, exception.getUrl()); + } + + @Test + @DisplayName("should inherit getHttpMethod from TransportException") + void shouldInheritGetHttpMethod() { + Request request = createRequest("DELETE", TEST_URL); + NetworkException exception = new NetworkException("Error", new IOException(), request); + + assertEquals("DELETE", exception.getHttpMethod()); + } + + @Test + @DisplayName("should inherit getRequest from TransportException") + void shouldInheritGetRequest() { + Request request = createRequest("GET", TEST_URL); + NetworkException exception = new NetworkException("Error", new IOException(), request); + + assertSame(request, exception.getRequest()); + } + } + + @Nested + @DisplayName("toString Tests") + class ToStringTests { + + @Test + @DisplayName("should include NetworkException in toString") + void shouldIncludeClassNameInToString() { + NetworkException exception = new NetworkException("Connection refused", new IOException()); + + String toString = exception.toString(); + + assertTrue(toString.contains("NetworkException")); + } + + @Test + @DisplayName("should include request context in toString") + void shouldIncludeRequestContextInToString() { + Request request = createRequest("GET", TEST_URL); + NetworkException exception = new NetworkException("Error", new IOException("timeout"), request); + + String toString = exception.toString(); + + assertTrue(toString.contains("method='GET'")); + assertTrue(toString.contains(TEST_URL)); + assertTrue(toString.contains("IOException")); + } + } + + @Nested + @DisplayName("Exception Hierarchy Tests") + class ExceptionHierarchyTests { + + @Test + @DisplayName("should be instance of TransportException") + void shouldBeInstanceOfTransportException() { + NetworkException exception = new NetworkException("Error", new IOException()); + assertTrue(exception instanceof TransportException); + } + + @Test + @DisplayName("should be catchable as TransportException") + void shouldBeCatchableAsTransportException() { + try { + throw new NetworkException("Network error", new IOException()); + } catch (TransportException e) { + assertTrue(e instanceof NetworkException); + assertTrue(e.isRetryable()); + } + } + } + + private Request createRequest(String method, String url) { + return Request.builder() + .method(method) + .url(url) + .build(); + } +} + diff --git a/src/test/java/com/chargebee/v4/exceptions/ServerErrorExceptionTest.java b/src/test/java/com/chargebee/v4/exceptions/ServerErrorExceptionTest.java new file mode 100644 index 00000000..ba6b3a87 --- /dev/null +++ b/src/test/java/com/chargebee/v4/exceptions/ServerErrorExceptionTest.java @@ -0,0 +1,225 @@ +package com.chargebee.v4.exceptions; + +import com.chargebee.v4.transport.Request; +import com.chargebee.v4.transport.Response; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.*; + +@DisplayName("ServerErrorException Tests") +class ServerErrorExceptionTest { + + private static final String TEST_URL = "https://test-site.chargebee.com/api/v2/customers"; + + @Nested + @DisplayName("Status Code Helper Tests") + class StatusCodeHelperTests { + + @Test + @DisplayName("should identify 500 as internal server error") + void shouldIdentify500AsInternalServerError() { + ServerErrorException exception = createException(500); + assertTrue(exception.isInternalServerError()); + } + + @Test + @DisplayName("should identify 501 as not implemented") + void shouldIdentify501AsNotImplemented() { + ServerErrorException exception = createException(501); + assertTrue(exception.isNotImplemented()); + } + + @Test + @DisplayName("should identify 502 as bad gateway") + void shouldIdentify502AsBadGateway() { + ServerErrorException exception = createException(502); + assertTrue(exception.isBadGateway()); + } + + @Test + @DisplayName("should identify 503 as service unavailable") + void shouldIdentify503AsServiceUnavailable() { + ServerErrorException exception = createException(503); + assertTrue(exception.isServiceUnavailable()); + } + + @Test + @DisplayName("should identify 504 as gateway timeout") + void shouldIdentify504AsGatewayTimeout() { + ServerErrorException exception = createException(504); + assertTrue(exception.isGatewayTimeout()); + } + + @Test + @DisplayName("should not identify 500 as bad gateway") + void shouldNotIdentify500AsBadGateway() { + ServerErrorException exception = createException(500); + assertFalse(exception.isBadGateway()); + } + } + + @Nested + @DisplayName("isRetryable Tests") + class IsRetryableTests { + + @ParameterizedTest + @ValueSource(ints = {500, 502, 503, 504}) + @DisplayName("should be retryable for most 5xx errors") + void shouldBeRetryableForMost5xx(int statusCode) { + ServerErrorException exception = createException(statusCode); + assertTrue(exception.isRetryable(), "Status " + statusCode + " should be retryable"); + } + + @Test + @DisplayName("501 Not Implemented should NOT be retryable") + void shouldNotBeRetryableFor501() { + ServerErrorException exception = createException(501); + assertFalse(exception.isRetryable()); + } + + @ParameterizedTest + @ValueSource(ints = {505, 506, 507, 508, 510, 511}) + @DisplayName("should be retryable for other 5xx errors") + void shouldBeRetryableForOther5xx(int statusCode) { + ServerErrorException exception = createException(statusCode); + assertTrue(exception.isRetryable()); + } + } + + @Nested + @DisplayName("Exception Hierarchy Tests") + class ExceptionHierarchyTests { + + @Test + @DisplayName("should be instance of HttpException") + void shouldBeInstanceOfHttpException() { + ServerErrorException exception = createException(500); + assertTrue(exception instanceof HttpException); + } + + @Test + @DisplayName("should be instance of TransportException") + void shouldBeInstanceOfTransportException() { + ServerErrorException exception = createException(500); + assertTrue(exception instanceof TransportException); + } + + @Test + @DisplayName("should be catchable as HttpException") + void shouldBeCatchableAsHttpException() { + try { + throw createException(503); + } catch (HttpException e) { + assertTrue(e instanceof ServerErrorException); + assertEquals(503, e.getStatusCode()); + } + } + + @Test + @DisplayName("should be catchable as TransportException with isRetryable") + void shouldBeCatchableAsTransportExceptionWithIsRetryable() { + try { + throw createException(502); + } catch (TransportException e) { + assertTrue(e.isRetryable()); + } + } + } + + @Nested + @DisplayName("Inherited Methods Tests") + class InheritedMethodsTests { + + @Test + @DisplayName("should inherit isServerError returning true") + void shouldInheritIsServerError() { + ServerErrorException exception = createException(500); + assertTrue(exception.isServerError()); + } + + @Test + @DisplayName("should inherit isClientError returning false") + void shouldInheritIsClientError() { + ServerErrorException exception = createException(500); + assertFalse(exception.isClientError()); + } + + @Test + @DisplayName("should inherit getUrl") + void shouldInheritGetUrl() { + ServerErrorException exception = createException(500); + assertEquals(TEST_URL, exception.getUrl()); + } + + @Test + @DisplayName("should inherit getHttpMethod") + void shouldInheritGetHttpMethod() { + Request request = Request.builder() + .method("POST") + .url(TEST_URL) + .build(); + Response response = createResponse(500, "{}"); + ServerErrorException exception = new ServerErrorException(500, "Error", request, response); + + assertEquals("POST", exception.getHttpMethod()); + } + } + + @Nested + @DisplayName("Constructor Tests") + class ConstructorTests { + + @Test + @DisplayName("should create exception with all parameters") + void shouldCreateWithAllParameters() { + Request request = createRequest(); + Response response = createResponse(500, "{\"error\":\"internal error\"}"); + + ServerErrorException exception = new ServerErrorException(500, "Internal Server Error", request, response); + + assertEquals(500, exception.getStatusCode()); + assertEquals("Internal Server Error", exception.getMessage()); + assertNotNull(exception.getRequest()); + assertNotNull(exception.getResponse()); + } + + @Test + @DisplayName("should create exception with cause") + void shouldCreateWithCause() { + Request request = createRequest(); + Response response = createResponse(500, "{}"); + Exception cause = new RuntimeException("database error"); + + ServerErrorException exception = new ServerErrorException(500, "Error", request, response, cause); + + assertEquals(cause, exception.getCause()); + } + } + + private ServerErrorException createException(int statusCode) { + Request request = createRequest(); + Response response = createResponse(statusCode, "{}"); + return new ServerErrorException(statusCode, "Error " + statusCode, request, response); + } + + private Request createRequest() { + return Request.builder() + .method("GET") + .url(TEST_URL) + .build(); + } + + private Response createResponse(int statusCode, String body) { + Map> headers = new HashMap<>(); + return new Response(statusCode, headers, body.getBytes()); + } +} + diff --git a/src/test/java/com/chargebee/v4/exceptions/TimeoutExceptionTest.java b/src/test/java/com/chargebee/v4/exceptions/TimeoutExceptionTest.java new file mode 100644 index 00000000..5badead7 --- /dev/null +++ b/src/test/java/com/chargebee/v4/exceptions/TimeoutExceptionTest.java @@ -0,0 +1,262 @@ +package com.chargebee.v4.exceptions; + +import com.chargebee.v4.transport.Request; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import java.net.SocketTimeoutException; + +import static org.junit.jupiter.api.Assertions.*; + +@DisplayName("TimeoutException Tests") +class TimeoutExceptionTest { + + private static final String TEST_URL = "https://test-site.chargebee.com/api/v2/customers"; + + @Nested + @DisplayName("Constructor Tests") + class ConstructorTests { + + @Test + @DisplayName("should create connect timeout exception") + void shouldCreateConnectTimeoutException() { + SocketTimeoutException cause = new SocketTimeoutException("connect timed out"); + + TimeoutException exception = new TimeoutException( + TimeoutException.CONNECT, + "Connection timeout", + cause + ); + + assertEquals("connect", exception.getTimeoutType()); + assertEquals("Connection timeout", exception.getMessage()); + assertEquals(cause, exception.getCause()); + assertNull(exception.getRequest()); + } + + @Test + @DisplayName("should create read timeout exception") + void shouldCreateReadTimeoutException() { + SocketTimeoutException cause = new SocketTimeoutException("Read timed out"); + + TimeoutException exception = new TimeoutException( + TimeoutException.READ, + "Read timeout", + cause + ); + + assertEquals("read", exception.getTimeoutType()); + assertEquals("Read timeout", exception.getMessage()); + } + + @Test + @DisplayName("should create timeout exception with full context") + void shouldCreateWithFullContext() { + SocketTimeoutException cause = new SocketTimeoutException("connect timed out"); + Request request = createRequest("POST", TEST_URL); + + TimeoutException exception = new TimeoutException( + TimeoutException.CONNECT, + "Connection timeout", + cause, + request + ); + + assertEquals("connect", exception.getTimeoutType()); + assertNotNull(exception.getRequest()); + assertEquals(TEST_URL, exception.getUrl()); + assertEquals("POST", exception.getHttpMethod()); + } + } + + @Nested + @DisplayName("Timeout Type Tests") + class TimeoutTypeTests { + + @Test + @DisplayName("should identify connect timeout") + void shouldIdentifyConnectTimeout() { + TimeoutException exception = new TimeoutException( + TimeoutException.CONNECT, + "Timeout", + new SocketTimeoutException() + ); + + assertTrue(exception.isConnectTimeout()); + assertFalse(exception.isReadTimeout()); + } + + @Test + @DisplayName("should identify read timeout") + void shouldIdentifyReadTimeout() { + TimeoutException exception = new TimeoutException( + TimeoutException.READ, + "Timeout", + new SocketTimeoutException() + ); + + assertFalse(exception.isConnectTimeout()); + assertTrue(exception.isReadTimeout()); + } + + @Test + @DisplayName("should handle custom timeout type") + void shouldHandleCustomTimeoutType() { + TimeoutException exception = new TimeoutException( + "custom", + "Custom timeout", + new SocketTimeoutException() + ); + + assertFalse(exception.isConnectTimeout()); + assertFalse(exception.isReadTimeout()); + assertEquals("custom", exception.getTimeoutType()); + } + + @Test + @DisplayName("CONNECT constant should be 'connect'") + void connectConstantShouldBeConnect() { + assertEquals("connect", TimeoutException.CONNECT); + } + + @Test + @DisplayName("READ constant should be 'read'") + void readConstantShouldBeRead() { + assertEquals("read", TimeoutException.READ); + } + } + + @Nested + @DisplayName("isRetryable Tests") + class IsRetryableTests { + + @Test + @DisplayName("connect timeout should be retryable") + void connectTimeoutShouldBeRetryable() { + TimeoutException exception = new TimeoutException( + TimeoutException.CONNECT, + "Timeout", + new SocketTimeoutException() + ); + + assertTrue(exception.isRetryable()); + } + + @Test + @DisplayName("read timeout should be retryable") + void readTimeoutShouldBeRetryable() { + TimeoutException exception = new TimeoutException( + TimeoutException.READ, + "Timeout", + new SocketTimeoutException() + ); + + assertTrue(exception.isRetryable()); + } + } + + @Nested + @DisplayName("Inherited Methods Tests") + class InheritedMethodsTests { + + @Test + @DisplayName("should inherit getUrl from TransportException") + void shouldInheritGetUrl() { + Request request = createRequest("GET", TEST_URL); + TimeoutException exception = new TimeoutException( + TimeoutException.READ, + "Timeout", + new SocketTimeoutException(), + request + ); + + assertEquals(TEST_URL, exception.getUrl()); + } + + @Test + @DisplayName("should return null URL when request not provided") + void shouldReturnNullUrlWhenNoRequest() { + TimeoutException exception = new TimeoutException( + TimeoutException.READ, + "Timeout", + new SocketTimeoutException() + ); + + assertNull(exception.getUrl()); + } + } + + @Nested + @DisplayName("toString Tests") + class ToStringTests { + + @Test + @DisplayName("should include timeout type in toString") + void shouldIncludeTimeoutTypeInToString() { + TimeoutException exception = new TimeoutException( + TimeoutException.CONNECT, + "Connection timeout", + new SocketTimeoutException() + ); + + String toString = exception.toString(); + + assertTrue(toString.contains("TimeoutException")); + assertTrue(toString.contains("timeoutType='connect'")); + } + + @Test + @DisplayName("should include request context in toString") + void shouldIncludeRequestContextInToString() { + Request request = createRequest("GET", TEST_URL); + TimeoutException exception = new TimeoutException( + TimeoutException.READ, + "Read timeout", + new SocketTimeoutException(), + request + ); + + String toString = exception.toString(); + + assertTrue(toString.contains("method='GET'")); + assertTrue(toString.contains(TEST_URL)); + } + } + + @Nested + @DisplayName("Exception Hierarchy Tests") + class ExceptionHierarchyTests { + + @Test + @DisplayName("should be instance of TransportException") + void shouldBeInstanceOfTransportException() { + TimeoutException exception = new TimeoutException( + TimeoutException.CONNECT, + "Timeout", + new SocketTimeoutException() + ); + + assertTrue(exception instanceof TransportException); + } + + @Test + @DisplayName("should be catchable as TransportException") + void shouldBeCatchableAsTransportException() { + try { + throw new TimeoutException(TimeoutException.READ, "Timeout", new SocketTimeoutException()); + } catch (TransportException e) { + assertTrue(e instanceof TimeoutException); + assertTrue(e.isRetryable()); + } + } + } + + private Request createRequest(String method, String url) { + return Request.builder() + .method(method) + .url(url) + .build(); + } +} + diff --git a/src/test/java/com/chargebee/v4/exceptions/TransportExceptionTest.java b/src/test/java/com/chargebee/v4/exceptions/TransportExceptionTest.java new file mode 100644 index 00000000..585294bb --- /dev/null +++ b/src/test/java/com/chargebee/v4/exceptions/TransportExceptionTest.java @@ -0,0 +1,180 @@ +package com.chargebee.v4.exceptions; + +import com.chargebee.v4.transport.Request; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +@DisplayName("TransportException Tests") +class TransportExceptionTest { + + private static final String TEST_URL = "https://test-site.chargebee.com/api/v2/customers"; + private static final String TEST_MESSAGE = "Transport error occurred"; + + @Nested + @DisplayName("Constructor Tests") + class ConstructorTests { + + @Test + @DisplayName("should create exception with message only") + void shouldCreateWithMessageOnly() { + TransportException exception = new TransportException(TEST_MESSAGE); + + assertEquals(TEST_MESSAGE, exception.getMessage()); + assertNull(exception.getCause()); + assertNull(exception.getRequest()); + assertNull(exception.getUrl()); + assertNull(exception.getHttpMethod()); + } + + @Test + @DisplayName("should create exception with message and cause") + void shouldCreateWithMessageAndCause() { + Exception cause = new RuntimeException("root cause"); + TransportException exception = new TransportException(TEST_MESSAGE, cause); + + assertEquals(TEST_MESSAGE, exception.getMessage()); + assertEquals(cause, exception.getCause()); + assertNull(exception.getRequest()); + } + + @Test + @DisplayName("should create exception with message, cause, and request") + void shouldCreateWithMessageCauseAndRequest() { + Exception cause = new RuntimeException("root cause"); + Request request = createRequest("GET", TEST_URL); + + TransportException exception = new TransportException(TEST_MESSAGE, cause, request); + + assertEquals(TEST_MESSAGE, exception.getMessage()); + assertEquals(cause, exception.getCause()); + assertNotNull(exception.getRequest()); + assertEquals(TEST_URL, exception.getUrl()); + assertEquals("GET", exception.getHttpMethod()); + } + + @Test + @DisplayName("should create exception with message and request only") + void shouldCreateWithMessageAndRequest() { + Request request = createRequest("POST", TEST_URL); + + TransportException exception = new TransportException(TEST_MESSAGE, request); + + assertEquals(TEST_MESSAGE, exception.getMessage()); + assertNull(exception.getCause()); + assertEquals(TEST_URL, exception.getUrl()); + assertEquals("POST", exception.getHttpMethod()); + } + } + + @Nested + @DisplayName("Request Context Tests") + class RequestContextTests { + + @Test + @DisplayName("should return null URL when request is null") + void shouldReturnNullUrlWhenRequestIsNull() { + TransportException exception = new TransportException(TEST_MESSAGE); + assertNull(exception.getUrl()); + } + + @Test + @DisplayName("should return null method when request is null") + void shouldReturnNullMethodWhenRequestIsNull() { + TransportException exception = new TransportException(TEST_MESSAGE); + assertNull(exception.getHttpMethod()); + } + + @Test + @DisplayName("should return URL from request") + void shouldReturnUrlFromRequest() { + Request request = createRequest("GET", TEST_URL); + TransportException exception = new TransportException(TEST_MESSAGE, request); + + assertEquals(TEST_URL, exception.getUrl()); + } + + @Test + @DisplayName("should return HTTP method from request") + void shouldReturnHttpMethodFromRequest() { + Request request = createRequest("DELETE", TEST_URL); + TransportException exception = new TransportException(TEST_MESSAGE, request); + + assertEquals("DELETE", exception.getHttpMethod()); + } + } + + @Nested + @DisplayName("isRetryable Tests") + class IsRetryableTests { + + @Test + @DisplayName("base TransportException should not be retryable by default") + void shouldNotBeRetryableByDefault() { + TransportException exception = new TransportException(TEST_MESSAGE); + assertFalse(exception.isRetryable()); + } + } + + @Nested + @DisplayName("toString Tests") + class ToStringTests { + + @Test + @DisplayName("should include message in toString") + void shouldIncludeMessageInToString() { + TransportException exception = new TransportException(TEST_MESSAGE); + + String toString = exception.toString(); + + assertTrue(toString.contains("TransportException")); + assertTrue(toString.contains(TEST_MESSAGE)); + } + + @Test + @DisplayName("should include request details in toString when available") + void shouldIncludeRequestDetailsInToString() { + Request request = createRequest("PUT", TEST_URL); + TransportException exception = new TransportException(TEST_MESSAGE, request); + + String toString = exception.toString(); + + assertTrue(toString.contains("method='PUT'")); + assertTrue(toString.contains("url='" + TEST_URL + "'")); + } + + @Test + @DisplayName("should include cause details in toString when available") + void shouldIncludeCauseDetailsInToString() { + Exception cause = new RuntimeException("network failure"); + TransportException exception = new TransportException(TEST_MESSAGE, cause); + + String toString = exception.toString(); + + assertTrue(toString.contains("cause=RuntimeException")); + assertTrue(toString.contains("network failure")); + } + + @Test + @DisplayName("should handle cause with null message") + void shouldHandleCauseWithNullMessage() { + Exception cause = new RuntimeException(); + TransportException exception = new TransportException(TEST_MESSAGE, cause); + + String toString = exception.toString(); + + assertTrue(toString.contains("cause=RuntimeException")); + assertFalse(toString.contains("null")); + } + } + + private Request createRequest(String method, String url) { + return Request.builder() + .method(method) + .url(url) + .build(); + } +} + diff --git a/src/test/java/com/chargebee/v4/internal/JsonUtilTest.java b/src/test/java/com/chargebee/v4/internal/JsonUtilTest.java new file mode 100644 index 00000000..5fc09d30 --- /dev/null +++ b/src/test/java/com/chargebee/v4/internal/JsonUtilTest.java @@ -0,0 +1,1037 @@ +package com.chargebee.v4.internal; + +import org.junit.jupiter.api.*; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * Comprehensive test suite for JsonUtil. + * Inspired by Gson's testing strategies to battle-test our JSON parsing. + */ +@DisplayName("JsonUtil Tests") +class JsonUtilTest { + + // ========== getString Tests ========== + @Nested + @DisplayName("getString Tests") + class GetStringTests { + + @Test + @DisplayName("should extract simple string value") + void shouldExtractSimpleString() { + String json = "{\"name\": \"John\"}"; + assertEquals("John", JsonUtil.getString(json, "name")); + } + + @Test + @DisplayName("should extract string with spaces") + void shouldExtractStringWithSpaces() { + String json = "{\"message\": \"Hello World\"}"; + assertEquals("Hello World", JsonUtil.getString(json, "message")); + } + + @Test + @DisplayName("should handle escaped quotes in string") + void shouldHandleEscapedQuotes() { + String json = "{\"text\": \"He said \\\"Hello\\\"\"}"; + assertEquals("He said \"Hello\"", JsonUtil.getString(json, "text")); + } + + @Test + @DisplayName("should handle escaped backslashes") + void shouldHandleEscapedBackslashes() { + String json = "{\"path\": \"C:\\\\Users\\\\test\"}"; + assertEquals("C:\\Users\\test", JsonUtil.getString(json, "path")); + } + + @Test + @DisplayName("should handle newlines and tabs") + void shouldHandleNewlinesAndTabs() { + String json = "{\"text\": \"line1\\nline2\\ttab\"}"; + assertEquals("line1\nline2\ttab", JsonUtil.getString(json, "text")); + } + + @Test + @DisplayName("should return null for missing key") + void shouldReturnNullForMissingKey() { + String json = "{\"name\": \"John\"}"; + assertNull(JsonUtil.getString(json, "missing")); + } + + @Test + @DisplayName("should return null for null json") + void shouldReturnNullForNullJson() { + assertNull(JsonUtil.getString(null, "key")); + } + + @Test + @DisplayName("should return null for null key") + void shouldReturnNullForNullKey() { + assertNull(JsonUtil.getString("{\"name\": \"John\"}", null)); + } + + @Test + @DisplayName("should extract empty string") + void shouldExtractEmptyString() { + String json = "{\"empty\": \"\"}"; + assertEquals("", JsonUtil.getString(json, "empty")); + } + + @Test + @DisplayName("should extract string with unicode characters") + void shouldExtractUnicodeString() { + String json = "{\"text\": \"日本語 中文 한국어\"}"; + assertEquals("日本語 中文 한국어", JsonUtil.getString(json, "text")); + } + + @Test + @DisplayName("should extract string with special JSON characters") + void shouldExtractStringWithSpecialChars() { + String json = "{\"text\": \"test: \\\"value\\\", more\"}"; + assertEquals("test: \"value\", more", JsonUtil.getString(json, "text")); + } + } + + // ========== getLong Tests ========== + @Nested + @DisplayName("getLong Tests") + class GetLongTests { + + @Test + @DisplayName("should extract positive long") + void shouldExtractPositiveLong() { + String json = "{\"id\": 12345678901234}"; + assertEquals(12345678901234L, JsonUtil.getLong(json, "id")); + } + + @Test + @DisplayName("should extract negative long") + void shouldExtractNegativeLong() { + String json = "{\"value\": -9876543210}"; + assertEquals(-9876543210L, JsonUtil.getLong(json, "value")); + } + + @Test + @DisplayName("should extract zero") + void shouldExtractZero() { + String json = "{\"count\": 0}"; + assertEquals(0L, JsonUtil.getLong(json, "count")); + } + + @Test + @DisplayName("should return null for missing key") + void shouldReturnNullForMissingKey() { + String json = "{\"id\": 123}"; + assertNull(JsonUtil.getLong(json, "missing")); + } + + @Test + @DisplayName("should return null for null json") + void shouldReturnNullForNullJson() { + assertNull(JsonUtil.getLong(null, "key")); + } + + @Test + @DisplayName("should extract epoch timestamp") + void shouldExtractEpochTimestamp() { + String json = "{\"created_at\": 1605530769}"; + assertEquals(1605530769L, JsonUtil.getLong(json, "created_at")); + } + + @Test + @DisplayName("should extract resource_version (large long)") + void shouldExtractResourceVersion() { + String json = "{\"resource_version\": 1605530769000}"; + assertEquals(1605530769000L, JsonUtil.getLong(json, "resource_version")); + } + } + + // ========== getInteger Tests ========== + @Nested + @DisplayName("getInteger Tests") + class GetIntegerTests { + + @Test + @DisplayName("should extract positive integer") + void shouldExtractPositiveInteger() { + String json = "{\"count\": 42}"; + assertEquals(42, JsonUtil.getInteger(json, "count")); + } + + @Test + @DisplayName("should extract negative integer") + void shouldExtractNegativeInteger() { + String json = "{\"offset\": -10}"; + assertEquals(-10, JsonUtil.getInteger(json, "offset")); + } + + @Test + @DisplayName("should return null for missing key") + void shouldReturnNullForMissingKey() { + String json = "{\"count\": 42}"; + assertNull(JsonUtil.getInteger(json, "missing")); + } + } + + // ========== getBoolean Tests ========== + @Nested + @DisplayName("getBoolean Tests") + class GetBooleanTests { + + @Test + @DisplayName("should extract true") + void shouldExtractTrue() { + String json = "{\"active\": true}"; + assertTrue(JsonUtil.getBoolean(json, "active")); + } + + @Test + @DisplayName("should extract false") + void shouldExtractFalse() { + String json = "{\"deleted\": false}"; + assertFalse(JsonUtil.getBoolean(json, "deleted")); + } + + @Test + @DisplayName("should return null for missing key") + void shouldReturnNullForMissingKey() { + String json = "{\"active\": true}"; + assertNull(JsonUtil.getBoolean(json, "missing")); + } + + @Test + @DisplayName("should return null for null json") + void shouldReturnNullForNullJson() { + assertNull(JsonUtil.getBoolean(null, "key")); + } + } + + // ========== getDouble Tests ========== + @Nested + @DisplayName("getDouble Tests") + class GetDoubleTests { + + @Test + @DisplayName("should extract positive double") + void shouldExtractPositiveDouble() { + String json = "{\"price\": 99.99}"; + assertEquals(99.99, JsonUtil.getDouble(json, "price"), 0.001); + } + + @Test + @DisplayName("should extract negative double") + void shouldExtractNegativeDouble() { + String json = "{\"balance\": -123.45}"; + assertEquals(-123.45, JsonUtil.getDouble(json, "balance"), 0.001); + } + + @Test + @DisplayName("should extract exchange rate") + void shouldExtractExchangeRate() { + String json = "{\"exchange_rate\": 1.0}"; + assertEquals(1.0, JsonUtil.getDouble(json, "exchange_rate"), 0.001); + } + + @Test + @DisplayName("should extract integer as double") + void shouldExtractIntegerAsDouble() { + String json = "{\"amount\": 10000}"; + assertEquals(10000.0, JsonUtil.getDouble(json, "amount"), 0.001); + } + } + + // ========== getBigDecimal Tests ========== + @Nested + @DisplayName("getBigDecimal Tests") + class GetBigDecimalTests { + + @Test + @DisplayName("should extract decimal value") + void shouldExtractDecimalValue() { + String json = "{\"amount\": 1234.56}"; + assertEquals(new BigDecimal("1234.56"), JsonUtil.getBigDecimal(json, "amount")); + } + + @Test + @DisplayName("should extract integer as BigDecimal") + void shouldExtractIntegerAsBigDecimal() { + String json = "{\"amount\": 10000}"; + assertEquals(new BigDecimal("10000"), JsonUtil.getBigDecimal(json, "amount")); + } + } + + // ========== getObject Tests ========== + @Nested + @DisplayName("getObject Tests") + class GetObjectTests { + + @Test + @DisplayName("should extract simple nested object") + void shouldExtractSimpleNestedObject() { + String json = "{\"customer\": {\"id\": \"cust_123\", \"name\": \"John\"}}"; + String result = JsonUtil.getObject(json, "customer"); + assertNotNull(result); + assertTrue(result.contains("\"id\": \"cust_123\"")); + assertTrue(result.contains("\"name\": \"John\"")); + } + + @Test + @DisplayName("should extract deeply nested object") + void shouldExtractDeeplyNestedObject() { + String json = "{\"data\": {\"customer\": {\"address\": {\"city\": \"NYC\"}}}}"; + String dataObj = JsonUtil.getObject(json, "data"); + assertNotNull(dataObj); + String customerObj = JsonUtil.getObject(dataObj, "customer"); + assertNotNull(customerObj); + String addressObj = JsonUtil.getObject(customerObj, "address"); + assertNotNull(addressObj); + assertEquals("NYC", JsonUtil.getString(addressObj, "city")); + } + + @Test + @DisplayName("should handle object with nested arrays") + void shouldHandleObjectWithNestedArrays() { + String json = "{\"transaction\": {\"id\": \"txn_123\", \"linked_invoices\": [{\"id\": \"inv_1\"}]}}"; + String result = JsonUtil.getObject(json, "transaction"); + assertNotNull(result); + assertTrue(result.contains("linked_invoices")); + assertTrue(result.contains("inv_1")); + } + + @Test + @DisplayName("should handle object with escaped strings") + void shouldHandleObjectWithEscapedStrings() { + String json = "{\"data\": {\"text\": \"Hello \\\"World\\\"\"}}"; + String result = JsonUtil.getObject(json, "data"); + assertNotNull(result); + assertTrue(result.contains("Hello \\\"World\\\"")); + } + + @Test + @DisplayName("should return null for missing key") + void shouldReturnNullForMissingKey() { + String json = "{\"customer\": {\"id\": \"123\"}}"; + assertNull(JsonUtil.getObject(json, "missing")); + } + + @Test + @DisplayName("should return null when value is not object") + void shouldReturnNullWhenNotObject() { + String json = "{\"name\": \"John\"}"; + assertNull(JsonUtil.getObject(json, "name")); + } + + @Test + @DisplayName("should extract empty object") + void shouldExtractEmptyObject() { + String json = "{\"metadata\": {}}"; + assertEquals("{}", JsonUtil.getObject(json, "metadata")); + } + } + + // ========== getArray Tests - THE CRITICAL FIX ========== + @Nested + @DisplayName("getArray Tests") + class GetArrayTests { + + @Test + @DisplayName("should extract simple array of strings") + void shouldExtractSimpleArrayOfStrings() { + String json = "{\"tags\": [\"a\", \"b\", \"c\"]}"; + String result = JsonUtil.getArray(json, "tags"); + assertNotNull(result); + assertEquals("[\"a\", \"b\", \"c\"]", result); + } + + @Test + @DisplayName("should extract empty array") + void shouldExtractEmptyArray() { + String json = "{\"items\": []}"; + assertEquals("[]", JsonUtil.getArray(json, "items")); + } + + @Test + @DisplayName("should extract array of objects") + void shouldExtractArrayOfObjects() { + String json = "{\"list\": [{\"id\": 1}, {\"id\": 2}]}"; + String result = JsonUtil.getArray(json, "list"); + assertNotNull(result); + assertTrue(result.startsWith("[")); + assertTrue(result.endsWith("]")); + assertTrue(result.contains("{\"id\": 1}")); + assertTrue(result.contains("{\"id\": 2}")); + } + + @Test + @DisplayName("should handle array with nested arrays - THE BUG FIX TEST") + void shouldHandleArrayWithNestedArrays() { + // This is the exact case that was failing before the fix! + String json = "{\"list\": [{\"transaction\": {\"linked_invoices\": [{\"id\": \"inv_1\"}], \"linked_refunds\": []}}]}"; + String result = JsonUtil.getArray(json, "list"); + assertNotNull(result); + assertTrue(result.startsWith("[")); + assertTrue(result.endsWith("]")); + // Verify the entire array is extracted, not truncated at first ] + assertTrue(result.contains("linked_invoices")); + assertTrue(result.contains("linked_refunds")); + assertTrue(result.contains("inv_1")); + } + + @Test + @DisplayName("should handle complex nested structure from transaction API") + void shouldHandleComplexNestedStructure() { + // Real-world example from the bug report + String json = "{\"list\": [{\"transaction\": {" + + "\"id\": \"txn_AzZhUGSPAkLskJQo\"," + + "\"customer_id\": \"cbdemo_dave\"," + + "\"amount\": 10000," + + "\"linked_invoices\": [{" + + "\"invoice_id\": \"DemoInv_103\"," + + "\"applied_amount\": 10000," + + "\"applied_at\": 1605530769" + + "}]," + + "\"linked_refunds\": []," + + "\"payment_method_details\": \"{\\\"card\\\":{\\\"iin\\\":\\\"555555\\\"}}\"" + + "}}]}"; + + String result = JsonUtil.getArray(json, "list"); + assertNotNull(result); + assertTrue(result.startsWith("[")); + assertTrue(result.endsWith("]")); + + // Critical: verify we got the complete array, not truncated + assertTrue(result.contains("txn_AzZhUGSPAkLskJQo")); + assertTrue(result.contains("linked_invoices")); + assertTrue(result.contains("DemoInv_103")); + assertTrue(result.contains("linked_refunds")); + } + + @Test + @DisplayName("should handle array with deeply nested objects") + void shouldHandleArrayWithDeeplyNestedObjects() { + String json = "{\"data\": [{\"level1\": {\"level2\": {\"level3\": [{\"value\": 1}]}}}]}"; + String result = JsonUtil.getArray(json, "data"); + assertNotNull(result); + assertTrue(result.contains("level1")); + assertTrue(result.contains("level2")); + assertTrue(result.contains("level3")); + assertTrue(result.contains("value")); + } + + @Test + @DisplayName("should handle array with escaped strings containing brackets") + void shouldHandleArrayWithEscapedBrackets() { + String json = "{\"messages\": [\"text with [brackets]\", \"another [one]\"]}"; + String result = JsonUtil.getArray(json, "messages"); + assertNotNull(result); + assertTrue(result.contains("[brackets]")); + assertTrue(result.contains("[one]")); + } + + @Test + @DisplayName("should handle array with JSON string field containing brackets") + void shouldHandleArrayWithJsonStringField() { + // payment_method_details contains a JSON string with brackets + String json = "{\"list\": [{\"details\": \"{\\\"array\\\":[1,2,3]}\"}]}"; + String result = JsonUtil.getArray(json, "list"); + assertNotNull(result); + assertTrue(result.contains("details")); + } + + @Test + @DisplayName("should return null for missing array key") + void shouldReturnNullForMissingKey() { + String json = "{\"data\": [1, 2, 3]}"; + assertNull(JsonUtil.getArray(json, "missing")); + } + + @Test + @DisplayName("should return null when value is not array") + void shouldReturnNullWhenNotArray() { + String json = "{\"name\": \"John\"}"; + assertNull(JsonUtil.getArray(json, "name")); + } + + @Test + @DisplayName("should handle multiple arrays in same object") + void shouldHandleMultipleArrays() { + String json = "{\"first\": [1, 2], \"second\": [3, 4], \"third\": [5, 6]}"; + assertEquals("[1, 2]", JsonUtil.getArray(json, "first")); + assertEquals("[3, 4]", JsonUtil.getArray(json, "second")); + assertEquals("[5, 6]", JsonUtil.getArray(json, "third")); + } + + @Test + @DisplayName("should handle array with null values") + void shouldHandleArrayWithNulls() { + String json = "{\"values\": [null, \"a\", null, \"b\"]}"; + String result = JsonUtil.getArray(json, "values"); + assertNotNull(result); + assertTrue(result.contains("null")); + } + } + + // ========== parseObjectArray Tests ========== + @Nested + @DisplayName("parseObjectArray Tests") + class ParseObjectArrayTests { + + @Test + @DisplayName("should parse array of simple objects") + void shouldParseArrayOfSimpleObjects() { + String arrayJson = "[{\"id\": 1}, {\"id\": 2}, {\"id\": 3}]"; + List objects = JsonUtil.parseObjectArray(arrayJson); + assertEquals(3, objects.size()); + assertTrue(objects.get(0).contains("\"id\": 1")); + assertTrue(objects.get(1).contains("\"id\": 2")); + assertTrue(objects.get(2).contains("\"id\": 3")); + } + + @Test + @DisplayName("should parse array of complex objects") + void shouldParseArrayOfComplexObjects() { + String arrayJson = "[{\"transaction\": {\"id\": \"txn_1\", \"items\": [1, 2]}}, {\"transaction\": {\"id\": \"txn_2\"}}]"; + List objects = JsonUtil.parseObjectArray(arrayJson); + assertEquals(2, objects.size()); + assertTrue(objects.get(0).contains("txn_1")); + assertTrue(objects.get(1).contains("txn_2")); + } + + @Test + @DisplayName("should return empty list for null input") + void shouldReturnEmptyListForNull() { + List objects = JsonUtil.parseObjectArray(null); + assertTrue(objects.isEmpty()); + } + + @Test + @DisplayName("should return empty list for empty array") + void shouldReturnEmptyListForEmptyArray() { + List objects = JsonUtil.parseObjectArray("[]"); + assertTrue(objects.isEmpty()); + } + + @Test + @DisplayName("should return empty list for non-array input") + void shouldReturnEmptyListForNonArray() { + List objects = JsonUtil.parseObjectArray("{\"id\": 1}"); + assertTrue(objects.isEmpty()); + } + + @Test + @DisplayName("should handle objects with escaped strings") + void shouldHandleObjectsWithEscapedStrings() { + String arrayJson = "[{\"text\": \"Hello \\\"World\\\"\"}]"; + List objects = JsonUtil.parseObjectArray(arrayJson); + assertEquals(1, objects.size()); + assertTrue(objects.get(0).contains("Hello \\\"World\\\"")); + } + } + + // ========== parseArrayOf* Tests ========== + @Nested + @DisplayName("parseArrayOf* Tests") + class ParseArrayOfTests { + + @Test + @DisplayName("should parse array of strings") + void shouldParseArrayOfStrings() { + String arrayJson = "[\"a\", \"b\", \"c\"]"; + List result = JsonUtil.parseArrayOfString(arrayJson); + assertEquals(3, result.size()); + assertEquals("a", result.get(0)); + assertEquals("b", result.get(1)); + assertEquals("c", result.get(2)); + } + + @Test + @DisplayName("should parse array of integers") + void shouldParseArrayOfIntegers() { + String arrayJson = "[1, 2, 3, -4, 0]"; + List result = JsonUtil.parseArrayOfInteger(arrayJson); + assertEquals(5, result.size()); + assertEquals(1, result.get(0)); + assertEquals(-4, result.get(3)); + assertEquals(0, result.get(4)); + } + + @Test + @DisplayName("should parse array of longs") + void shouldParseArrayOfLongs() { + String arrayJson = "[1605530769000, 1605530770000]"; + List result = JsonUtil.parseArrayOfLong(arrayJson); + assertEquals(2, result.size()); + assertEquals(1605530769000L, result.get(0)); + } + + @Test + @DisplayName("should parse array of booleans") + void shouldParseArrayOfBooleans() { + String arrayJson = "[true, false, true]"; + List result = JsonUtil.parseArrayOfBoolean(arrayJson); + assertEquals(3, result.size()); + assertTrue(result.get(0)); + assertFalse(result.get(1)); + assertTrue(result.get(2)); + } + + @Test + @DisplayName("should parse array of doubles") + void shouldParseArrayOfDoubles() { + String arrayJson = "[1.5, 2.7, 3.14]"; + List result = JsonUtil.parseArrayOfDouble(arrayJson); + assertEquals(3, result.size()); + assertEquals(1.5, result.get(0), 0.001); + } + + @Test + @DisplayName("should parse array of BigDecimal") + void shouldParseArrayOfBigDecimal() { + String arrayJson = "[123.45, 678.90]"; + List result = JsonUtil.parseArrayOfBigDecimal(arrayJson); + assertEquals(2, result.size()); + } + + @Test + @DisplayName("should return empty list for empty arrays") + void shouldReturnEmptyListForEmptyArrays() { + assertTrue(JsonUtil.parseArrayOfString("[]").isEmpty()); + assertTrue(JsonUtil.parseArrayOfInteger("[]").isEmpty()); + assertTrue(JsonUtil.parseArrayOfLong("[]").isEmpty()); + assertTrue(JsonUtil.parseArrayOfBoolean("[]").isEmpty()); + assertTrue(JsonUtil.parseArrayOfDouble("[]").isEmpty()); + } + + @Test + @DisplayName("should return empty list for null input") + void shouldReturnEmptyListForNull() { + assertTrue(JsonUtil.parseArrayOfString(null).isEmpty()); + assertTrue(JsonUtil.parseArrayOfInteger(null).isEmpty()); + } + } + + // ========== getTimestamp Tests ========== + @Nested + @DisplayName("getTimestamp Tests") + class GetTimestampTests { + + @Test + @DisplayName("should parse epoch seconds to timestamp") + void shouldParseEpochSecondsToTimestamp() { + String json = "{\"created_at\": 1605530769}"; + Timestamp result = JsonUtil.getTimestamp(json, "created_at"); + assertNotNull(result); + assertEquals(1605530769000L, result.getTime()); + } + + @Test + @DisplayName("should return null for missing key") + void shouldReturnNullForMissingKey() { + String json = "{\"updated_at\": 1605530769}"; + assertNull(JsonUtil.getTimestamp(json, "created_at")); + } + } + + // ========== hasValue Tests ========== + @Nested + @DisplayName("hasValue Tests") + class HasValueTests { + + @Test + @DisplayName("should return true for existing non-null value") + void shouldReturnTrueForExistingValue() { + String json = "{\"name\": \"John\", \"age\": 30}"; + assertTrue(JsonUtil.hasValue(json, "name")); + assertTrue(JsonUtil.hasValue(json, "age")); + } + + @Test + @DisplayName("should return false for null value") + void shouldReturnFalseForNullValue() { + String json = "{\"name\": null}"; + assertFalse(JsonUtil.hasValue(json, "name")); + } + + @Test + @DisplayName("should return false for missing key") + void shouldReturnFalseForMissingKey() { + String json = "{\"name\": \"John\"}"; + assertFalse(JsonUtil.hasValue(json, "missing")); + } + } + + // ========== parseJsonObjectToMap Tests ========== + @Nested + @DisplayName("parseJsonObjectToMap Tests") + class ParseJsonObjectToMapTests { + + @Test + @DisplayName("should parse simple object to map") + void shouldParseSimpleObjectToMap() { + String json = "{\"name\": \"John\", \"age\": 30, \"active\": true}"; + Map map = JsonUtil.parseJsonObjectToMap(json); + assertEquals("John", map.get("name")); + assertEquals(30L, map.get("age")); + assertEquals(true, map.get("active")); + } + + @Test + @DisplayName("should handle nested objects") + void shouldHandleNestedObjects() { + String json = "{\"user\": {\"name\": \"John\"}}"; + Map map = JsonUtil.parseJsonObjectToMap(json); + assertTrue(map.get("user") instanceof String); + assertTrue(((String) map.get("user")).contains("name")); + } + + @Test + @DisplayName("should handle arrays in map") + void shouldHandleArraysInMap() { + String json = "{\"tags\": [\"a\", \"b\"]}"; + Map map = JsonUtil.parseJsonObjectToMap(json); + assertTrue(map.get("tags") instanceof String); + assertTrue(((String) map.get("tags")).contains("\"a\"")); + } + + @Test + @DisplayName("should return empty map for empty object") + void shouldReturnEmptyMapForEmptyObject() { + Map map = JsonUtil.parseJsonObjectToMap("{}"); + assertTrue(map.isEmpty()); + } + + @Test + @DisplayName("should return empty map for null") + void shouldReturnEmptyMapForNull() { + Map map = JsonUtil.parseJsonObjectToMap(null); + assertTrue(map.isEmpty()); + } + + @Test + @DisplayName("should handle null values") + void shouldHandleNullValues() { + String json = "{\"value\": null}"; + Map map = JsonUtil.parseJsonObjectToMap(json); + assertTrue(map.containsKey("value")); + assertNull(map.get("value")); + } + + @Test + @DisplayName("should handle double values") + void shouldHandleDoubleValues() { + String json = "{\"price\": 99.99}"; + Map map = JsonUtil.parseJsonObjectToMap(json); + assertEquals(99.99, (Double) map.get("price"), 0.001); + } + } + + // ========== toJson Tests ========== + @Nested + @DisplayName("toJson Tests") + class ToJsonTests { + + @Test + @DisplayName("should serialize map to JSON") + void shouldSerializeMapToJson() { + Map map = new java.util.LinkedHashMap<>(); + map.put("name", "John"); + map.put("age", 30); + + String json = JsonUtil.toJson(map); + assertTrue(json.contains("\"name\":\"John\"")); + assertTrue(json.contains("\"age\":30")); + } + + @Test + @DisplayName("should serialize list to JSON") + void shouldSerializeListToJson() { + List list = java.util.Arrays.asList("a", "b", "c"); + String json = JsonUtil.toJson(list); + assertEquals("[\"a\",\"b\",\"c\"]", json); + } + + @Test + @DisplayName("should serialize empty map") + void shouldSerializeEmptyMap() { + assertEquals("{}", JsonUtil.toJson(new java.util.HashMap<>())); + } + + @Test + @DisplayName("should serialize empty list") + void shouldSerializeEmptyList() { + assertEquals("[]", JsonUtil.toJson(new java.util.ArrayList<>())); + } + + @Test + @DisplayName("should escape special characters") + void shouldEscapeSpecialCharacters() { + Map map = new java.util.HashMap<>(); + map.put("text", "Hello \"World\"\nNew line"); + + String json = JsonUtil.toJson(map); + assertTrue(json.contains("\\\"World\\\"")); + assertTrue(json.contains("\\n")); + } + + @Test + @DisplayName("should serialize null values") + void shouldSerializeNullValues() { + Map map = new java.util.HashMap<>(); + map.put("value", null); + + String json = JsonUtil.toJson(map); + assertTrue(json.contains("\"value\":null")); + } + + @Test + @DisplayName("should serialize nested structures") + void shouldSerializeNestedStructures() { + Map inner = new java.util.HashMap<>(); + inner.put("id", 123); + + Map outer = new java.util.HashMap<>(); + outer.put("data", inner); + + String json = JsonUtil.toJson(outer); + assertTrue(json.contains("\"data\":{")); + assertTrue(json.contains("\"id\":123")); + } + } + + // ========== Edge Cases and Real-World Scenarios ========== + @Nested + @DisplayName("Real-World Scenarios") + class RealWorldScenarios { + + @Test + @DisplayName("should parse transaction list response correctly") + void shouldParseTransactionListResponse() { + String json = "{" + + "\"list\": [{\"transaction\": {" + + "\"id\": \"txn_AzZhUGSPAkLskJQo\"," + + "\"customer_id\": \"cbdemo_dave\"," + + "\"subscription_id\": \"cbdemo_dave-sub1\"," + + "\"gateway_account_id\": \"gw_AzZhUGSPAkLeQJPg\"," + + "\"payment_method\": \"card\"," + + "\"gateway\": \"chargebee\"," + + "\"type\": \"payment\"," + + "\"date\": 1605530769," + + "\"exchange_rate\": 1.0," + + "\"amount\": 10000," + + "\"id_at_gateway\": \"cb___dev__KyVnqiSIrqRVUEN\"," + + "\"status\": \"success\"," + + "\"updated_at\": 1605530769," + + "\"resource_version\": 1605530769000," + + "\"deleted\": false," + + "\"object\": \"transaction\"," + + "\"masked_card_number\": \"************4444\"," + + "\"currency_code\": \"USD\"," + + "\"base_currency_code\": \"USD\"," + + "\"amount_unused\": 0," + + "\"linked_invoices\": [{" + + "\"invoice_id\": \"DemoInv_103\"," + + "\"applied_amount\": 10000," + + "\"applied_at\": 1605530769," + + "\"invoice_date\": 1605530769," + + "\"invoice_total\": 10000," + + "\"invoice_status\": \"paid\"" + + "}]," + + "\"linked_refunds\": []," + + "\"payment_method_details\": \"{\\\"card\\\":{\\\"iin\\\":\\\"555555\\\",\\\"last4\\\":\\\"4444\\\"}}\"" + + "}}]," + + "\"next_offset\": null" + + "}"; + + // Test getArray with nested structures + String listArray = JsonUtil.getArray(json, "list"); + assertNotNull(listArray, "list array should not be null"); + assertTrue(listArray.startsWith("["), "Should start with ["); + assertTrue(listArray.endsWith("]"), "Should end with ]"); + + // Verify it contains the complete transaction data + assertTrue(listArray.contains("txn_AzZhUGSPAkLskJQo")); + assertTrue(listArray.contains("linked_invoices")); + assertTrue(listArray.contains("DemoInv_103")); + assertTrue(listArray.contains("linked_refunds")); + assertTrue(listArray.contains("payment_method_details")); + + // Test parseObjectArray + List objects = JsonUtil.parseObjectArray(listArray); + assertEquals(1, objects.size()); + + // Test nested object extraction + String transactionWrapper = objects.get(0); + String transaction = JsonUtil.getObject(transactionWrapper, "transaction"); + assertNotNull(transaction); + + assertEquals("txn_AzZhUGSPAkLskJQo", JsonUtil.getString(transaction, "id")); + assertEquals("cbdemo_dave", JsonUtil.getString(transaction, "customer_id")); + assertEquals(10000, JsonUtil.getInteger(transaction, "amount")); + assertEquals(1.0, JsonUtil.getDouble(transaction, "exchange_rate"), 0.001); + assertFalse(JsonUtil.getBoolean(transaction, "deleted")); + assertEquals(1605530769000L, JsonUtil.getLong(transaction, "resource_version")); + + // Test nested array extraction + String linkedInvoices = JsonUtil.getArray(transaction, "linked_invoices"); + assertNotNull(linkedInvoices); + assertTrue(linkedInvoices.contains("DemoInv_103")); + + String linkedRefunds = JsonUtil.getArray(transaction, "linked_refunds"); + assertNotNull(linkedRefunds); + assertEquals("[]", linkedRefunds); + } + + @Test + @DisplayName("should handle customer list response") + void shouldHandleCustomerListResponse() { + String json = "{" + + "\"list\": [" + + "{\"customer\": {\"id\": \"cust_123\", \"email\": \"test@example.com\"}}," + + "{\"customer\": {\"id\": \"cust_456\", \"email\": \"user@example.com\"}}" + + "]," + + "\"next_offset\": \"offset_abc123\"" + + "}"; + + String listArray = JsonUtil.getArray(json, "list"); + assertNotNull(listArray); + + List items = JsonUtil.parseObjectArray(listArray); + assertEquals(2, items.size()); + + String customer1 = JsonUtil.getObject(items.get(0), "customer"); + assertEquals("cust_123", JsonUtil.getString(customer1, "id")); + + String nextOffset = JsonUtil.getString(json, "next_offset"); + assertEquals("offset_abc123", nextOffset); + } + + @Test + @DisplayName("should handle subscription with multiple nested arrays") + void shouldHandleSubscriptionWithMultipleNestedArrays() { + String json = "{" + + "\"subscription\": {" + + "\"id\": \"sub_123\"," + + "\"subscription_items\": [" + + "{\"item_price_id\": \"price_1\", \"quantity\": 1}," + + "{\"item_price_id\": \"price_2\", \"quantity\": 2}" + + "]," + + "\"addons\": [{\"id\": \"addon_1\"}]," + + "\"coupons\": []," + + "\"discounts\": [{\"id\": \"disc_1\", \"apply_till\": [1, 2, 3]}]" + + "}" + + "}"; + + String subscription = JsonUtil.getObject(json, "subscription"); + assertNotNull(subscription); + + String items = JsonUtil.getArray(subscription, "subscription_items"); + assertNotNull(items); + List itemsList = JsonUtil.parseObjectArray(items); + assertEquals(2, itemsList.size()); + + String addons = JsonUtil.getArray(subscription, "addons"); + assertNotNull(addons); + + String coupons = JsonUtil.getArray(subscription, "coupons"); + assertEquals("[]", coupons); + + String discounts = JsonUtil.getArray(subscription, "discounts"); + assertNotNull(discounts); + // Verify nested array within object within array is handled + assertTrue(discounts.contains("apply_till")); + assertTrue(discounts.contains("[1, 2, 3]") || discounts.contains("[1,2,3]")); + } + } + + // ========== Edge Cases ========== + @Nested + @DisplayName("Edge Cases") + class EdgeCases { + + @Test + @DisplayName("should handle whitespace variations") + void shouldHandleWhitespaceVariations() { + String json1 = "{\"key\":\"value\"}"; + String json2 = "{ \"key\" : \"value\" }"; + String json3 = "{\n \"key\"\t:\n \"value\"\n}"; + + assertEquals("value", JsonUtil.getString(json1, "key")); + assertEquals("value", JsonUtil.getString(json2, "key")); + assertEquals("value", JsonUtil.getString(json3, "key")); + } + + @Test + @DisplayName("should handle keys with special characters") + void shouldHandleKeysWithSpecialCharacters() { + String json = "{\"my-key\": \"value1\", \"my_key\": \"value2\", \"my.key\": \"value3\"}"; + assertEquals("value1", JsonUtil.getString(json, "my-key")); + assertEquals("value2", JsonUtil.getString(json, "my_key")); + assertEquals("value3", JsonUtil.getString(json, "my.key")); + } + + @Test + @DisplayName("should handle very long strings") + void shouldHandleVeryLongStrings() { + StringBuilder longValue = new StringBuilder(); + for (int i = 0; i < 10000; i++) { + longValue.append("x"); + } + String json = "{\"long\": \"" + longValue + "\"}"; + assertEquals(longValue.toString(), JsonUtil.getString(json, "long")); + } + + @Test + @DisplayName("should handle deeply nested structures") + void shouldHandleDeeplyNestedStructures() { + // Create 10 levels of nesting + StringBuilder json = new StringBuilder(); + for (int i = 0; i < 10; i++) { + json.append("{\"level").append(i).append("\": "); + } + json.append("\"deep_value\""); + for (int i = 0; i < 10; i++) { + json.append("}"); + } + + String result = json.toString(); + String level0 = JsonUtil.getObject(result, "level0"); + assertNotNull(level0); + assertTrue(level0.contains("deep_value")); + } + + @Test + @DisplayName("should handle array with mixed types") + void shouldHandleArrayWithMixedTypes() { + String json = "{\"mixed\": [1, \"two\", true, null, {\"key\": \"value\"}, [1, 2]]}"; + String array = JsonUtil.getArray(json, "mixed"); + assertNotNull(array); + assertTrue(array.contains("1")); + assertTrue(array.contains("\"two\"")); + assertTrue(array.contains("true")); + assertTrue(array.contains("null")); + } + + @Test + @DisplayName("should handle colons in string values") + void shouldHandleColonsInStringValues() { + String json = "{\"url\": \"https://example.com:8080/path\"}"; + assertEquals("https://example.com:8080/path", JsonUtil.getString(json, "url")); + } + + @Test + @DisplayName("should handle quotes in key names") + void shouldHandleFirstMatchForDuplicateKeys() { + // JSON spec says duplicate keys have undefined behavior, but we should handle gracefully + String json = "{\"key\": \"first\", \"key\": \"second\"}"; + String result = JsonUtil.getString(json, "key"); + // Should return one of the values (typically first) + assertNotNull(result); + } + } +} + diff --git a/src/test/java/com/chargebee/v4/transport/DefaultTransportTest.java b/src/test/java/com/chargebee/v4/transport/DefaultTransportTest.java index 939d19f2..b728e1e5 100644 --- a/src/test/java/com/chargebee/v4/transport/DefaultTransportTest.java +++ b/src/test/java/com/chargebee/v4/transport/DefaultTransportTest.java @@ -1,5 +1,6 @@ package com.chargebee.v4.transport; +import com.chargebee.v4.exceptions.*; import org.junit.jupiter.api.*; import org.mockito.*; @@ -208,7 +209,7 @@ void shouldHandle400ClientError() throws Exception { .url(server.getUrl()) .build(); - ClientErrorException exception = assertThrows(ClientErrorException.class, + ClientErrorException exception = assertThrows(ClientErrorException.class, () -> transport.send(request)); assertEquals(400, exception.getStatusCode()); diff --git a/src/test/java/com/chargebee/v4/transport/HttpStatusHandlerTest.java b/src/test/java/com/chargebee/v4/transport/HttpStatusHandlerTest.java index 7b75f92e..1286b8c9 100644 --- a/src/test/java/com/chargebee/v4/transport/HttpStatusHandlerTest.java +++ b/src/test/java/com/chargebee/v4/transport/HttpStatusHandlerTest.java @@ -1,6 +1,7 @@ package com.chargebee.v4.transport; import com.chargebee.v4.exceptions.*; +import com.chargebee.v4.exceptions.codes.*; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -34,7 +35,9 @@ void shouldThrowPaymentExceptionForPaymentErrorType() { assertEquals(402, exception.getStatusCode()); assertEquals("payment", exception.getType()); - assertEquals("card_declined", exception.getApiErrorCode()); + assertEquals(ErrorType.PAYMENT, exception.getErrorType()); + // card_declined is not a known error code for 402, so it will be _UNKNOWN + assertNotNull(exception.getApiErrorCode()); assertEquals("Your card was declined", exception.getMessage()); } @@ -42,7 +45,7 @@ void shouldThrowPaymentExceptionForPaymentErrorType() { @DisplayName("Should throw OperationFailedException for operation_failed error type") void shouldThrowOperationFailedExceptionForOperationFailedType() { Request request = createMockRequest("https://test-site.chargebee.com/api/v2/subscriptions"); - String errorJson = "{\"type\":\"operation_failed\",\"api_error_code\":\"state_conflict\",\"message\":\"Cannot perform this operation in current state\"}"; + String errorJson = "{\"type\":\"operation_failed\",\"api_error_code\":\"invalid_request\",\"message\":\"Cannot perform this operation in current state\"}"; Response response = createMockResponse(400, errorJson); OperationFailedException exception = assertThrows(OperationFailedException.class, @@ -50,14 +53,16 @@ void shouldThrowOperationFailedExceptionForOperationFailedType() { assertEquals(400, exception.getStatusCode()); assertEquals("operation_failed", exception.getType()); - assertEquals("state_conflict", exception.getApiErrorCode()); + assertEquals(ErrorType.OPERATION_FAILED, exception.getErrorType()); + assertEquals(BadRequestApiErrorCode.INVALID_REQUEST, exception.getApiErrorCode()); + assertEquals("invalid_request", exception.getApiErrorCodeRaw()); } @Test @DisplayName("Should throw InvalidRequestException for invalid_request error type") void shouldThrowInvalidRequestExceptionForInvalidRequestType() { Request request = createMockRequest("https://test-site.chargebee.com/api/v2/customers"); - String errorJson = "{\"type\":\"invalid_request\",\"api_error_code\":\"missing_field\",\"message\":\"Required field is missing\",\"param\":\"email\"}"; + String errorJson = "{\"type\":\"invalid_request\",\"api_error_code\":\"param_wrong_value\",\"message\":\"Required field is missing\",\"param\":\"email\"}"; Response response = createMockResponse(400, errorJson); InvalidRequestException exception = assertThrows(InvalidRequestException.class, @@ -65,25 +70,28 @@ void shouldThrowInvalidRequestExceptionForInvalidRequestType() { assertEquals(400, exception.getStatusCode()); assertEquals("invalid_request", exception.getType()); - assertEquals("missing_field", exception.getApiErrorCode()); + assertEquals(ErrorType.INVALID_REQUEST, exception.getErrorType()); + assertEquals(BadRequestApiErrorCode.PARAM_WRONG_VALUE, exception.getApiErrorCode()); + assertEquals("param_wrong_value", exception.getApiErrorCodeRaw()); assertEquals(1, exception.getParams().size()); assertEquals("email", exception.getParams().get(0)); } @Test - @DisplayName("Should throw UbbBatchIngestionInvalidRequestException for ubb_batch_ingestion_invalid_request type") - void shouldThrowUbbBatchIngestionExceptionForUbbBatchType() { + @DisplayName("Should throw APIException for ubb_batch_ingestion_invalid_request type (unrecognized type)") + void shouldThrowAPIExceptionForUbbBatchType() { Request request = createMockRequest("https://test-site.chargebee.com/api/v2/usages"); - String errorJson = "{\"type\":\"ubb_batch_ingestion_invalid_request\",\"api_error_code\":\"invalid_format\",\"message\":\"Batch data format is invalid\"}"; + String errorJson = "{\"type\":\"ubb_batch_ingestion_invalid_request\",\"api_error_code\":\"invalid_request\",\"message\":\"Batch data format is invalid\"}"; Response response = createMockResponse(400, errorJson); - UbbBatchIngestionInvalidRequestException exception = assertThrows( - UbbBatchIngestionInvalidRequestException.class, + // ubb_batch_ingestion_invalid_request is not a standard error type, so it falls back to APIException + APIException exception = assertThrows(APIException.class, () -> HttpStatusHandler.validateResponse(request, response)); assertEquals(400, exception.getStatusCode()); assertEquals("ubb_batch_ingestion_invalid_request", exception.getType()); - assertEquals("invalid_format", exception.getApiErrorCode()); + assertEquals(ErrorType._UNKNOWN, exception.getErrorType()); + assertEquals(BadRequestApiErrorCode.INVALID_REQUEST, exception.getApiErrorCode()); } @Test @@ -98,6 +106,7 @@ void shouldThrowGenericAPIExceptionForUnknownType() { assertEquals(400, exception.getStatusCode()); assertEquals("unknown_error", exception.getType()); + assertEquals(ErrorType._UNKNOWN, exception.getErrorType()); assertEquals("Something went wrong", exception.getMessage()); } @@ -105,7 +114,7 @@ void shouldThrowGenericAPIExceptionForUnknownType() { @DisplayName("Should throw generic APIException when type is missing but message and api_error_code exist") void shouldThrowGenericAPIExceptionWhenTypeIsMissing() { Request request = createMockRequest("https://test-site.chargebee.com/api/v2/customers"); - String errorJson = "{\"message\":\"An error occurred\",\"api_error_code\":\"general_error\"}"; + String errorJson = "{\"message\":\"An error occurred\",\"api_error_code\":\"invalid_request\"}"; Response response = createMockResponse(400, errorJson); APIException exception = assertThrows(APIException.class, @@ -113,7 +122,9 @@ void shouldThrowGenericAPIExceptionWhenTypeIsMissing() { assertEquals(400, exception.getStatusCode()); assertNull(exception.getType()); - assertEquals("general_error", exception.getApiErrorCode()); + assertEquals(ErrorType._UNKNOWN, exception.getErrorType()); + assertEquals(BadRequestApiErrorCode.INVALID_REQUEST, exception.getApiErrorCode()); + assertEquals("invalid_request", exception.getApiErrorCodeRaw()); assertEquals("An error occurred", exception.getMessage()); } @@ -172,7 +183,7 @@ void shouldHandleEmptyErrorResponseGracefully() { @DisplayName("Should use default message when message field is missing") void shouldUseDefaultMessageWhenMessageFieldIsMissing() { Request request = createMockRequest("https://test-site.chargebee.com/api/v2/invoices"); - String errorJson = "{\"type\":\"payment\",\"api_error_code\":\"card_declined\"}"; + String errorJson = "{\"type\":\"payment\",\"api_error_code\":\"payment_processing_failed\"}"; Response response = createMockResponse(402, errorJson); PaymentException exception = assertThrows(PaymentException.class, @@ -182,18 +193,56 @@ void shouldUseDefaultMessageWhenMessageFieldIsMissing() { } @Test - @DisplayName("Should throw BatchAPIException when URL contains /batch/") - void shouldThrowBatchAPIExceptionWhenUrlContainsBatch() { + @DisplayName("Should throw APIException for batch URL (batch handling not yet implemented)") + void shouldThrowAPIExceptionForBatchUrl() { Request request = createMockRequest("https://test-site.chargebee.com/api/v2/batch/customers"); - String errorJson = "{\"type\":\"invalid_request\",\"api_error_code\":\"batch_error\",\"message\":\"Batch operation failed\"}"; + String errorJson = "{\"type\":\"invalid_request\",\"api_error_code\":\"invalid_request\",\"message\":\"Batch operation failed\"}"; Response response = createMockResponse(400, errorJson); - BatchAPIException exception = assertThrows(BatchAPIException.class, + // Batch URL special handling would need to be added to HttpStatusHandler template + // For now, it falls back to the standard error type handling + InvalidRequestException exception = assertThrows(InvalidRequestException.class, () -> HttpStatusHandler.validateResponse(request, response)); assertEquals(400, exception.getStatusCode()); assertEquals("invalid_request", exception.getType()); - assertEquals("batch_error", exception.getApiErrorCode()); + assertEquals(BadRequestApiErrorCode.INVALID_REQUEST, exception.getApiErrorCode()); + } + + @Test + @DisplayName("Should handle strongly-typed ApiErrorCode enums") + void shouldHandleStronglyTypedApiErrorCodeEnums() { + Request request = createMockRequest("https://test-site.chargebee.com/api/v2/customers"); + String errorJson = "{\"type\":\"invalid_request\",\"api_error_code\":\"duplicate_entry\",\"message\":\"Duplicate entry found\"}"; + Response response = createMockResponse(400, errorJson); + + InvalidRequestException exception = assertThrows(InvalidRequestException.class, + () -> HttpStatusHandler.validateResponse(request, response)); + + // Verify strongly typed enum + ApiErrorCode apiErrorCode = exception.getApiErrorCode(); + assertTrue(apiErrorCode instanceof BadRequestApiErrorCode); + assertEquals(BadRequestApiErrorCode.DUPLICATE_ENTRY, apiErrorCode); + assertTrue(apiErrorCode.isKnown()); + assertEquals("duplicate_entry", apiErrorCode.getValue()); + } + + @Test + @DisplayName("Should handle unknown api_error_code with _UNKNOWN enum") + void shouldHandleUnknownApiErrorCodeWithUnknownEnum() { + Request request = createMockRequest("https://test-site.chargebee.com/api/v2/customers"); + String errorJson = "{\"type\":\"invalid_request\",\"api_error_code\":\"future_unknown_code\",\"message\":\"Unknown error\"}"; + Response response = createMockResponse(400, errorJson); + + InvalidRequestException exception = assertThrows(InvalidRequestException.class, + () -> HttpStatusHandler.validateResponse(request, response)); + + // Verify unknown error code handling + ApiErrorCode apiErrorCode = exception.getApiErrorCode(); + assertEquals(BadRequestApiErrorCode._UNKNOWN, apiErrorCode); + assertFalse(apiErrorCode.isKnown()); + assertNull(apiErrorCode.getValue()); // _UNKNOWN has null value + assertNull(exception.getApiErrorCodeRaw()); // Raw value is null for _UNKNOWN } private Request createMockRequest(String url) {